branch_name
stringclasses
149 values
text
stringlengths
23
89.3M
directory_id
stringlengths
40
40
languages
listlengths
1
19
num_files
int64
1
11.8k
repo_language
stringclasses
38 values
repo_name
stringlengths
6
114
revision_id
stringlengths
40
40
snapshot_id
stringlengths
40
40
refs/heads/master
<file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open') // there is no preset on the remote-media-secure mapping // authenticated: bothe original and derived are protected let url = cloudinary.url("remote-media-secure/grapes.jpg", { type: 'private', sign_url: true, secure: true }); console.log(url) open(url) //the URL get signed <file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open') let url = cloudinary.url(`${process.env.ASSET_SOURCE_BASE}/assets/images/oranges.jpg`, { type: "fetch" }) console.log(url) open(url) // http://res.cloudinary.com/picturecloud7/image/fetch/${process.env.ASSET_SOURCE_BASE}/assets/images/oranges.jpg<file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open') // create url let url = cloudinary.url("killer-whale.jpg", { width: 300, height: 300, quality: "auto", crop: "mfit" }) console.log(url) open(url) <file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open'); let url = cloudinary.url("remote-media-secure/cherries.jpg", { type: 'private', secure: true, resource_type: 'image', sign_url: true }); console.log(url) open(url) // https://res.cloudinary.com/picturecloud7/image/private/s--j5G57Mm9--/v1/remote-media-secure/cherries.jpg<file_sep>// docs: https://cloudinary.com/documentation/upload_images#update_already_uploaded_images //test public_id is dolphin which is authenticated require('dotenv').config(); const crypto = require('crypto'); const URLSafeBase64 = require('urlsafe-base64'); const open = require('open') //dolphin is authenticated //hand coded signature let transformation = "c_mfit,f_auto,h_300,q_auto,w_300"; let public_id = "dolphin"; let secret = process.env.API_SECRET; let to_sign = [transformation, public_id].join("/") + secret; let s = URLSafeBase64.encode(crypto.createHash('sha1').update(to_sign).digest()).slice(0,8); let signature = 's--' + s + '--' url = ['https://res.cloudinary.com/picturecloud7/image/authenticated',signature,transformation, public_id].join("/") console.log("hand code:",url) open(url) // https://res.cloudinary.com/picturecloud7/image/authenticated/s--Oe58XLUa--/c_mfit,f_auto,h_300,q_auto,w_300/dolphin<file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; // choose a image in a remote media subfolder and rename it so // that is is located directly under remote-media cloudinary.uploader.rename('remote-media/images/pineapple', 'remote-media/pineapple', { invalidate: true }, function (error, result) { console.log(result, error) }); // public_id: 'remote-media/pineapple',<file_sep>const crypto = require('crypto'); exports.signmedialib = function () { let timestamp = (new Date).getTime(); let str_to_sign = `cloud_name=${process.env.CLOUD_NAME}&timestamp=${timestamp}&username=${process.env.USERNAME}${process.env.API_SECRET}` let signature = crypto.createHash('sha256').update(str_to_sign).digest('hex'); return ({signature:signature, timestamp:timestamp}); };<file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; function uploadImage(uri) { console.log(uri) cloudinary.uploader.upload(uri, { use_filename: true, unique_filename: false, type: "upload", overwrite: true }) .then(uploadResult => { console.log(uploadResult) let url = uploadResult.secure_url; }) .catch(error => console.error(error)); } const uri = process.argv && process.argv.length > 1 && process.argv[2]; console.log(uri) uploadImage(uri) <file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open') let url = cloudinary.url(`${process.env.ASSET_SOURCE_BASE}/assets/images/oranges.jpg`, { type: "fetch", width: 400, height: 400, crop: "fill", gravity: "auto", radius: "max", effect: "sharpen", fetch_format: "auto" } ) console.log(url) open(url) // http://res.cloudinary.com/picturecloud7/image/fetch/c_fill,e_sharpen,f_auto,g_auto,h_400,r_max,w_400/`${process.env.ASSET_SOURCE_BASE}/assets/images/oranges.jpg<file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open') let url = cloudinary.url('shark', { transformation:['auto-400-xform'] }); console.log(url) open(url)<file_sep>const crypto = require('crypto'); const utf8 = require('utf8'); exports.signupload = function () { let timestamp = (new Date).getTime(); let str_to_sign = `source=uw&timestamp=${timestamp}${process.env.API_SECRET}` let signature = utf8.encode(crypto.createHash('sha1').update(str_to_sign).digest('hex')); return {signature:signature, timestamp: timestamp} };<file_sep># Advanced Concepts This folder contains data and scripts to use with exercises in Advanced Concepts workshop. ## Web Server This folder contains asset folders that can be served using github.io. To turn on github.io service after copying this repo into your account: 1. go to settings 2. scroll down to github pages 3. select `master branch` from source 4. check enforce HTTPS if you are using a CNAME for your github.io repo 5. you should be able to serve the assets using this URL: ```https://<domain name | accountname.github.io>/advanced-concepts/<images | raw | video>``` ## env variables and credentials Your .env should look like this: CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME API_SECRET=<api secret> ASSET_SOURCE_BASE=“https://<github account>.github.io/advanced-concepts To use the scripts for exercises on Auto Upload management API's 1. `npm install` 3. run your scripts from the root directory unless otherwise directed 4. make changes to scripts as needed for your cloud name 5. .env file is git ignored so it won't get checked in and doesn't exist in a fresh repo <file_sep>require('dotenv').config(); const cloudinary = require('cloudinary').v2; const open = require('open'); const today = new Date().toISOString(); const addDays = days=>{ let currentDate = new Date(); return new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate()+days); } // set to expire after 1 day const enddate = addDays(7).toISOString(); console.log('oneweekfromtoday',enddate); cloudinary.uploader.upload(`${process.env.ASSET_SOURCE_BASE}/assets/images/koi.jpg`, { public_id: "koi", type: "upload", overwrite: true, invalidate:true, "access_control": [ { access_type: "anonymous", start: today, end: enddate} ] }) .then(uploadResult => { console.log(uploadResult) let url = uploadResult.secure_url; open(url) }) .catch(error => console.error(error));<file_sep># Variables replace black with white and center the logo overlay ### Start #### Black baseball cap with transparent background ![start black hat](https://res.cloudinary.com/picturecloud7/image/upload//baseball-hat.png) #### Make the cap white and auto everything and high res ![make it white](https://res.cloudinary.com/picturecloud7/image/upload/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat) #### Add variable for height and width and apply to baseball had ![height and width through variables](https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,h_$vertical,w_$horizontal,c_fit,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat) #### Add a logo overlay and use (default) g_center (gravity center) provide a variable for the width of the logo ![add over lay centered on image](https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,$logowidth_200,w_$horizontal,h_$vertical,c_fit,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_logo-big,c_scale,w_$logowidth,g_center,f_auto,q_auto/baseball-hat) #### Use vertical/horizontal variables to calculate position instead of g_center placement of logo (essentially centered like default): x = $horizontal - initial width / 2 y = $vertical - initial height / 2 if inital dim of the baseball cap = 1024 x 843 x = (500 - 1024)/2 = -262 y = (500 - 843)/2 = -171.5 ![use variables to calc x,y position of image](https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,$logowidth_200,w_$horizontal,h_$vertical,c_fit,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_logo-big,c_scale,w_$logowidth,g_north,x_$horizontal_sub_iw_div_2,y_$vertical_sub_ih_div_2/baseball-hat) iw in the overlay = initial width of the baseball cap ih in the overlay = initial height of the baseball cap #### Final Add a horizontal correction factor because the hat is at an angle in the image x = $horizontal - initial width / 2 + $horizontal * $correction y = $vertical - initial height / 2 new x = (500 - 1024)/2 + (500 * .05) = -237 ![add a 5% correction on the horizon because hat at an angle](https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,$logowidth_200,$correction_0.05,w_$horizontal,h_$vertical,c_fit,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_logo-big,c_scale,w_$logowidth,g_north,x_$horizontal_sub_iw_div_2_add_$horizontal_mul_$correction,y_$vertical_sub_ih_div_2/baseball-hat) -------------- https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_400,$vertical_400,$name_!XXXXX!/w_$horizontal,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_text:Arial_80_black_bold:$(name),g_center/baseball-hat https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,$name_!XXXXX!/w_$horizontal,h_$vertical,c_scale,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_logo-big,c_scale,w_200,g_north,x_$horizontal_sub_iw_div_2,y_$vertical_sub_ih_div_2/baseball-hat https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_400,$vertical_400,$name_!XXXXX!/w_$horizontal,h_$vertical,c_scale,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_logo-big,c_scale,w_160,g_north,x_$horizontal_sub_iw_div_2,y_$vertical_sub_ih_div_2/baseball-hat https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_400,$vertical_400,$name_!XXXXX!/w_$horizontal,e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/l_text:Arial_80_black_bold:$(name),g_center/baseball-hat ----- https://res.cloudinary.com/picturecloud7/image/upload/$test_150,$horizontal_500,$vertical_500,$logoheight_200,$logowidth_200,f_auto,q_auto/w_500/l_logo-big,c_scale,w_200,g_north,x_$horizontal_sub_iw_div_2,y_$vertical_sub_iw_div_2/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,$logoheight_200,f_auto,q_auto/w_500,c_fit/l_logo-big,c_fit,w_$logoheight,g_north,y_$vertical_mul_0.1/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_500,$vertical_500,$correction_0.04,$logoheight_200,f_auto,q_auto/w_500,c_fit/l_logo-big,c_fit,w_$logoheight,g_north,x_$horizontal_mul_$correction,y_$vertical_mul_0.1/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_400,$vertical_400,$correction_0.04,$logoheight_160,f_auto,q_auto/w_400,c_fit/l_logo-big,c_fit,w_$logoheight,g_north,x_$horizontal_mul_$correction,y_$vertical_mul_0.1/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_300,$vertical_300,$correction_0.04,$logoheight_120,f_auto,q_auto/w_300,c_fit/l_logo-big,c_fit,w_$logoheight,g_north,x_$horizontal_mul_$correction,y_$vertical_mul_0.1/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_200,$vertical_200,$correction_0.04,$logoheight_80,f_auto,q_auto/w_200,c_fit/l_logo-big,c_fit,w_$logoheight,g_north,y_$vertical_mul_0.1/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/picturecloud7/image/upload/$horizontal_100,$vertical_100,$logoheight_40,f_auto,q_auto/w_100,c_fit/l_logo-big,c_fit,w_$logoheight,g_north,y_$vertical_mul_0.1/e_replace_color:ffffff:30:111111,dpr_2.0,f_auto,q_auto/baseball-hat.png https://res.cloudinary.com/maribelmullins/image/upload/$horizontal_568,$vertical_824,f_auto,q_auto,$name_!MSM!/l_text:Mr%20De%20Haviland_80_bold:$(name),g_north,x_$horizontal_sub_iw_div_2,y_$vertical/w_500,dpr_2.0,f_auto,q_auto/Towel.jpg https://res.cloudinary.com/maribelmullins/image/upload/$horizontal_568,$vertical_824,f_auto,q_auto,$name_!MSM!/l_text:Mr%20De%20Haviland_80_bold:$(name),g_north,x_$horizontal_sub_iw_div_2,y_$vertical/w_200,dpr_2.0,f_auto,q_auto/Towel.jpg ------------------- <file_sep>// docs: https://cloudinary.com/documentation/upload_images#update_already_uploaded_images //test public_id is dolphin which is authenticated require('dotenv').config(); const cloudinary = require('cloudinary').v2; cloudinary.config() const open = require('open'); // dolphin requires signing // helper signature let url = cloudinary.url("dolphin", { type: "authenticated", secure: true, width: 400, height: 400, fetch_format: "auto", quality: "auto", crop: "mfit", sign_url: true }); console.log("cloudinary helper:",url ) open(url) // https://res.cloudinary.com/picturecloud7/image/authenticated/s--eK4_eXLe--/c_mfit,f_auto,h_400,q_auto,w_400/dolphin
b795c361edf9d47b3c38decc469df00fbcba36ec
[ "JavaScript", "Markdown" ]
15
JavaScript
shirlymanor/advanced-concepts
f7d00814261857ac3704b0c775022b3147c510da
c028314501d37b2fd534bfac2f7baa8f2121e56a
refs/heads/master
<file_sep>#!/bin/bash -eu echo "[INFO] =======================================" echo "[INFO] = Starting instance" echo "[INFO] =======================================" /srv/current/start_eXo.sh <file_sep># How to run docker ``` docker buid -t plf_template docker docker -v $(pwd):/src pls_template/ ``` <file_sep>#!/bin/bash -eu export BASEDIR=${BASEDIR:-$(dirname $0)} export BUILD_ID=${BUILD_ID:-"1"} export DOCKER_HOST=${QA_DOCKER_HOST:?QA_DOCKER_HOST is mandatory} export OFFLINE=${OFFLINE:-false} export DB_TYPE=mysql export DB_VERSION=5.5 export PLF_ARTIFACT_GROUPID=com.exoplatform.platform.distributions export PLF_ARTIFACT_ARTIFACTID=plf-enterprise-tomcat-standalone #export PLF_VERSION=4.3.x-SNAPSHOT #export PLF_ARTIFACT_GROUPID=${QA_PLF_ARTIFACT_GROUPID:?Mandatory} #export PLF_ARTIFACT_ARTIFACTID=${QA_PLF_ARTIFACT_ARTIFACTID:?Mandatory} export PLF_VERSION=${PLF_VERSION:?Mandatory} export PLF_INSTALLER_IMAGE=plf-installer export TS_TIMESTAMP=$(date +%Y%m%d-%H%M%S) #export TS_TIMESTAMP=20151113-021923 export PLF_NAME=${PLF_ARTIFACT_ARTIFACTID}_${PLF_VERSION}_${TS_TIMESTAMP} export NEXUS_USER=${QA_NEXUS_USER:?Mandatory} export NEXUS_USER=${QA_NEXUS_PASSWORD:?Mandatory} type docker > /dev/null if [ $? -ne 0 ] then echo "ERROR Docker command line not found in path" exit 1 fi echo > env.${BUILD_ID} eval $(${BASEDIR}/_installPlatform.sh) echo [INFO] Platform installed on volume ${PLF_NAME} eval $(${BASEDIR}/_startDatabaseContainer.sh) ${BASEDIR}/_startPlatform.sh echo "DB_CONTAINER_ID=${DB_CONTAINER_ID}" >> ${BASEDIR}/env.${BUILD_ID} echo "PLF_NAME=${PLF_NAME}" >> ${BASEDIR}/env.${BUILD_ID} exit 0 <file_sep>#!/bin/bash -eu # ############################################################################# # Initialize # ############################################################################# SCRIPT_NAME="${0##*/}" SCRIPT_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Load env settings source ${SCRIPT_DIR}/_setenv.sh # Load common functions source ${SCRIPT_DIR}/_functions.sh function usage { echo "Usage: $0 <PLF_VERSION>" } if [ $# -lt 1 ]; then echo ">>> Missing arguments" usage exit; fi; VERSION=$1 # Remove old binaries ## TODO Move on AMI mkdir -p ${DL_DIR} find ${DL_DIR} -mtime +28 -name "${PLF_NAME}-*" -exec rm {} \; # Download archive do_download_from_nexus \ "${REPOSITORY_URL}" "${REPOSITORY_USERNAME}" "${REPOSITORY_PASSWORD}" \ "${PLF_ARTIFACT_GROUPID}" "${PLF_ARTIFACT_ARTIFACTID}" "${VERSION}" "${PLF_ARTIFACT_PACKAGING}" "${PLF_ARTIFACT_CLASSIFIER}" \ "${DL_DIR}" "${PLF_NAME}" "PLF" source ${DL_DIR}/${PLF_NAME}-${VERSION}.info <file_sep>FROM exoplatform/ubuntu-jdk7:7u71 # TODO use exo user # ENV EXO_USER exo # ENV EXO_GROUP ${EXO_USER} # Install some useful or needed tools RUN apt-get update RUN apt-get -y upgrade RUN apt-get -y install libxml-xpath-perl zip # apt-get -qq -y autoremove && \ # apt-get -qq -y autoclean \ RUN apt-get install -y time RUN mkdir /scripts ## Not needed on the installer # libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-math libreoffice-writer && \ # USER ${EXO_USER} WORKDIR /scripts VOLUME /downloads ENTRYPOINT ["/scripts/installInstance.sh"] COPY [ "_downloadPLF.sh", "_functions.sh", "_functions_download.sh", "_setenv.sh", "installInstance.sh", "/scripts/" ] <file_sep>#!/bin/bash -eu #Activate aliases usage in scripts shopt -s expand_aliases # Various command aliases #alias display_time='/usr/bin/time -f "[INFO] Return code : %x\n[INFO] Time report (sec) : \t%e real,\t%U user,\t%S system"' alias display_time='/usr/bin/time' # #################################### # Generic bash functions library # #################################### # OS specific support. $var _must_ be set to either true or false. CYGWIN=false LINUX=false; OS400=false DARWIN=false case "`uname`" in CYGWIN*) CYGWIN=true ;; Linux*) LINUX=true ;; OS400*) OS400=true ;; Darwin*) DARWIN=true ;; esac # Rsync directory $1 -> $2 # Parameters : # * $1 : origin path # * $2 : destination path function rsync_directories { mkdir -p $1 display_time rsync --delete-during --inplace --stats -haAXPW $1 $2 } do_curl() { if [ $# -lt 4 ]; then echo "" echo "[ERROR] No enough parameters for function do_curl !" exit 1; fi # # Function parameters # local _curlOptions="$1"; shift; local _url="$1"; shift; local _filePath="$1"; shift; local _description="$1"; shift; echo "[INFO] Downloading $_description from $_url ..." set +e if [ "${OFFLINE}" != "true" ] then curl $_curlOptions "$_url" > $_filePath if [ "$?" -ne "0" ]; then echo "[ERROR] Sorry, cannot download $_description" rm -f $_filePath # Remove potential corrupted file exit 1 fi else # TODO test if file exists in local echo Offline mode activated fi set -e echo "[INFO] $_description downloaded" echo "[INFO] Local path : $_filePath" } # # Function that downloads an artifact from nexus # It will be updated if a SNAPSHOT is asked and a more recent version exists # Because Nexus REST APIs don't use Maven 3 metadata to download the latest SNAPSHOT # of a given GAVCE we need to manually get the timestamp using xpath # see https://issues.sonatype.org/browse/NEXUS-4423 # do_download_from_nexus() { if [ $# -lt 10 ]; then echo "" echo "[ERROR] No enough parameters for function do_download_from_nexus !" exit 1; fi # # Function parameters # local _repositoryURL="$1"; shift; local _repositoryUsername="$1"; shift; local _repositoryPassword="$1"; shift; local _artifactGroupId="$1"; shift; local _artifactArtifactId="$1"; shift; local _artifactVersion="$1"; shift; local _artifactPackaging="$1"; shift; local _artifactClassifier="$1"; shift; local _downloadDirectory="$1"; shift; local _fileBaseName="$1"; shift; local _prefix="$1"; shift; # Used to _prefix variables that store artifact details # # Local variables # local _artifactDate="" # We can compute the artifact date only for SNAPSHOTs local _artifactTimestamp="$_artifactVersion" # By default we set the timestamp to the given version (for a release) local _isTimestamp=false local _isRelease=false local _isSnapshot=false if [[ "$_artifactVersion" =~ .*-SNAPSHOT ]]; then # If this is a SNAPSHOT _isSnapshot=true elif [[ "$_artifactVersion" =~ .*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]+ ]]; then # If this is a TIMESTAMP we need to set the version to -SNAPSHOT _artifactVersion=`expr "$_artifactTimestamp" : '\(.*\)-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]\+'`"-SNAPSHOT" _isTimestamp=true else _isRelease=true fi local _baseUrl="${_repositoryURL}/${_artifactGroupId//.//}/$_artifactArtifactId/$_artifactVersion" # base url where to download from local _curlOptions=""; # Credentials and options if [ -n "$_repositoryUsername" ]; then _curlOptions="--fail --show-error --location-trusted -u $_repositoryUsername:$_repositoryPassword" # Repository credentials and options else _curlOptions="--fail --show-error --location-trusted" fi # Create the directory where we will download it mkdir -p $_downloadDirectory # # For a SNAPSHOT we will need to manually compute its TIMESTAMP from maven metadata # if $_isSnapshot; then local _metadataFile="$_downloadDirectory/$_fileBaseName-$_artifactVersion-maven-metadata.xml" local _metadataUrl="$_baseUrl/maven-metadata.xml" # Backup lastest metadata to be able to use them if newest are wrong # (were removed from nexus for example thus we can use what we have in our local cache) if [ -e "$_metadataFile" ]; then mv $_metadataFile $_metadataFile.bck fi do_curl "$_curlOptions" "$_metadataUrl" "$_metadataFile" "Artifact Metadata" local _xpathQuery=""; if [ -z "$_artifactClassifier" ]; then _xpathQuery="/metadata/versioning/snapshotVersions/snapshotVersion[(not(classifier))and(extension=\"$_artifactPackaging\")]/value/text()" else _xpathQuery="/metadata/versioning/snapshotVersions/snapshotVersion[(classifier=\"$_artifactClassifier\")and(extension=\"$_artifactPackaging\")]/value/text()" fi set +e if $DARWIN; then _artifactTimestamp=`xpath $_metadataFile $_xpathQuery` fi if $LINUX; then _artifactTimestamp=`xpath -q -e $_xpathQuery $_metadataFile` fi set -e if [ -z "$_artifactTimestamp" ] && [ -e "$_metadataFile.bck" ]; then # We will restore the previous one to get its timestamp and redeploy it echo "[WARNING] Current metadata invalid (no more package in the repository ?). Reinstalling previous downloaded version." mv $_metadataFile.bck $_metadataFile if $DARWIN; then _artifactTimestamp=`xpath $_metadataFile $_xpathQuery` fi if $LINUX; then _artifactTimestamp=`xpath -q -e $_xpathQuery $_metadataFile` fi fi if [ -z "$_artifactTimestamp" ]; then echo "[ERROR] No package available in the remote repository and no previous version available locally." exit 1; fi rm -f $_metadataFile.bck echo "[INFO] Latest timestamp : $_artifactTimestamp" _artifactDate=`expr "$_artifactTimestamp" : '.*-\(.*\)-.*'` fi # # Compute the Download URL for the artifact # local _filename=$_artifactArtifactId-$_artifactTimestamp local _name=$_artifactGroupId:$_artifactArtifactId:$_artifactVersion if [ -n "$_artifactClassifier" ]; then _filename="$_filename-$_artifactClassifier" _name="$_name:$_artifactClassifier" fi _filename="$_filename.$_artifactPackaging" _name="$_name:$_artifactPackaging" local _artifactUrl="$_baseUrl/$_filename" local _artifactFile="$_downloadDirectory/$_fileBaseName-$_artifactTimestamp.$_artifactPackaging" # # Download the artifact SHA1 # local _sha1Url="${_artifactUrl}.sha1" local _sha1File="${_artifactFile}.sha1" if [ ! -e "$_sha1File" ]; then do_curl "$_curlOptions" "$_sha1Url" "$_sha1File" "Artifact SHA1" fi # # Download the artifact # if [ -e "$_artifactFile" ]; then echo "[INFO] $_name was already downloaded. Skip artifact download !" else do_curl "$_curlOptions" "$_artifactUrl" "$_artifactFile" "Artifact $_name" fi # # Validate download integrity # echo "[INFO] Validating download integrity ..." # Read the SHA1 from Maven read -r mavenSha1 < $_sha1File || true echo "$mavenSha1 $_artifactFile" > $_sha1File.tmp set +e shasum -c $_sha1File.tmp if [ "$?" -ne "0" ]; then echo "[ERROR] Sorry, $_name download integrity failed" rm -f $_artifactFile rm -f $_sha1File rm -f $_sha1File.tmp exit 1 fi set -e rm -f $_sha1File.tmp echo "[INFO] Download integrity validated." # # Validate archive integrity # echo "[INFO] Validating archive integrity ..." set +e case "$_artifactPackaging" in zip) zip -T $_artifactFile ;; jar | war | ear) jar -tf $_artifactFile > /dev/null 2>&1 ;; tar.gz | tgz) gzip -t $_artifactFile ;; *) echo "[WARNING] No method to validate \"$_artifactPackaging\" file type." ;; esac if [ "$?" -ne "0" ]; then echo "[ERROR] Sorry, $_name archive integrity failed. Local copy is deleted." rm -f $_artifactFile rm -f $mavenSha1 exit 1 fi set -e echo "[INFO] Archive integrity validated." # # Create an info file with all details about the artifact # local _artifactInfo="$_downloadDirectory/$_fileBaseName-$_artifactTimestamp.info" echo "[INFO] Creating archive descriptor ..." cat << EOF > $_artifactInfo ${_prefix}_VERSION="$_artifactVersion" ${_prefix}_ARTIFACT_GROUPID="$_artifactGroupId" ${_prefix}_ARTIFACT_ARTIFACTID="$_artifactArtifactId" ${_prefix}_ARTIFACT_TIMESTAMP="$_artifactTimestamp" ${_prefix}_ARTIFACT_DATE="$_artifactDate" ${_prefix}_ARTIFACT_CLASSIFIER="$_artifactClassifier" ${_prefix}_ARTIFACT_PACKAGING="$_artifactPackaging" ${_prefix}_ARTIFACT_URL="$_artifactUrl" ${_prefix}_ARTIFACT_LOCAL_PATH="$_artifactFile" EOF echo "[INFO] Done." #Display the deployment descriptor echo "[INFO] ========================== Archive Descriptor ===========================" cat $_artifactInfo echo "[INFO] =========================================================================" # # Create a symlink if it is a SNAPSHOT to the TIMESTAMPED version # if $_isSnapshot; then ln -fs "$_fileBaseName-$_artifactTimestamp.$_artifactPackaging" "$_downloadDirectory/$_fileBaseName-$_artifactVersion.$_artifactPackaging" ln -fs "$_fileBaseName-$_artifactTimestamp.info" "$_downloadDirectory/$_fileBaseName-$_artifactVersion.info" fi } do_load_artifact_descriptor() { if [ $# -lt 3 ]; then echo "" echo "[ERROR] No enough parameters for function do_load_artifact_descriptor !" exit 1; fi local _downloadDirectory="$1"; shift; local _fileBaseName="$1"; shift; local _artifactVersion="$1"; shift; source "$_downloadDirectory/$_fileBaseName-$_artifactVersion.info" } # Backup the file passed as parameter backup_logs() { if [ -d $1 ]; then # We need to backup existing logs if they already exist cd $1 local _start_date=`date -u "+%Y%m%d-%H%M%S-UTC"` for file in $2 do if [ -e $file ]; then echo "[INFO] Archiving existing log file $file as archived-on-${_start_date}-$file ..." mv $file archived-on-${_start_date}-$file echo "[INFO] Done." fi done cd - fi } # $1 : Startup time # $2 : End time delay() { if [ $# -lt 2 ]; then echo "" echo "[ERROR] No enough parameters for function delay !" exit 1; fi local _start=$1 local _end=$2 echo "$(( (_end - _start)/3600 )) hour(s) $(( ((_end - _start) % 3600) / 60 )) minute(s) $(( (_end - _start) % 60 )) second(s)" } # $1 : Message # $2 : Startup time # $3 : End time display_delay() { if [ $# -lt 3 ]; then echo "" echo "[ERROR] No enough parameters for function display_delay !" exit 1; fi echo "[INFO] $1: $(delay $2 $3) ." } # # Replace in file $1 the value $2 by $3 # replace_in_file() { local _tmpFile=$(mktemp ${TMP_DIR}/replace.XXXXXXXXXX) || { echo "Failed to create temp file"; exit 1; } mv $1 ${_tmpFile} sed "s|$2|$3|g" ${_tmpFile} > $1 rm ${_tmpFile} } # The function computes the UTC date and time from now with a given delay in minutes # $1 The delay in minutes computes_operation_utc_date_and_time() { local _delay=$1 YEAR=`date -u -d "$(date) ${_delay} minutes" +%Y` MONTH=`date -u -d "$(date) ${_delay} minutes" +%m` DAY=`date -u -d "$(date) ${_delay} minutes" +%d` HOUR=`date -u -d "$(date) ${_delay} minutes" +%H` MIN=`date -u -d "$(date) ${_delay} minutes" +%M` } # $1 : Template # $2 : Recipient # $3 : Sender # $4 : Service # $* : Others templates substitution with XXX=YYY to replace in the template all @XXX@ occurences by YYY send_mail() { local _template=$1; shift; local _recipient=$1; shift; local _sender=$1; shift; local _service=$1; shift; local _message=$(mktemp ${TMP_DIR}/email.XXXXXXXXXX) || { echo "Failed to create temp file"; exit 1; } local _date=`date "+%Y-%m-%d"` cp ${_template} ${_message} replace_in_file ${_message} "@SERVICE@" ${_service} replace_in_file ${_message} "@SENDER@" ${_sender} replace_in_file ${_message} "@RECIPIENT@" ${_recipient} for p in "$@"; do replace_in_file ${_message} "@${p%%=*}@" "${p##*=}" done; cat ${_message} | sendmail -t rm -f ${_message} } <file_sep>REPOSITORY_URL=https://repository.exoplatform.org/content/repositories/exo-private-snapshots REPOSITORY_USERNAME=${REPOSITORY_USERNAME:?UNSET} REPOSITORY_PASSWORD=${REPOSITORY_PASSWORD:?UNSET} PLF_ARTIFACT_GROUPID=${PLF_ARTIFACT_GROUPID:?UNSET} PLF_ARTIFACT_ARTIFACTID=${PLF_ARTIFACT_ARTIFACTID:?UNSET} VERSION=${VERSION:?UNSET} PLF_ARTIFACT_PACKAGING=zip PLF_ARTIFACT_CLASSIFIER= DL_DIR=/downloads PLF_NAME=tqa-poc PLF_SRV_DIR=/srv DEPLOYMENT_MYSQL_DRIVER_VERSION=5.1.25 <file_sep>#!/bin/bash # Don't load it several times set +u ${_FUNCTIONS_DOCKER_LOADED:-false} && return set -u # #################################### # Generic bash functions library # #################################### # OS specific support. $var _must_ be set to either true or false. CYGWIN=false LINUX=false; OS400=false DARWIN=false case "`uname`" in CYGWIN*) CYGWIN=true ;; Linux*) LINUX=true ;; OS400*) OS400=true ;; Darwin*) DARWIN=true ;; esac function get_port_mapping() { docker port $1 | cut -f2 -d":" } function get_plf_host() { echo $DOCKER_HOST | cut -f2 -d":" | cut -f3 -d"/" } function get_plf_url() { echo http://$(get_plf_host):$(get_port_mapping $1) } function wait_open_port() { HOST=$1 PORT=$2 max=600 current=0 ok=false while [ $current -lt $max ] do current=$((current + 1)) set +e nc -vz $1 $2 2> /dev/null if [ $? -eq 0 ] then ok=true current=$max else echo "DEBUG waiting for ${HOST}:${PORT}" >/dev/stderr sleep 1 fi set -e done if [ $ok == false ] then echo "ERROR Port $HOST:$PORT not opened after ${max}s" return 1 fi return 0 } <file_sep>#!/bin/bash -eu PLF_VERSION=${PLF_VERSION:?mandatory} PLF_ARTIFACT_ARTIFACTID=${PLF_ARTIFACT_ARTIFACTID:?mandatory} PLF_ARTIFACT_GROUPID=${PLF_ARTIFACT_GROUPID:?mandatory} TS_TIMESTAMP=${TS_TIMESTAMP:?mandatory} PLF_VOLUME_NAME=${PLF_NAME:?Mandatory} QA_NEXUS_USER=${QA_NEXUS_USER:?Mandatory} QA_NEXUS_PASSWORD=${QA_NEXUS_PASSWORD:?Mandatory} #### Create volumes PLF_INSTALL_VOLUME=$(docker volume create --name ${PLF_VOLUME_NAME}) DOWNLOADS_VOLUME=$(docker volume create --name plf_artifacts_downloads) ## Download and install PLF docker run -v ${PLF_INSTALL_VOLUME}:/srv -v ${DOWNLOADS_VOLUME}:/downloads -e OFFLINE=${OFFLINE} -e VERSION=${PLF_VERSION} -e REPOSITORY_USERNAME=${QA_NEXUS_USER} -e REPOSITORY_PASSWORD=${<PASSWORD>} -e PLF_ARTIFACT_GROUPID=${PLF_ARTIFACT_GROUPID} -e PLF_ARTIFACT_ARTIFACTID=${PLF_ARTIFACT_ARTIFACTID} --name ${PLF_INSTALL_VOLUME}_installer ${PLF_INSTALLER_IMAGE} 1>&2 # Dont use directly --rm in the previous command to avoid removing the volumes docker rm ${PLF_INSTALL_VOLUME}_installer > /dev/null export PLF_VOLUME=${PLF_INSTALL_VOLUME} <file_sep>#!/bin/bash -eu source ${BASEDIR}/_functions_docker.sh PLF_VOLUME=${PLF_VOLUME-$PLF_NAME} PLF_LAUNCHER_IMAGE=plf-runner PLF_NAME=${PLF_NAME:?Mandatory} PLF_CONTAINER=$(docker run -d -v ${PLF_VOLUME}:/srv -v ${PLF_NAME}:/srv --link ${DB_CONTAINER_ID}:db --name ${PLF_NAME} -p 8080 ${PLF_LAUNCHER_IMAGE}) PLF_URL=$(get_plf_url ${PLF_NAME}) PLF_PORT=$(get_port_mapping ${PLF_NAME}) PLF_HOST=$(get_plf_host) echo "INFO Platform url ${PLF_URL}" docker logs -f ${PLF_NAME} & wait_open_port ${PLF_HOST} ${PLF_PORT} echo "INFO PLF started and available at ${PLF_URL}" echo "PLF_URL=${PLF_URL}" >> ${BASEDIR}/env.${BUILD_ID} <file_sep>FROM exoplatform/ubuntu-jdk7:7u71 COPY entrypoint.sh / RUN chmod -u+x /entrypoint.sh ENTRYPOINT /entrypoint.sh <file_sep>version: '2' services: exo: image: exoplatform/exo-community:4.3 environment: EXO_DB_TYPE: mysql EXO_DB_NAME: exo EXO_DB_USER: exo EXO_DB_PASSWORD: exo EXO_DB_HOST: mysql EXO_ADDONS_LIST: exo-jdbc-driver-mysql expose: - "8080" ports: - "8081:8080" volumes: - exo_data:/srv/exo - exo_logs:/var/log/exo links: - mysql depends_on: - mysql mysql: image: mysql:5.5 environment: MYSQL_ROOT_PASSWORD: <PASSWORD> MYSQL_DATABASE: exo MYSQL_USER: exo MYSQL_PASSWORD: exo volumes: - mysql_data:/var/lib/mysql volumes: exo_data: external: name: exo_data exo_logs: external: name: exo_logs mysql_data: external: name: mysql_data<file_sep>#!/bin/bash -eu export BUILD_ID=${BUILD_ID:-"1"} export BASEDIR=${BASEDIR:-$(dirname $0)} source ${BASEDIR}/_functions_docker.sh source ${BASEDIR}/env.${BUILD_ID} echo "INFO Cleaning database container" docker rm -f ${DB_CONTAINER_ID} echo "INFO Cleaning PLF container" docker rm -f ${PLF_NAME} <file_sep><?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <artifactId>maven-parent-pom</artifactId> <groupId>org.exoplatform</groupId> <version>15</version> <relativePath /> </parent> <groupId>org.exoplatform.platform.tests</groupId> <artifactId>ui-test-selenium</artifactId> <version>1.0.x-SNAPSHOT</version> <packaging>jar</packaging> <properties> <maven.surefire.plugin.version>2.19</maven.surefire.plugin.version> <selenium-java.version>2.46.0</selenium-java.version> <testng.version>6.3.1</testng.version> <!-- eXo dependencies with UI Selenium Tests --> <exo.ui.testsuite.version>4.2.x-POC-SNAPSHOT</exo.ui.testsuite.version> <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version> <testSuite>sniff</testSuite> </properties> <dependencies> <dependency> <groupId>org.exoplatform.selenium</groupId> <artifactId>ui-testsuite</artifactId> <version>${exo.ui.testsuite.version}</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>${testng.version}</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>${selenium-java.version}</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>${selenium-java.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven.surefire.plugin.version}</version> <configuration> <dependenciesToScan> <dependency>org.exoplatform.selenium:ui-testsuite</dependency> </dependenciesToScan> </configuration> <executions> <execution> <id>d-integration-test</id> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> <configuration> <suiteXmlFiles> <suiteXmlFile>target/selenium/suites/${testSuite}.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>${maven-dependency-plugin.version}</version> <executions> <execution> <id>unpack</id> <phase>process-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.exoplatform.selenium</groupId> <artifactId>ui-testsuite</artifactId> <version>${exo.ui.testsuite.version>}</version> <type>jar</type> <overWrite>false</overWrite> <outputDirectory>${project.build.directory}/selenium</outputDirectory> <includes>**/*.xml</includes> <excludes>**/*.class</excludes> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> <file_sep>= Selenium GRID [source,bash] ---- mvn verify -DtestSuite=wiki-sniff -DscreenshotsPath=/tmp/selenium -Dbrowser=firefox -Dplatform=LINUX -DhubURL=http://localhost:4444/wd/hub -DplfURL=http://locahost:8080/portal # creating new clean volumes for eXo Platform persistent data $ docker volume create --name=exo_data $ docker volume create --name=exo_logs $ docker volume create --name=mysql_data # Start MySQL + PLF + Selenium HUB + Chrome and firefox drivers $ docker-compose up ---- <file_sep>#!/bin/bash -eu ## A script to start a database container ## must define these variables ## - DB_URL ## - DB_USER ## - DB_PASSWORD ## - DB_CONTAINER_ID DB_TYPE=${DB_TYPE:?DB_TYPE is mandatory} DB_VERSION=${DB_VERSION:?DB_VERSION is mandatory} DOCKER_HOST=${DOCKER_HOST:?DOCKER_HOST is mandatory} ${BASEDIR}/_startDatabaseContainer-${DB_TYPE}.sh <file_sep>#!/bin/bash -eu source ${BASEDIR}/_functions_docker.sh IMAGE=mysql VERSION=${DB_VERSION} MYSQL_ROOT=eXo # TODO random MYSQL_DATABASE=plf MYSQL_USER=plf MYSQL_PASSWORD=plf #docker run -ti -e MYSQL_ROOT_PASSWORD=eXo -e MYSQL_DATABASE=plf -e MYSQL_USER=plf -e MYSQL_PASSWORD=plf --name mysql mysql:5.5 echo "INFO Database starting ...." > /dev/stderr DB_CONTAINER_ID=$(docker run -p 3306 -d -e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT} -e MYSQL_DATABASE=${MYSQL_DATABASE} -e MYSQL_USER=${MYSQL_USER} -e MYSQL_PASSWORD=${MYSQL_PASSWORD} ${IMAGE}:${VERSION} ) DB_PORT=$(get_port_mapping ${DB_CONTAINER_ID}) DB_HOST=$(get_plf_host) wait_open_port ${DB_HOST} ${DB_PORT} echo "INFO Database available container=${DB_CONTAINER_ID}" > /dev/stderr echo export DB_CONTAINER_ID=${DB_CONTAINER_ID} echo export DB_URL=jdbc:mysql://db:3306 <file_sep>#!/bin/bash # ############################################################################# # Initialize # ############################################################################# SCRIPT_NAME="${0##*/}" SCRIPT_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source _functions_download.sh source _functions.sh #do_download_server https://repository.exoplatform.com source ./_downloadPLF.sh ${VERSION} mkdir -p ${PLF_SRV_DIR} echo "" echo "[INFO] =======================================" echo "[INFO] = Extract ${PLF_NAME} ${VERSION} ..." echo "[INFO] =======================================" rm -rf ${PLF_SRV_DIR}/${PLF_NAME}-${VERSION} mkdir -p ${PLF_SRV_DIR}/${PLF_NAME}-${VERSION} echo "[INFO] Uncompressing ${PLF_ARTIFACT_LOCAL_PATH} in to ${PLF_SRV_DIR}/${PLF_NAME}-${VERSION} ..." display_time unzip -q ${PLF_ARTIFACT_LOCAL_PATH} -d ${PLF_SRV_DIR}/${PLF_NAME}-${VERSION} if [ "$?" -ne "0" ]; then echo "[ERROR] Unable to unpack the server." exit 1 fi echo "" echo "[INFO] =======================================" echo "[INFO] = Configure intance ${PLF_NAME} ${VERSION} ..." echo "[INFO] =======================================" rm -f ${PLF_SRV_DIR}/current ln -fs ${PLF_SRV_DIR}/${PLF_NAME}-${VERSION}/platform-${VERSION} ${PLF_SRV_DIR}/current ln -fs ${PLF_SRV_DIR}/bin/_setenv.sh ${PLF_SRV_DIR}/current/bin/setenv-local.sh mv ${PLF_SRV_DIR}/current/conf/server.xml ${PLF_SRV_DIR}/current/conf/server.xml.ori cp ${PLF_SRV_DIR}/current/conf/server-mysql.xml ${PLF_SRV_DIR}/current/conf/server.xml #ln -fs ${PLF_SRV_DIR}/bin/_setenv.sh ${PLF_SRV_DIR}/current/bin/setenv-local.sh mv ${PLF_SRV_DIR}/current/conf/server.xml ${PLF_SRV_DIR}/current/conf/server.xml.ori cp ${PLF_SRV_DIR}/current/conf/server-mysql.xml ${PLF_SRV_DIR}/current/conf/server.xml sed -i 's/localhost:3306/db:3306/g' ${PLF_SRV_DIR}/current/conf/server.xml MYSQL_JAR_URL="http://repository.exoplatform.org/public/mysql/mysql-connector-java/${DEPLOYMENT_MYSQL_DRIVER_VERSION}/mysql-connector-java-${DEPLOYMENT_MYSQL_DRIVER_VERSION}.jar" pushd . mkdir -p ${DL_DIR}/mysql-connector-java/${DEPLOYMENT_MYSQL_DRIVER_VERSION}/ echo "[INFO] Downloading MySQL JDBC driver from ${MYSQL_JAR_URL} ..." set +e curl --fail --show-error --location-trusted ${MYSQL_JAR_URL} > ${DL_DIR}/mysql-connector-java/${DEPLOYMENT_MYSQL_DRIVER_VERSION}/`basename ${MYSQL_JAR_URL}` if [ "$?" -ne "0" ]; then echo "[ERROR] Cannot download ${MYSQL_JAR_URL}" rm -f "${DL_DIR}/mysql-connector-java/${DEPLOYMENT_MYSQL_DRIVER_VERSION}/"`basename ${MYSQL_JAR_URL}` # Remove potential corrupted file exit 1 fi set -e echo "[INFO] Done." cp -f "${DL_DIR}/mysql-connector-java/${DEPLOYMENT_MYSQL_DRIVER_VERSION}/"`basename ${MYSQL_JAR_URL}` ${PLF_SRV_DIR}/current/lib set -e echo "[INFO] Done" echo "[INFO] =======================================" echo "[INFO] = Installing Acme addon" echo "[INFO] =======================================" ${PLF_SRV_DIR}/current/addon install exo-acme-sample:4.3.x-SNAPSHOT echo "[INFO] =======================================" echo "[INFO] = Starting instance" echo "[INFO] =======================================" ${PLF_SRV_DIR}/current/start_eXo.sh
1b23cae9b310ec73fbab3ae93ad06ce7b77a6b79
[ "YAML", "Markdown", "Maven POM", "AsciiDoc", "Dockerfile", "Shell" ]
18
Shell
exoplatform/poc-ui-test-selenium
6181930c91726278c2291aa1e4f2767a116091f4
f5ccf32c9067d7bc197a8f393bd25d26429adcbb
refs/heads/master
<repo_name>ddaina/CMSKubernetes<file_sep>/docker/couchdb/Dockerfile FROM cmssw/cmsweb:20190814 MAINTAINER <NAME> <EMAIL> ENV WDIR=/data ENV USER=_couchdb ADD install.sh $WDIR/install.sh # add new user RUN useradd ${USER} && install -o ${USER} -d ${WDIR} # add user to sudoers file RUN echo "%$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers # switch to user USER ${USER} # start the setup RUN mkdir -p $WDIR WORKDIR ${WDIR} # pass env variable to the build ARG CMSK8S ENV CMSK8S=$CMSK8S # install RUN $WDIR/install.sh # build couchdb exporter ENV GOPATH=$WDIR/gopath RUN mkdir -p $GOPATH ENV PATH="${GOROOT}/bin:${WDIR}:${PATH}" RUN go get github.com/golang/glog RUN go get github.com/namsral/flag #RUN go get github.com/gesellix/couchdb-prometheus-exporter/glogadapt RUN go get github.com/gesellix/couchdb-prometheus-exporter/lib RUN go get github.com/gesellix/couchdb-prometheus-exporter # add necessary scripts ADD run.sh $WDIR/run.sh ADD monitor.sh $WDIR/monitor.sh # setup final environment USER $USER WORKDIR $WDIR CMD ["./run.sh"] <file_sep>/docker/rucio-server/Dockerfile # Copyright European Organization for Nuclear Research (CERN) 2017 # # 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 # # Authors: # - <NAME>, <<EMAIL>>, 2018 ARG RUCIO_VERSION FROM rucio/rucio-server:release-$RUCIO_VERSION ADD https://raw.githubusercontent.com/dmwm/CMSRucio/master/docker/CMSRucioClient/scripts/cmstfc.py /usr/lib/python2.7/site-packages/cmstfc.py RUN chmod 755 /usr/lib/python2.7/site-packages/cmstfc.py RUN yum -y install http://linuxsoft.cern.ch/wlcg/centos7/x86_64/wlcg-repo-1.0.0-1.el7.noarch.rpm ADD http://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI-trustanchors.repo /etc/yum.repos.d/egi.repo RUN yum update -y RUN yum -y install ca-policy-egi-core RUN yum -y install ca-certificates.noarch fetch-crl cronie psmisc ADD cms-entrypoint.sh / RUN echo "32 */6 * * * root ! /usr/sbin/fetch-crl -q -r 360 ; killall -HUP httpd" > /etc/cron.d/fetch-crl-docker ENTRYPOINT ["/cms-entrypoint.sh"] <file_sep>/docker/rucio-probes/scripts/15-minutes.sh #! /bin/bash echo "Running things to be run every 15 minutes" set -x j2 /tmp/rucio.cfg.j2 | sed '/^\s*$/d' > /opt/rucio/etc/rucio.cfg ls /opt/rucio/etc cd /root/probes/common # Rewrite script(s) until a generic version is available from Dimitrious sed -i -E "s/atlas_rucio.//g" check_transfer_queues_status ./check_transfer_queues_status sleep 60<file_sep>/helm/README.md To add to the repo: * helm package rucio-statsd-exporter * helm repo index . <file_sep>/docker/udp-server/Dockerfile FROM golang:latest MAINTAINER <NAME> <EMAIL> ENV WDIR=/data ENV USER=http EXPOSE 9331 ADD udp_server.go $WDIR/udp_server.go WORKDIR $WDIR RUN go mod init github.com/vkuznet/udp-server RUN go build udp_server.go <file_sep>/docker/rucio-server/README.md Steps to create image and push to docker hub * docker login * export RUCIO_VERSION=1.20.1 * docker build --build-arg RUCIO_VERSION=$RUCIO_VERSION -t cmssw/rucio-server:release-$RUCIO_VERSION . * docker push cmssw/rucio-server:release-$RUCIO_VERSION <file_sep>/kubernetes/rucio/create_secrets.sh #!/usr/bin/env bash # This script will create the various secrets needed by our installation. Before running set the following env variables # HOSTP12 - The .p12 file from corresponding to the host certificate # ROBOTCERT - The robot certificate (named usercert.pem) # ROBOTKEY - The robot certificate key (unencrypted, named new_userkey.pem) # INSTANCE - The instance name (dev/testbed/int/prod) export DAEMON_NAME=cms-ruciod-${INSTANCE} export SERVER_NAME=cms-rucio-${INSTANCE} export UI_NAME=cms-webui-${INSTANCE} echo echo "When prompted, enter the password used to encrypt the P12 file" # Secret for redirecting server traffic from 443 to 80 # Setup files so that secretes are unavailable the least amount of time openssl pkcs12 -in $HOSTP12 -clcerts -nokeys -out ./tls.crt openssl pkcs12 -in $HOSTP12 -nocerts -nodes -out ./tls.key # Secrets for the auth server cp tls.key hostkey.pem cp tls.crt hostcert.pem cp /etc/pki/tls/certs/CERN_Root_CA.pem ca.pem chmod 600 ca.pem # Many of these are old names. Change as we slowly adopt the new names everywhere. echo "Removing existing secrets" kubectl delete secret rucio-server.tls-secret kubectl delete secret ca host-key host-cert kubectl delete secret ${DAEMON_NAME}-fts-cert ${DAEMON_NAME}-fts-key ${DAEMON_NAME}-hermes-cert ${DAEMON_NAME}-hermes-key kubectl delete secret ${DAEMON_NAME}-rucio-ca-bundle ${DAEMON_NAME}-rucio-ca-bundle-reaper kubectl delete secret ${SERVER_NAME}-hostcert ${SERVER_NAME}-hostkey ${SERVER_NAME}-cafile kubectl delete secret ${DAEMON_NAME}-host-cert ${DAEMON_NAME}-host-key ${DAEMON_NAME}-cafile kubectl delete secret ${UI_NAME}-hostcert ${UI_NAME}-hostkey ${UI_NAME}-cafile echo "Creating new secrets" kubectl create secret tls rucio-server.tls-secret --key=tls.key --cert=tls.crt kubectl create secret generic ${SERVER_NAME}-hostcert --from-file=hostcert.pem kubectl create secret generic ${SERVER_NAME}-hostkey --from-file=hostkey.pem kubectl create secret generic ${SERVER_NAME}-cafile --from-file=ca.pem kubectl create secret generic ${DAEMON_NAME}-host-cert --from-file=hostcert.pem kubectl create secret generic ${DAEMON_NAME}-host-key --from-file=hostkey.pem kubectl create secret generic ${DAEMON_NAME}-cafile --from-file=ca.pem kubectl create secret generic ${UI_NAME}-hostcert --from-file=hostcert.pem kubectl create secret generic ${UI_NAME}-hostkey --from-file=hostkey.pem # See below for CA for WebUI # Secrets for FTS, hermes kubectl create secret generic ${DAEMON_NAME}-fts-cert --from-file=$ROBOTCERT kubectl create secret generic ${DAEMON_NAME}-fts-key --from-file=$ROBOTKEY kubectl create secret generic ${DAEMON_NAME}-hermes-cert --from-file=$ROBOTCERT kubectl create secret generic ${DAEMON_NAME}-hermes-key --from-file=$ROBOTKEY kubectl create secret generic ${DAEMON_NAME}-rucio-ca-bundle --from-file=/etc/pki/tls/certs/CERN-bundle.pem kubectl create secret generic ${DAEMON_NAME}-rucio-ca-bundle-reaper --from-file=/etc/pki/tls/certs/CERN-bundle.pem # WebUI needs whole bundle as ca.pem. Keep this at end since we just over-wrote ca.pem cp /etc/pki/tls/certs/CERN-bundle.pem ca.pem kubectl create secret generic ${UI_NAME}-cafile --from-file=ca.pem # Clean up rm tls.key tls.crt hostkey.pem hostcert.pem ca.pem kubectl get secrets <file_sep>/docker/rucio-server/cms-entrypoint.sh #! /bin/bash /usr/sbin/fetch-crl & /usr/sbin/crond /docker-entrypoint.sh <file_sep>/kubernetes/rucio/README.md Adapted from rucio instructions here: https://github.com/rucio/helm-charts/tree/master/rucio-server # Accessing the existing kubernetes clusters The instructions below are for a fresh setup of a new kubernetes cluster. Most people will only need to access an existing cluster to view logs, change configs, etc. This is much simpler: ssh lxplus-cloud.cern.ch mkdir [directory to hold cluster files] cd [directory to hold cluster files] `openstack coe cluster config --os-project-name CMSRucio [cluster name, eg. cmsruciodev1]` even that is only needed the first time one accesses a particular cluster. On subsequent logins, just ssh lxplus-cloud.cern.ch export KUBECONFIG=[directory to hold cluster files]/config You can now issue all kubectl commands mentioned below as well as run the upgrade scripts. # First time setup ## OpenStack project You need to request a personal OpenStack project in which to install your kubernetes cluster. You might also want to request a quota for "Shares" in the "Geneva CephFS Testing" type for persistent data storage. This is used right now by Graphite. ## Setup a new cluster in the CMSRucio project: Begin by logging into the CERN cloud infrastructure `slogin lxplus7-cloud.cern.ch`. Edit `CMSKubernetes/kubernetes/rucio/create_cluster.sh` for the correct name and size. This script has the current recommened openstack parameters for the cluster. You can determine all current labels with `openstack --os-project-name CMSRucio coe cluster template show [template]` cd CMSKubernetes/kubernetes/rucio/ openstack coe cluster delete --os-project-name CMSRucio cmsruciotest ./create_cluster.sh If you are creating your own project for development, please omit `--os-project-name CMSRucio`. This will create a kubernetes cluster in your own openstack space rather than the central group space. CMSRucio is a project space CERN has set up for us to contain our production and testbed servers. ### If setting up a new/changed cluster: cd [some directory] # or use $HOME export BASEDIR=`pwd` rm key.pem cert.pem ca.pem config openstack coe cluster config --os-project-name CMSRucio cmsruciotest This command will show you the proper value of your `KUBECONFIG` variable which should be this: export KUBECONFIG=$BASEDIR/config Copy and paste the last line. On subsequent logins it is all that is needed. Now make sure that your nodes exist: -bash-4.2$ kubectl get nodes NAME STATUS ROLES AGE VERSION cmsruciotest-mzvha4weztri-minion-0 Ready <none> 5m v1.11.2 cmsruciotest-mzvha4weztri-minion-1 Ready <none> 6m v1.11.2 cmsruciotest-mzvha4weztri-minion-2 Ready <none> 6m v1.11.2 cmsruciotest-mzvha4weztri-minion-3 Ready <none> 6m v1.11.2 ## Setup the helm repos if needed kubectl config current-context helm repo add rucio https://rucio.github.io/helm-charts helm repo add kiwigrid https://kiwigrid.github.io helm repo add cms-kubernetes https://dmwm.github.io/CMSKubernetes/helm/ helm repo add kube-eagle https://raw.githubusercontent.com/cloudworkz/kube-eagle-helm-chart/master ## Install helm into the kubernetes project This is needed even though CERN installs its own helm to manage ingress-nginx. The two helm instances are in separate k8s namespaces, so they do not collide. cd CMSKubernetes/kubernetes/rucio ./install_helm.sh ## Get a host certificate for the server Go to ca.cern.ch and get the host certificate for one of the load balanced names above. Add Service alternate names for the load balanced hostname, e.g. * cms-rucio-testbed * cms-rucio-auth-testbed * cms-rucio-webui-testbed * cms-rucio-stats-testbed * cms-rucio-trace-testbed ## Create relevant secrets Set the following environment variables. The filenames must match these exactly. cd CMSKubernetes/kubernetes/rucio export HOSTP12=[path to host cert for ]-minion-0.p12 export ROBOTCERT=[path to robot cert]/usercert.pem export ROBOTKEY=[path to unencrypted robot]/new_userkey.pem ./create_secrets.sh *This needs to be relocated ./CMSKubernetes/kubernetes/rucio/rucio_reaper_secret.sh # Currently needs to be done after helm install below * N.b. In the past we also used /etc/pki/tls/certs/CERN-bundle.pem as a volume mount for logstash. That no longer seems to be needed. ## Install CMS server into the kubernetes project. Later we can add another set of values files for testbed, integration, production export KUBECONFIG=[as above] cd CMSKubernetes/kubernetes/rucio ./install_rucio_[production, testbed, etc].sh # To upgrade the servers The above is what is needed to get things bootstrapped the first time. After this, you can modify the various yaml files and export KUBECONFIG=[as above] cd CMSKubernetes/kubernetes/rucio ./upgrade_rucio_[production, testbed, etc].sh # Resizing a cluster You can add or subtract nodes with the following command openstack coe cluster update [cluster_name] --os-project-name CMSRucio replace node_count=[new_count] # Get a client running and connect to your server There are lots of ways of doing this, but the easiest now is to use the CMS installed Rucio from CVMFS. Note that the python environment can clash with openstack, so best to use a new window. source /cvmfs/cms.cern.ch/rucio/setup.sh You will also need to setup a config file pointed to by RUCIO_HOME. You can also run the rucio client in a container or even in the k8s cluster. Instructions for these methods are no longer provided. Then setup a proxy and export RUCIO_ACCOUNT=[an account your identity maps to] rucio whoami From here you should be able to use any rucio command line commands you need to. # Decommission a cluster It's probably best to do this in a controlled fashion. You can run the teardown_dns.sh script or remove any DNS aliases manually from the cluster: openstack server unset --property landb-alias --os-project-name CMSRucio cmsruciotestbed-ga3x5mujvho7-minion-0 openstack server unset --property landb-alias --os-project-name CMSRucio cmsruciotestbed-ga3x5mujvho7-minion-1 ... Then wait 30-60 minutes for DNS to reflect this removal. Make sure you can access the new cluster with the Rucio client. Then you can delete the cluster with openstack coe cluster delete --os-project-name CMSRucio MYOLDCLUSTER or remove the kubernetes parts of the cluster and THEN delete the cluster helm del --purge cms-rucio-testbed cms-ruciod-testbed filebeat logstash graphite openstack coe cluster delete --os-project-name CMSRucio MYOLDCLUSTER <file_sep>/docker/udp-server/udp_server.go package main // udp_server - UDP Server implementation with optional support to send UDP messages // to StompAMQ endpoint // // Copyright (c) 2020 - <NAME> <<EMAIL>> // import ( "encoding/json" "flag" "io/ioutil" "log" "net" "strings" "github.com/go-stomp/stomp" ) // Configuration stores server configuration parameters type Configuration struct { Port int `json:"port"` // server port number BufSize int `json:"bufSize"` // buffer size StompURI string `json:"stompURI"` // StompAMQ URI StompLogin string `json:"stompLogin"` // StompAQM login name StompPassword string `json:"stompPassword"` // StompAQM password Endpoint string `json:"endpoint"` // StompAMQ endpoint ContentType string `json:"contentType"` // ContentType of UDP packet Verbose bool `json:"verbose"` // verbose output } var Config Configuration // parseConfig parse given config file func parseConfig(configFile string) error { data, err := ioutil.ReadFile(configFile) if err != nil { log.Println("Unable to read", err) return err } err = json.Unmarshal(data, &Config) if err != nil { log.Println("Unable to parse", err) return err } // default values if Config.Port == 0 { Config.Port = 9331 } if Config.BufSize == 0 { Config.BufSize = 1024 // 1 KByte } if Config.ContentType == "" { Config.ContentType = "application/json" } return nil } // send data to StompAMQ endpoint func sendStomp() { } // udp server implementation func udpServer() { conn, err := net.ListenUDP("udp", &net.UDPAddr{ Port: Config.Port, IP: net.ParseIP("0.0.0.0"), }) if err != nil { panic(err) } defer conn.Close() log.Printf("UDP server %s\n", conn.LocalAddr().String()) var stompConn *stomp.Conn if Config.StompURI != "" && Config.StompLogin != "" && Config.StompPassword != "" { stompConn, err = stomp.Dial("tcp", Config.StompURI, stomp.ConnOpt.Login(Config.StompLogin, Config.StompPassword)) if err != nil { log.Printf("Unable to connect to %s, error %v", Config.StompURI, err) } if Config.Verbose { log.Printf("connected to StompAMQ server %s %v", Config.StompURI, stompConn) } } // defer stomp connection if it exists if stompConn != nil { defer stompConn.Disconnect() } // set initial buffer size to handle UDP packets bufSize := Config.BufSize for { // create a buffer we'll use to read the UDP packets buffer := make([]byte, bufSize) // read UDP packets rlen, remote, err := conn.ReadFromUDP(buffer[:]) if err != nil { log.Printf("Unable to read UDP packet, error %v", err) continue } data := buffer[:rlen] // try to parse the data, we are expecting JSON var packet map[string]interface{} err = json.Unmarshal(data, &packet) if err != nil { log.Printf("unable to unmarshal UDP packet into JSON, error %v\n", err) // let's increse buf size to adjust to the packet bufSize = bufSize * 2 if bufSize > 100*Config.BufSize { log.Fatal("unable to unmarshal UDP packet into JSON with buffer size %d", bufSize) } } // dump message to our log if Config.Verbose { sdata := strings.TrimSpace(string(data)) log.Printf("received: %s from %s\n", sdata, remote) } // send data to Stomp endpoint if Config.Endpoint != "" && stompConn != nil { err = stompConn.Send(Config.Endpoint, Config.ContentType, data) if err != nil { log.Printf("Stomp, unable to send to %s, data %s, error %v", Config.Endpoint, string(data), err) } else { if Config.Verbose { log.Printf("send data to StompAMQ endpoint %s", Config.Endpoint) } } } // clear-up our buffer buffer = nil } } func main() { var config string flag.StringVar(&config, "config", "", "configuration file") flag.Parse() err := parseConfig(config) if err == nil { udpServer() } log.Fatal(err) }
4b48b0fcc29b23b445b25d540289d81380aab1e5
[ "Markdown", "Go", "Dockerfile", "Shell" ]
10
Dockerfile
ddaina/CMSKubernetes
1ff4d37a6439d6e0da548e68813454b7d304a6ef
270a7794c24ceb11b775d381a6387a940ba109ca
refs/heads/master
<repo_name>viktorija6420/august-11<file_sep>/exercise.rb trains =[ {train: "72C", frequency_in_minutes: 15, direction: "north"}, {train: "72D", frequency_in_minutes: 15, direction: "south"}, {train: "610", frequency_in_minutes: 5, direction: "north"}, {train: "611", frequency_in_minutes: 5, direction: "south"}, {train: "80A", frequency_in_minutes: 30, direction: "east"}, {train: "80B", frequency_in_minutes: 30, direction: "west"}, {train: "110", frequency_in_minutes: 15, direction: "north"}, {train: "111", frequency_in_minutes: 15, direction: "south"} ] #1.Save the direction of train 111 into a variable direction_111 = trains[-1][:direction] p direction_111 #2.Save the frequency of train 80B into a variable. frequency_80B = trains[-3][:frequency_in_minutes] p frequency_80B #3.Save the direction of train 610 into a variable. direction_610 = trains[3][:direction] p direction_610 #4.Create an empty array. Iterate through each train and add the name of the #train into the array if it travels north. empty_array = [] trains.each do |train| train.each do |key,value| if train[:direction] == "north" empty_array << train[:train] end end end p empty_array #5.Do the same thing for trains that travel east. empty_array_2 = [] trains.each do |train| train.each do |key,value| if train[:direction] == "east" empty_array_2 << train[:train] end end end p empty_array_2 #6.You probably just ended up rewriting some of the same code. # Move this repeated code into a method that accepts a # direction and a list of trains as arguments, and returns # a list of just the trains that go in that direction. # Call this method once for north and once for east in order # to DRY up your code. def train_search(direction, trains) trains_in_this_direction = [] trains.each do |train| train.each do |key, value| if train[:direction] == direction trains_in_this_direction << train[:train] return "Trains in this direction: #{trains_in_this_direction}" end end end end p train_search("east", trains) p train_search("north", trains) #7.Pick one train and add another key/value pair for the # first_departure_time. For simplicity, assume the first # train always leave on the hour. You can represent this hour # as an integer: 6 for 6:00am, 12 for noon, 13 for 1:00pm, # etc trains[1][:first_departure_time] = "6am" p trains[1]
3b818154d98f06242c9dd6ee299e777a3f7886ca
[ "Ruby" ]
1
Ruby
viktorija6420/august-11
a28befad5b0f6c649ca17c5b7896062262a09a68
ef2fb2ba591475600ae4ad7cc2802212917ae73d
refs/heads/master
<file_sep># CommuneChatbot 0.2 0.2 版本正在开发中... Demo 介绍视频已经可以查看: https://www.bilibili.com/video/BV1tK4y1a75B - 展示网站:https://communechatbot.com/chatlog - v0.1网站: https://communechatbot.com/ - v0.1文档: https://communechatbot.com/docs/#/ 微信公众号 CommuneChatbot,qq群:907985715 欢迎交流! 核心功能: 1. 基于配置的多轮对话逻辑, 可以无限扩充对话节点. 2. 可以在对话中增加逻辑节点, 用对话给机器人编程, 用对话来生成新的对话 3. 实现了 Ghost in Shells 架构, 机器人可以异构到多个平台, 同时运行 相关项目: - studio: https://github.com/thirdgerb/studio-hyperf - 前端项目: https://github.com/thirdgerb/chatlog-web - nlu单元: https://github.com/thirdgerb/spacy-nlu <file_sep><?php /** * 基于 Stdio 实现的单点 Shell */ require __DIR__ .'/bootstrap/autoload.php'; // 运行平台. $host->run('stdio');
81e58d605af10fa8bc7e010effe7b964c691cae4
[ "Markdown", "PHP" ]
2
Markdown
RedStarGroup/chatbot
d1d6a3c8893fba61b25c9d520a8e0e9b8669778f
4f24307ccaea42eaa34dde44088aad3ca7edd7c8
refs/heads/master
<file_sep># M-Security Mobile app Java Backend # M-Security Mobile app Java Backend <file_sep>package com.safaricom.customer; import com.safaricom.commons.DbBoilerPlates; import com.safaricom.commons.Log; import org.json.JSONObject; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.time.LocalDateTime; import java.util.Formatter; public class CustomerAPI { public static String NewCustomer(String payload) { JSONObject response = new JSONObject(); JSONObject requested_data = new JSONObject(payload); Log.w("Data sent here:"+payload); if(requested_data.has("pin") && requested_data.has("surname") && requested_data.has("first_name") && requested_data.has("last_name") && requested_data.has("id_number") && requested_data.has("phone_number")){ //check if a simillar phone_number is already registered int is_registered = DbBoilerPlates.DoReturnInt("select * from tbl_customer_details where phone_number ='"+requested_data.getString("phone_number")+"'", "phone_number"); if(is_registered>0){ response.put("status", false); response.put("reason", "This phone number is already registered. Kindly contact customer care for help"); }else{ String pin = requested_data.getString("pin"); String secure_pin = encryptPassword(pin); String surname = requested_data.getString("surname"); String first_name = requested_data.getString("first_name"); String second_name = requested_data.getString("last_name"); String id_number = requested_data.getString("id_number"); String phone_number = requested_data.getString("phone_number"); int j = DbBoilerPlates.DoInserts("insert into tbl_customer_details (pin, surname, first_name, last_name, id_number, phone_number) values ('"+secure_pin+"','"+surname+"','"+first_name+"','"+second_name+"','"+id_number+"','"+phone_number+"') "); if(j>0){ response.put("status", true); response.put("reason", "Registration is Successfully"); } } }else{ response.put("status", false); response.put("reason", "ALl fields are mandatory"); } return response.toString(); } public static String NewMobileWalletCustomer(String payload) { JSONObject response = new JSONObject(); JSONObject requested_data = new JSONObject(payload); if(requested_data.has("mobile_wallet_pin") && requested_data.has("surname") && requested_data.has("firstname") && requested_data.has("secondname") && requested_data.has("phone_number")){ //check if a simillar phone_number is already registered int is_registered = DbBoilerPlates.DoReturnInt("select * from tbl_mobile_wallet_details where phone_number ='"+requested_data.getString("phone_number")+"'", "phone_number"); if(is_registered>0){ response.put("status", false); response.put("reason", "You already have an account. Contact customer care"); }else{ String mobile_wallet_pin = requested_data.getString("mobile_wallet_pin"); String secure_pin = encryptPassword(mobile_wallet_pin); String surname = requested_data.getString("surname"); String firstname = requested_data.getString("firstname"); String secondname = requested_data.getString("secondname"); String phone_number = requested_data.getString("phone_number"); LocalDateTime reg_date = LocalDateTime.now(); int j = DbBoilerPlates.DoInserts("insert into tbl_mobile_wallet_details (pin, surname, first_name, last_name, phone_number, reg_date, last_activity) values ('"+secure_pin+"','"+surname+"','"+firstname+"','"+secondname+"','"+phone_number+"','"+reg_date+"','"+reg_date+"') "); if(j>0){ response.put("status", true); response.put("reason", "Registration is Successfully"); } } }else{ response.put("status", false); response.put("reason", "ALl fields are mandatory"); } return response.toString(); } public static String encryptPassword(String password) { String sha1 = ""; try { MessageDigest crypt = MessageDigest.getInstance("SHA-1"); crypt.reset(); crypt.update(password.getBytes("UTF-8")); sha1 = byteToHex(crypt.digest()); } catch(NoSuchAlgorithmException e) { e.printStackTrace(); } catch(UnsupportedEncodingException e) { e.printStackTrace(); } return sha1; } private static String byteToHex(final byte[] hash) { Formatter formatter = new Formatter(); for (byte b : hash) { formatter.format("%02x", b); } String result = formatter.toString(); formatter.close(); return result; } } <file_sep>package com.safaricom.commons; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; /** * Created by khisahamphrey */ public class SafHikariConnection { private static volatile SafHikariConnection hikariCP = null; private static HikariDataSource hikariDataSource = null; private static HikariDataSource reportsDbHikariDataSource = null; private SafHikariConnection(HikariConfig config) { hikariDataSource = new HikariDataSource(config); } public static void initialize(HikariConfig hikariConfig) { if (hikariCP == null) { synchronized (SafHikariConnection.class) { if (hikariCP == null) { hikariCP = new SafHikariConnection (hikariConfig); } } } } public static SafHikariConnection getInstance() { return hikariCP; } public static HikariDataSource getDataSource() { hikariCP = getInstance(); return hikariDataSource; } public static void connectReportsDb(HikariConfig config) { hikariCP = getInstance(); reportsDbHikariDataSource = new HikariDataSource(config); } public static HikariDataSource getReportsDbDataSource() { hikariCP = getInstance(); return reportsDbHikariDataSource; } public static HikariDataSource getDataSourceReportsDb() { hikariCP = getInstance(); HikariDataSource hikariDataSourceReportsDb = hikariDataSource; //TODO its better to actually pick it from a properties files that is is either passed in the init or whichever way that makes sense String mainDbConUrl = "jdbc:mysql://172.16.58.3:3306/tumaxpress?useConfigs=maxPerformance"; String mysqlMainUser = "root"; String mysqlMainPassword = <PASSWORD>"; int hikariMinPool = 0; int hikariMaxPool = 10; hikariDataSourceReportsDb.setJdbcUrl(mainDbConUrl); hikariDataSourceReportsDb.setUsername(mysqlMainUser); hikariDataSourceReportsDb.setPassword(<PASSWORD>Main<PASSWORD>); hikariDataSourceReportsDb.addDataSourceProperty("cachePrepStmts", "true"); hikariDataSourceReportsDb.addDataSourceProperty("prepStmtCacheSize", "400"); hikariDataSourceReportsDb.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); hikariDataSourceReportsDb.setAutoCommit(true); hikariDataSourceReportsDb.setPoolName("safcom_app"); hikariDataSourceReportsDb.setRegisterMbeans(true); hikariDataSourceReportsDb.setMinimumIdle(hikariMinPool); //for maximum performance and responsiveness to spike demands, let HikariCP act as a fixed size connection pool hikariDataSourceReportsDb.setMaximumPoolSize(hikariMaxPool); return hikariDataSourceReportsDb; } } <file_sep>cd /opt/scraper && cd target && java -jar "khisaham-1.0-SNAPSHOT.jar:lib/*" com.safaricom.Main<file_sep><?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.safaricom</groupId> <artifactId>khisaham</artifactId> <version>1.0-SNAPSHOT</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>8</source> <target>8</target> </configuration> </plugin> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.3.5.v20151012</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory> ${project.build.directory}/lib </outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.2</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> <mainClass>com.safaricom.Main</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> <extensions> <extension> <groupId>kr.motd.maven</groupId> <artifactId>os-maven-plugin</artifactId> <version>1.4.0.Final</version> </extension> </extensions> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build> <profiles> <profile> <id>docker</id> <activation> <file> <exists>src/main/docker/Dockerfile</exists> </file> </activation> <properties> <imageTag>latest</imageTag> </properties> <build> <plugins> <plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/target</outputDirectory> <resources> <resource> <directory>src/main/docker</directory> <filtering>true</filtering> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>linux</id> <activation> <os> <family>linux</family> </os> </activation> <dependencies> <dependency> <groupId>io.netty</groupId> <artifactId>netty-transport-native-epoll</artifactId> <version>4.1.14.Final</version> <!--suppress UnresolvedMavenProperty --> <classifier>${os.detected.classifier}</classifier> </dependency> </dependencies> </profile> <profile> <id>mac</id> <activation> <os> <family>mac</family> </os> </activation> <dependencies> <dependency> <groupId>io.netty</groupId> <artifactId>netty-transport-native-kqueue</artifactId> <version>4.1.14.Final</version> <!--suppress UnresolvedMavenProperty --> <classifier>${os.detected.classifier}</classifier> </dependency> </dependencies> </profile> </profiles> <dependencies> <dependency> <groupId>com.stripe</groupId> <artifactId>stripe-java</artifactId> <version>5.6.0</version> </dependency> <dependency> <groupId>biz.paluch.redis</groupId> <artifactId>lettuce</artifactId> <version>4.1.2.Final</version> <exclusions> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-common</artifactId> </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-transport</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>3.11.0</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20131018</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> </dependency> <dependency> <groupId>com.mandrillapp.wrapper.lutung</groupId> <artifactId>lutung</artifactId> <version>0.0.7</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-actor_2.11</artifactId> <version>2.4.7</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-remote_2.11</artifactId> <version>2.4.7</version> </dependency> <!-- Prometheus related instrumentation libraries --> <!-- The client --> <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient</artifactId> <version>0.5.0</version> </dependency> <!-- Hotspot JVM metrics--> <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_hotspot</artifactId> <version>0.5.0</version> </dependency> <!-- Exposition HTTPServer--> <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_httpserver</artifactId> <version>0.5.0</version> </dependency> <!-- Logback for the Prometheus Client --> <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_logback</artifactId> <version>0.5.0</version> </dependency> <!-- https://mvnrepository.com/artifact/com.googlecode.libphonenumber/libphonenumber --> <dependency> <groupId>com.googlecode.libphonenumber</groupId> <artifactId>libphonenumber</artifactId> <version>3.5</version> </dependency> <dependency> <groupId>com.opencsv</groupId> <artifactId>opencsv</artifactId> <version>4.0</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk</artifactId> <version>1.11.25</version> </dependency> <dependency><!-- Includes org.slf4j for logging --> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.1.7</version> </dependency> <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</artifactId> <version>2.4.3</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.14.Final</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-handler</artifactId> <version>4.1.14.Final</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-example</artifactId> <version>4.1.14.Final</version> </dependency> <dependency> <groupId>com.squareup.okhttp</groupId> <artifactId>okhttp</artifactId> <version>2.6.0</version> </dependency> <dependency> <groupId>in.ashwanthkumar</groupId> <artifactId>slack-java-webhook</artifactId> <version>0.0.4</version> </dependency> <dependency> <groupId>org.jasypt</groupId> <artifactId>jasypt</artifactId> <version>1.9.2</version> </dependency> <dependency> <groupId>net.jodah</groupId> <artifactId>failsafe</artifactId> <version>1.1.0</version> </dependency> <dependency> <groupId>com.mixpanel</groupId> <artifactId>mixpanel-java</artifactId> <version>1.4.4</version> </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.10</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz-jobs</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>net.joelinn</groupId> <artifactId>quartz-redis-jobstore</artifactId> <version>1.1.13</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.9.10</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-s3</artifactId> <version>1.10.77</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk-s3</artifactId> <version>1.10.77</version> </dependency> <dependency> <groupId>com.esri.geometry</groupId> <artifactId>esri-geometry-api</artifactId> <version>2.0.0</version> </dependency> <dependency> <groupId>com.esri.geometry</groupId> <artifactId>esri-geometry-api</artifactId> <version>2.0.0</version> </dependency> <!-- https://mvnrepository.com/artifact/postgresql/postgresql --> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.1-901-1.jdbc4</version> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> <version>5.15.3</version> </dependency> <dependency> <groupId>org.influxdb</groupId> <artifactId>influxdb-java</artifactId> <version>2.13</version> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.3-1104-jdbc41</version> </dependency> <!-- https://mvnrepository.com/artifact/io.netty/netty-tcnative --> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative</artifactId> <version>2.0.20.Final</version> </dependency> </dependencies> </project>
95279c4f4226b41414157c39bb3ea3d073c106b3
[ "Markdown", "Java", "Maven POM", "Shell" ]
5
Markdown
khisaham/msecurity-java-backend
da4b1fa602909c86b96f0d82aa1478deb25c9d70
62a9dca1917954d748d69ff17901e77ddc3db3dd
refs/heads/master
<repo_name>blazejocd/study-spring-webflow<file_sep>/src/main/java/pl/blaise/pizza/domain/Payment.java package pl.blaise.pizza.domain; import java.io.Serializable; public abstract class Payment implements Serializable { private static final long serialVersionUID = 1L; private float amount; public void setAmount(float value) { this.amount = value; } public float getAmount() { return this.amount; } } <file_sep>/build.gradle apply plugin: 'eclipse' apply plugin: 'eclipse-wtp' apply plugin: 'war' version = '4.0.0' configurations.compile.transitive = true repositories { mavenCentral() maven { url "http://repo.springsource.org/milestone" } } dependencies { compile 'log4j:log4j:1.2.14' compile 'org.springframework:spring-aspects:4.0.7.RELEASE' compile 'org.springframework:spring-web:4.0.7.RELEASE' compile 'org.springframework:spring-webmvc:4.0.7.RELEASE' compile group: 'org.springframework.webflow', name: 'spring-webflow', version: '2.4.1.RELEASE' compile group: 'org.springframework.webflow', name: 'spring-binding', version: '2.4.1.RELEASE' compile 'org.aspectj:aspectjweaver:1.7.2' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1' compile group: 'javax.servlet', name: 'jstl', version: '1.2' providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' providedCompile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.1' providedCompile group: 'javax.el', name: 'javax.el-api', version: '2.2.4' } task wrapper(type: Wrapper) { gradleVersion = '2.1' } war { baseName = 'SpringPizza' } eclipse { wtp { component { contextPath = 'SpringPizza' } } }
e863ca20edea302a2d7d81c28ac3e5fd5632209e
[ "Java", "Gradle" ]
2
Java
blazejocd/study-spring-webflow
7c60de0f256be64570a4190884783f030b8657ab
14902a0959d2b571ddf00290f62515c690a900f6
refs/heads/master
<file_sep>const request = require('supertest'); const app = require('../lib/app'); describe('penguins API', () => { // GET /api/penguins should return ['bernice', 'bernard'] it('can respond with json for a path', () => { return request(app) .get('/api/penguins') .then(res => { expect(res.body).toEqual(['bernice', 'bernard']); }); }); // GET /api/penguin/king?format=<simple|full> it('can conditionally respond with json per url query format', () => { return request(app) .get('/api/penguin/king?format=full') .then(res => { expect(res.body).toEqual({ name: 'bernice', description: 'What a penguin!', age: 7 }); }) .then(() => { return request(app) .get('/api/penguin/king?format=simple') .then(res => { expect(res.body).toEqual({ name: 'bernice' }); }); }); }); // DELETE /mistake should return { deleted: true } it('can respond with json if DELETE /mistake requested', () => { return request(app) .delete('/mistake') .then(res => { expect(res.body).toEqual({ deleted: true }); }); }); // Any other response should return a 404 status code it('displays error when path not found', () => { return request(app) .get('/blah') .then(res => { expect(res.status).toEqual(404); }); }); }); <file_sep>const { parse } = require('url'); module.exports = (req, res) => { const url = parse(req.url, true); res.setHeader('Content-Type', 'application/json'); if(url.pathname === '/') { res.setHeader('Content-Type', 'text/html'); res.end(` <html> <body> <p>Welcome to Cari's HTTP Quiz</p> </body> </html> `); } // GET /api/penguins should return ['bernice', 'bernard'] else if(url.pathname === '/api/penguins') { res.end(JSON.stringify(['bernice', 'bernard'])); } // GET /api/penguin/king?format=<simple|full> else if(req.method === 'GET' && url.pathname === '/api/penguin/king') { // If format=full return full json, else return name only if(url.query['format'] === 'full') { res.end(JSON.stringify({ name: 'bernice', description: 'What a penguin!', age: 7 })); } else { res.end(JSON.stringify({ name: 'bernice' })); } } // DELETE /mistake should return { deleted: true } else if(req.method === 'DELETE' && url.pathname === '/mistake') { res.end(JSON.stringify({ deleted: true })); } // Any other response should return a 404 status code else { res.statusCode = 404; res.setHeader('Content-Type', 'text/html'); res.end('Sorry, page "' + req.url + '" not found!'); } };
fddbd42b292e795c9b0ddd952070bb70acba6f4f
[ "JavaScript" ]
2
JavaScript
caripizza/http-quiz
30d6cf6911245e323d24277d8c9ae6b2907d7984
f2a6b66abb976db1ec090e3308b7095deb96ebc1
refs/heads/master
<file_sep># -*- coding:utf-8 -*- import json import MySQLdb import os import time import sys import xlrd from flask import make_response from flask import render_template, flash, redirect, jsonify, Response from app import app from threading import Thread from flask import request from bs4 import BeautifulSoup from app.database_config import * # 狗跨域 def cors_response(res): response = make_response(jsonify(res)) response.headers['Access-Control-Allow-Origin'] = '*' response.headers['Access-Control-Allow-Methods'] = 'POST' response.headers['Access-Control-Allow-Headers'] = 'x-requested-with,content-type' return response def LongToInt(value): assert isinstance(value, (int, long)) return int(value & sys.maxint) @app.route('/addcar', methods=['POST']) def addcar(): carinfo = request.json.get("carinfo") imageIds = request.json.get("imageIds") reports = request.json.get("reports") title = carinfo["title"] price = carinfo["price"] oldPrice = carinfo["oldPrice"] gongLi = carinfo["gongLi"] city = carinfo["city"] dang = carinfo["dang"] description = carinfo["desc"] cartype = carinfo["cartype"] carOut = carinfo["carOut"] carTime = carinfo["carTime"] pailiang = carinfo["pailiang"] isPay = carinfo["isPay"] firstPay = carinfo["firstPay"] payTime = carinfo["payTime"] mPay = carinfo["mPay"] imageIds = str(imageIds) reports = json.dumps(reports) # 连接 db = MySQLdb.connect(database_host,database_username,database_password,database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'insert into car_list (title,price,oldPrice,gongLi,city,dang,description,cartype,carOut,carTime,pailiang,isPay,firstPay,payTime,mPay,imageIds,reports,isSaled,isDelete) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,0,0)' # test = sql%(title,price,oldPrice,gongLi,dang,description,cartype,carOut,carTime,pailiang,isPay,firstPay,payTime,mPay,imageIds,reports) # print(test) dbc.execute(sql, (title,price,oldPrice,gongLi,city,dang,description,cartype,carOut,carTime,pailiang,isPay,firstPay,payTime,mPay,imageIds,reports)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '上传成功'}) return response from werkzeug.utils import secure_filename import os def allowed_file(filename): return '.' in filename and \ filename.rsplit('.', 1)[1] in app.config['ALLOWED_EXTENSIONS'] @app.route('/uploadimage', methods=['POST']) def uploadimage(): upload_file = request.files["file"] if upload_file: if allowed_file(upload_file.filename): # 连接 db = MySQLdb.connect(database_host,database_username,database_password,database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') filename = secure_filename(upload_file.filename) imageId = int(round(time.time() * 1000)) #保存文件 upload_file.save(os.path.join(app.root_path, app.config['UPLOAD_FOLDER'], filename)) imageURL = "static/uploads/"+filename sql = 'insert into car_image (imageId,imageURL) VALUES (%s,%s)' dbc.execute(sql, (imageId,imageURL)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'imageId': imageId}) return response else: response = cors_response({'code': 10002, 'msg': '不支持的文件格式'}) return response else: response = cors_response({'code': 10001, 'msg': '上传失败'}) return response @app.route('/searchlist', methods=['POST']) def search_list(): try: carType = request.json.get("carType") salPrice = request.json.get("salPrice") paiXuType = request.json.get("paiXuType") carTitle = request.json.get("carTitle") except: carType = request.values.get("carType") salPrice = request.values.get("salPrice") paiXuType = request.values.get("paiXuType") carTitle = request.values.get("carTitle") if carType == u"全部车型": carType = u"" if salPrice == u"不限": salPrice = u"" if paiXuType == u"默认排序": paiXuType = u"" sql = 'select * from car_list where isDelete = 0 ' if carType != "" and carType != None: l1 = 'cartype = "%s"'%carType sql = 'select * from car_list where isDelete = 0 AND '+l1 if salPrice != "" and salPrice != None: l2 = '' if salPrice == u'3万以下': l2 = ' and price <= 3 ' if salPrice == u'3-5万': l2 = ' and price >= 3 and price <= 5 ' if salPrice == u'5-10万': l2 = ' and price >= 5 and price <= 10 ' if salPrice == u'10-15万': l2 = ' and price >= 10 and price <= 15 ' if salPrice == u'15-20万': l2 = ' and price >= 15 and price <= 20 ' if salPrice == u'20-30万': l2 = ' and price >= 20 and price <= 30 ' if salPrice == u'30万以上': l2 = ' and price >= 30' if carType == u"": sql = 'select * from car_list where isDelete = 0 AND ' l2 = l2[4:len(l2)] sql = sql + l2 if paiXuType != "" and paiXuType != None: l3 = '' if paiXuType == u'最新发布': l3 = ' order by addTime desc' if paiXuType == u'价格最低': l3 = ' ORDER BY price DESC ' if paiXuType == u'价格最高': l3 = ' ORDER BY price ASC ' if paiXuType == u'最短里程': l3 = ' ORDER BY gongLi ASC ' sql = sql + l3 # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') if carTitle != "" and carTitle != None: carTitle = carTitle.replace('>','') carTitle = carTitle.replace('<','') carTitle = carTitle.replace('=','') carTitle = carTitle.replace('or','') carTitle = carTitle.replace('and','') carTitle = carTitle.replace('-','') sql = 'select * from car_list where isDelete = 0 and title like "%%%s%%"'%carTitle dbc.execute(sql) else: dbc.execute(sql) car_list = dbc.fetchall() if car_list is None or len(car_list) < 1: response = cors_response({'code': 10001, 'msg': '还没有车辆信息'}) return response result = [] for obj in car_list: imageIds = obj[16] imageIds = imageIds.replace("[","") imageIds = imageIds.replace("]","") imageIds = imageIds.replace("L","") imageIds = imageIds.split(',') first_image = imageIds[0] sql = 'select imageURL from car_image where imageId = %s'%first_image dbc.execute(sql) imageData = dbc.fetchone() if imageData is not None: imageURL = 'http://192.168.0.108:5000/'+imageData[0] else: imageURL = 'http://192.168.0.108:5000/'+'static/uploads/no_image.jpg' result.append({"id": obj[0], "title": obj[1], "carTime": obj[10], "gongLi": obj[4], "price": obj[2], "firstPay": obj[13], "imageURL": imageURL, }) db.commit() dbc.close() db.close() response = cors_response({"code": 0, "content": result}) return response @app.route('/getdetail', methods=['POST']) def get_detail(): try: carid = request.json.get("carid") except: carid = request.values.get("carid") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select id,title,price,oldPrice,gongLi,city,dang,carOut,carTime,pailiang,isPay,firstPay,mPay,imageIds,isSaled,isDelete from car_list where id = %s '%carid dbc.execute(sql) car_data = dbc.fetchone() if car_data is None: response = cors_response({'code': 0, 'msg': '还没有车辆信息'}) return response car_info = car_data imageIds = car_info[13] imageIds = imageIds.replace("[", "(") imageIds = imageIds.replace("]", ")") imageIds = imageIds.replace("L", "") sql = 'select imageURL from car_image where imageId in %s' % imageIds dbc.execute(sql) imageData = dbc.fetchall() imageURLs = [] for obj in imageData: imageURLs.append('http://192.168.0.108:5000/'+obj[0]) result = [] result.append({"id": car_info[0], "title": car_info[1], "price": car_info[2], "oldPrice": car_info[3], "gongLi": car_info[4], "city": car_info[5], "dang": car_info[6], "carOut": car_info[7], "carTime": car_info[8], "pailiang": car_info[9], "isPay": car_info[10], "firstPay": car_info[11], "mPay": car_info[12], "isSaled": car_info[14], "isDelete": car_info[15], "imageURLs": imageURLs, }) db.commit() dbc.close() db.close() response = cors_response({"code": 0, "content": result}) return response @app.route('/getreport', methods=['POST']) def get_report(): try: carid = request.json.get("carid") except: carid = request.values.get("carid") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select id,title,description,reports from car_list where id = %s '%carid dbc.execute(sql) car_data = dbc.fetchone() if car_data is None: response = cors_response({'code': 0, 'msg': '还没有车辆信息'}) return response car_info = car_data result = [] result.append({"id": car_info[0], "title": car_info[1], "description": car_info[2], "reports": json.loads(car_info[3]), }) db.commit() dbc.close() db.close() response = cors_response({"code": 0, "content": result}) return response @app.route('/getfenqi', methods=['POST']) def get_fenqi(): try: carid = request.json.get("carid") except: carid = request.values.get("carid") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select id,title,oldPrice,firstPay,mPay,payTime from car_list where id = %s '%carid dbc.execute(sql) car_data = dbc.fetchone() if car_data is None: response = cors_response({'code': 0, 'msg': '还没有车辆信息'}) return response car_info = car_data result = [] result.append({"id": car_info[0], "title": car_info[1], "oldPrice": car_info[2], "firstPay": car_info[3], "mPay": car_info[4], "payTime": car_info[5], }) db.commit() dbc.close() db.close() response = cors_response({"code": 0, "content": result}) return response @app.route('/deleteCar', methods=['POST']) def delete_car(): try: carid = request.json.get("carid") except: carid = request.values.get("carid") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'update car_list set isDelete = 1 where id = %s' state = dbc.execute(sql, (carid,)) db.commit() if state: dbc.close() db.close() response = cors_response({'code': 0, 'msg': '下架成功'}) return response else: dbc.close() db.close() response = cors_response({'code': 10001, 'msg': '下架失败'}) return response @app.route('/unableCar', methods=['POST']) def unable_car(): try: carid = request.json.get("carid") except: carid = request.values.get("carid") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'update car_list set isSaled = 1 where id = %s' state = dbc.execute(sql, (carid,)) db.commit() if state: dbc.close() db.close() response = cors_response({'code': 0, 'msg': '下架成功'}) return response else: dbc.close() db.close() response = cors_response({'code': 10001, 'msg': '下架失败'}) return response<file_sep>database_host = "xxx.xxx" database_username = "xxxx" database_password = "<PASSWORD>" database1 = "1" database2 = "2"<file_sep># -*- coding:utf-8 -*- import MySQLdb import os import sys from flask import make_response from flask import jsonify from app import app from flask import request from app.database_config import * from werkzeug.utils import secure_filename # 狗跨域 def cors_response(res): response = make_response(jsonify(res)) response.headers['Access-Control-Allow-Origin'] = '*' response.headers['Access-Control-Allow-Methods'] = 'POST' response.headers['Access-Control-Allow-Headers'] = 'x-requested-with,content-type' return response def LongToInt(value): assert isinstance(value, (int, long)) return int(value & sys.maxint) @app.route('/getVideoList', methods=['GET']) def getVideoList(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') gfvideoList = [] fwvideoList = [] sql = 'select * from video_list where video_type = "原画" ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) > 0: for item in queryList: #预览图 image_url_sql = 'select url from attachment where id = %s' dbc.execute(image_url_sql, (item[2],)) image_url = dbc.fetchone()[0] #评论数 repaly_count_sql = 'select id from pinglun_list where ptype = "video" and pid = %s '%item[2] dbc.execute(repaly_count_sql) repalyCountList = dbc.fetchall() remark_count = len(repalyCountList) gfvideoList.append({ "id": item[0], "title": item[1], "img": "http://orion-c.top/app"+image_url, 'remark':remark_count, "play_count":item[6], }) sql = 'select * from video_list where video_type = "番外" ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) > 0: for item in queryList: image_url_sql = 'select url from attachment where id = %s' dbc.execute(image_url_sql, (item[2],)) image_url = dbc.fetchone()[0] repaly_count_sql = 'select id from pinglun_list where ptype = "video" and pid = %s ' % item[2] dbc.execute(repaly_count_sql) repalyCountList = dbc.fetchall() remark_count = len(repalyCountList) fwvideoList.append({ "id": item[0], "title": item[1], "img": "http://orion-c.top/app"+image_url, 'remark': remark_count, "play_count": item[6], }) result = { "gan": True, "gfvideoList": gfvideoList, "fwvideoList":fwvideoList, } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getVideoDetail', methods=['GET']) def getVideoDetail(): id = request.values.get("detailId") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from video_list where id = %s' dbc.execute(sql,(id,)) detail = dbc.fetchone() atSql = 'select url from attachment where id = %s' dbc.execute(atSql, (detail[3],)) url = dbc.fetchone() # 评论 repaly_count_sql = 'select * from pinglun_list where ptype = "video" and pid = %s and status = "1" ' % detail[0] dbc.execute(repaly_count_sql) repalyCountList = dbc.fetchall() replayList = [] if len(repalyCountList) > 0 : has_repaly = True for i in range (0,len(repalyCountList)): replayList.append({ "id":repalyCountList[i][0], "avantar": repalyCountList[i][3], "user_name": repalyCountList[i][4], "replay_time": repalyCountList[i][6], "lou": len(repalyCountList) - i, "replay_desc": repalyCountList[i][5], }) else: has_repaly = False result = { "title": detail[1], "video_url": "http://orion-c.top/app"+url[0], "play_count": detail[6], "add_time": detail[4].strftime('%Y-%m-%d'), "has_replay_list": has_repaly, "replay_list":replayList , } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getPicList', methods=['GET']) def getPicList(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') gfpicList = [] fwpicList = [] sql = 'select * from pic_list ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) > 0: for item in queryList: atSql = 'select url from attachment where id in (%s)'%item[2] dbc.execute(atSql) imageUrl = dbc.fetchone() # print urlList # newUrlList = [] # for image_item in urlList: # newUrlList.append(image_item[0]) gfpicList.append({ "img": "http://orion-c.top/app"+imageUrl[0], "id": item[0], "title": item[1], "read_count": item[4], "add_time": item[3].strftime('%Y-%m-%d'), }) sql = 'select * from fwpic_list ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) > 0: for item in queryList: atSql = 'select url from attachment where id in (%s)'%item[5] dbc.execute(atSql) imageUrl = dbc.fetchone() # print urlList # newUrlList = [] # for image_item in urlList: # newUrlList.append(image_item[0]) fwpicList.append({ "img": "http://orion-c.top/app"+imageUrl[0], "id": item[0], "title": item[1], "read_count": item[4], "add_time": item[3].strftime('%Y-%m-%d'), }) result = { "gan": True, "gfpicList":gfpicList, "fwpicList": fwpicList, } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getVoiceList', methods=['GET']) def getVoiceList(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') voice_list = [] voice_play_list = [] sql = 'select * from voice_list ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) > 0: for item in queryList: atSql = 'select url from attachment where id in (%s)'%item[4] dbc.execute(atSql) imageUrl = dbc.fetchone()[0] atSql = 'select url from attachment where id in (%s)' % item[2] dbc.execute(atSql) voiceUrl = dbc.fetchone()[0] voice_list.append({ "id": item[0], "title": item[1], }) voice_play_list.append({ "src":"http://orion-c.top/app"+voiceUrl, "poster":"http://orion-c.top/app"+imageUrl, "name":item[1], "author":"", }) result = { "count":len(voice_list), "voice_list":voice_list, "voice_play_list": voice_play_list, } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getPicDetail', methods=['GET']) def getPicDetail(): id = request.values.get("detailId") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select image_ids from pic_list where id = %s' dbc.execute(sql,(id,)) imageIds = dbc.fetchone()[0] imageIds = imageIds.split(',') preview_list = [] image_list = [] for imageId in imageIds: atSql = 'select * from attachment where id in (%s)' % imageId dbc.execute(atSql) iamgeDetail = dbc.fetchone() imageId = iamgeDetail[0] imageUrl = iamgeDetail[2] preview_list.append("http://orion-c.top/app"+imageUrl) image_list.append({ "img_url": "http://orion-c.top/app"+imageUrl, "id": imageId, }) result = { "preview_list": preview_list, "image_list":image_list, } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getPicFwDetail', methods=['GET']) def getPicFwDetail(): id = request.values.get("detailId") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from fwpic_list where id = %s' dbc.execute(sql, (id,)) detail = dbc.fetchone() page_list_sql = 'select * from fwdetail_list where pid = %s' dbc.execute(page_list_sql, (id,)) page_list = dbc.fetchall() pageList = [] for pageItem in page_list: if pageItem[2] == 'image': atSql = 'select url from attachment where id in (%s)' % pageItem[3] dbc.execute(atSql) imageUrl = dbc.fetchone() item_content = "http://orion-c.top/app"+imageUrl[0] else: item_content = pageItem[3] pageList.append({ 'content_type': pageItem[2], 'content': item_content, 'content_id': pageItem[0], }) # 评论 repaly_count_sql = 'select * from pinglun_list where ptype = "fwPic" and pid = %s and status = "1" ' % detail[0] dbc.execute(repaly_count_sql) repalyCountList = dbc.fetchall() replayList = [] if len(repalyCountList) > 0: has_repaly = True for i in range(0, len(repalyCountList)): replayList.append({ "id": repalyCountList[i][0], "avantar": repalyCountList[i][3], "user_name": repalyCountList[i][4], "replay_time": repalyCountList[i][6], "lou": len(repalyCountList) - i, "replay_desc": repalyCountList[i][5], }) else: has_repaly = False result = { 'title': detail[1], 'fx_time': detail[3].strftime('%Y-%m-%d'), 'fx_from': detail[2], 'page_list': pageList, "has_replay_list": has_repaly, "replay_list":replayList, } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/uploadTitleImage', methods=['POST']) def uploadTitleImage(): upload_file = request.files["videoImgae"] if upload_file: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') filename = secure_filename(upload_file.filename) # 保存文件 upload_file.save(os.path.join(app.root_path, app.config['UPLOAD_FOLDER'], filename)) # 入库 sql = 'insert into attachment (file_name,url) VALUES (%s,%s)' dbc.execute(sql, (filename, '/static/uploads/' + filename)) db.commit() # 取id getId = 'SELECT LAST_INSERT_ID()' dbc.execute(getId) ids = dbc.fetchone() attachment_id = ids[0] dbc.close() db.close() response = cors_response({'code': 0, 'msg': '上传成功', 'content': {'attachment_id': attachment_id}}) return response else: response = cors_response({'code': 10001, 'msg': '上传失败'}) return response @app.route('/uploadVideo', methods=['POST']) def uploadVideo(): upload_file = request.files["video"] if upload_file: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') filename = secure_filename(upload_file.filename) # 保存文件 upload_file.save(os.path.join(app.root_path, app.config['UPLOAD_FOLDER'], filename)) # 入库 sql = 'insert into attachment (file_name,url) VALUES (%s,%s)' dbc.execute(sql, (filename, '/static/uploads/' + filename)) db.commit() # 取id getId = 'SELECT LAST_INSERT_ID()' dbc.execute(getId) ids = dbc.fetchone() attachment_id = ids[0] dbc.close() db.close() response = cors_response({'code': 0, 'msg': '上传成功', 'content': {'attachment_id': attachment_id}}) return response else: response = cors_response({'code': 10001, 'msg': '上传失败'}) return response @app.route('/submitVideo', methods=['POST']) def submitVideo(): type = request.json.get("type") videoId = request.json.get("videoId") imageId = request.json.get("imageId") title = request.json.get("title") if type and videoId and imageId and title: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') # 入库 sql = 'insert into video_list (title,image_id,video_id,video_type) VALUES (%s,%s,%s,%s)' dbc.execute(sql, (title, imageId, videoId, type)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '添加成功'}) return response else: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response @app.route('/submitPic', methods=['POST']) def submitPic(): imageIds = request.json.get("imageIds") title = request.json.get("title") if imageIds and title: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') strImageIds = ",".join(imageIds) # 入库 sql = 'insert into pic_list (title,image_ids) VALUES (%s,%s)' dbc.execute(sql, (title, strImageIds)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '添加成功'}) return response else: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response @app.route('/getVideoListPC', methods=['GET']) def getVideoListPC(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from video_list ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) == 0: dbc.close() db.close() response = cors_response({"code": 10001, "msg": "还没有任务"}) return response result = [] for item in queryList: image_url_sql = 'select url from attachment where id = %s' dbc.execute(image_url_sql, (item[2],)) image_url = dbc.fetchone()[0] video_url_sql = 'select url from attachment where id = %s' dbc.execute(video_url_sql, (item[3],)) video_url = dbc.fetchone()[0] result.append({ "id": item[0], "title": item[1], "image_url": image_url, "video_url": "http://orion-c.top/app"+video_url, }) dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getPicListPC', methods=['GET']) def getPicListPC(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from pic_list ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) == 0: dbc.close() db.close() response = cors_response({"code": 10001, "msg": "还没有任务"}) return response result = [] for item in queryList: # atSql = 'select url from attachment where id in (%s)'%item[2] # print atSql # dbc.execute(atSql) # urlList = dbc.fetchall() # print urlList # newUrlList = [] # for image_item in urlList: # newUrlList.append(image_item[0]) result.append({ "id": item[0], "title": item[1], }) dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/submitfwPic', methods=['POST']) def submitfwPic(): title = request.json.get("title") fromValue = request.json.get("from") imageId = request.json.get("imageId") if title: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') # 入库 sql = 'insert into fwpic_list (title,from_value,image_id) VALUES (%s,%s,%s)' dbc.execute(sql, (title, fromValue,imageId)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '添加成功'}) return response else: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response @app.route('/submitVoice', methods=['POST']) def submitVoice(): title = request.json.get("title") voiceId = request.json.get("voiceId") imageId = request.json.get("imageId") if title: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') # 入库 sql = 'insert into voice_list (title,voice_id,image_id) VALUES (%s,%s,%s)' dbc.execute(sql, (title, voiceId,imageId)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '添加成功'}) return response else: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response @app.route('/submitfwPicDetail', methods=['POST']) def submitfwPicDetail(): id = request.json.get("id") imageId = request.json.get("imageId") desc = request.json.get("desc") type = request.json.get("type") if type and id: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') # 入库 if type == 'text': sql = 'insert into fwdetail_list (pid,content_type,content) VALUES (%s,%s,%s)' content = desc else: sql = 'insert into fwdetail_list (pid,content_type,content) VALUES (%s,%s,%s)' content = imageId dbc.execute(sql, (id, type, content)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '添加成功'}) return response else: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response @app.route('/getfwPicListPC', methods=['GET']) def getfwPicListPC(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from fwpic_list ORDER by add_time DESC' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) == 0: dbc.close() db.close() response = cors_response({"code": 10001, "msg": "还没有任务"}) return response result = [] for item in queryList: atSql = 'select url from attachment where id = %s'%item[5] dbc.execute(atSql) url = dbc.fetchone() # print urlList # newUrlList = [] # for image_item in urlList: # newUrlList.append(image_item[0]) result.append({ "id": item[0], "title": item[1], "from_value": item[2], "image_url":url[0], }) dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getVoiceListPC', methods=['GET']) def getVoiceListPC(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from voice_list ORDER by add_time DESC ' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) == 0: dbc.close() db.close() response = cors_response({"code": 10001, "msg": "还没有任务"}) return response result = [] for item in queryList: atSql = 'select url from attachment where id = %s' dbc.execute(atSql, (item[2],)) url = dbc.fetchone() result.append({ "id": item[0], "title": item[1], "voice_url": url[0], }) dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getPingLunListPC', methods=['GET']) def getPingLunListPC(): # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from pinglun_list ORDER by add_time DESC ' dbc.execute(sql) queryList = dbc.fetchall() if len(queryList) == 0: dbc.close() db.close() response = cors_response({"code": 10001, "msg": "还没有任务"}) return response result = [] for item in queryList: if item[1] == 'voice': atSql = 'select title from voice_list where id = %s' dbc.execute(atSql, (item[2],)) title = dbc.fetchone() if item[1] == 'vedio': atSql = 'select title from video_list where id = %s' dbc.execute(atSql, (item[2],)) title = dbc.fetchone() if item[1] == 'gfPic': atSql = 'select title from pic_list where id = %s' dbc.execute(atSql, (item[2],)) title = dbc.fetchone() if item[1] == 'fwPic': atSql = 'select title from fwpic_list where id = %s' dbc.execute(atSql, (item[2],)) title = dbc.fetchone() try: result.append({ "id": item[0], "title": title[0], "user_name": item[4], "pinglun_dec": item[5], "add_time": item[6].strftime('%Y-%m-%d'), "status": item[7], }) except: continue dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response @app.route('/getfwPicDetailPC', methods=['POST']) def getfwPicDetailPC(): id = request.json.get("id") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from fwpic_list WHERE id = %s' dbc.execute(sql, (id,)) query = dbc.fetchone() if len(query) == 0: dbc.close() db.close() response = cors_response({"code": 10001, "msg": "还没有任务"}) return response detailSql = 'select * from fwdetail_list WHERE pid = %s' dbc.execute(detailSql, (id,)) detailList = dbc.fetchall() detailResult = [] if len(detailList) > 0: for item in detailList: if item[2] == 'image': atSql = 'select url from attachment where id = %s' dbc.execute(atSql, (item[3],)) url = dbc.fetchone() detail_content = url[0] else: detail_content = item[3] detailResult.append({ "id": item[0], "content_type": item[2], "content": detail_content, }) result = { "id": query[0], "title": query[1], "from_value": query[2], "detail_list": detailResult, } dbc.close() db.close() response = cors_response({'code': 0, 'msg': '', 'content': result}) return response <file_sep># -*- coding:utf-8 -*- import MySQLdb import os, time import sys from flask import make_response from flask import jsonify from app import app from flask import request from app.database_config import * from werkzeug.utils import secure_filename from sec import prpcrypt # 狗跨域 def cors_response(res): response = make_response(jsonify(res)) response.headers['Access-Control-Allow-Origin'] = '*' response.headers['Access-Control-Allow-Methods'] = 'POST' response.headers['Access-Control-Allow-Headers'] = 'x-requested-with,content-type' return response def LongToInt(value): assert isinstance(value, (int, long)) return int(value & sys.maxint) @app.route('/submitRecord', methods=['POST']) def submitRecord(): content = request.values.get("content") showType = request.values.get("showType") attachmentIds = request.values.get("attachmentIds") lat = request.values.get("lat") lon = request.values.get("lon") userId = request.values.get("userId") if userId == u'' or userId == None: response = cors_response({'code':10001, 'msg': '添加失败'}) return response try: pc = prpcrypt('lovechentiantian') # 初始化密钥 secId = pc.decrypt(userId) except: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response if content: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') # 入库 sql = 'insert into record_list (content,showType,attachmentIds,lat,lon,userId) VALUES (%s,%s,%s,%s,%s,%s)' dbc.execute(sql, (content, showType, attachmentIds, lat, lon,secId)) db.commit() dbc.close() db.close() response = cors_response({'code': 0, 'msg': '添加成功'}) return response else: response = cors_response({'code': 10001, 'msg': '添加失败'}) return response @app.route('/uploadRecordImages', methods=['POST']) def uploadRecordImages(): upload_files = request.files.getlist('file') if upload_files: # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') attachment_ids = [] for upload_file in upload_files: filename = secure_filename(upload_file.filename) t = int(round(time.time() * 1000)) if filename: filename = str(t) + filename else: filename = str(t) + '.png' # 保存文件 upload_file.save(os.path.join(app.root_path, app.config['UPLOAD_FOLDER'], filename)) # 入库 sql = 'insert into attachment (file_name,url) VALUES (%s,%s)' dbc.execute(sql, (filename, '/static/uploads/' + filename)) db.commit() # 取id getId = 'SELECT LAST_INSERT_ID()' dbc.execute(getId) ids = dbc.fetchone() attachment_id = ids[0] attachment_ids.append(str(attachment_id)) dbc.close() db.close() response = cors_response({'code': 0, 'msg': '上传成功', 'content': {'attachment_ids': attachment_ids}}) return response else: response = cors_response({'code': 10001, 'msg': '上传失败'}) return response @app.route("/getRecordList", methods=["POST", "GET"]) def getRecordList(): userId = request.values.get("userId") try: pc = prpcrypt('lovechentiantian') # 初始化密钥 secId = pc.decrypt(userId) except: response = cors_response({'code': 0, 'msg': '还没有信息', 'content': []}) return response # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') resultList = [] sql = "SELECT * FROM record_list WHERE userId = %s or showType = '对所有人公开' ORDER BY addTime DESC " dbc.execute(sql, (secId)) queryList = dbc.fetchall() if len(queryList) > 0: for item in queryList: imageUrls = [] if item[5]: ids = item[5].replace("[", "") ids = ids.replace("]", "") atSql = 'select url from attachment where id in (%s)' % ids dbc.execute(atSql) urlData = dbc.fetchall() if len(urlData) > 0: for urlItem in urlData: imageUrls.append('http://192.168.30.41:5000'+urlItem[0]) resultList.append({ "id": item[0], "content": item[1], "lat": item[2], "lon": item[3], "add_time": item[6].strftime('%Y-%m-%d'), "imageUrls": imageUrls, }) dbc.close() db.close() response = cors_response({'code': 0, 'msg': '获取成功', 'content': resultList}) return response @app.route("/getRecordDetail", methods=["POST"]) def getRecordDetail(): detailId = request.values.get("detailId") # 连接 db = MySQLdb.connect(database_host, database_username, database_password, database1) dbc = db.cursor() # 编码问题 db.set_character_set('utf8') dbc.execute('SET NAMES utf8;') dbc.execute('SET CHARACTER SET utf8;') dbc.execute('SET character_set_connection=utf8;') sql = 'select * from record_list where id = %s ' dbc.execute(sql, (detailId,)) data = dbc.fetchone() if data is None: response = cors_response({'code': 0, 'msg': '还没有信息'}) return response imageUrls = [] if data[5]: ids = data[5].replace("[", "") ids = ids.replace("]", "") atSql = 'select url from attachment where id in (%s)' % ids dbc.execute(atSql) urlData = dbc.fetchall() if len(urlData) > 0: for urlItem in urlData: imageUrls.append('http://192.168.30.41:5000'+urlItem[0]) result = { "id":data[0], "content": data[1], "lat": data[2], "lon": data[3], "add_time": data[6].strftime('%Y-%m-%d'), "imageUrls": imageUrls, } db.commit() dbc.close() db.close() response = cors_response({"code": 0, "content": result}) return response
ef680a4fc40011ff6419cdd14a1e1459c6a0a28d
[ "Python" ]
4
Python
t880216t/recordMe
d7e198d055d58f4cba66485913eb2d933300925c
cd92c8041b44146406663258808fe5d3b2b627ca
refs/heads/master
<repo_name>hilbert-space/fft<file_sep>/src/lib.rs extern crate dft; pub use dft::*; <file_sep>/Cargo.toml [package] name = "fft" version = "0.4.0" authors = ["<NAME> <<EMAIL>>"] license = "MIT" repository = "https://github.com/hilbert-space/fft" homepage = "https://github.com/hilbert-space/fft" description = "Use the DFT package instead." [dependencies] dft = "*" <file_sep>/README.md # FFT Use the [DFT](the://crates.io/crates/dft) package instead.
c4c9517fa640aea06b67be0ccdc929f41bec7900
[ "TOML", "Rust", "Markdown" ]
3
Rust
hilbert-space/fft
bc4c17ce21da4c0b6afab1214c59e88df9e24c7c
6158c02de4d242096f3d46abd9c3c4be21d98f02
refs/heads/master
<repo_name>shrinaththube/Data-Structure<file_sep>/src/tree/BST_Driver.java package tree; public class BST_Driver { public static void main(String [] args){ int[] TestingArray = {8,6,9,11,10,12,5,1,3,2}; BinarySerchTreeExtraFunctionality FirstBst = new BinarySerchTreeExtraFunctionality(); FirstBst.createBinarySearchTree(TestingArray); FirstBst.displayTree(); System.out.println("Sum of smallest sum path ="+ FirstBst.sumOfSmallestSumPath(FirstBst.root) ); System.out.println("Sum of largest sum path = "+ FirstBst.sumOfLargestestSumPath(FirstBst.root)); } } <file_sep>/src/tree/BinarySerchTreeExtraFunctionality.java package tree; public class BinarySerchTreeExtraFunctionality extends BinarySearchTree { //This method finds the path in BST which has smallest sum from root node to one of the leaf. It returns that sum to user or caller public int sumOfSmallestSumPath(TreeNode travelingNode) { if(travelingNode==null) return 0; else if(travelingNode.leftNode == null) return sumOfSmallestSumPath(travelingNode.rightNode) + travelingNode.value; else if(travelingNode.rightNode == null) return sumOfSmallestSumPath(travelingNode.leftNode) + travelingNode.value; return Math.min(sumOfSmallestSumPath(travelingNode.leftNode), sumOfSmallestSumPath(travelingNode.rightNode)) + travelingNode.value; } //This method finds the path in BST which has largest sum from root node to one of the leaf. It returns that sum to user or caller public int sumOfLargestestSumPath(TreeNode travelingNode) { if(travelingNode==null) return 0; else if(travelingNode.leftNode == null) return sumOfLargestestSumPath(travelingNode.rightNode) + travelingNode.value; else if(travelingNode.rightNode == null) return sumOfLargestestSumPath(travelingNode.leftNode) + travelingNode.value; return Math.max(sumOfLargestestSumPath(travelingNode.leftNode), sumOfLargestestSumPath(travelingNode.rightNode)) + travelingNode.value; } } <file_sep>/src/bitwiseOperations/BitDriver.java package bitwiseOperations; public class BitDriver { public static void main(String[] args){ BitProblem obj = new BitProblem(); System.out.println("Number of set bit in number = "+obj.countSetBit(5)); } } <file_sep>/src/bitwiseOperations/BitProblem.java package bitwiseOperations; public class BitProblem { /*** * ***** Find the number of set bits in an interger ****** * @param number find the number of one in this integer * @return count of number of one */ public int countSetBit(int number){ int count = 0; while(number>0){ number = number & (number - 1); count++; } return count; } } <file_sep>/src/linkedlist/README.md ******** This package contains code related to singly linked list ********* ------------------- LinkListNode.java ----------------------- This is singly Linked List node contains - * - value (as int data type which stores data filed in linked list) * - nextNode (as refernce to next node of LinkList) ------------------- LinkList.java --------------------------- This contains following operations on linked list - * - creating Linked List from given array. * - Display Linked List. * - Sorting of Linked List by Bubble and Insertion. * - Merging of sorted linked list in place and keep sorted while merging. * - Reverse all linked list. * - Reverse nodes in a group in Linked List. * - Reverse Linked List from specific position. ------------------- LinkListTest.java ---------------------- This java file is jUnit test file that test functionality of LinkList.java file <file_sep>/src/sorting_algoritms/Sorting.java package sorting_algoritms; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import org.junit.rules.Stopwatch; /** * @author Shrinath * */ public class Sorting { public void modified_Bubble_sort(int [] array){ //Flag will check is their any swapping in first iteration of bubble sort boolean flag = true; for(int i=0;i<array.length;i++){ for(int j=0;j<array.length-1;j++){ if(array[j]>array[j+1]){ int temp = array[j]; array[j] = array[j+1]; array[j+1] = temp; flag = false; } } if(flag){ break; } } } /*** * ******************************* Merge Sort *************************************** * Recursive function divides array into left and right till get single element and in merge function merge it * by comparing element value in ascending order * * @param array that caller wants to sort */ public void mergeSort(int array[]){ int length = array.length; if(length<2) return; int mid = length/2; int[] left = new int[mid]; int[] right = new int[length-mid]; for(int i=0;i<mid;i++){ left[i] = array[i]; } for(int j=mid;j<length;j++) { right[j-mid] = array[j]; } mergeSort(left); mergeSort(right); merge(array,left,right); } public void merge(int[] array,int[] left,int[] right) { int lLeft = left.length; int lRight = right.length; int i=0,j=0,k=0; while(i<lLeft && j<lRight) { if(left[i]<right[j]) { array[k]=left[i]; i++; k++; } else{ array[k]=right[j]; j++; k++; } } while(i<lLeft) { array[k]=left[i]; i++; k++; } while(j<lRight) { array[k]=right[j]; j++; k++; } } /*** * ************* Quick Sort **************************************** * Divide the array in two part on pivotal postion * @param array that want to sort * @param low lower index of array * @param high higher index of array */ public void quickSort(int array[],int low , int high) { int partIndex; if(low>high) return; partIndex = partition(array, low, high); quickSort(array,low, partIndex -1 ); quickSort(array,partIndex+1, high); } public int partition(int[] array,int low,int high){ int pivot = array[0]; int i=low,j=high; while(i<j) { while(array[i]<pivot) i++; while(array[j]>pivot) j--; if(i<j) { int temp = array[i]; array[i] = array[j]; array[j] = temp; } } array[low] = array[j]; array[j] = pivot; return j; } /*** * Insertion Sorting - insert element at appropriate position. * @param array it is given by user * @param i loop variable starts from 1 not from 0 up to length of array. It picks the element which we want to insert in left part of array. * @param element It keep the value of element that we want to sort * @param position It maintains the index where element should be insert. * @param j inner loop variable starts from i-1 and scan backward up to 0'th position. * */ public void insertionSort(int array[]) { for(int i=1;i<array.length; i++){ int element = array[i]; int position = i; for(int j=i-1;j>-1;j--){ if(array[j]< element){ break; } else{ array[j+1] = array[j]; position = j; } } array[position] = element; } } /*** * ****************** Display any array ****************************** * @param array that caller wants to display * @param execution_time time that required to perform sorting operation */ public void printArray(int[] array,long execution_time){ System.out.print("Array = "); for(int i=0;i<array.length;i++){ System.out.println(array[i]+" ");} System.out.print(" Execution time = "+execution_time+ " ns"); System.out.println(); } /*** * ****************** Reading file ********************************************* * This method read the given text file and makes an array to give input to sorting function * @return returns the populated array. */ public int[] readFile(){ // The name of the file to open. //String fileName = "C:\\Users\\Shrinath\\Desktop\\temp.txt"; String fileName = "C:\\Users\\Shrinath\\Desktop\\tp\\Sorting\\hgkjflgkdjd.txt"; // This will reference one line at a time String line = null; // ArrayList<Integer> array = new ArrayList<>(); int [] array = new int[10000]; int i =0; try { // FileReader reads text files in the default encoding. FileReader fileReader = new FileReader(fileName); // Always wrap FileReader in BufferedReader. BufferedReader bufferedReader = new BufferedReader(fileReader); while((line = bufferedReader.readLine()) != null) { //System.out.println(line); array[i] = Integer.parseInt(line); i++; } // Always close files. bufferedReader.close(); } catch(FileNotFoundException ex) { System.out.println( "Unable to open file '" + fileName + "'"); } catch(IOException ex) { System.out.println( "Error reading file '" + fileName + "'"); // Or we could just do this: // ex.printStackTrace(); } return array; } } <file_sep>/src/objectOrientedProperties_Inheritance/Rectangle.java package objectOrientedProperties_Inheritance; public class Rectangle extends Shapes{ private int lengthOfRectangle; private int widthOfRectangle; public Rectangle(int lengthOfRectangle, int widthOfRectangle){ this.lengthOfRectangle = lengthOfRectangle; this.widthOfRectangle = widthOfRectangle; } @Override void area(){ area = this.lengthOfRectangle * this.widthOfRectangle; } } <file_sep>/src/linkedlist/LLFindMergePoint.java package linkedlist; public class LLFindMergePoint extends LinkList{ /*** * This method created merge LL for testing finding merge point method * @param head1 head of first linked list * @param head2 head of second linked list * @param position position of node from first LL where merge the second LL */ public void createMergePoint(LinkListNode head1, LinkListNode head2, int position){ if(head1 == null || head2 == null){ System.out.println("Linked list is not formed yet"); return; } LinkListNode trav1 = head1; LinkListNode trav2 = head2; int i=1; while(i<position && trav1.nextNode != null ){ trav1 = trav1.nextNode; i++; } while(trav2.nextNode != null){ trav2 = trav2.nextNode; } trav2.nextNode = trav1; } /*** * This find intersection point of LL * @param head1 LL1 head * @param head2 LL2 head * @return returns intersection node if present or null if not */ public LinkListNode mergePointLL(LinkListNode head1,LinkListNode head2){ if(head1 == null || head2 == null){ System.out.println("Linked list is not formed yet"); return null; } LinkListNode trav1 = head1; LinkListNode trav2 = head2; int count1 = 1; int count2 = 1; while(trav1.nextNode !=null){ count1++; trav1 = trav1.nextNode; } while(trav2.nextNode !=null){ count2++; trav2 = trav2.nextNode; } trav1 = head1; trav2 = head2; if(count1>count2){ for(int i=0;i<count1-count2;i++) trav1 = trav1.nextNode; } else{ for(int i=0;i<count2-count1;i++) trav2 = trav2.nextNode; } while(trav1.nextNode !=null){ if(trav1.equals(trav2)) return trav1; trav1 = trav1.nextNode; trav2 = trav2.nextNode; } return null; } /*** * This method print the intersected part of two linked list if present * @param head1 LL1 head * @param head2 LL2 head */ public void printCommonIntersectionOfLL(LinkListNode head1, LinkListNode head2){ if(head1 == null || head2 == null){ System.out.println("Linked list is not formed yet"); return; } LinkListNode iHead = mergePointLL(head1,head2); System.out.print("Intersection of two Linked List - "); this.displayLinkList(iHead); } } <file_sep>/src/random_dataset_generator/RandomDataSet.java package random_dataset_generator; import java.io.*; import java.util.Random; import java.util.Scanner; public class RandomDataSet { public static void main(String args[]){ //Take the name of data set from input System.out.print("Give name to data set = "); Scanner input = new Scanner(System.in); String fileName = "C:\\Users\\Shrinath\\Desktop\\tp\\"+ input.nextLine() + ".txt"; System.out.println(); System.out.print("Give the size of data set = "); while (!input.hasNextInt()) { System.out.println("It should be integer"); input.nextLine(); } int size = input.nextInt(); System.out.println(); System.out.print("Give range of data set with space between start and end for example- 1 10 = "); String[] range = input.nextLine().split(" "); while (range.length!=2) { System.out.println("Somethig got wrong Try again"); range = input.nextLine().split(" "); } int start = Integer.parseInt(range[0]); int end = Integer.parseInt(range[1]); input.close(); Random random = new Random(); int rand_number; try { // Assume default encoding. FileWriter fileWriter = new FileWriter(fileName); // Always wrap FileWriter in BufferedWriter. BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); for(int i=0;i<size;i++){ rand_number = random.nextInt((end-start) + 1) + start; System.out.println(rand_number); //String tmp = rand_number.toString; bufferedWriter.write(String.valueOf(rand_number)); bufferedWriter.newLine(); } // Always close files. bufferedWriter.close(); } catch(IOException ex) { System.out.println( "Error writing to file '" + fileName + "'"); // Or we could just do this: // ex.printStackTrace(); } } } <file_sep>/src/graph/GraphApp.java package graph; import java.io.IOException; import java.util.Scanner; /** * @author vtupe *GraphApp class is driver class for Graph application to find shortest path between two nodes. * */ public class GraphApp { public static void main(String args[]){ try{ Scanner in = new Scanner(System.in); System.out.println("Enter the number of vertices"); int n = Integer.parseInt(in.nextLine()); Graph g = new Graph(n); for(int i=0; i<n; i++){ g.addVertex(i); } for(int i=0; i<n; i++){ String s= in.nextLine(); String x[]= s.split(" "); for(int j=1; j<x.length; j++){ g.edge(i, Integer.parseInt(x[j])); } } // for traversing graph using Breadth first search traversal method //g.bfs(); in.nextLine(); for(int i=0; i<3; i++){ String s= in.nextLine(); String x[]= s.split(" "); g.shortestPath(Integer.parseInt(x[0]), Integer.parseInt(x[1])); } } catch(Exception e){ e.printStackTrace(); } } } <file_sep>/src/matrix/Matrix_Driver.java package matrix; /*** * Driver class to check all method of class Matrix2D_Rotate All methods which * are doing operations on square matrix do changes on original matrix and do * not return anything. But all methods which perform operations on mismatch * matrix return another matrix as it can not rotate original matrix due to * having different length and width. * */ public class Matrix_Driver { public static void main(String[] args) { int[][] mat = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 0, 1, 2 }, { 3, 4, 5, 6 } }; int[][] mixMatchMat = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 0, 1, 2 }, { 3, 4, 5, 6 }, { 4, 5, 6, 7 } }; Matrix2D_Rotate obj = new Matrix2D_Rotate(); System.out.println("Original Square matrix"); obj.display(mat); // Rotate square matrix System.out.println("Rotated left matrix"); obj.rotateMinus90(mat); obj.display(mat); // Rotate right System.out.println("Rotated right matrix"); obj.rotatePlus90(mat); obj.display(mat); // rotate 180 System.out.println("Rotated 180"); obj.rotate180(mat); obj.display(mat); System.out.println("Original Mismatch matrix"); obj.display(mixMatchMat); // rotate right System.out.println("Rotated right matrix"); obj.display(obj.rotateRightMismatchMat(mixMatchMat)); // rotate left System.out.println("Rotated left matrix"); obj.display(obj.rotateLeftMismatchMat(mixMatchMat)); // rotate 180 System.out.println("Rotated by 180 matrix"); obj.display(obj.rotateMismatchMat180(mixMatchMat)); } } <file_sep>/src/tree/TreeNode.java package tree; public class TreeNode { public int value; public TreeNode leftNode; public TreeNode rightNode; public TreeNode(int value){ this.value = value; this.leftNode = null; this.rightNode = null; } } <file_sep>/src/objectOrientedProperties_Inheritance/Shapes.java package objectOrientedProperties_Inheritance; public abstract class Shapes { protected int area; abstract void area(); public void display(){ System.out.print("Area ="+area); } } <file_sep>/src/random_problems/FindLargestRectangleArea.java package random_problems; import java.util.Stack; /** * @author Shrinath * --------Finding the Largest rectangle area--------- * Input -- Array of heights of rectangles. Width of rectangle assuming fixed = 1 * Return -- Area of largest rectangle formed by combining elements. */ public class FindLargestRectangleArea { public static void main(String args[]){ //Test case FindLargestRectangleArea obj= new FindLargestRectangleArea(); int [] array = {3,2,1,4,5}; int area = obj.largestArea(array); System.out.println("LArgest area = "+ area); } //This method returns largest area of rectangle created by elements of array. public int largestArea(int[]array){ int max_area=0; int window_size=0; int length_array= array.length; int area=0; // Loop will run up to window size less than array size while(window_size<=array.length){ window_size+=1; //This loop move window by one element and calculate area of largest rectangle for(int j=0;j<=(length_array-window_size);j++){ int min_element= array[j]; //Finding the minimum element from window for(int k=j;k<(j+window_size);k++){ if(min_element>array[k]){ min_element = array[k]; } } //Calculating area of largest rectangle from window area = min_element*window_size; //Assigning max_area if window rectangle area is larger than max_area if(max_area<area){ max_area=area; } } } return max_area; } /** * Reference : geekforgeek - http://www.geeksforgeeks.org/largest-rectangle-under-histogram/ * @param hist * @return maxArea */ public int largestArea2(int hist[]){ int n = hist.length; // Create an empty stack. The stack holds indexes of hist[] array // The bars stored in stack are always in increasing order of their // heights. Stack<Integer> s = new Stack<Integer>();; int max_area = 0; // Initalize max area int tp; // To store top of stack int area_with_top; // To store area with top bar as the smallest bar // Run through all bars of given histogram int i = 0; while (i < n) { // If this bar is higher than the bar on top stack, push it to stack if (s.empty() || hist[s.peek()] <= hist[i]){ //System.out.println("pushing on stack : "+i); s.push(i++); } // If this bar is lower than top of stack, then calculate area of rectangle // with stack top as the smallest (or minimum height) bar. 'i' is // 'right index' for the top and element before top in stack is 'left index' else { tp = s.peek(); // store the top index s.pop(); // pop the top // Calculate the area with hist[tp] stack as smallest bar area_with_top = hist[tp] * (s.empty() ? i : i - s.peek() - 1); // update max area, if needed if (max_area < area_with_top) max_area = area_with_top; } } // Now pop the remaining bars from stack and calculate area with every // popped bar as the smallest bar while (s.empty() == false) { tp = s.peek(); //System.out.println("tp : "+tp); //System.out.println("calc : "+(s.empty() ? i : i - s.peek() - 1)); s.pop(); area_with_top = hist[tp] * (s.empty() ? i : i - s.peek() - 1); // Not understood logical reasoning behind this formula //System.out.println("area with top : "+area_with_top); if (max_area < area_with_top) max_area = area_with_top; } return max_area; } } <file_sep>/src/objectOrientedProperties_Inheritance/ShapesDriver.java package objectOrientedProperties_Inheritance; public class ShapesDriver { public static void main(String [] args){ Square squareChessBoard = new Square(5); Rectangle rectangleBricks = new Rectangle(7, 5); squareChessBoard.area(); squareChessBoard.display(); rectangleBricks.area(); rectangleBricks.display(); } }
6a83006052bc58b242baf148a32fd026cdaa3e52
[ "Markdown", "Java" ]
15
Java
shrinaththube/Data-Structure
a48ec3d756bdebaeac52a5e0e3b210a93ae60735
586ecbb55af56f30f80f3d5edebb7041c8a924f6
refs/heads/master
<file_sep>HomeActivityManager = (function (pub) { 'use strict'; pub.addDialog = document.querySelector('.dialog-container'); pub.daysOfWeek = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; /***************************************************************************** * * Event listeners for UI elements * ****************************************************************************/ $('#butRefresh').click(function () { pub.updateForecasts(); }); $('#butAdd').click(function () { pub.toggleAddDialog(true); }); $('#butAddCity').click(function () { // Add the newly selected city var select = document.getElementById('selectTaskToAdd'); var selected = select.options[select.selectedIndex]; var key = selected.value; var label = selected.textContent; addActivity(key); pub.saveActivitiesLocal(); pub.renderAllActivities(); pub.toggleAddDialog(false); }); $('#butAddCancel').click(function () { // Close the add new city dialog pub.toggleAddDialog(false); }); var addActivity = function(activityId){ $.post('addActivity/' + activityId, function(){ pub.getUserActivities(); }); }; /***************************************************************************** * * Methods to update/refresh the UI * ****************************************************************************/ // Toggles the visibility of the add new city dialog. pub.toggleAddDialog = function (visible) { if (visible) { pub.addDialog.classList.add('dialog-container--visible'); } else { pub.addDialog.classList.remove('dialog-container--visible'); } }; /***************************************************************************** * * Methods for dealing with the model * ****************************************************************************/ if ('serviceWorker' in navigator) { // window.addEventListener('load', function () { // navigator.serviceWorker.register('/sw.js').then(function (registration) { // // Registration was successful // console.log('ServiceWorker registration successful with scope: ', registration.scope); // }).catch(function (err) { // // registration failed :( // console.log('ServiceWorker registration failed: ', err); // }); // }); } return pub; })(HomeActivityManager || {});<file_sep>#!/bin/bash replaceString='s/database_name:.*/database_name: home_activity_manager/' replaceFile=app/config/parameters.yml unamestr=$(uname) # troca o nome do banco para garantir if [[ "$unamestr" == 'Linux' ]]; then sed -i "$replaceString" "$replaceFile" else # o sed tem putaria diferente para MAC sed -i '' "$replaceString" "$replaceFile" fi # Exporta base em yaml (gera arquivos em metadados) php bin/console doctrine:mapping:convert yaml ./src/AppBundle/Resources/config/doctrine/metadata/orm --from-database --force # Cria classes de entidade php bin/console doctrine:mapping:import AppBundle annotation php bin/console doctrine:generate:entities AppBundle --no-backup git add database/scripts git add src/AppBundle/Entity git add -f src/AppBundle/Resources/config/doctrine/metadata/orm git checkout app/config/parameters.yml <file_sep><?php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\JsonResponse; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use AppBundle\Entity\Activity; use AppBundle\Entity\UserSystemMakeActivity; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class DefaultController extends Controller { /** * @Route("/app", name="homepage") */ public function app(Request $request) { return $this->render('default/home.html.twig'); } /** * @Route("/customLogin") */ public function login(Request $request) { return $this->render('default/login.html.twig'); } /** * @Route("/getUserActivities") * @Security("is_granted('ROLE_USER')") */ public function getUserActivities(Request $request) { $em = $this->getDoctrine()->getManager(); $userId = $this->getUser()->getId(); $data = $em->createQuery( "SELECT usma.id, a.name, a.punctuation, usma.createdAt " . "FROM AppBundle:Activity a " . "JOIN AppBundle:UserSystemMakeActivity usma " . "WITH usma.activity = a " . "JOIN usma.userSystem u " . "WHERE u.id = :userSystemId " . "ORDER BY usma.createdAt") ->setParameter('userSystemId', $userId) ->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); $jsonResponse = new JsonResponse(); $jsonResponse->setData($data); return $jsonResponse; } /** * @Route("/getAllActivities") * @Security("is_granted('ROLE_USER')") */ public function getAllActivities(Request $request) { $em = $this->getDoctrine()->getManager(); $userId = $this->getUser()->getId(); $data = $em->createQuery( "SELECT a.id, a.name, a.punctuation, a.description " . "FROM AppBundle:Activity a " . "ORDER BY a.name") ->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY); $jsonResponse = new JsonResponse(); $jsonResponse->setData($data); return $jsonResponse; } /** * @Route("/addActivity/{activity}") * @ParamConverter("activity", class="AppBundle:Activity") * @Security("is_granted('ROLE_USER')") */ public function addActivity(Activity $activity) { $em = $this->getDoctrine()->getManager(); $userId = $this->getUser()->getId(); $userSystem = $em->getReference('AppBundle:UserSystem', $userId); $usma = new UserSystemMakeActivity(); $usma->setActivity($activity); $usma->setUserSystem($userSystem); $usma->setCreatedAt(new \DateTime('now', new \DateTimeZone('America/Sao_Paulo'))); $em->persist($usma); $em->flush(); return new Response(); } /** * @Route("/deleteUserActivity/{userActivity}") * @ParamConverter("userActivity", class="AppBundle:UserSystemMakeActivity") * @Security("is_granted('ROLE_USER')") */ public function deleteUserActivity(UserSystemMakeActivity $userActivity) { $em = $this->getDoctrine()->getManager(); $em->remove($userActivity); $em->flush(); return new Response(); } } <file_sep>INSERT INTO `user_system` (`id`, `name`) VALUES (NULL, 'Paulo'), (NULL, 'Juline'); INSERT INTO `activity` (`id`, `name`, `punctuation`, `description`) VALUES (NULL, 'Fazer almoço', '10', NULL), (NULL, 'Fazer a janta', '5', NULL), (NULL, 'Pôr a mesa', '2', NULL), (NULL, 'Limpar a mesa', '2', NULL), (NULL, 'Lavar a louça', '5', NULL), (NULL, 'Tirar o lixo', '2', NULL), (NULL, 'Levar o lixo', '1', NULL), (NULL, 'Varrer um cômodo', '2', NULL), (NULL, 'Varrer a casa toda', '5', NULL), (NULL, 'Passar pano em um cômodo', '2', NULL); (NULL, 'Passar pano na casa toda', '5', '1', NULL), (NULL, 'Limpar o banheiro', '5', '1', NULL), (NULL, 'Limpar box do banheiro', '3', '1', NULL), (NULL, 'Colocar roupa para lavar', '2', '1', NULL), (NULL, 'Estender roupa', '3', '1', NULL), (NULL, 'Dobrar roupa para passar', '3', '1', NULL), (NULL, 'Passar 30 minutos de roupa', '10', '1', NULL), (NULL, 'Tirar pó de móveis', '5', '1', NULL), (NULL, 'Limpar as janelas', '10', '1', NULL), (NULL, 'Limpar os espelhos', '4', '1', NULL), (NULL, 'Arrumar a cama', '1', '1', NULL), (NULL, 'Limpar a geladeira', '10', '1', NULL), (NULL, 'Ir no mercado', '10', '1', NULL);<file_sep>my_project ========== A Symfony project created on February 12, 2017, 3:30 pm. # home_activity_manager
c072a92ec83b2727f5efb088acaa1d352b6b589e
[ "SQL", "JavaScript", "Markdown", "PHP", "Shell" ]
5
JavaScript
paulopmt1/home_activity_manager
4584c79cac5e553e27df3e0fd63c330c0aaf8543
3d83bb6849f5a4d5ecabcd04c6cc3a343a04b632
refs/heads/master
<repo_name>cooperok/FoxHunting<file_sep>/gradle.properties //path from home debugSigningPropertiesPath=.androidSigning/foxHunting/debugProperties releaseSigningPropertiesPath=.androidSigning/foxHunting/releaseProperties<file_sep>/build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.7+' } } apply plugin: 'android' android { compileSdkVersion 7 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 14 } sourceSets { main { manifest.srcFile file('AndroidManifest.xml') java.srcDirs = ['src'] resources.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } instrumentTest { manifest.srcFile file('tests/AndroidManifest.xml') java.srcDirs = ['tests/src'] resources.srcDirs = ['tests/src'] res.srcDirs = ['tests/res'] assets.srcDirs = ['tests/assets'] } } //Загружаем значения для подписи приложения if(project.hasProperty("debugSigningPropertiesPath") && project.hasProperty("releaseSigningPropertiesPath")) { //Файлы в которых хранятся значения для подписи File debugPropsFile = new File(System.getenv('HOME') + "/" + project.property("debugSigningPropertiesPath")) File releasePropsFile = new File(System.getenv('HOME') + "/" + project.property("releaseSigningPropertiesPath")) if(debugPropsFile.exists() && releasePropsFile.exists()) { Properties debugProps = new Properties() debugProps.load(new FileInputStream(debugPropsFile)) Properties releaseProps = new Properties() releaseProps.load(new FileInputStream(releasePropsFile)) //Дописываем в конфиг загруженные значения signingConfigs { debug { storeFile file(debugPropsFile.getParent() + "/" + debugProps['keystore']) storePassword debugProps['keystore.password'] keyAlias debugProps['keyAlias'] keyPassword debugProps['keyPassword'] } release { storeFile file(releasePropsFile.getParent() + "/" + releaseProps['keystore']) storePassword releaseProps['keystore.password'] keyAlias releaseProps['keyAlias'] keyPassword releaseProps['keyPassword'] } } buildTypes { debug { signingConfig signingConfigs.debug } release { signingConfig signingConfigs.release } } } } } task wrapper(type: Wrapper) { gradleVersion = '1.9' }<file_sep>/src/ua/cooperok/foxhunting/game/Record.java package ua.cooperok.foxhunting.game; import java.sql.Date; /** * Class that represent one single record of all records */ public class Record { /** * Primary key of record */ private long mId; /** * Date of record's creation */ private long mCreated; /** * Count of steps */ private int mSteps; public Record() { } public Record(long id, int steps, long created) { mId = id; mSteps = steps; mCreated = created; } /** * Returns id of record */ public long getId() { return mId; } /** * Returns count of steps */ public int getSteps() { return mSteps; } /** * Returns created date */ public long getCreated() { return mCreated; } public String getCreatedAsString() { return new Date(mCreated).toString(); } }<file_sep>/src/ua/cooperok/foxhunting/gui/RecordsActivity.java package ua.cooperok.foxhunting.gui; import java.util.ArrayList; import ua.cooperok.foxhunting.db.FoxhuntingDatabase; import ua.cooperok.foxhunting.db.RecordsColumns; import ua.cooperok.foxhunting.R; import android.app.ListActivity; import android.os.Bundle; import android.database.Cursor; import android.widget.ArrayAdapter; import android.widget.ListView; public class RecordsActivity extends ListActivity { private static final int RECORDS_LIMIT = 10; private FoxhuntingDatabase mDbAdapter; private Cursor mRecordsCursor; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mDbAdapter = new FoxhuntingDatabase(getApplicationContext()); mRecordsCursor = getRecords(); initListAdapter(); ListView lv = getListView(); lv.setTextFilterEnabled(true); setContentView(R.layout.records_layout); } private void initListAdapter() { setListAdapter(new ArrayAdapter<String>(this, R.layout.records_list_item, getRecordsArrayList())); } private Cursor getRecords() { return mDbAdapter.getRecords(RECORDS_LIMIT); } private ArrayList<String> getRecordsArrayList() { ArrayList<String> recordsList = new ArrayList<String>(); if (mRecordsCursor.moveToFirst()) { do { recordsList.add( mRecordsCursor.getString(mRecordsCursor.getColumnIndex(RecordsColumns.USERNAME)) + " / " + mRecordsCursor.getInt(mRecordsCursor.getColumnIndex(RecordsColumns.STEPS)) ); } while (mRecordsCursor.moveToNext()); } return recordsList; } }<file_sep>/src/ua/cooperok/foxhunting/db/FoxhuntingDatabase.java package ua.cooperok.foxhunting.db; import ua.cooperok.foxhunting.game.Record; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteQueryBuilder; public class FoxhuntingDatabase { public static final String DATABASE_NAME = "foxhunting"; public static final String RECORDS_TABLE_NAME = "records"; private DatabaseHelper mDatabaseHelper; public FoxhuntingDatabase(Context context) { mDatabaseHelper = new DatabaseHelper(context); } public Cursor getRecords(int limit) { SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); qb.setTables(RECORDS_TABLE_NAME); SQLiteDatabase db = mDatabaseHelper.getReadableDatabase(); return qb.query(db, null, null, null, null, null, RecordsColumns.STEPS + " ASC, " + RecordsColumns.CREATED + " ASC", String.valueOf(limit) ); } public Record insertRecord(int steps, String username) { long rowId; long now = System.currentTimeMillis(); ContentValues values = new ContentValues(); values.put(RecordsColumns.STEPS, steps); values.put(RecordsColumns.USERNAME, username); values.put(RecordsColumns.CREATED, now); SQLiteDatabase db = mDatabaseHelper.getWritableDatabase(); // rowId = db.insert(RECORDS_TABLE_NAME, RecordsColumns.ID, values); db.close(); Record record; if (rowId > 0) { record = new Record(rowId, steps, now); } else { throw new SQLException("Failed to insert record"); } return record; } public void deleteRecord(long recordID) { SQLiteDatabase db = mDatabaseHelper.getWritableDatabase(); // delete the record db.delete(RECORDS_TABLE_NAME, RecordsColumns.ID + "=" + recordID, null); db.close(); } }<file_sep>/README.md Fox hunting is a simple game. Also known as transmitter hunting. Main idea is to locate all foxes in a field in the least amount of steps. Size of field is 10x10 squares, in which 10 foxes are placed in random order. When player selecting one field he'll see either fox or count of visible foxes from that field. Visible area is every field in horizontal, vertical or diagonal way from selected field. <file_sep>/src/ua/cooperok/foxhunting/helpers/Morphology.java package ua.cooperok.foxhunting.helpers; /** * Class that helps with russian or ukrainian morphology */ public class Morphology { private static String default_first_end = ""; private static String default_second_end = "а"; private static String default_third_end = "ов"; /** * Возвращает окончание для слова, в зависимости от количества * 1 - товар'', 2 товар'а', 5 товар'ов' * * @param number * @param first_end * @param second_end * @param third_end * @return */ public static String getWordEndingByNumber(int number, String first_end, String second_end, String third_end) { String result = third_end; String str_number = String.valueOf(number); if (str_number.matches("^(.*)(11|12|13|14|15|16|17|18|19)$")) { result = third_end; } else if (str_number.matches("^(.*)1$")) { result = first_end; } else if (str_number.matches("^(.*)(2|3|4)$")) { result = second_end; } return result; } /** * Возвращает окончание для слова, в зависимости от количества * 1 - товар'', 2 товар'а', 5 товар'ов' * * @param number * @return */ public static String getWordEndingByNumber(int number) { return getWordEndingByNumber(number, default_first_end, default_second_end, default_third_end); } /** * Возвращает окончание для слова, в зависимости от количества * 1 - товар'', 2 товар'а', 5 товар'ов' * * @param number * @param first_end * @return */ public static String getWordEndingByNumber(int number, String first_end) { return getWordEndingByNumber(number, first_end, default_second_end, default_third_end); } /** * Возвращает окончание для слова, в зависимости от количества * 1 - товар'', 2 товар'а', 5 товар'ов' * * @param number * @param first_end * @param second_end * @return */ public static String getWordEndingByNumber(int number, String first_end, String second_end) { return getWordEndingByNumber(number, first_end, second_end, default_third_end); } } <file_sep>/src/ua/cooperok/foxhunting/game/Field.java package ua.cooperok.foxhunting.game; import android.graphics.Point; import android.os.Parcel; import android.os.Parcelable; public class Field implements Parcelable { public static final int FOX_VALUE = -1; /** * Value of field, which contain count of foxes from visible fields */ private int mValue; /** * Does this field contains fox */ private boolean mContainFox; /** * Was this field scanned, and its value had been shown */ private boolean mIsScanned; private Point mPosition; public Field(int x, int y) { mPosition = new Point(x, y); mContainFox = false; mValue = 0; } public Field(Parcel in) { mPosition = new Point(in.readInt(), in.readInt()); mValue = in.readInt(); mContainFox = in.readByte() != 0; mIsScanned = in.readByte() != 0; } void setFox() { mContainFox = true; } public Field(Point position) { mPosition = position; } public boolean isScanned() { return mIsScanned; } public boolean isContainsFox() { return mContainFox; } public int getValue() { return mValue; } /** * Sets value of field * * @param value * count of foxes in visible fields, can be a Field.FOX_VALUE, which means, that this field contains fox */ public void setValue(int value) { mValue = value; mContainFox = value == FOX_VALUE; } /** * Means that this field was scanned and its value had been shown */ public void setScanned() { mIsScanned = true; } public Point getPosition() { return mPosition; } @Override public boolean equals(Object o) { boolean equals = false; if (o != null) { try { Point position = ((Field) o).getPosition(); equals = position.equals(mPosition); } catch (ClassCastException e) { // don't do anything, anyway equals is false } } return equals; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mPosition.x); dest.writeInt(mPosition.y); dest.writeInt(mValue); dest.writeByte((byte) (mContainFox ? 1 : 0)); dest.writeByte((byte) (mIsScanned ? 1 : 0)); } public static final Parcelable.Creator<Field> CREATOR = new Parcelable.Creator<Field>() { public Field createFromParcel(Parcel in) { return new Field(in); } public Field[] newArray(int size) { return new Field[size]; } }; }
c4339ec73e17fc2fae0270710a1ae6508296e826
[ "Markdown", "Java", "INI", "Gradle" ]
8
INI
cooperok/FoxHunting
33bf4d13162ed1056c2adc3eab263220879c3492
f0cb4d665a13d10e1bc0340ddfc5faa639c7b805
refs/heads/master
<repo_name>jbsselim972/AkumaWrath<file_sep>/src/com/example/akumawrath/GameScene.java package com.example.akumawrath; import java.io.IOException; import org.andengine.engine.camera.Camera; import org.andengine.engine.camera.hud.HUD; import org.andengine.engine.camera.hud.controls.AnalogOnScreenControl; import org.andengine.engine.camera.hud.controls.AnalogOnScreenControl.IAnalogOnScreenControlListener; import org.andengine.engine.camera.hud.controls.BaseOnScreenControl; import org.andengine.engine.handler.physics.PhysicsHandler; import org.andengine.engine.handler.timer.ITimerCallback; import org.andengine.engine.handler.timer.TimerHandler; import org.andengine.entity.Entity; import org.andengine.entity.IEntity; import org.andengine.entity.modifier.LoopEntityModifier; import org.andengine.entity.modifier.ScaleModifier; import org.andengine.entity.modifier.SequenceEntityModifier; import org.andengine.entity.scene.IOnAreaTouchListener; import org.andengine.entity.scene.IOnSceneTouchListener; import org.andengine.entity.scene.ITouchArea; import org.andengine.entity.scene.Scene; import org.andengine.entity.scene.background.AutoParallaxBackground; import org.andengine.entity.scene.background.Background; import org.andengine.entity.scene.background.ParallaxBackground; import org.andengine.entity.scene.background.ParallaxBackground.ParallaxEntity; import org.andengine.entity.sprite.AnimatedSprite; import org.andengine.entity.sprite.Sprite; import org.andengine.entity.text.Text; import org.andengine.entity.text.TextOptions; import org.andengine.extension.debugdraw.DebugRenderer; import org.andengine.extension.physics.box2d.FixedStepPhysicsWorld; import org.andengine.extension.physics.box2d.PhysicsConnector; import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.util.GLState; import org.andengine.opengl.vbo.VertexBufferObjectManager; import org.andengine.util.HorizontalAlign; import org.andengine.util.SAXUtils; import org.andengine.util.color.Color; import org.andengine.util.debug.Debug; import org.andengine.util.level.IEntityLoader; import org.andengine.util.level.LevelLoader; import org.andengine.util.level.constants.LevelConstants; import org.andlabs.andengine.extension.physicsloader.PhysicsEditorLoader; import org.xml.sax.Attributes; import android.opengl.GLES20; import android.view.MotionEvent; import android.widget.Toast; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; import com.badlogic.gdx.physics.box2d.Contact; import com.badlogic.gdx.physics.box2d.ContactImpulse; import com.badlogic.gdx.physics.box2d.ContactListener; import com.badlogic.gdx.physics.box2d.Fixture; import com.badlogic.gdx.physics.box2d.FixtureDef; import com.badlogic.gdx.physics.box2d.Manifold; import com.example.akumawrath.Enemy.EnemyType; import com.example.akumawrath.LevelCompletion.StarsCount; import com.example.akumawrath.SceneManager.SceneType; public class GameScene extends BaseScene implements IOnSceneTouchListener, IOnAreaTouchListener{ private HUD gameHUD; private Text scoreText; private int score = 0; public int level = 1; private PhysicsWorld physicsWorld; private PhysicsHandler physicsHandler; private boolean firstTouch = false; private Player player; private Enemy enemy; private static final String TAG_ENTITY = "entity"; private static final String TAG_ENTITY_ATTRIBUTE_X = "x"; private static final String TAG_ENTITY_ATTRIBUTE_Y = "y"; private static final String TAG_ENTITY_ATTRIBUTE_TYPE = "type"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLATFORM1 = "platform1"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLATFORM2 = "platform2"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLATFORM3 = "platform3"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_COIN = "coin"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_LEVEL_COMPLETE = "levelcomplete"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLAYER = "player"; private static final Object TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_ENEMY1 = "enemy1"; private LevelCompletion levelCompleteWindow; private Text gameOverText; private boolean gameOverDisplayed = false; /* PRIVATE FCTS */ private void createBackground() { // attachChild(new Sprite(0, 0, resourcesManager.game_background_region, vbom) // { // @Override // protected void preDraw(GLState pGLState, Camera pCamera) // { // super.preDraw(pGLState, pCamera); // pGLState.enableDither(); // } // }); // setBackground(new Background(Color.WHITE)); if (ResourcesManager.getInstance().level == 1) { final AutoParallaxBackground AutoParallaxBackground = new AutoParallaxBackground(0, 0, 0, 10); final VertexBufferObjectManager vertexBufferObjectManager = vbom; AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, 480 - resourcesManager.mParallaxLayerBack1.getHeight(), resourcesManager.mParallaxLayerBack1, vertexBufferObjectManager))); AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-5.0f, new Sprite(0, 80, resourcesManager.mParallaxLayerMid1, vertexBufferObjectManager))); AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 100, resourcesManager.mParallaxLayerFront1, vertexBufferObjectManager))); setBackground(AutoParallaxBackground); } else if (ResourcesManager.getInstance().level == 2) { final AutoParallaxBackground AutoParallaxBackground = new AutoParallaxBackground(0, 0, 0, 10); final VertexBufferObjectManager vertexBufferObjectManager = vbom; AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, 480 - resourcesManager.mParallaxLayerBack2.getHeight(), resourcesManager.mParallaxLayerBack2, vertexBufferObjectManager))); AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-3.0f, new Sprite(0, 50, resourcesManager.mParallaxLayerMid2, vertexBufferObjectManager))); AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 480 - resourcesManager.mParallaxLayerFront2.getHeight(), resourcesManager.mParallaxLayerFront2, vertexBufferObjectManager))); setBackground(AutoParallaxBackground); }else if (ResourcesManager.getInstance().level == 3) { final AutoParallaxBackground AutoParallaxBackground = new AutoParallaxBackground(0, 0, 0, 10); final VertexBufferObjectManager vertexBufferObjectManager = vbom; AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, 480 - resourcesManager.mParallaxLayerBack3.getHeight(), resourcesManager.mParallaxLayerBack3, vertexBufferObjectManager))); AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-3.0f, new Sprite(0, 100, resourcesManager.mParallaxLayerMid3, vertexBufferObjectManager))); AutoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 480 - resourcesManager.mParallaxLayerFront3.getHeight(), resourcesManager.mParallaxLayerFront3, vertexBufferObjectManager))); setBackground(AutoParallaxBackground); } } private void createHUD() { gameHUD = new HUD(); final Sprite life; final int click = 0; life = new Sprite(690, 10, resourcesManager.player_life_region, vbom); gameHUD.attachChild(life); // CREATE SCORE TEXT // scoreText = new Text(400, 240, resourcesManager.font, "Score: 0123456789", new TextOptions(HorizontalAlign.LEFT), vbom); scoreText = new Text(25, 25, resourcesManager.font, "Score: 0123456789",vbom); scoreText.setPosition(20, 10); scoreText.setText("Score: 0"); scoreText.setColor(Color.WHITE); gameHUD.attachChild(scoreText); physicsHandler = new PhysicsHandler(player); final Sprite buttonA = new Sprite(620, 340, resourcesManager.mOnScreenControlButtonARegion, vbom) { @Override public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float X, float Y) { if(pSceneTouchEvent.isActionDown()) { // Debug.e("BUTTON A PRESSED"); //running } return true; }; }; gameHUD.registerTouchArea(buttonA); gameHUD.attachChild(buttonA); final Sprite buttonB = new Sprite(690, 390, resourcesManager.mOnScreenControlButtonBRegion, vbom) { @Override public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float X, float Y) { if(pSceneTouchEvent.isActionDown()) { Debug.e("BUTTON B PRESSED" + player.getClick() + 1); Debug.e("player is Jumping"); player.setClick(player.getClick() + 1); player.setJumping(player.getClick()); } return true; }; }; gameHUD.registerTouchArea(buttonB); gameHUD.attachChild(buttonB); camera.setHUD(gameHUD); Debug.e("created text"); } private void addToScore(int i) { score += i; scoreText.setText("Score: " + score); } private void createPhysics() { physicsWorld = new FixedStepPhysicsWorld(60, new Vector2(0, 17), false); physicsWorld.setContactListener(contactListener()); registerUpdateHandler(physicsWorld); } private void loadLevel(int levelID) { final LevelLoader levelLoader = new LevelLoader(); final FixtureDef FIXTURE_DEF = PhysicsFactory.createFixtureDef(0, 0.01f, 0.5f); levelLoader.registerEntityLoader(LevelConstants.TAG_LEVEL, new IEntityLoader() { public IEntity onLoadEntity(String pEntityName, Attributes pAttributes) { final int width = SAXUtils.getIntAttributeOrThrow(pAttributes, LevelConstants.TAG_LEVEL_ATTRIBUTE_WIDTH); final int height = SAXUtils.getIntAttributeOrThrow(pAttributes, LevelConstants.TAG_LEVEL_ATTRIBUTE_HEIGHT); Debug.e( "WIDTH : "+ width + "et HEIGHT : "+ height); camera.setBounds(0, 0, width, height); // here we set camera bounds // camera.setChaseEntity(player); camera.setBoundsEnabled(true); return GameScene.this; } }); levelLoader.registerEntityLoader(TAG_ENTITY, new IEntityLoader() { public IEntity onLoadEntity(final String pEntityName, Attributes pAttributes) { final int x = SAXUtils.getIntAttributeOrThrow(pAttributes, TAG_ENTITY_ATTRIBUTE_X); final int y = SAXUtils.getIntAttributeOrThrow(pAttributes, TAG_ENTITY_ATTRIBUTE_Y); final String type = SAXUtils.getAttributeOrThrow(pAttributes, TAG_ENTITY_ATTRIBUTE_TYPE); final Sprite levelObject; final PhysicsEditorLoader loader = new PhysicsEditorLoader(); if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLATFORM1)) { levelObject = new Sprite(x, y, resourcesManager.platform1_region, vbom); PhysicsFactory.createBoxBody(physicsWorld, levelObject, BodyType.StaticBody, FIXTURE_DEF).setUserData("platform1"); // try { // loader.setAssetBasePath("xml/"); // loader.load(activity, physicsWorld, "platform1.xml", levelObject,false, false); // // } catch (IOException e) { // e.printStackTrace(); // } } else if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLATFORM2)) { levelObject = new Sprite(x, y, resourcesManager.platform2_region, vbom); // final Body body = PhysicsFactory.createBoxBody(physicsWorld, levelObject, BodyType.StaticBody, FIXTURE_DEF); // body.setUserData("platform2");; try { loader.setAssetBasePath("xml/"); loader.load(activity, physicsWorld, "platform2.xml", levelObject,false, false); } catch (IOException e) { e.printStackTrace(); } physicsWorld.registerPhysicsConnector(new PhysicsConnector(levelObject, loader.getBody("platform2"), true, false)); } else if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLATFORM3)) { levelObject = new Sprite(x, y, resourcesManager.platform3_region, vbom); // final Body body = PhysicsFactory.createBoxBody(physicsWorld, levelObject, BodyType.StaticBody, FIXTURE_DEF); // body.setUserData("platform3"); try { loader.setAssetBasePath("xml/"); loader.load(activity, physicsWorld, "platform3.xml", levelObject,false, false); } catch (IOException e) { e.printStackTrace(); } physicsWorld.registerPhysicsConnector(new PhysicsConnector(levelObject, loader.getBody("platform3"), true, false)); } else if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_COIN)) { levelObject = new Sprite(x, y, resourcesManager.coin_region, vbom) { @Override protected void onManagedUpdate(float pSecondsElapsed) { super.onManagedUpdate(pSecondsElapsed); if (player.collidesWith(this)) { addToScore(10); this.setVisible(false); this.setIgnoreUpdate(true); //registerTouchArea(this); } } }; levelObject.registerEntityModifier(new LoopEntityModifier(new ScaleModifier(1, 1, 1.3f))); } else if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_PLAYER)) { player = new Player(x, y, vbom, camera, physicsWorld) { @Override public void onDie() { if (!gameOverDisplayed) { displayGameOverText(); } } }; levelObject = player; Debug.e( "player created"); } else if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_ENEMY1)) { enemy = new Enemy(x, y, vbom, camera, physicsWorld, resourcesManager.enemy1_region) { @Override public void onDie() { enemy.setDying(); } }; levelObject = enemy; enemy.setWalking(); }else if (type.equals(TAG_ENTITY_ATTRIBUTE_TYPE_VALUE_LEVEL_COMPLETE)) { levelObject = new Sprite(x, y, resourcesManager.star_region, vbom) { @Override protected void onManagedUpdate(float pSecondsElapsed) { super.onManagedUpdate(pSecondsElapsed); if (player.collidesWith(this)) { ResourcesManager.getInstance().level += 1; levelCompleteWindow.display(StarsCount.TWO, GameScene.this, camera); this.setVisible(false); this.setIgnoreUpdate(true); } } }; levelObject.registerEntityModifier(new LoopEntityModifier(new ScaleModifier(1, 1, 1.3f))); } else { throw new IllegalArgumentException(); } levelObject.setCullingEnabled(true); return levelObject; } }); try { levelLoader.loadLevelFromAsset(activity.getAssets(), "gfx/game/levels/" + levelID + ".lvl"); } catch (final IOException e) { Debug.e(e); } } /* BASE FCTS */ @Override public void createScene() { //level += 1; createBackground(); createHUD(); createPhysics(); Debug.e("niveau : " + level); loadLevel(ResourcesManager.getInstance().level); createGameOverText(); levelCompleteWindow = new LevelCompletion(vbom); setOnSceneTouchListener(this); setOnAreaTouchListener(this); DebugRenderer debug = new DebugRenderer(physicsWorld, vbom); this.attachChild(debug); createController(); } public void createController(){ physicsHandler = new PhysicsHandler(player); final AnalogOnScreenControl analogOnScreenControl = new AnalogOnScreenControl(40, 480 - this.resourcesManager.mOnScreenControlBaseTextureRegion.getHeight(), camera, this.resourcesManager.mOnScreenControlBaseTextureRegion, this.resourcesManager.mOnScreenControlKnobTextureRegion, 0.1f, 200, this.vbom, new IAnalogOnScreenControlListener() { @Override public void onControlChange(final BaseOnScreenControl pBaseOnScreenControl, final float pValueX, final float pValueY) { if ((pValueX > 0.5) && player.getRunningState() == false){ player.setFlippedHorizontal(false); player.setSpeed(5); player.setWalking(); } else if ((pValueX < -0.5) && player.getRunningState() == false){ player.setFlippedHorizontal(true); player.setSpeed(-5); player.setWalking(); } if (pValueX < 0.4 && pValueX > -0.4 && pValueY < 0.4 && pValueY > -0.4) { player.setIdle(); } } @Override public void onControlClick(final AnalogOnScreenControl pAnalogOnScreenControl) { // player.registerEntityModifier(new SequenceEntityModifier(new ScaleModifier(0.25f, 1, 1.5f), new ScaleModifier(0.25f, 1.5f, 1))); } }); analogOnScreenControl.getControlBase().setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA); analogOnScreenControl.getControlBase().setAlpha(0.5f); analogOnScreenControl.getControlBase().setScaleCenter(0, 128); analogOnScreenControl.getControlBase().setScale(1.25f); analogOnScreenControl.getControlKnob().setScale(1.25f); analogOnScreenControl.refreshControlKnobPosition(); this.setChildScene(analogOnScreenControl); } @Override public void onBackKeyPressed() { ResourcesManager.getInstance().level = 1; SceneManager.getInstance().loadMenuScene(engine); } @Override public SceneType getSceneType() { return SceneType.SCENE_GAME; } @Override public void disposeScene() { camera.setHUD(null); camera.setCenter(400, 240); camera.setChaseEntity(null); } private void createGameOverText() { gameOverText = new Text(0, 0, resourcesManager.font, "Game Over!", vbom); gameOverText.setColor(Color.RED); } private void displayGameOverText() { camera.setChaseEntity(null); gameOverText.setPosition(camera.getCenterX(), camera.getCenterY()); attachChild(gameOverText); gameOverDisplayed = true; } public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) { if (pSceneTouchEvent.isActionDown()) { if (!firstTouch) { firstTouch = true; } else { firstTouch = false; } } return false; } private ContactListener contactListener() { ContactListener contactListener = new ContactListener() { public void beginContact(Contact contact) { final Fixture x1 = contact.getFixtureA(); final Fixture x2 = contact.getFixtureB(); ; if (x1.getBody().getUserData() != null && x2.getBody().getUserData() != null) { if (x1.getBody().getUserData().equals("player")) { player.increaseFootContacts(); } if (x1.getBody().getUserData().equals("enemy11")) { enemy.increaseFootContacts(); } } if (x2.getBody().getUserData().equals("platform3") && x1.getBody().getUserData().equals("player")) { x2.getBody().setType(BodyType.DynamicBody); } if ((x2.getBody().getUserData().equals("enemy11") && x1.getBody().getUserData().equals("player")) || (x2.getBody().getUserData().equals("player") && x1.getBody().getUserData().equals("enemy11"))) { Debug.e("X2 : " + x2.getBody().getUserData()); Debug.e("X2 x :" + x2.getBody().getPosition().x + " et X2 y : " + x2.getBody().getPosition().y); Debug.e("X1 : " + x1.getBody().getUserData()); Debug.e("X1 x :" + x1.getBody().getPosition().x + " et X1 y : " + x1.getBody().getPosition().y); if ( x1.getBody().getPosition().y < x2.getBody().getPosition().y) { enemy.setDying(); }else { player.setDying(); } } if (x2.getBody().getUserData().equals("platform2") && x1.getBody().getUserData().equals("player")) { engine.registerUpdateHandler(new TimerHandler(0.2f, new ITimerCallback() { public void onTimePassed(final TimerHandler pTimerHandler) { pTimerHandler.reset(); engine.unregisterUpdateHandler(pTimerHandler); x2.getBody().setType(BodyType.DynamicBody); } })); } } public void endContact(Contact contact) { final Fixture x1 = contact.getFixtureA(); final Fixture x2 = contact.getFixtureB(); if (x1.getBody().getUserData() != null && x2.getBody().getUserData() != null) { if (x1.getBody().getUserData().equals("player")) { player.decreaseFootContacts(); } } } public void preSolve(Contact contact, Manifold oldManifold) { } public void postSolve(Contact contact, ContactImpulse impulse) { } }; return contactListener; } @Override public boolean onAreaTouched(TouchEvent pSceneTouchEvent, ITouchArea pTouchArea, float pTouchAreaLocalX, float pTouchAreaLocalY) { if(pSceneTouchEvent.getAction() == MotionEvent.ACTION_DOWN) { Debug.e("BUTTON A PRESSED"); } else if(pSceneTouchEvent.getAction() == MotionEvent.ACTION_UP) { Debug.e("BUTTON B PRESSED"); } return false; } } <file_sep>/src/com/example/akumawrath/LevelCompletion.java package com.example.akumawrath; import org.andengine.engine.camera.Camera; import org.andengine.engine.handler.timer.ITimerCallback; import org.andengine.engine.handler.timer.TimerHandler; import org.andengine.entity.scene.Scene; import org.andengine.entity.sprite.Sprite; import org.andengine.entity.sprite.TiledSprite; import org.andengine.opengl.vbo.VertexBufferObjectManager; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; public class LevelCompletion extends Sprite { private TiledSprite star1; private TiledSprite star2; private TiledSprite star3; public enum StarsCount { ONE, TWO, THREE } public LevelCompletion(VertexBufferObjectManager pSpriteVertexBufferObject) { super(0, 0, 650, 400, ResourcesManager.getInstance().complete_window_region, pSpriteVertexBufferObject); attachStars(pSpriteVertexBufferObject); } private void attachStars(VertexBufferObjectManager pSpriteVertexBufferObject) { star1 = new TiledSprite(80, 150, ResourcesManager.getInstance().complete_stars_region, pSpriteVertexBufferObject); star2 = new TiledSprite(265, 150, ResourcesManager.getInstance().complete_stars_region, pSpriteVertexBufferObject); star3 = new TiledSprite(430, 150, ResourcesManager.getInstance().complete_stars_region, pSpriteVertexBufferObject); attachChild(star1); attachChild(star2); attachChild(star3); } /** * Change star`s tile index, depends on stars count. * @param starsCount */ public void display(StarsCount starsCount, Scene scene, Camera camera) { // Change stars tile index, based on stars count (1-3) switch (starsCount) { case ONE: star1.setCurrentTileIndex(0); star2.setCurrentTileIndex(1); star3.setCurrentTileIndex(1); break; case TWO: star1.setCurrentTileIndex(0); star2.setCurrentTileIndex(0); star3.setCurrentTileIndex(1); break; case THREE: star1.setCurrentTileIndex(0); star2.setCurrentTileIndex(0); star3.setCurrentTileIndex(0); break; } // Hide HUD camera.getHUD().setVisible(false); // Disable camera chase entity camera.setChaseEntity(null); // Attach our level complete panel in the middle of camera // setPosition(camera.getCenterX(), camera.getCenterY()); setPosition(100, 50); scene.attachChild(this); ResourcesManager.getInstance().engine.registerUpdateHandler(new TimerHandler(3.0f, new ITimerCallback() { public void onTimePassed(final TimerHandler pTimerHandler) { pTimerHandler.reset(); ResourcesManager.getInstance().engine.unregisterUpdateHandler(pTimerHandler); SceneManager.getInstance().loadGameScene(ResourcesManager.getInstance().engine); } })); } } <file_sep>/src/com/example/akumawrath/Enemy.java package com.example.akumawrath; import java.io.IOException; import org.andengine.engine.camera.Camera; import org.andengine.engine.handler.timer.ITimerCallback; import org.andengine.engine.handler.timer.TimerHandler; import org.andengine.entity.sprite.AnimatedSprite; import org.andengine.entity.sprite.Sprite; import org.andengine.extension.physics.box2d.PhysicsConnector; import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.opengl.texture.region.ITiledTextureRegion; import org.andengine.opengl.vbo.VertexBufferObjectManager; import org.andengine.util.debug.Debug; import org.andlabs.andengine.extension.physicsloader.PhysicsEditorLoader; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; //import com.example.ResourcesManager; public abstract class Enemy extends AnimatedSprite { // --------------------------------------------- // VARIABLES // --------------------------------------------- private Body body; private PhysicsEditorLoader loader = new PhysicsEditorLoader(); private int speed = 2; private Boolean left = true; private int alive = 1; private int footContacts = 0; public enum EnemyType { RAT, WOLF, SNAKE, } // --------------------------------------------- // CONSTRUCTOR // --------------------------------------------- public Enemy(float pX, float pY, VertexBufferObjectManager vbo, Camera camera, PhysicsWorld physicsWorld, ITiledTextureRegion type) { super(pX, pY, ResourcesManager.getInstance().enemy1_region, vbo); createPhysics(camera, physicsWorld); } public PhysicsEditorLoader getLoader(){ return (loader); } public int getSpeed(){ return (speed); } public void setSpeed(int factor){ speed = factor; } public void increaseFootContacts() { footContacts++; } public void decreaseFootContacts() { footContacts--; } // --------------------------------------------- // MEMBER FCTS // --------------------------------------------- public abstract void onDie(); private void createPhysics(final Camera camera, PhysicsWorld physicsWorld) { try { loader.setAssetBasePath("xml/"); loader.load(ResourcesManager.getInstance().activity, physicsWorld, "enemy11.xml", this,false, false); } catch (IOException e) { e.printStackTrace(); } physicsWorld.registerPhysicsConnector(new PhysicsConnector(this, loader.getBody("enemy11"), true, false) { @Override public void onUpdate(float pSecondsElapsed) { super.onUpdate(pSecondsElapsed); camera.onUpdate(0.1f); // if (getY() >= 480) // { // onDie(); // } if (alive == 1){ loader.getBody("enemy11").setLinearVelocity(new Vector2(speed, loader.getBody("enemy11").getLinearVelocity().y)); } else { loader.getBody("enemy11").setLinearVelocity(new Vector2(0, 2)); loader.getBody("enemy11").setActive(false); return; } // loader.getBody("enemy11").setLinearVelocity(new Vector2(speed, loader.getBody("enemy11").getLinearVelocity().y)); if (footContacts == 5) { if (left){ setFlippedHorizontal(true); left = false; } else{ setFlippedHorizontal(false); left = true; } setSpeed(-speed); footContacts = 0; } } }); } public void setWalking() { final long[] ENEMY_ANIMATE = new long[] { 100, 100, 100,100 ,100 ,100}; animate(ENEMY_ANIMATE, 0, 5, true); } public void setDying() { final long[] ENEMY_DIE_ANIMATE = new long[] { 100, 100, 100,100 ,100 ,100}; animate(ENEMY_DIE_ANIMATE, 6, 11, false); alive = 0; } } <file_sep>/src/com/example/akumawrath/ResourcesManager.java package com.example.akumawrath; import org.andengine.engine.Engine; import org.andengine.engine.camera.BoundCamera; import org.andengine.engine.camera.Camera; import org.andengine.opengl.font.Font; import org.andengine.opengl.font.FontFactory; import org.andengine.opengl.texture.ITexture; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; import org.andengine.opengl.texture.atlas.buildable.builder.BlackPawnTextureAtlasBuilder; import org.andengine.opengl.texture.atlas.buildable.builder.ITextureAtlasBuilder.TextureAtlasBuilderException; import org.andengine.opengl.texture.region.ITextureRegion; import org.andengine.opengl.texture.region.ITiledTextureRegion; import org.andengine.opengl.vbo.VertexBufferObjectManager; import org.andengine.util.color.Color; import org.andengine.util.debug.Debug; public class ResourcesManager { //--------------------------------------------- // VARIABLES //--------------------------------------------- private static final ResourcesManager INSTANCE = new ResourcesManager(); public Engine engine; public MainActivity activity; public BoundCamera camera; public VertexBufferObjectManager vbom; public Font font; public int level = 1; //--------------------------------------------- // TEXTURES & TEXTURE REGIONS //--------------------------------------------- /* SPLASH SCENE */ public ITextureRegion splash_region; private BitmapTextureAtlas splashTextureAtlas; /* MENU SCENE */ public ITextureRegion menu_background_region; public ITextureRegion play_region; public ITextureRegion options_region; public ITextureRegion editor_region; private BuildableBitmapTextureAtlas menuTextureAtlas; /* LOADING SCENE */ public ITextureRegion loading_region; /* GAME SCENE */ public ITextureRegion game_background_region; public ITextureRegion platform1_region; public ITextureRegion platform2_region; public ITextureRegion platform3_region; public ITextureRegion coin_region; public BuildableBitmapTextureAtlas gameTextureAtlas; public ITiledTextureRegion enemy1_region; public ITiledTextureRegion player_region; public ITextureRegion player_life_region; public BitmapTextureAtlas mOnScreenControlTexture; public ITextureRegion mOnScreenControlBaseTextureRegion; public ITextureRegion mOnScreenControlKnobTextureRegion; public ITextureRegion mOnScreenControlButtonARegion; public ITextureRegion mOnScreenControlButtonBRegion; /*PARALLAX BACKGROUND*/ public BitmapTextureAtlas mAutoParallaxBackgroundTexture1; public ITextureRegion mParallaxLayerBack1; public ITextureRegion mParallaxLayerMid1; public ITextureRegion mParallaxLayerFront1; public BitmapTextureAtlas mAutoParallaxBackgroundTexture2; public ITextureRegion mParallaxLayerBack2; public ITextureRegion mParallaxLayerMid2; public ITextureRegion mParallaxLayerFront2; public BitmapTextureAtlas mAutoParallaxBackgroundTexture3; public ITextureRegion mParallaxLayerBack3; public ITextureRegion mParallaxLayerMid3; public ITextureRegion mParallaxLayerFront3; // Level Complete Window public ITextureRegion complete_window_region; public ITextureRegion star_region; public ITiledTextureRegion complete_stars_region; //--------------------------------------------- // CLASS LOGIC //--------------------------------------------- //--------------------------------------------- // MENU SCENE //--------------------------------------------- public void loadMenuResources() { loadMenuGraphics(); loadMenuAudio(); loadMenuFonts(); } private void loadMenuGraphics() { BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/"); menuTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 2048, 1024, TextureOptions.BILINEAR); menu_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "Menu_background.png"); play_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "Play.png"); options_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "Options.png"); editor_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "Editor.png"); loading_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "Loading.png"); //Loading scene try { this.menuTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0)); this.menuTextureAtlas.load(); } catch (final TextureAtlasBuilderException e) { Debug.e(e); } } private void loadMenuAudio() { } public void unloadMenuTextures() { menuTextureAtlas.unload(); } public void loadMenuTextures() { menuTextureAtlas.load(); } private void loadMenuFonts() { FontFactory.setAssetBasePath("font/"); // final ITexture mainFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA); font = FontFactory.createFromAsset(activity.getFontManager(), activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR, activity.getAssets(), "font.ttf", 32f, true, Color.RED_ABGR_PACKED_INT); //font = FontFactory.createStrokeFromAsset(activity.getFontManager(), mainFontTexture, activity.getAssets(), "font.ttf",35, true,5,(float)20, 6); font.load(); Debug.e("GAME FONTS LOADED."); } //--------------------------------------------- // GAME SCENE //--------------------------------------------- public void loadGameResources() { loadGameGraphics(); //loadGameFonts(); loadGameAudio(); } private void loadGameGraphics() { //this.level += 1; BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/game/"); gameTextureAtlas = new BuildableBitmapTextureAtlas(activity.getTextureManager(), 4000, 2000, TextureOptions.BILINEAR); platform1_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "platform1.png"); platform2_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "platform2.png"); platform3_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "platform3.png"); coin_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "coin.png"); game_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "Game_background.png"); complete_window_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "levelcomplete.png"); star_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "star2.png"); complete_stars_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "star.png", 2, 1); enemy1_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "characters/enemy11.png", 6, 2); player_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(gameTextureAtlas, activity, "characters/player.png", 9, 10); player_life_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(gameTextureAtlas, activity, "player_life.png"); try { this.gameTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0)); this.gameTextureAtlas.load(); } catch (final TextureAtlasBuilderException e) { Debug.e(e); } /* CONTROLLER RESSOURCES*/ mOnScreenControlTexture = new BitmapTextureAtlas(activity.getTextureManager(), 456, 128, TextureOptions.BILINEAR); mOnScreenControlBaseTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mOnScreenControlTexture, activity, "onscreen_control_base.png", 0, 0); mOnScreenControlKnobTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mOnScreenControlTexture, activity, "onscreen_control_knob.png", 128, 0); mOnScreenControlButtonARegion =BitmapTextureAtlasTextureRegionFactory.createFromAsset(mOnScreenControlTexture, activity, "buttonA.png", 192, 0); mOnScreenControlButtonBRegion =BitmapTextureAtlasTextureRegionFactory.createFromAsset(mOnScreenControlTexture, activity, "buttonB.png", 292, 0); mOnScreenControlTexture.load(); /*BACKGROUND*/ mAutoParallaxBackgroundTexture3 = new BitmapTextureAtlas(activity.getTextureManager(), 2000, 2000); mParallaxLayerFront3 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture3, activity, "level3_parallax_background_layer_front.png", 0, 0); mParallaxLayerBack3 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture3, activity, "level3_parallax_background_layer_back.png", 0, 115); mParallaxLayerMid3 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture3, activity, "level3_parallax_background_layer_mid.png", 0, 595); mAutoParallaxBackgroundTexture3.load(); mAutoParallaxBackgroundTexture2 = new BitmapTextureAtlas(activity.getTextureManager(), 2000, 2000); mParallaxLayerFront2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture2, activity, "level2_parallax_background_layer_front.png", 0, 0); mParallaxLayerBack2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture2, activity, "level2_parallax_background_layer_back.png", 0, 188); mParallaxLayerMid2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture2, activity, "level2_parallax_background_layer_mid.png", 0, 670); mAutoParallaxBackgroundTexture2.load(); mAutoParallaxBackgroundTexture1 = new BitmapTextureAtlas(activity.getTextureManager(), 2000, 2000); mParallaxLayerFront1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture1, activity, "level1_parallax_background_layer_front.png", 0, 0); mParallaxLayerBack1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture1, activity, "level1_parallax_background_layer_back.png", 0, 676); mParallaxLayerMid1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mAutoParallaxBackgroundTexture1, activity, "level1_parallax_background_layer_mid.png", 0, 1560); mAutoParallaxBackgroundTexture1.load(); } private void loadGameFonts() { FontFactory.setAssetBasePath("font/"); // final ITexture mainFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA); font = FontFactory.createFromAsset(activity.getFontManager(), activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR, activity.getAssets(), "font.ttf", 32f, true, Color.YELLOW_ARGB_PACKED_INT); //font = FontFactory.createStrokeFromAsset(activity.getFontManager(), mainFontTexture, activity.getAssets(), "font.ttf",35, true,5,(float)20, 6); font.load(); Debug.e("GAME FONTS LOADED."); } private void loadGameAudio() { } public void unloadGameTextures() { // TODO (Since we did not create any textures for game scene yet) } //--------------------------------------------- // SPLASH SCENE //--------------------------------------------- public void loadSplashScreen() { BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/"); splashTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 600, 360, TextureOptions.BILINEAR); splash_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(splashTextureAtlas, activity, "Splash.png", 0, 0); splashTextureAtlas.load(); } public void unloadSplashScreen() { splashTextureAtlas.unload(); splash_region = null; } /** * @param engine * @param activity * @param camera * @param vbom * <br><br> * We use this method at beginning of game loading, to prepare Resources Manager properly, * setting all needed parameters, so we can latter access them from different classes (eg. scenes) */ public static void prepareManager(Engine engine, MainActivity activity, BoundCamera camera, VertexBufferObjectManager vbom) { getInstance().engine = engine; getInstance().activity = activity; getInstance().camera = camera; getInstance().vbom = vbom; } //--------------------------------------------- // GETTERS AND SETTERS //--------------------------------------------- public static ResourcesManager getInstance() { return INSTANCE; } } <file_sep>/src/com/example/akumawrath/Player.java package com.example.akumawrath; import java.io.IOException; import org.andengine.engine.camera.Camera; import org.andengine.engine.handler.timer.ITimerCallback; import org.andengine.engine.handler.timer.TimerHandler; import org.andengine.entity.sprite.AnimatedSprite; import org.andengine.entity.sprite.Sprite; import org.andengine.extension.physics.box2d.PhysicsConnector; import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.opengl.vbo.VertexBufferObjectManager; import org.andengine.util.debug.Debug; import org.andlabs.andengine.extension.physicsloader.PhysicsEditorLoader; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; //import com.example.ResourcesManager; public abstract class Player extends AnimatedSprite { // --------------------------------------------- // VARIABLES // --------------------------------------------- private Body body; private boolean canRun = false; private boolean canStop = false; private int footContacts = 0; int lives = 3; private int click = 0; private PhysicsEditorLoader loader = new PhysicsEditorLoader(); private int speed = 5; // --------------------------------------------- // CONSTRUCTOR // --------------------------------------------- public Player(float pX, float pY, VertexBufferObjectManager vbo, Camera camera, PhysicsWorld physicsWorld) { super(pX, pY, ResourcesManager.getInstance().player_region, vbo); createPhysics(camera, physicsWorld); camera.setChaseEntity(this); setIdle(); } public int getClick(){ return (click); } public void setClick(int count){ click = count; } public PhysicsEditorLoader getLoader(){ return (loader); } public boolean getRunningState(){ return (canRun); } public boolean getIdleState(){ return (canStop); } public int getSpeed(){ return (speed); } public void setSpeed(int factor){ speed = factor; } // --------------------------------------------- // MEMBER FCTS // --------------------------------------------- public abstract void onDie(); private void createPhysics(final Camera camera, PhysicsWorld physicsWorld) { // body = PhysicsFactory.createBoxBody(physicsWorld, this, BodyType.DynamicBody, PhysicsFactory.createFixtureDef(0, 0, 0)); // body.setUserData("player"); // body.setFixedRotation(true); try { loader.setAssetBasePath("xml/"); loader.load(ResourcesManager.getInstance().activity, physicsWorld, "player.xml", this,false, false); } catch (IOException e) { e.printStackTrace(); } physicsWorld.registerPhysicsConnector(new PhysicsConnector(this, loader.getBody("player"), true, false) { @Override public void onUpdate(float pSecondsElapsed) { super.onUpdate(pSecondsElapsed); camera.onUpdate(0.1f); // if (getY() >= 480) // { // onDie(); // } // if (getX() <= 0) // { // loader.getBody("player").setLinearVelocity(new Vector2(0, loader.getBody("player").getLinearVelocity().y)); // canRun = false; // } if (lives != 0){ if (canRun) { loader.getBody("player").setLinearVelocity(new Vector2(speed, loader.getBody("player").getLinearVelocity().y)); } else if (!canRun){ loader.getBody("player").setLinearVelocity(new Vector2(0, loader.getBody("player").getLinearVelocity().y)); } } else{ loader.getBody("player").setLinearVelocity(new Vector2(0, 6f)); // loader.getBody("player").setActive(false); return; } } }); } public void increaseFootContacts() { footContacts++; } public void decreaseFootContacts() { footContacts--; } public void setIdle() { if (canRun && footContacts >= 1 || canStop == false){ Debug.e("player is idle"); final long[] PLAYER_IDLE_ANIMATE = new long[] { 100, 100, 100, 100, 100, 100, 100}; animate(PLAYER_IDLE_ANIMATE, 25, 31, true); canRun = false; canStop =true; click = 0; } } public void setWalking() { if (!canRun && footContacts >= 1 ){ final long[] PLAYER_ANIMATE = new long[] { 100, 100, 100,100 ,100 ,100,100 ,100 }; animate(PLAYER_ANIMATE, 0, 7, true); canRun = true; click = 0; } } public void setRunning() { canRun = true; final long[] PLAYER_RUN_ANIMATE = new long[] { 100, 100, 100, 100, 100, 100}; animate(PLAYER_RUN_ANIMATE, 32, 37, true); } public void setJumping(int click) { if (footContacts < 1 && click > 2) { return; } Debug.e("les clicks sont au nombre de " + click); // canRun = false; loader.getBody("player").setLinearVelocity(new Vector2( loader.getBody("player").getLinearVelocity().x, -9)); final long[] PLAYER_JUMP_ANIMATE = new long[] { 100, 100, 100, 100, 100, 100, 100, 100, 100}; final long[] PLAYER_DOUBLE_JUMP_ANIMATE = new long[] { 100, 100, 100, 100, 100, 100, 100, 100}; if (click == 2) { animate(PLAYER_DOUBLE_JUMP_ANIMATE, 17, 24, false); ResourcesManager.getInstance().engine.registerUpdateHandler(new TimerHandler(2.8f, new ITimerCallback() { public void onTimePassed(final TimerHandler pTimerHandler) { pTimerHandler.reset(); Debug.e("passed time : " + footContacts); ResourcesManager.getInstance().engine.unregisterUpdateHandler(pTimerHandler); canStop = false; Debug.e("walking smoothly " + footContacts); setIdle(); } })); }else if (click == 1) { animate(PLAYER_JUMP_ANIMATE, 8, 16, false); ResourcesManager.getInstance().engine.registerUpdateHandler(new TimerHandler(1.4f, new ITimerCallback() { public void onTimePassed(final TimerHandler pTimerHandler) { pTimerHandler.reset(); Debug.e("passed time : " + footContacts); ResourcesManager.getInstance().engine.unregisterUpdateHandler(pTimerHandler); canStop = false; Debug.e("walking smoothly " + footContacts); setIdle(); } })); }else { click = 0; } } public void setDying() { final long[] PLAYER_DIE_ANIMATE = new long[] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}; animate(PLAYER_DIE_ANIMATE, 38, 48, false); lives -= 1; } } <file_sep>/src/com/example/akumawrath/MainActivity.java package com.example.akumawrath; import java.io.IOException; import org.andengine.engine.Engine; import org.andengine.engine.LimitedFPSEngine; import org.andengine.engine.camera.BoundCamera; import org.andengine.engine.camera.Camera; import org.andengine.engine.handler.timer.ITimerCallback; import org.andengine.engine.handler.timer.TimerHandler; import org.andengine.engine.options.EngineOptions; import org.andengine.engine.options.ScreenOrientation; import org.andengine.engine.options.WakeLockOptions; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; import org.andengine.entity.scene.Scene; import org.andengine.input.touch.controller.MultiTouch; import org.andengine.ui.activity.BaseGameActivity; import android.view.KeyEvent; import android.widget.Toast; public class MainActivity extends BaseGameActivity { private BoundCamera camera; private ResourcesManager resourcesManager; public int CAMERA_WIDTH = 800; public int CAMERA_HEIGHT = 480; private boolean mPlaceOnScreenControlsAtDifferentVerticalLocations = false; @Override public Engine onCreateEngine(EngineOptions pEngineOptions) { return new LimitedFPSEngine(pEngineOptions, 60); } public EngineOptions onCreateEngineOptions() { camera = new BoundCamera(0, 0, 800, 480); EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(800, 480), this.camera); engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true); engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON); engineOptions.getTouchOptions().setNeedsMultiTouch(true); if(MultiTouch.isSupported(this)) { if(MultiTouch.isSupportedDistinct(this)) { //Toast.makeText(this, "MultiTouch detected --> Both controls will work properly!", Toast.LENGTH_SHORT).show(); } else { this.mPlaceOnScreenControlsAtDifferentVerticalLocations = true; //Toast.makeText(this, "MultiTouch detected, but your device has problems distinguishing between fingers.\n\nControls are placed at different vertical locations.", Toast.LENGTH_LONG).show(); } } else { //Toast.makeText(this, "Sorry your device does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)\n\nControls are placed at different vertical locations.", Toast.LENGTH_LONG).show(); } return engineOptions; } public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback) throws IOException { ResourcesManager.prepareManager(mEngine, this, camera, getVertexBufferObjectManager()); resourcesManager = ResourcesManager.getInstance(); pOnCreateResourcesCallback.onCreateResourcesFinished(); } public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback) throws IOException { SceneManager.getInstance().createSplashScene(pOnCreateSceneCallback); } public void onPopulateScene(Scene pScene, OnPopulateSceneCallback pOnPopulateSceneCallback) throws IOException { mEngine.registerUpdateHandler(new TimerHandler(2f, new ITimerCallback() { public void onTimePassed(final TimerHandler pTimerHandler) { mEngine.unregisterUpdateHandler(pTimerHandler); SceneManager.getInstance().createMenuScene(); } })); pOnPopulateSceneCallback.onPopulateSceneFinished(); } @Override protected void onDestroy() { super.onDestroy(); System.exit(0); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { SceneManager.getInstance().getCurrentScene().onBackKeyPressed(); } return false; } public int getHeight() { return (CAMERA_HEIGHT); } public int getWidth() { return (CAMERA_WIDTH); } }
b661b4b3359fd4d3e997357c47ee35060b853525
[ "Java" ]
6
Java
jbsselim972/AkumaWrath
ef98084fd343e50ec39b9da3ac2a2f35141908cd
cbef5125ec3239181817734f378bed3b5e1c311a
refs/heads/master
<repo_name>xiaoyudai/H2O-RuleEnsemble<file_sep>/src/rfR2HTML.R # AUTHOR: <NAME>, <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/rfExport.R")) source(file.path(REGO_HOME, "/src/rfRulesIO.R")) library(R2HTML) library(ROCR, verbose = FALSE, quietly=TRUE, warn.conflicts = FALSE) WriteHTML <- function(rego_Rules, conf, model.path, out.path = model.path, rfmod, y, y.hat) { # Writes an HTML page with information about a RuleFit model. Page includes # variable importance table, rules, training confusion matrix, training ROC # curve, etc. # # Args: # model.path : rulefit model location (content generated by # ExportModel() function) # conf : html configuration parameters # out.path : String naming the location to write to (default # is model.path/R2HTML) # rfmodel : glm on rules and linear terms (a H2O glm model object, usually LASSO) # y: response vector # y.hat: prediction on response # # Returns: # None. kPlotWidth <- 620 kPlotHeight <- 480 if (out.path == model.path) { out.path <- file.path(out.path, "R2HTML") } # Create output directory (if appropriate) if (!file.exists(out.path)) { dir.create(out.path) } # Initialize HTML report html.file <- HTMLInitFile(out.path, conf$html.fname, Title = conf$html.title, BackGroundColor = "#BBBBEE") HTML.title(conf$html.title) # Read variable importance table vi.df <- read.table(file.path(model.path, kMod.varimp.fname), header = F, sep = "\t") colnames(vi.df) <- c("Importance", "Variable") # ... filter out low importance entries i.zero.imp <- which(vi.df$Importance < conf$html.min.var.imp) if ( length(i.zero.imp == 1) ) { vi.df <- vi.df[-i.zero.imp, ] } # ... Format float values for easier reading vi.df$Importance <- sprintf("%.1f", vi.df$Importance) # Write out var imp HTML(vi.df, caption = "Global Variable Importance", row.names = F) # Read model rules rules <- rego_Rules rules.df <- PrintRules(rules, x.levels.fname = file.path(model.path, kMod.x.levels.fname), file = NULL) if (!setequal(colnames(rules.df), c("type", "supp.std", "coeff", "importance", "def"))) { error(logger, "WriteHTML: Rules header mismatch") } # ... filter out low importance entries i.zero.imp <- which(rules.df$importance < conf$html.min.rule.imp) if ( length(i.zero.imp == 1) ) { rules.df <- rules.df[-i.zero.imp, ] } # ... Rename column to more verbose values colnames(rules.df) <- c("Rule", "Support (or std)", "Coefficient", "Importance", "Definition") rules.df$Rule <- 1:nrow(rules.df) # ... Replace 'AND' with '&' in rule strings for easier reading rules.df$Definition <- gsub(" AND ", " & ", rules.df$Definition) # ... Format float values for easier reading rules.df$Importance <- sprintf("%.1f", rules.df$Importance) rules.df$Coefficient <- sprintf("%.3f", rules.df$Coefficient) # Write out rules HTML(rules.df, caption = "Rule Ensemble Model", row.names = F, innerBorder = 1) # model metric summary if(rfmod@allparameters$family == "binomial"){ # classification mse = h2o.mse(rfmod) r2 = h2o.r2(rfmod) logloss = h2o.logloss (rfmod) mpce = h2o.mean_per_class_error(rfmod) auc = h2o.auc(rfmod) nd = h2o.null_deviance(rfmod) rd = h2o.residual_deviance(rfmod) aic = h2o.aic(rfmod) metric.df = data.frame(cbind(c("MSE", "R2", "LogLoss", "Mean Per-Class Error", "AUC", "Null Deviance", "Residual Deviance", "AIC"), c(mse, r2, logloss, mpce, auc, nd, rd, aic))) colnames(metric.df) = c("metric", "value") } else { # regression mse = h2o.mse(rfmod) r2 = h2o.r2(rfmod) mrd = h2o.mean_residual_deviance(rfmod) nd = h2o.null_deviance(rfmod) ndf = h2o.null_dof(rfmod) rd = h2o.residual_deviance(rfmod) rdf = h2o.residual_dof(rfmod) aic = h2o.aic(rfmod) metric.df = data.frame(cbind(c("MSE", "R2", "Mean Residual Deviance", "Null Deviance", "Null D.o.F", "Residual Deviance", "Residual D.o.F", "AIC"), c(mse, r2, mrd, nd, ndf, rd, rdf, aic))) colnames(metric.df) = c("metric", "value") } # Write out model metric HTML(metric.df, caption = "Model Performance", row.names = F, innerBorder = 1) # # # test error and ROC # # Process y vs yHat according to model type # # if (length(unique(y)) == 2) { # # "classification" mode... build confusion table # conf.m <- table(y, sign(y.hat)) # stopifnot("-1" %in% rownames(conf.m)) # stopifnot("1" %in% rownames(conf.m)) # TN <- ifelse("-1" %in% colnames(conf.m), conf.m["-1", "-1"], 0) # TP <- ifelse("1" %in% colnames(conf.m), conf.m["1","1"], 0) # train.acc <- 100*(TN+TP)/sum(conf.m) # # Write out table # HTML(conf.m, caption = sprintf("Training Confusion Matrix (accuracy: %.2f%%)", train.acc), # innerBorder = 1) # # Generate ROC plot # # pred <- prediction(y.hat, y) # # perf <- performance(pred, "tpr", "fpr") # # plot.fname <- "ROC.png" # # png(file = file.path(out.path, plot.fname), width=kPlotWidth, height=kPlotHeight) # # plot(perf, colorize=T, main="") # # lines(x=c(0, 1), y=c(0,1)) # # dev.off() # # auc.value <- unlist(slot(performance(pred,"auc"), "y.values")) # # HTMLInsertGraph(plot.fname, Caption=sprintf("Training ROC curve. AUC:%.4f\n", auc.value), WidthHTML=kPlotWidth, HeightHTML=kPlotHeight) # # info(logger, sprintf("AUC:%.4f", auc.value)) # } else { # # "regression" mode... create data-frame with simple AAE meassure # re.train.error <- sum(abs(y.hat - y))/length(y) # med.train.error <- sum(abs(y - median(y)))/length(y) # aae.train <- re.train.error / med.train.error # error.df <- data.frame(cbind(c("RE", "Median ", "ratio"), # c(round(re.train.error, 4), round(med.train.error, 4), round(aae.train, 2)))) # colnames(error.df) <- c("Model", "Error") # HTML(error.df, caption = "Training Error (Unweighted)", row.names = F, col.names = F) # } # End report HTMLEndFile() } WriteHTMLSinglePlot <- function(conf, model.path, vars = NULL, out.path = model.path, do.restore = FALSE, xmiss = 9.0e30) { # Writes an HTML page with single variable partial dependence plots for a given # RuleFit model. # # Args: # conf : html configuration parameters # model.path : rulefit model location (content generated by # ExportModel() function) # vars : vector of variable identifiers (column names) # specifying selected variables to be plotted. If NULL, # variable names are taken from varimp table. # out.path : String naming the location to write to (default # is model.path/R2HTML/singleplot # do.restore : whether or not a model restore is needed -- e.g, not # necessary if called inmediatedly after a model build. # Returns: # None. AddQuantileJitter <- function(q) { # Add a small amount of noise to given numeric vector, assumed to represent # quantiles of a variable, when adjacent values are equal. set.seed(123) q.rle <- rle(q) out.q <- c() for (i in seq(along=q.rle$lengths)) { num.eq <- q.rle$lengths[i] if (num.eq > 1) { tmp.q <- rep(q.rle$values[i], num.eq) if ( q.rle$values[i] > 1) { tmp.q <- sort(jitter(tmp.q, factor = 0.75)) } else { # small value... do jittering by hand i.mid <- ceiling(num.eq/2) jitter.amount <- 0.005 * (1:num.eq - i.mid) tmp.q <- tmp.q + jitter.amount } } else { tmp.q <- c(q.rle$values[i]) } out.q <- c(out.q, tmp.q) } return(out.q) } GetRugQuantiles <- function(x, var, xmiss, do.jitter = TRUE) { # Computes quantiles for generating a "rug" (skips NA in calculation). # Args: # x : "matrix" -- e.g., from model restore # var : column name in x for whcih quantiles are to be computed # xmiss : NA value # do.jitter : whether or not "jitter" should be added to differentiate # equal quantile values # Returns: # list(quant:quantile values, na.rate: number of NAs as percentage quant <- NULL na.rate <- NULL i.col <- grep(paste("^", var, "$", sep = ""), colnames(x), perl=T) if ( length(i.col) > 0 ) { which.NA <- which(x[,i.col] == xmiss) na.rate <- round(100*length(which.NA)/nrow(x), 1) if (length(which.NA) < nrow(x)) { quant <- quantile(x[, i.col], na.rm = T, probs = seq(0.1, 0.9, 0.1)) if (do.jitter) { quant <- AddQuantileJitter(quant) } } } return(list(quant = quant, na.rate = na.rate)) } if (out.path == model.path) { out.path <- file.path(out.path, "R2HTML", "singleplot") } # Create output directory (if appropriate) if (!file.exists(out.path)) { dir.create(out.path) } # Load & restore model mod <- LoadModel(model.path) ok <- 1 if (do.restore) { tryCatch(rfrestore(mod$rfmod, mod$x, mod$y, mod$wt), error = function(err){ok <<- 0}) if (ok == 0) { error(logger, "WriteHTMLSinglePlot: got stuck in rfrestore") } } # Load levels x.levels <- as.data.frame(do.call("rbind", ReadLevels(file.path(model.path, kMod.x.levels.fname)))) if (ncol(x.levels) != 2 || any(colnames(x.levels) != c("var", "levels"))) { error(logger, "WriteHTMLSinglePlot: problem reading level info") } else { var.names <- x.levels[, 1] x.levels <- x.levels[, 2] names(x.levels) <- var.names } # Initialize HTML report html.file <- HTMLInitFile(out.path, conf$html.singleplot.fname, Title = conf$html.title, BackGroundColor = "#BBBBEE") HTML.title(conf$html.singleplot.title) # Which variables are to be plotted? # ... read variable importance table vi.df <- read.table(file.path(model.path, kMod.varimp.fname), header = F, sep = "\t") colnames(vi.df) <- c("Importance", "Variable") if (is.null(vars)) { # ... pick subset from varimp list # ... ... first, filter out low importance entries min.var.imp <- max(conf$html.min.var.imp, 1.0) i.zero.imp <- which(vi.df$Importance < min.var.imp) if ( length(i.zero.imp == 1) ) { vi.df <- vi.df[-i.zero.imp, ] } nvars <- min(conf$html.singleplot.nvars, nrow(vi.df)) vars <- vi.df$Variable[1:nvars] } else { nvars <- length(vars) if (length(intersect(vars, vi.df$Variable)) != nvars) { error(logger, "WriteHTMLSinglePlot: variable name mismatch") } } # Generate plots for (var in vars) { plot.fname <- paste(var, "png", sep = ".") plot.width <- 620 plot.height <- 480 cat.vals <- NULL rug.vals <- NULL rug.cols <- NULL # Get levels, if this is a categorical variables. Get deciles, if continuous. if (!is.null(x.levels[var][[1]])) { cat.vals <- sapply(x.levels[var][[1]], substr, 1, 10, USE.NAMES = F) if (length(cat.vals) > 40 ) { plot.width <- 920 } plot.caption <- var } else { rug.out <- GetRugQuantiles(mod$x, var, xmiss) rug.vals <- rug.out$quant if (!is.null(rug.vals)) { rug.cols <- rainbow(length(rug.vals)) } # Insert NA rate in caption plot.caption <- paste(var, " (NAs: ", rug.out$na.rate, "%)", sep="") } png(file = file.path(out.path, plot.fname), width=plot.width, height=plot.height) # tryCatch(singleplot(var, catvals=cat.vals, rugvals=rug.vals, rugcols=rug.cols), # error = function(err){ok <<- 0}) tryCatch(singleplot(var, catvals=cat.vals), error = function(err){ok <<- 0}) if (ok == 0) { error(logger, "WriteHTMLSinglePlot: got stuck in singleplot") } dev.off() HTMLInsertGraph(plot.fname, Caption=plot.caption, WidthHTML=plot.width, HeightHTML=plot.height) } # End report HTMLEndFile() } <file_sep>/src/winsorize.R # AUTHOR: <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/logger.R")) winsorize <- function(x, beta = 0.025) { # Return l(x) = min(delta_+, max(delta_-, x)) where delta_- and delta_+ are # the beta and (1 - beta) quantiles of the data distribution {x_i}. The # value for beta reflects ones prior suspicions concerning the fraction of # such outliers. x.n <- length(x) if ( beta < 0 || beta > 0.5 ) { error(logger, paste("winsorize: invalid argument beta =", beta)) } if ( length(x) < 1 || length(which(is.na(x) == FALSE)) == 0) { error(logger, paste("winsorize: invalid argument x -- length =", length(x), "NAs =", length(which(is.na(x))))) } quant <- quantile(x, probs = c(beta, 1.0 - beta), na.rm = T) x.min2keep <- quant[1] x.max2keep <- quant[2] x.copy <- x x.copy[which(x < x.min2keep)] <- x.min2keep x.copy[which(x > x.max2keep)] <- x.max2keep return(list(x = x.copy, min2keep = x.min2keep, max2keep = x.max2keep)) } <file_sep>/src/rfAPI.R # AUTHOR: <NAME>, <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/logger.R")) # source(file.path(REGO_HOME, "/lib/RuleFit/rulefit.r")) DefaultRFContext <- function() { # Populates a list of configuration parameters, with names and values as used # by RuleFit3. rf.ctxt <- vector(mode='list') rf.ctxt$xmiss <- 9.0e30 rf.ctxt$rfmode <- "regress" rf.ctxt$sparse <- 1 rf.ctxt$test.reps <- 0 rf.ctxt$test.fract <- 0.2 rf.ctxt$mod.sel <- 2 rf.ctxt$model.type <- "both" rf.ctxt$tree.size <- 4 rf.ctxt$max.rules <- 2000 rf.ctxt$max.trms <- 500 rf.ctxt$costs <- c(1,1) rf.ctxt$trim.qntl <- 0.025 rf.ctxt$inter.supp <- 3.0 rf.ctxt$memory.par <- 0.1 rf.ctxt$conv.thr <- 1.0e-3 rf.ctxt$mem.tree.store <- 10000000 rf.ctxt$mem.cat.store <- 1000000 rf.ctxt$quiet <- TRUE # new for h2o rf.ctxt$regularization.alpha <- 1 rf.ctxt$regularization.lambda <- NULL rf.ctxt$data.trim.quantile <- 0.025 rf.ctxt$pd.sample.size <- 500 rf.ctxt$qntl <- 0.025 rf.ctxt$max.var.vals <- 40 return(rf.ctxt) } InitRFContext <- function(model.conf.fname, data.conf) { # Parses a given configuration file, and uses it to initialize an RF "context." # An "RF Context" is just a verbose version of RuleFit's config param set needed # to run it. # # Args: # model.conf.fname: model configuration file name # # Returns: # A list of <param name, param value> pairs kKnownParamNames <- c("rf.platform", "rf.working.dir", "rf.export.dir", "task", "model.type", "model.max.rules", "model.max.terms", "te.tree.size", "te.sample.fraction", "te.interaction.suppress", "te.memory.param", "sparsity.method", "score.criterion", "crossvalidation.num.folds", "crossvalidation.fold.size", "misclassification.costs", "data.trim.quantile", "data.NA.value", "convergence.threshold", "mem.tree.store", "mem.cat.store", "elastic.net.param", "pd.sample.size", "qntl", "max.var.vals", "regularization.alpha", "regularization.lambda", "ip", "port", "nthreads") rf.ctxt <- DefaultRFContext() # Read config file (two columns assumed: 'param' and 'value') tmp <- read.table(model.conf.fname, header=T, as.is=T) conf <- as.list(tmp$value) names(conf) <- tmp$param # Do we recognize all given param names? for (param in names(conf)) { if (!(param %in% kKnownParamNames)) { warn(logger, paste("Unrecognized parameter name:", param)) } } # Installation info # ...Auto-detect the platform: rf.ctxt$platform <- switch(.Platform$OS.type , windows = "windows" , unix = switch(Sys.info()["sysname"] , Linux = "linux" , Darwin = "mac")) if (is.null(rf.ctxt$platform)) error(logger, "Unable to detect platform") # ...path to RF working directory if (!("rf.working.dir" %in% names(conf))) { # Try to get parameter from the env conf$rf.working.dir <- Sys.getenv("RF_WORKING_DIR") } if (substr(conf$rf.working.dir, 1, 2) == "./") { # Avoid relative paths conf$rf.working.dir <- file.path(getwd(), conf$rf.working.dir) } if (file.access(conf$rf.working.dir) != 0) { error(logger, paste("You need to specify a valid RF working dir...", conf$rf.working.dir, "isn't good")) } else { rf.ctxt$working.dir <- conf$rf.working.dir } # ...path to RF export directory if (!("rf.export.dir" %in% names(conf))) { conf$rf.export.dir <- file.path(conf$rf.working.dir, "export") } if (!(file.exists(conf$rf.export.dir))) { dir.create(conf$rf.export.dir) } if (file.access(conf$rf.export.dir) != 0) { error(logger, paste("You need to specify a valid RF export dir...", conf$rf.export.dir, "isn't good")) } else { rf.ctxt$export.dir <- conf$rf.export.dir } # Regression or classification task? if (!("task" %in% names(conf))) { error(logger,"You need to specify a 'task' type: 'regression' or 'classification'") } else if (conf$task == "regression") { rf.ctxt$rfmode <- "regress" } else if (conf$task == "classification") { rf.ctxt$rfmode <- "class" } else { error(logger, paste("Unrecognized 'task' type:", conf$task, " ... expecting: 'regression' or 'classification'")) } # Model specification # ... type # if (!("model.type" %in% names(conf)) | # !(conf$model.type %in% c("linear", "rules", "both"))) { # error(logger, "You need to specify a model type: 'linear', 'rules' or 'both'") # } else { # rf.ctxt$model.type <- conf$model.type # } # ...number of rules generated for regression posprocessing if ("model.max.rules" %in% names(conf)) { rf.ctxt$max.rules <- as.numeric(conf$model.max.rules) } # ...maximum number of terms selected for final model if ("model.max.terms" %in% names(conf)) { rf.ctxt$max.trms <- as.numeric(conf$model.max.terms) } # Tree Ensemble control # ...average number of terminal nodes in generated trees if ("te.tree.size" %in% names(conf)) { rf.ctxt$tree.size <- as.numeric(conf$te.tree.size) } # ...fraction of randomly chosen training observations used to produce each tree if ("te.sample.fraction" %in% names(conf)) { rf.ctxt$samp.fract <- as.numeric(conf$te.sample.fraction) } # ...incentive factor for using fewer variables in tree based rules if ("te.interaction.suppress" %in% names(conf)) { rf.ctxt$inter.supp <- as.numeric(conf$te.interaction.suppress) } # ... learning rate applied to each new tree when sequentially induced if ("te.memory.param" %in% names(conf)) { rf.ctxt$memory.par <- as.numeric(conf$te.memory.param) } # Regularization (postptocessing) control if (!("sparsity.method" %in% names(conf)) | !(conf$sparsity.method %in% c("Lasso", "Lasso+FSR", "FSR", "ElasticNet"))) { error(logger, "You need to specify a sparsity method: 'Lasso', 'Lasso+FSR', 'FSR' or 'ElasticNet'") } else if (conf$sparsity.method == "Lasso") { rf.ctxt$sparse <- 1 } else if (conf$sparsity.method == "Lasso+FSR") { rf.ctxt$sparse <- 2 } else if (conf$sparsity.method == "FSR") { rf.ctxt$sparse <- 3 } else if (conf$sparsity.method == "ElasticNet") { if ("elastic.net.param" %in% names(conf)) { rf.ctxt$sparse <- as.numeric(conf$elastic.net.param) } else { error(logger, "For 'ElasticNet' sparsity method, you need to specify 'elastic.net.param'") } } # Model selection # ...loss/score criterion # if (!("score.criterion" %in% names(conf)) | # !(conf$score.criterion %in% c("1-AUC", "AAE", "LS", "Misclassification"))) { # error(logger, "You need to specify a score criterion: '1-AUC', 'AAE', 'LS' or 'Misclassification'") # } else if (conf$score.criterion == "1-AUC" & conf$task == "classification") { # rf.ctxt$mod.sel <- 1 # } else if (conf$score.criterion == "AAE" & conf$task == "regression") { # rf.ctxt$mod.sel <- 1 # } else if (conf$score.criterion == "LS") { # rf.ctxt$mod.sel <- 2 # } else if (conf$score.criterion == "Misclassification" & conf$task == "classification") { # rf.ctxt$mod.sel <- 3 # } else { # error(logger, paste("Invalid score criterion specification -- task: '", # conf$task, "', score.criterion: '", conf$score.criterion, "'", sep = "")) # } # ...number of cross-validation replications if ("crossvalidation.num.folds" %in% names(conf)) { rf.ctxt$test.reps <- as.numeric(conf$crossvalidation.num.folds) } # ...fraction of observations used it test group if ("crossvalidation.fold.size" %in% names(conf)) { rf.ctxt$test.fract <- as.numeric(conf$crossvalidation.fold.size) } # ...misclassificarion costs if ("misclassification.costs" %in% names(conf)) { rf.ctxt$costs <- c() rf.ctxt$costs[1] <- as.numeric(strsplit(conf$misclassification.costs, ",")[[1]][1]) rf.ctxt$costs[2] <- as.numeric(strsplit(conf$misclassification.costs, ",")[[1]][2]) } # Data preprocessing # ...linear variable winsorizing factor if ("data.trim.quantile" %in% names(conf)) { rf.ctxt$trim.qntl <- as.numeric(conf$data.trim.quantile) } # ...numeric value indicating missingness in predictors if ("data.NA.value" %in% names(conf)) { rf.ctxt$xmiss <- as.numeric(conf$data.NA.value) } # Iteration Control # ...convergence threshold for regression postprocessing if ("convergence.threshold" %in% names(conf)) { rf.ctxt$conv.thr <- as.numeric(conf$convergence.threshold) } # Memory management # ...size of internal tree storage (decrease in response to allocation error; # increase value for very large values of max.rules and/or tree.size) if ("mem.tree.store" %in% names(conf)) { rf.ctxt$mem.tree.store <- as.numeric(conf$mem.tree.store) } # ... size of internal categorical value storage (decrease in response to # allocation error; increase for very large values of max.rules and/or # tree.size in the presence of many categorical variables with many levels) if ("mem.cat.store" %in% names(conf)) { rf.ctxt$mem.cat.store <- as.numeric(conf$mem.cat.store) } # Print RF's progress info rf.ctxt$quiet <- ifelse(data.conf$log.level <= kLogLevelDEBUG, FALSE, TRUE) # new for H2O if ("regularization.alpha" %in% names(conf)) { rf.ctxt$regularization.alpha <- as.numeric(conf$regularization.alpha) } if ("regularization.lambda" %in% names(conf)) { rf.ctxt$regularization.lambda <- as.numeric(conf$regularization.lambda) } if ("data.trim.quantile" %in% names(conf)) { rf.ctxt$data.trim.quantile <- as.numeric(conf$data.trim.quantile) } if ("pd.sample.size" %in% names(conf)) { rf.ctxt$pd.sample.size <- as.numeric(conf$pd.sample.size) } if ("qntl" %in% names(conf)) { rf.ctxt$qntl <- as.numeric(conf$qntl) } if ("max.var.vals" %in% names(conf)) { rf.ctxt$max.var.vals <- as.numeric(conf$max.var.vals) } return(rf.ctxt) } TrainRF <- function(x, y, wt, rf.context, cat.vars=NULL, not.used=NULL) { # Invokes RuleFit model building procedure. # # Args: # x: input data frame # y: response vector # wt: observation weights # cat.vars: categorical variables (column numbers or names) # rf.context: configuration parameters # # Returns: # RuleFit model object dbg(logger, "TrainRF:") ok <- 1 if ("samp.fract" %in% names(rf.context)) { # User-specified "samp.fract" tryCatch(rfmod <- rulefit(x, y, wt, cat.vars, not.used ,xmiss = rf.context$xmiss ,rfmode = rf.context$rfmode ,sparse = rf.context$sparse ,test.reps = rf.context$test.reps ,test.fract = rf.context$test.fract ,mod.sel = rf.context$mod.sel ,model.type = rf.context$model.type ,tree.size = rf.context$tree.size ,max.rules = rf.context$max.rules ,max.trms = rf.context$max.trms ,costs = rf.context$costs ,trim.qntl = rf.context$trim.qntl ,samp.fract = rf.context$samp.fract ,inter.supp = rf.context$inter.supp ,memory.par = rf.context$memory.par ,conv.thr = rf.context$conv.thr ,quiet = rf.ctxt$quiet ,tree.store = rf.context$mem.tree.store ,cat.store = rf.context$mem.cat.store), error = function(err){ok <<- 0; dbg(logger, paste("Error Message from RuleFit:", err))}) if (ok == 0) { error(logger, "TrainRF: got stuck in rulefit") } } else { # No mention of "samp.fract"... let rulefit set it based on data size tryCatch(rfmod <- rulefit(x, y, wt, cat.vars, not.used ,xmiss = rf.context$xmiss ,rfmode = rf.context$rfmode ,sparse = rf.context$sparse ,test.reps = rf.context$test.reps ,test.fract = rf.context$test.fract ,mod.sel = rf.context$mod.sel ,model.type = rf.context$model.type ,tree.size = rf.context$tree.size ,max.rules = rf.context$max.rules ,max.trms = rf.context$max.trms ,costs = rf.context$costs ,trim.qntl = rf.context$trim.qntl ,inter.supp = rf.context$inter.supp ,memory.par = rf.context$memory.par ,conv.thr = rf.context$conv.thr ,quiet = rf.ctxt$quiet ,tree.store = rf.context$mem.tree.store ,cat.store = rf.context$mem.cat.store), error = function(err){ok <<- 0; dbg(logger, paste("Error Message from RuleFit:", err))}) if (ok == 0) { error(logger, "TrainRF: got stuck in rulefit") } } return(rfmod) } <file_sep>/bin/runModel.sh #! /bin/sh #=================================================================================== # FILE: runModel.sh # # USAGE: runModel.sh --m=<model path> --d=<Data spec file> --o=<H2O config file> # # DESCRIPTION: Computes predictions using a previously built RuleFit model on the # specified data. #=================================================================================== USAGESTR="usage: runModel.sh --m=<Model path> --d=<Data spec file>" # Parse arguments for i in $* do case $i in --m=*) MODEL_PATH=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; --d=*) DATA_CONF=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; *) # unknown option echo $USAGESTR exit 1 ;; esac done # Validate command-line arguments if [ -z "$MODEL_PATH" -o -z "$DATA_CONF" ]; then echo $USAGESTR exit 1 fi # Invoke R code $REGO_HOME/src/rfPredict_main.R -m ${MODEL_PATH} -d ${DATA_CONF} <file_sep>/src/rfTrain_main.R #!/usr/local/bin/Rscript ############################################################################### # FILE: rfTrain_main.R # # USAGE: rfTrain_main.R -d DATA.conf -m MODEL.conf -o H2O.conf # # DESCRIPTION: # Provides a "batch" interface to the RuleFit statistical model building # program. RuleFit refers to Professor <NAME>'s implementation of Rule # Ensembles, an interpretable type of ensemble model where the base-learners # consist of conjunctive rules derived from decision trees. # # ARGUMENTS: # DATA.conf: the data configuration file specifying options such as # where the data is coming from, what column corresponds to # the target, etc. # MODEL.conf: the model configuration file specifying options such as the # type of model being fit, the criteria being optimized, etc. # H2O.conf: the H2O configuartion file specifying options such as the ip, # number of threads, port, etc. # # REQUIRES: # REGO_HOME: environment variable pointing to the directory where you # have placed this file (and its companion ones) # RF_HOME: environment variable pointing to appropriate RuleFit # executable -- e.g., export RF_HOME=$REGO_HOME/lib/RuleFit/mac # # AUTHOR: <NAME>, <NAME> ############################################################################### REGO_HOME <- Sys.getenv("REGO_HOME") source(file.path(REGO_HOME, "/src/logger.R")) source(file.path(REGO_HOME, "/src/rfAPI.R")) source(file.path(REGO_HOME, "/src/rfTrain.R")) source(file.path(REGO_HOME, "/src/rfR2HTML.R")) source(file.path(REGO_HOME, "/src/rfGraphics.R")) source(file.path(REGO_HOME, "/src/rfStartH2O.R")) source(file.path(REGO_HOME, "/src/rfLoadData.R")) source(file.path(REGO_HOME, "/src/rfTrainModel_h2o.R")) library(getopt) library(RODBC) ValidateConfigArgs <- function(conf) { # Validates and initializes configuration parameters. # # Args: # conf: A list of <param name, param value> pairs # Returns: # A list of <param name, param value> pairs # Must have a valid data source type stopifnot("data.source.type" %in% names(conf)) stopifnot(conf$data.source.type %in% c("csv", "db", "rdata", "hdfs")) if (conf$data.source.type == "db") { stopifnot("db.dsn" %in% names(conf) && "db.name" %in% names(conf) && "db.type" %in% names(conf) && "db.tbl.name" %in% names(conf)) } else if (conf$data.source.type == "csv") { stopifnot("csv.path" %in% names(conf) && "csv.fname" %in% names(conf)) if ("csv.sep" %in% names(conf)) { conf$csv.sep <- as.character(conf$csv.sep) } else { conf$csv.sep <- "," } } else if (conf$data.source.type == "hdfs") { stopifnot("hdfs.server" %in% names(conf) && "hdfs.fname" %in% names(conf)) } else { # rdata stopifnot(c("rdata.path", "rdata.fname") %in% names(conf)) } # Must have column type specification, unless data source type is # "rdata" stopifnot(conf$data.source.type == "rdata" || "col.types.fname" %in% names(conf)) ## Set defaults for the options that were not specified if (!("col.y" %in% names(conf))) { conf$col.y <- "y" } if (!("db.tbl.maxrows" %in% names(conf))) { conf$db.tbl.maxrows <- "ALL" } else { conf$db.tbl.maxrows <- as.numeric(conf$db.tbl.maxrows) } if (!("col.weights" %in% names(conf)) || nchar(conf$col.weights) == 0) { conf$col.weights <- NULL } if (!("col.id" %in% names(conf)) || nchar(conf$col.id) == 0) { conf$col.id <- NA } if (!("col.skip.fname" %in% names(conf))) { conf$col.skip.fname <- "" } if (!("col.winz.fname" %in% names(conf))) { conf$col.winz.fname <- "" } if (!("na.threshold" %in% names(conf))) { conf$na.threshold <- 0.95 } else { conf$na.threshold <- as.numeric(conf$na.threshold) } if (!("min.level.count" %in% names(conf))) { conf$min.level.count <- 0 } else { conf$min.level.count <- as.numeric(conf$min.level.count) } if (!("do.class.balancing" %in% names(conf))) { conf$do.class.balancing <- FALSE } else { conf$do.class.balancing <- (as.numeric(conf$do.class.balancing) == 1) } if (!("html.min.var.imp" %in% names(conf))) { conf$html.min.var.imp <- 5 } else { conf$html.min.var.imp <- as.numeric(conf$html.min.var.imp) } if (!("html.min.rule.imp" %in% names(conf))) { conf$html.min.rule.imp <- 5 } else { conf$html.min.rule.imp <- as.numeric(conf$html.min.rule.imp) } if ("html.singleplot.fname" %in% names(conf)) { if (!("html.singleplot.title" %in% names(conf))) { conf$html.singleplot.title <- "Dependence Plots:" } if (!("html.singleplot.nvars" %in% names(conf))) { conf$html.singleplot.nvars <- 10 } else { conf$html.singleplot.nvars <- as.integer(conf$html.singleplot.nvars) } } if (!("rand.seed" %in% names(conf))) { conf$rand.seed <- 135711 } else { conf$rand.seed <- as.numeric(conf$rand.seed) } if (!("log.level" %in% names(conf))) { conf$log.level <- kLogLevelDEBUG } else { conf$log.level <- get(conf$log.level) } # partial dependence plot or not if (!("is.pardep" %in% names(conf))) { conf$is.pardep <- 'off' } else { conf$is.pardep <- conf$is.pardep } # Save workspace before training? (for debugging purposes) if (!("save.workspace" %in% names(conf))) { conf$save.workspace <- FALSE } else { conf$save.workspace <- as.logical(as.numeric(conf$save.workspace)) } # H2O cluster init if (!("ip" %in% names(conf))) { conf$ip <- "localhost" } else { conf$ip <- conf$ip } if (!("port" %in% names(conf))) { conf$port <- 54321 } else { conf$port <- as.numeric(conf$port) } if (!("nthreads" %in% names(conf))) { conf$nthreads <- -2 } else { conf$nthreads <- as.numeric(conf$nthreads) } return(conf) } ValidateCmdArgs <- function(opt, args.m) { # Parses and validates command line arguments. # # Args: # opt: getopt() object # args.m: valid arguments spec passed to getopt(). # # Returns: # A list of <param name, param value> pairs kUsageString <- "/path/to/rfTrain_main.R -d <Data configuration file> -m <RF model configuration file> [-l <Log file name>]" # Validate command line arguments if ( !is.null(opt$help) || is.null(opt$data_conf) || is.null(opt$model_conf) ) { self <- commandArgs()[1] cat("Usage: ", kUsageString, "\n") q(status=1); } # Do we have a log file name? "" will send messages to stdout if (is.null(opt$log)) { opt$log <- "" } # Read config file (two columns assumed: 'param' and 'value') tmp <- read.table(opt$data_conf, header=T, as.is=T) conf <- as.list(tmp$value) names(conf) <- tmp$param conf <- ValidateConfigArgs(conf) conf$log.fname <- opt$log return(conf) } GetSQLQueryTemplate <- function(conf) { # Returns a SQL query template string for fetching training data if ("db.query.tmpl" %in% names(conf)) { # User-supplied template sql.query.tmpl <- scan(conf$db.query.tmpl, "character", quiet = T) } else { if (conf$db.type == "SQLServer") { sql.query.tmpl <- " SELECT _MAXROWS_ * FROM _TBLNAME_ " } else { stopifnot(conf$db.type == "Netezza") sql.query.tmpl <- " SELECT * FROM _TBLNAME_ LIMIT _MAXROWS_ " } } return(sql.query.tmpl) } CopyConfigFiles <- function(conf, rf.ctxt) { # Save configuration files with model export directory ok <- 1 if (!file.exists(file.path(rf.ctxt$working.dir,"configuration"))) { ok <- dir.create(file.path(rf.ctxt$working.dir,"configuration")) } if (ok) { ok <- file.copy(from = opt$data_conf, to = file.path(rf.ctxt$working.dir,"configuration")) } if (ok) { ok <- file.copy(from = opt$model_conf, to = file.path(rf.ctxt$working.dir,"configuration")) } if ("col.types.fname" %in% names(conf) && nchar(conf$col.types.fname) > 0 && ok) { ok <- file.copy(from = conf$col.types.fname, to = file.path(rf.ctxt$working.dir,"configuration")) } if ("col.skip.fname" %in% names(conf) && nchar(conf$col.skip.fname) > 0 && ok) { ok <- file.copy(from = conf$col.skip.fname, to = file.path(rf.ctxt$working.dir,"configuration")) } if (ok == 0) { dbg(logger, "CopyConfigFiles: couldn't copy files") } } ############## ## Main # # Grab command-line arguments args.m <- matrix(c( 'data_conf' ,'d', 1, "character", 'model_conf' ,'m', 1, "character", 'log' ,'l', 1, "character", 'help' ,'h', 0, "logical" ), ncol=4,byrow=TRUE) opt <- getopt(args.m) conf <- ValidateCmdArgs(opt, args.m) # Create logging object logger <- new("logger", log.level = conf$log.level, file.name = conf$log.fname) ## Use own version of png() if necessary: if (isTRUE(conf$html.graph.dev == "Bitmap")) { png <- png_via_bitmap if (!CheckWorkingPNG(png)) error(logger, "cannot generate PNG graphics") } else { png <- GetWorkingPNG() if (is.null(png)) error(logger, "cannot generate PNG graphics") } # Load model specification parameters rf.ctxt <- InitRFContext(opt$model_conf, conf) # start H2O rfStartH2O(conf) # Load data data = rfLoadData(conf) # Set global env variables required by RuleFit platform <- rf.ctxt$platform RF_HOME <- Sys.getenv("RF_HOME") RF_WORKING_DIR <- rf.ctxt$working.dir # main function rfTrainModel_h2o(data, conf, rf.ctxt) # Save configuration files with model CopyConfigFiles(conf, rf.ctxt) # # Generate HTML report # if ("html.fname" %in% names(conf)) { # rfmod.stats <- runstats(train.out$rfmod) # WriteHTML(conf, model.path = rf.ctxt$export.dir, rfmod.stats = rfmod.stats) # if ("html.singleplot.fname" %in% names(conf)) { # WriteHTMLSinglePlot(conf, model.path = rf.ctxt$export.dir) # } # } print("Rule Ensemble completed!") print(paste("See model results in ", RF_WORKING_DIR, "/export/", sep="")) q(status=0) # close h2o cluster h2o.shutdown() print("H2O Cluster Closed")<file_sep>/examples/hdfs/readme.txt $REGO_HOME/bin/trainModel.sh --d=/home/xiaoydai/H2OREgo/examples/hdfs/data.conf --m=/home/xiaoydai/H2OREgo/examples/hdfs/model.conf $REGO_HOME/bin/runModel.sh --m=/home/xiaoydai/H2OREgo/examples/hdfs/output/export/ --d=/home/xiaoydai/H2OREgo/examples/hdfs/test.conf <file_sep>/src/rfStartH2O.R # AUTHOR: <NAME> ############################################################################### library(h2o) rfStartH2O <- function(conf){ h2o.init(ip = conf$ip, port = conf$port, nthreads = conf$nthreads) }<file_sep>/src/rfRulesIO.R # AUTHOR: <NAME>, <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/rfPreproc.R")) # Constants kRuleTypeLinear <- "linear" kRuleTypeSplit <- "split" kSplitTypeContinuous <- "continuous" kSplitTypeCategorical <- "categorical" kSplitTypeDiffer <- "differ" kSplitTypeIsNAorLess <- "isNAorLess" kSplitTypeIsNA <- "isNA" kMinusInf <- -9.9e+35 kPlusInf <- 9.9e+35 kMissing <- 9e+30 kCondIN <- "in" kCondNotIN <- "not" ReadRules <- function(file) { # Reads the given text file, assumed to contain RuleFit-generated rules, # and returns a corresponding list representation. # # Args: # file: a character string or connection (this file is typically # created by the ExportModel() function) # Returns: # A list of <type, supp|std, coeff, imp, splits|var> tuples, # where: # type: "split" or "linear" term # supp: rule support, if "split" term # std: standard deviation of predictor, if "linear" term # coeff: term's coefficient # imp: term's importance # splits: list of one or more splits defining "split" term; can be # <type, var, cond, levels> or <type, var, min, max> # var: predictor name, if "linear" term stopifnot(is.character(file) || inherits(file, "connection")) NextRuleFitToken <- function(file) { # Fetches the next "token" from the given RuleFit rules text file. # # Args: # file: an open file or connection # Returns: # A string. kSep <- "=" # value separator # Skip "space" until beginning of token begunToken <- FALSE aChar <- readChar(file, 1) while (length(aChar) != 0 && begunToken == FALSE && aChar != "") { # skip whitespace while (regexpr("[[:space:]]", aChar) != -1 || aChar == kSep) { aChar <- readChar(file, 1) if ( length(aChar) == 0) break } aToken <- aChar begunToken <- TRUE } if (begunToken) { aChar <- readChar(file, 1) # Until a brace, whitespace, comma, or EOF while (length(aChar) != 0 && aChar != "" && regexpr("[[:space:]]", aChar) == -1 && !aChar %in% c(":", kSep) ) { aToken <- paste(aToken, aChar, sep="") aChar <- readChar(file, 1) } return(list(token=aToken)) } else { return(list(token=NULL)) } } ParseLinearRule <- function(file) { # Parses and returns a "linear" rule from the given RuleFit rules text file. # # Args: # file: an open file or connection # Returns: # A tuple <type="linear", std, coeff, imp, var>. kStdStr <- "std" kCoefficientStr <- "coeff" kImportanceStr <- "impotance" # misspelling is correct # Get variable name res <- NextRuleFitToken(file) ruleVarName <- res$token # Get rule 'std' res <- NextRuleFitToken(file) if (res$token != kStdStr) { error(logger, paste("ParseLinearRule: '", support.str, "' token expected, got: ", res$token)) } res <- NextRuleFitToken(file) ruleStd <- as.numeric(res$token) # Get rule 'coefficient' res <- NextRuleFitToken(file) if (res$token != kCoefficientStr) { error(logger, paste("ParseLinearRule: '", kCoefficientStr, "' token expected, got: ", res$token)) } res <- NextRuleFitToken(file) ruleCoeff <- as.numeric(res$token) # Get rule 'importance' res <- NextRuleFitToken(file) if (res$token != kImportanceStr) { error(logger, paste("ParseLinearRule: '", kImportanceStr, "' token expected, got: ", res$token)) } res <- NextRuleFitToken(file) ruleImp <- as.numeric(res$token) return(list(type="linear", std = ruleStd, coeff = ruleCoeff, imp = ruleImp, var = ruleVarName)) } ParseSplitRule <- function(file, ruleLgth) { # Parse and return a "split" rule from the given RuleFit rules text file. # # Args: # file: an open file or connection # ruleLght: how many vars are in this rule? # # Returns: # A tuple <type="split", supp, coeff, imp, splits> where 'splits' is a # list with tuples of the form <type="continuous", var, min, max> or # <type="categorical", var, cond, levels> or # <type="diff", var, cond, pt> support.str <- "support" kCoefficientStr <- "coeff" kImportanceStr <- "importance" kCont.split.id.str <- "range" kCateg.split.id1.str <- "in" kCateg.split.id2.str <- "not" kDiff.split.id1.str <- "equal" kDiff.split.id2.str <- "un" kCateg.missing <- "0.9000E+31" stopifnot(ruleLgth > 0) # Get rule 'support' res <- NextRuleFitToken(file) if (res$token != support.str) { error(logger, paste("ParseSplitRule: '", support.str, "' token expected, got: ", res$token)) } res <- NextRuleFitToken(file) ruleSupp <- as.numeric(res$token) # Get rule 'coefficient' res <- NextRuleFitToken(file) if (res$token != kCoefficientStr) { error(logger, paste("ParseSplitRule: '", kCoefficientStr, "' token expected, got: ", res$token)) } res <- NextRuleFitToken(file) ruleCoeff <- as.numeric(res$token) # Get rule 'importance' res <- NextRuleFitToken(file) if (res$token != kImportanceStr) { error(logger, paste("ParseSplitRule: '", kImportanceStr, "' token expected, got: ", res$token)) } res <- NextRuleFitToken(file) ruleImp <- as.numeric(res$token) # Get splits splits = vector(mode = "list") splitVarsSeen <- c() iSplit <- 1 res <- NextRuleFitToken(file) while (length(res$token) > 0 && res$token != "Rule") { # Get variable name splitVarName <- res$token # Parse split according to 'type' res <- NextRuleFitToken(file) if (res$token == kCont.split.id.str) { # "Continuous" split... Got range... need min & max res <- NextRuleFitToken(file) splitRangeMin <- as.numeric(res$token) res <- NextRuleFitToken(file) splitRangeMax <- as.numeric(res$token) split <- list(type=kSplitTypeContinuous, var = splitVarName, min = splitRangeMin, max = splitRangeMax) } else if (res$token == kCateg.split.id1.str || res$token == kCateg.split.id2.str) { # "Categorical" split... need levels if (res$token == kCateg.split.id2.str) { categ.cond <- kCateg.split.id2.str } else { categ.cond <- kCateg.split.id1.str } # ...skip until the end of the line readLines(file, n=1, ok=TRUE) # ... soak all levels, assumed to be in one single line level.line <- sub("^[ ]+", "", readLines(file, n = 1), perl=T) level.list.raw <- strsplit(level.line, "[ ]+", perl=T)[[1]] level.list <- c() for (iLevel in level.list.raw) { if (iLevel == kCateg.missing) { level.list <- c(level.list, NA) } else { level.list <- c(level.list, as.integer(iLevel)) } } split <- list(type=kSplitTypeCategorical, var = splitVarName, cond = categ.cond, levels = level.list) } else if (res$token == kDiff.split.id1.str || res$token == kDiff.split.id2.str) { # "Differ" split... need point if (res$token == kDiff.split.id2.str) { differ.cond <- kDiff.split.id2.str res <- NextRuleFitToken(file) } else { differ.cond <- kDiff.split.id1.str } res <- NextRuleFitToken(file) differ.pt <- as.numeric(res$token) split <- list(type=kSplitTypeDiffer, var = splitVarName, cond = differ.cond, pt = differ.pt) } else { error(logger, paste("ParseSplitRule: One of '", kCont.split.id.str, "', '", kCateg.split.id1.str, "', '", kCateg.split.id2.str, "' token expected, got: ", res$token)) } # Save split splits[[iSplit]] <- split iSplit <- iSplit + 1 # Did we get a "new" variable, or one we had seen before? if (length(grep(paste("^", splitVarName, "$", sep = ""), splitVarsSeen, perl=T)) == 0) { splitVarsSeen <- c(splitVarsSeen, splitVarName) } # Get next token res <- NextRuleFitToken(file) } # sometimes we do splits on the same node (as in the tricky type 2 condition in H2O POJO) # Check distinct vars found matched input param # if (length(splitVarsSeen) != ruleLgth) { # error(logger, paste("ParseSplitRule: ruleLgth = ", ruleLgth, " given... found ", length(splitVarsSeen), " variables!")) # } rule <- list(type="split", supp = ruleSupp, coeff = ruleCoeff, imp = ruleImp, splits = splits) return(list(rule=rule, lastToken=res)) } # ----------------------------------------------------------------------- # Open input file if (is.character(file)) { file <- file(file, "r") on.exit(close(file)) } if (!isOpen(file)) { open(file, "r") on.exit(close(file)) } # Read in the header information res <- NextRuleFitToken(file) # Read in rules rules = vector(mode = "list") while (length(res$token) > 0 && res$token == "Rule") { # Get rule number ruleNum <- as.integer(NextRuleFitToken(file)$token) # Parse rule according to 'type' res <- NextRuleFitToken(file) if (res$token == kRuleTypeLinear) { # "Linear" rule rule <- ParseLinearRule(file) # Get next token res <- NextRuleFitToken(file) } else { # "Split" rule ruleLgth <- res$token # ...skip until the end of the line readLines(file, n=1, ok=TRUE) # ... get rule info parseRes <- ParseSplitRule(file, as.integer(ruleLgth)) rule <- parseRes$rule # Get next token... 'ParseSplitRule' already advanced it, so just grab it res <- parseRes$lastToken } rules[[ruleNum]] <- rule } return(rules) } SplitRule2Char <- function(rule, x.levels, x.levels.lowcount) { # Turns a 'split' rule into a human 'readable' string. # # Args: # rule : list of <type="split", supp, coeff, imp, splits= <...>> # tuples, where the split sublist has elements of the form # <type="categorical", var, cond, levels> or # <type="continuous", var, min, max> # x.levels : level info used when rules were built so we can translate # level codes in categorical splits (optional). # x.levels.lowcount : low-count levels collapsed into a single one when # rules were built (optional). # Returns: # A character vector with representation of the rule. kSplit.and.str <- "AND" stopifnot(length(rule) > 0) stopifnot(rule$type == "split") old.o <- options("useFancyQuotes" = FALSE) ContSplit2Char <- function(split) { # Turns a 'continuous' split into a human 'readable' string # # Args: # split : list of the form <type="continuous", var, min, max> # # Returns: # A character vector with one of these strings: "var == NA", # "var != NA", "var <= split-value", "var > split-value", or # "var between split-value-low and split-value-high" if (split$max == kPlusInf) { if (split$min == kMissing) { # range = kMissing plus_inf" ==> "== NA" str <- paste(split$var, "== NA") } else { # range = xxx plus_inf" ==> "> xxx" str <- paste(split$var, ">", split$min) } } else if (split$min == kMinusInf) { if (split$max == kMissing) { # range = kMinusInf kMissing" ==> "!= NA" str <- paste(split$var, "!= NA") } else { # "range = kMinusInf xxx" ==> "<= xxx" str <- paste(split$var, "<=", split$max) } } else if (split$max == kMissing) { # range = xxx kMissing" ==> "> xxx" str <- paste(split$var, ">", split$min) } else if (split$max != kPlusInf && split$min != kMinusInf && split$max != kMissing && split$min != kMissing) { # "range = xxx yyy" ==> ">= xxx and < yyy" str <- paste(split$var, ">=", split$min, "and", split$var, "<", split$max) } else { error(logger, paste("ContSplit2Char: don't know how to print split: ", split)) } return(str) } DifferSplit2Char <- function(split) { # Turns a 'differ' split into a human 'readable' string # # Args: # split : list of the form <type="differ", var, cond, point> # # Returns: # A character vector with one of these strings: "var == point", # or "var != point" if(split$cond == "equal"){ str <- paste(split$var, "==", split$point) } else if(split$cond == "unequal"){ str <- paste(split$var, "!=", split$point) } else { error(logger, paste("DifferSplit2Char: don't know how to print split: ", split)) } return(str) } isNAorLessSplit2Char <- function(split) { # Turns a 'isNAorLess' split into a human 'readable' string # # Args: # split : list of the form <'isNAorLess', var, min, max> # # Returns: # str <- paste(split$var, 'is NULL or', split$var, '<', split$max) return(str) } isNASplit2Char <- function(split) { # Turns a 'isNAorLess' split into a human 'readable' string # # Args: # split : list of the form <'isNA', var, isNA|notNA> # # Returns: if(split$Is == 'isNA'){ str <- paste(split$var, 'is NULL') } else { str <- paste(split$var, 'is not NULL') } return(str) } CategSplit2Char <- function (split, x.levels, x.levels.lowcount) { # Turns a 'categorical' split into a human 'readable' string. # # Args: # split : list of the form <type="categorical", var, cond, levels> # x.levels : (optional) - {<var.name, var.levels>} list # x.levels.lowcount : (optional) - {<var.name, low count levels>} df # # Returns: # A character vector with one of these strings: "var IN (level set)", # or "var NOT IN (level set)" if (is.null(x.levels)) { split.levels.str <- paste(split$levels, collapse=", ") } else { # Substitute level-code... locate var's possible values var.levels <- NULL for (iVar in 1:length(x.levels)) { if (x.levels[[iVar]]$var == split$var) { var.levels <- x.levels[[iVar]]$levels } } if (is.null(var.levels)) { error(logger, paste("CategSplit2Char: Failed to find level data for: '", split$var, "'")) } # Replace each level-code by corresponding level-string for (iLevel in 1:length(split$levels)) { if (is.na(split$levels[iLevel])) { level.str <- NA } else { level.str <- var.levels[split$levels[iLevel]] # Is this a factor with recoded levels? if (!is.null(x.levels.lowcount)) { i.recoded <- grep(paste("^", split$var, "$", sep=""), x.levels.lowcount$var, perl=T) if (length(i.recoded) == 1 && level.str == kLowCountLevelsName) { low.count.levels <- unlist(x.levels.lowcount$levels[i.recoded]) level.str <- paste(lapply(low.count.levels, sQuote), collapse=",") } else { level.str <- sQuote(level.str) } } else { level.str <- sQuote(level.str) } } if (iLevel == 1) { split.levels.str <- level.str } else { split.levels.str <- paste(split.levels.str, level.str, sep = ",") } } } if (split$cond == kCondIN) { str <- paste(split$var, "IN", "(", split.levels.str, ")") } else if (split$cond == kCondNotIN) { str <- paste(split$var, "NOT IN", "(", split.levels.str, ")") } else { error(logger, paste("CategSplit2Char: don't know how to print split: ", split)) } return(str) } # ----------------------------------------------------------------------- splits <- rule$splits nSplits <- length(splits) stopifnot(nSplits > 0) # Build string representation of the rule: conjunction of splits splitStr <- "" for (iSplit in 1:nSplits) { split <- splits[[iSplit]] if (split$type == kSplitTypeContinuous) { if (iSplit == 1) { splitStr <- ContSplit2Char(split) } else { splitStr <- paste(splitStr, kSplit.and.str, ContSplit2Char(split)) } } else if (split$type == kSplitTypeCategorical) { if (iSplit == 1) { splitStr <- CategSplit2Char(split, x.levels, x.levels.lowcount) } else { splitStr <- paste(splitStr, kSplit.and.str, CategSplit2Char(split, x.levels, x.levels.lowcount)) } } else if (split$type == kSplitTypeDiffer) { if (iSplit == 1) { splitStr <- DifferSplit2Char(split) } else { splitStr <- paste(splitStr, kSplit.and.str, DifferSplit2Char(split)) } } else if (split$type == kSplitTypeIsNAorLess) { if (iSplit == 1) { splitStr <- isNAorLessSplit2Char(split) } else { splitStr <- paste(splitStr, kSplit.and.str, isNAorLessSplit2Char(split)) } } else if (split$type == kSplitTypeIsNA) { if (iSplit == 1) { splitStr <- isNASplit2Char(split) } else { splitStr <- paste(splitStr, kSplit.and.str, isNASplit2Char(split)) } } else { error(logger, paste("SplitRule2Char: unknown split type: ", split$type)) } } options("useFancyQuotes" = old.o) return(splitStr) } LinearRule2Char <- function(rule) { # Turns a 'linear' rule into a human 'readable' string. # # Args: # rule : list of the form <type="linear", std, coeff, imp, var> # # Returns: # A character vector with just the variable name if (length(rule) == 0) { error(logger, "LinearRule2Char: 'rule' must not be empty") } if (rule$type != "linear") { error(logger, paste("LinearRule2Char: unexpected rule type: ", rule$type)) } # Simply return var name return(rule$var) } ReadLevels <- function(file) { # Parse and return a list of "levels" for each categorical variable. # # Args: # file - a file name or an open file or connection # Returns: # A list of <variable name, variable levels> pairs if (is.character(file)) { file <- file(file, "r") on.exit(close(file)) } if (!inherits(file, "connection")) error(logger, "ReadLevels: argument `file' must be a character string or connection") if (!isOpen(file)) { open(file, "r") on.exit(close(file)) } # Read in level info levels <- vector(mode = "list") iVar <- 1 while (TRUE) { ## Read one line, which has one of these two forms: ## varname ## varname, level1, level2, ..., leveln ## (the varname and levels are optionally quoted) v <- scan(file, what = character(), sep = ",", nlines = 1, quiet = TRUE) if (length(v) == 0) break if (length(v) == 1) { levels[[iVar]] <- list(var = v, levels = NULL) } else { levels[[iVar]] <- list(var = v[1], levels = v[-1]) } iVar <- iVar + 1 } return(levels) } PrintRules <- function(rules, x.levels.fname = "", x.levels.lowcount.fname = "", file = "") { # Outputs a 'readable' version of the given RuleFit rules. # # Args: # rules : list of <type, supp|std, coeff, imp, splits|var> tuples, # as generated by the ReadRules() function # x.levels.fname: (optional) - text file with <var.name, var.levels> pairs # x.levels.lowcount.fname: (optional) - text file with <var.name, low-count var.levels> pairs # file: connection, or a character string naming the file to print # to; if "" (the default), prints to the standard output; if # NULL, prints to a data.frame # Returns: # None, or a data.frame with <type, supp.std, coeff, importance> cols stopifnot(length(rules) > 0) nRules <- length(rules) # Were we given data to translate categorical split levels? x.levels <- NULL x.levels.lowcount <- NULL if (nchar(x.levels.fname) > 0) { x.levels <- ReadLevels(x.levels.fname) if (nchar(x.levels.lowcount.fname) > 0) { x.levels.lowcount <- as.data.frame(do.call("rbind", ReadLevels(x.levels.lowcount.fname))) } } if (is.null(file)) { # Print to a data-frame instead out.df <- data.frame(type = rep(NA, nRules), supp.std = rep(NA, nRules), coeff = rep(NA, nRules), importance = rep(NA, nRules), def = rep(NA, nRules)) } # Print one rule at a time according to type for (iRule in 1:nRules) { rule <- rules[[iRule]] if (is.null(file)) { out.df$type[iRule] <- rule$type out.df$coeff[iRule] <- rule$coeff out.df$importance[iRule] <- rule$imp } if (rule$type == kRuleTypeLinear) { ruleStr <- LinearRule2Char(rule) if (is.null(file)) { out.df$supp.std[iRule] <- rule$std out.df$def[iRule] <- ruleStr } else { cat(ruleStr, "\n", file = file, append = T) } } else if (rule$type == kRuleTypeSplit) { ruleStr <- SplitRule2Char(rule, x.levels, x.levels.lowcount) if (is.null(file)) { out.df$supp.std[iRule] <- rule$supp out.df$def[iRule] <- ruleStr } else { cat(ruleStr, "\n", file = file, append = T) } } else { error(logger, paste("PrintRules: unknown rule type: ", rule$type)) } } if (is.null(file)) { return(out.df) } } <file_sep>/src/PD2HTML.R # AUTHOR: <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/rfExport.R")) source(file.path(REGO_HOME, "/src/rfRulesIO.R")) source(file.path(REGO_HOME, "/src/h2oPred.R")) library(R2HTML) library(ROCR, verbose = FALSE, quietly=TRUE, warn.conflicts = FALSE) PD2HTML <- function(model, data, Rules, feature, reference, varimp, rf.ctxt, conf, model.path){ out.path <- file.path(model.path, "R2HTML") # Create output directory (if appropriate) if (!file.exists(out.path)) { dir.create(out.path) } # variables whose importance above the threshold get displayed vars = varimp[which(varimp[,1] > conf$html.min.var.imp),2] # rules with zero coefficients. For these, we don't need to calculate their scores on the data. skip_rules = which(h2o.coef(model)[2:(length(Rules)+1)] == 0) keep_rules = setdiff(1:length(Rules),skip_rules) # Initialize HTML report html.file <- HTMLInitFile(out.path, conf$html.singleplot.fname, Title = conf$html.title, BackGroundColor = "#BBBBEE") HTML.title(conf$html.singleplot.title) for(var in vars){ print(paste('Generating single partial dependence plot for:',var,sep = " ")) single.PD = singlePD(var, model, data, Rules, keep_rules, feature, reference, rf.ctxt$pd.sample.size, rf.ctxt$qntl, rf.ctxt$max.var.vals) plot.fname <- paste(var, "png", sep = ".") plot.width <- 620 plot.height <- 480 png(file = file.path(out.path, plot.fname), width=plot.width, height=plot.height) if(is.factor(data[,var])){ single.PD$par.dep = single.PD$par.dep - min(single.PD$par.dep) bar.widths <- as.vector(h2o.table(data[,var])[,2] /nrow.H2OFrame(data)) barplot(single.PD$par.dep, names = single.PD$var.vals, width = bar.widths, xlab=var, ylab='Partial dependence', cex.names=0.75, las = 1, col = 637) # make sure it matches rego }else{ plot(single.PD$var.vals, single.PD$par.dep, xlab=var, ylab='Partial dependence', type='l') } dev.off() plot.caption = var HTMLInsertGraph(plot.fname, Caption=plot.caption, WidthHTML=plot.width, HeightHTML=plot.height) } HTMLEndFile() } singlePD <- function(var, model, data, Rules, keep_rules, feature, reference, pd.sample.size, qntl, max.var.vals){ ## Get evaluation points if (is.factor(data[,var])) { ## Use all levels for categorical variables is.fact <- TRUE var.vals <- h2o.levels(data[,var]) } else { ## Use 'max.var.vals' percentiles for numeric variables is.fact <- FALSE var.vals <- quantile(data[,var], na.rm=T, probs=seq(qntl, 1-qntl, 1.0/max.var.vals)) } num.var.vals <- length(var.vals) par.dep <- rep(0, num.var.vals) ## Get random sample of observations (to speed things up) data.sample <- data[row = sort(sample(1:nrow(data), size=pd.sample.size)), col = 1:ncol(data)] ## Compute partial dependence over selected random sample y.hat.m <- matrix(nrow=pd.sample.size, ncol=num.var.vals) for (i.var.val in 1:num.var.vals) { ## Hold x[,var] constant ####x.sample[,var] <- var.vals[i.var.val] data.var <- as.h2o(rep(var.vals[i.var.val], pd.sample.size)) data.sample[,var] <- data.var ## Compute y.hat y.hat.m[,i.var.val] <- h2oPred(data.sample, model, Rules, keep_rules, feature, reference) ## Compute avg(y.hat) par.dep[i.var.val] <- mean(y.hat.m[,i.var.val]) } return(list(var.vals=var.vals, par.dep=par.dep)) }<file_sep>/src/varImp.R # AUTHOR: <NAME> ############################################################################### varImp <- function(Rules, feature, reference, importance_Rules, importance_linear){ # calculate input variable importance # # Returns: # sorted relative input variable importance # linear input variables linear_names = feature[which(reference=="continuousFeature")] varimp = data.frame(matrix(nrow = length(feature), ncol = 2)) colnames(varimp) = c('scaled_importance', 'variable') for(i in 1:length(feature)){ var = feature[i] # importance from linear predictor if(reference[i] == 'continuousFeature'){ imp_var_linear = importance_linear[which(linear_names == var)] } else { imp_var_linear = 0 } # importance from rules containing var imp_var_rule = 0 for(j in 1:length(Rules)){ rule = Rules[[j]] # total number of splits n_splits = length(rule) # number of splits on var n_var_split = 0 for(split in rule){ if(split[[2]] == i-1){ n_var_split = n_var_split + 1 } } # split the rule importance with each var imp_var_rule = imp_var_rule + importance_Rules[j]*n_var_split/n_splits } varimp[i,'variable'] = var varimp[i,'scaled_importance'] = imp_var_linear + imp_var_rule } varimp = varimp[order(varimp[,'scaled_importance'], decreasing = TRUE),] if(varimp[1,'scaled_importance'] > 0){ varimp[,'scaled_importance'] = varimp[,'scaled_importance'] / varimp[1,'scaled_importance'] * 100 } else { varimp[,'scaled_importance'] = varimp[,'scaled_importance'] / 0.00000001 * 100 } return(varimp) }<file_sep>/src/rfTrainModel_h2o.R # AUTHOR: <NAME> ############################################################################### library(rPython) python.load(file.path(REGO_HOME, "/src/main.py"), get.exception = TRUE ) library(R2HTML) library(ROCR, verbose = FALSE, quietly=TRUE, warn.conflicts = FALSE) source(file.path(REGO_HOME, "/src/createFunction.r")) source(file.path(REGO_HOME, "/src/rfR2HTML.R")) source(file.path(REGO_HOME, "/src/H2Oconvert2Rego.R")) source(file.path(REGO_HOME, "/src/getTrimQuantiles.R")) source(file.path(REGO_HOME, "/src/getTrimQuantiles.R")) source(file.path(REGO_HOME, "/src/rfExportSQL.R")) source(file.path(REGO_HOME, "/src/rfExport.R")) source(file.path(REGO_HOME, "/src/varImp.R")) source(file.path(REGO_HOME, "/src/PD2HTML.R")) rfTrainModel_h2o <- function(data, conf, rf.ctxt){ # model path model.path = paste(rf.ctxt$working.dir,"/export",sep="") if (!file.exists(model.path)) { dir.create(model.path) } # POJO path POJO.path = paste(rf.ctxt$working.dir,"/export/POJO",sep="") if (!file.exists(POJO.path)) { dir.create(POJO.path) } # gradient boosted machine print("Tree Ensemble...") if(rf.ctxt$rfmod == "regress"){ gbm.distribution = "gaussian" regularization.family = "gaussian" } else if(rf.ctxt$rfmod == "class"){ gbm.distribution = "bernoulli" regularization.family = "binomial" } # skip columns cols2skip = scan(conf$col.skip.fname, what = "character") allCols = colnames(data) # input variable and response variable output_name = conf$col.y input_names = setdiff(allCols, cols2skip) input_names = setdiff(input_names, output_name) # get number of trees and depth based the input tree.size and max.rules rulesPerTree = 2 * (rf.ctxt$tree.size - 1) ntrees = as.integer(rf.ctxt$max.rules/rulesPerTree) + 1 # plus one to make more flexible max_depth = as.integer(log(rf.ctxt$tree.size, base = 2)) + 1 # plus one to make more flexible # GBM gbm <- h2o.gbm(x=input_names, y=output_name, training_frame = data, model_id = "gbm", ignore_const_cols = TRUE, distribution = gbm.distribution, ntrees = ntrees, max_depth = max_depth, weights_column = conf$col.weights, learn_rate = rf.ctxt$memory.par, sample_rate = rf.ctxt$samp.fract) # export POJO h2o.download_pojo(gbm,path=POJO.path) print("Applying Rules on Training Set...") # parse POJO file pojo_out = python.call("pojo_extractor", path=paste(POJO.path,"/gbm.java",sep="")) # get Rules, feature and reference feature = pojo_out[[1]] reference = pojo_out[[2]] Rules = pojo_out[[3]] # apply rules on training set print(paste("number of rules:" , length(Rules))) dataOnRule = list() for(i in 1:length(Rules)){ f_rule = createFunction(Rules[[i]], feature, reference) dataOnRule[[i]] = f_rule(data) colnames(dataOnRule[[i]]) = paste("rule",i,sep="") print(i) } dataALL = h2o.cbind(dataOnRule,data) # winsorize print("Winsorizing...") # linear input variables linear_names = feature[which(reference=="continuousFeature")] x.trims = getTrimQuantiles(data, beta=rf.ctxt$data.trim.quantile, feature, reference) write.table(x.trims, file = paste(model.path, "/x.trims.txt", sep=""), row.names = FALSE, quote = FALSE) # winsorize training dataset for(name in linear_names){ name.idx = which(x.trims[,1] == name) min2keep = x.trims[name.idx,2] max2keep = x.trims[name.idx,3] dataALL[,name] = ifelse(dataALL[,name]<min2keep, min2keep, dataALL[,name]) dataALL[,name] = ifelse(dataALL[,name]>max2keep, max2keep, dataALL[,name]) # also winsorize original data for partial dependence plot later data[,name] = ifelse(data[,name]<min2keep, min2keep, data[,name]) data[,name] = ifelse(data[,name]>max2keep, max2keep, data[,name]) } # regularization # need to manually tune lambda to control number of rules with non-zero coeff's. To be continued... print("Regularization...") if(rf.ctxt$test.reps == 0 && rf.ctxt$test.fract > 0){ data.split = h2o.splitFrame(dataALL, rf.ctxt$test.fract) valid_data = data.split[[1]] train_data = data.split[[2]] rfRegularization <- h2o.glm(x=c(colnames(dataALL)[1:length(Rules)], linear_names), y=output_name, training_frame = train_data, model_id = "rfRegularization", validation_frame = valid_data, ignore_const_cols = FALSE, # for structure maintainance. doesn't matter since coef of const col will be zero family = regularization.family, weights_column = conf$col.weights, alpha = rf.ctxt$regularization.alpha, lambda = rf.ctxt$regularization.lambda) } else if (rf.ctxt$test.reps > 0) { rfRegularization <- h2o.glm(x=c(colnames(dataALL)[1:length(Rules)], linear_names), y=output_name, training_frame = dataALL, model_id = "rfRegularization", nfolds = rf.ctxt$test.reps, ignore_const_cols = FALSE, # for structure maintainance. doesn't matter since coef of const col will be zero family = regularization.family, weights_column = conf$col.weights, alpha = rf.ctxt$regularization.alpha, lambda = rf.ctxt$regularization.lambda) } else { print('Warning: No validation data is available, so the best lambda is selected as the minimal lambda.') rfRegularization <- h2o.glm(x=c(colnames(dataALL)[1:length(Rules)], linear_names), y=output_name, training_frame = dataALL, model_id = "rfRegularization", ignore_const_cols = FALSE, # for structure maintainance. doesn't matter since coef of const col will be zero family = regularization.family, weights_column = conf$col.weights, alpha = rf.ctxt$regularization.alpha, lambda = rf.ctxt$regularization.lambda) } # export h2o model # H2O on Hadoop has problem saving model to specific path # h2o.saveModel(rfRegularization, path = model.path, force = TRUE) h2o.saveModel(rfRegularization, path = "/tmp", force = TRUE) # export rulefit coef write.csv(h2o.coef(rfRegularization), file = paste(model.path,'/coefficients.csv',sep=''), quote = F, row.names = F) if(rfRegularization@allparameters$family == "binomial"){ print(paste("AUC on training data: ", h2o.auc(rfRegularization))) } # y and y.hat for test error and ROC curve # if(rf.ctxt$rfmod == "regress"){ # y = as.vector(data[,output_name]) # y.hat = as.vector(h2o.predict(rfRegularization, dataALL)[,1]) # } else { # keys = h2o.levels(data, output_name) # y = as.vector(data[,output_name]) # y = ifelse(y == keys[1], 1, -1) # y.hat = as.vector(h2o.predict(rfRegularization, dataALL)[,2] - h2o.predict(rfRegularization, dataALL)[,3]) # } # converting to REGO print("Converting to rego_Rules...") coef = h2o.coef(rfRegularization) if(sum(coef!=0) == 1){ print("Warning: no predictors selected because lambda is too big.") } # Rule based importance coef_Rules = coef[2:(length(Rules)+1)] coef_Linear = coef[(length(Rules)+2):length(coef)] s = mean(dataALL[,1:length(Rules)], na.rm = T) std_linear = sqrt(diag(as.matrix(var(data[,linear_names], na.rm = T)))) importance_Rules = abs(coef_Rules)*sqrt(s*(1-s)) importance_linear = abs(coef_Linear) * std_linear importance = c(importance_Rules, importance_linear) importance[which(is.na(importance))] = 0 importance_Rules[which(is.na(importance_Rules))] = 0 importance_linear[which(is.na(importance_linear))] = 0 # Input variable importance varimp = varImp(Rules, feature, reference, importance_Rules, importance_linear) write.table(varimp, file=paste(model.path,"/varimp.txt",sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE, sep="\t") # support of rules and std of liner terms supp = as.vector(apply(dataALL[,1:length(Rules)],2,sum)/nrow(dataALL)) std_supp = c(supp, std_linear) # convert to rego-compatible Rules for model summary plot and SQL output rego_Rules = H2Oconvert2Rego(Rules, feature, reference, coef, importance, std_supp, out.path=model.path) # export SQL clause of the model, can be parsed into RErunner print("Exporting SQL... ") # export SQL ExportModel2SQL(rego_Rules, model.path, out.path = model.path, levels.fname = "xtrain_levels.txt", out.fname = "rules_forSQL.txt", merge.dups = FALSE, expand.lcl.mode = 1, export.type = "score", db.type = "SQLServer", max.sql.length = 500, x.trims = x.trims) # export HTML model summary for reading print("Exporting Model Summary...") # suppress AUC plot to speed up y = 0 y.hat = 0 WriteHTML(rego_Rules, conf, model.path, out.path = model.path, rfmod = rfRegularization, y, y.hat) ############### Partial dependence plots ####################### if(conf$is.pardep == 'on'){ PD2HTML(rfRegularization, data, Rules, feature, reference, varimp, rf.ctxt, conf, model.path) } } <file_sep>/src/getTrimQuantiles.R # AUTHOR: <NAME> ############################################################################### getTrimQuantiles <- function(data, beta = 0.025, feature, reference){ # Reads in "trim" quantiles, tuples <var-name, min, max, mean>, from the specified data. if(beta > 0.5){ beta = 1 - beta } trims.df <- data.frame(matrix(NA, nrow = length(feature), ncol = 4)) colnames(trims.df) <- c("vname", "min2keep", "max2keep", "mean") trims.df[,1] = feature idx_linear = which(reference=="continuousFeature") print(paste("Number of Linear Terms:", length(idx_linear))) i=1 for(idx in idx_linear){ print(i) i = i+1 qt = h2o.quantile(data[,feature[idx]], probs = c(beta, 1-beta)) x.min2keep = qt[1] x.max2keep = qt[2] trims.df[idx,2] = x.min2keep trims.df[idx,3] = x.max2keep trims.df[idx,4] = h2o.mean(data[,feature[idx]]) } return(trims.df) } <file_sep>/src/rfExportSQL.R # AUTHOR: <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/rfExport.R")) source(file.path(REGO_HOME, "/src/rfRulesIO.R")) # Constants kContinuousSplitTestOps <- c(' < ',' <= ',' > ', ' >= ') MergeDuplicateTerms <- function(terms) { # Dedupes term list. For computational efficiency reasons, Friedman's implementation # keeps rules in their source trees, so duplicates can be present in a RuleFit model. # # Args: # terms : list of <type, supp|std, coeff, imp, splits|var> tuples, # as generated by the ReadRules() function # Returns: # deduped list. CompareCategoricalSplits <- function(s1, s2) { stopifnot(s1$type == "categorical" && s2$type == "categorical") if (s1$var != s2$var || s1$cond != s2$cond || length(s1$levels) != length(s2$levels)) { return(FALSE) } if (identical(sort(s1$levels), sort(s2$levels)) ) return(TRUE) else return(FALSE) } CompareContinuousSplits <- function(s1, s2) { stopifnot(s1$type == "continuous" && s2$type == "continuous") if (s1$var == s2$var && s1$min == s2$min && s1$max == s2$max) { return(TRUE) } else { return(FALSE) } } CompareSplitLists <- function(l1, l2) { stopifnot(length(l1) == length(l2)) nSplits <- length(l1) bMatched <- rep(FALSE, nSplits) for (l1.split in l1) { bFoundMatch <- FALSE for (i.l2.split in seq.int(1, nSplits, +1)) { if (!bMatched[i.l2.split]) { l2.split <- l2[[i.l2.split]] if (l1.split$type != l2.split$type) { next } if (l1.split$type == "continuous") { if (CompareContinuousSplits(l1.split, l2.split)) { bFoundMatch <- TRUE bMatched[i.l2.split] <- TRUE break } } else { if (CompareCategoricalSplits(l1.split, l2.split)) { bFoundMatch <- TRUE bMatched[i.l2.split] <- TRUE break } } } } if (!bFoundMatch) { return(FALSE) } } return(TRUE) } CompareTerms <- function(t1, t2) { if (t1$type != t2$type) { return(FALSE) } if (t1$type == "linear" && t2$type == "linear") { if (t1$var == t2$var) return(TRUE) else return(FALSE) } if (t1$type != "split" || t2$type != "split") { error(logger, paste("CompareTerms: unexpected term type: '", t1$type, "', '", t2$type, "'")) } if (length(t1$splits) != length(t2$splits)) { return(FALSE) } return(CompareSplitLists(t1$splits, t2$splits)) } # ----------------------------------------------------------------------- stopifnot(length(terms) > 1) nTerms <- length(terms) terms.dedup <- list() bIsDup <- rep(FALSE, nTerms) iTermOut <- 1 iTermIn <- 1 repeat { while (iTermIn <= nTerms && bIsDup[iTermIn]) { iTermIn <- iTermIn + 1 } if (iTermIn > nTerms) { break } else if (iTermIn == nTerms) { terms.dedup[[iTermOut]] <- terms[[iTermIn]] break } else { term <- terms[[iTermIn]] for (iTerm in seq.int(iTermIn+1, nTerms, +1)) { if (!bIsDup[iTerm]) { termNext <- terms[[iTerm]] if (CompareTerms(term, termNext)) { term$coeff <- term$coeff + termNext$coeff dbg(logger, paste("MergeDuplicateTerms: merging term", iTermIn, ">>", ifelse(term$type == kRuleTypeLinear, LinearRule2Char(term), SplitRule2Char(term, NULL)), "<< and term", iTerm, ">>", ifelse(termNext$type == kRuleTypeLinear, LinearRule2Char(termNext), SplitRule2Char(termNext, NULL)), "<<")) bIsDup[iTerm] <- TRUE } } } terms.dedup[[iTermOut]] <- term iTermOut <- iTermOut + 1 iTermIn <- iTermIn + 1 } } return(terms.dedup) } ConvertTermsToSQL <- function(terms, db.type, x.levels.fname = "", x.levels.lowcount.fname = "", x.trims = NULL) { # Converts RuleFit terms into a SQL-compatible version. # # Args: # terms : list of <type, supp|std, coeff, imp, splits|var> tuples, # as generated by the ReadRules() function # db.type : SQL dialect to use # x.levels.fname : (optional) - text file with <var.name, var.levels> pairs # x.levels.lowcount.fname: (optional) - text file with <var.name, low-count var.levels> pairs # x.trims.fname : (optional) - text file with <var-name, min, max, mean> tuples. # # Returns: # data-frame with <type, coeff, rule definition as a SQL-like string> tuples ConvertCategoricalSplitTest <- function(split.str) { # Transforms splits of the form 'x IN ('v1', 'v2', NA, ...)' into sql clause # '(x IS NULL OR x IN ('v1', 'v2', ...))' and split 'x NOT IN ('v1', 'v2', NA, ...)' # into sql clause '(x IS NOT NULL AND x NOT IN ('v1', 'v2', ...))' stopifnot(grepl(" AND ", split.str) == FALSE) stopifnot(grepl(' IN \\( ', split.str)) # Remove leading/trailing white space; split split.str <- gsub("^\\s+", '', split.str, perl = TRUE) split.str <- gsub('\\s+$', '', split.str, perl = TRUE) split.parts <- strsplit(split.str, " ")[[1]] split.var <- split.parts[1] split.op <- split.parts[2] # Create NULL test string if (split.op == "NOT") { isNullStr <- paste(split.var, "IS NOT NULL") split.op.is.NOT <- TRUE } else { isNullStr <- paste(split.var, "IS NULL") split.op.is.NOT <- FALSE } # Now remove NA from the list of test levels (if present) if (grepl('NA,', split.str)) { # NA at start, or middle, of value list split.str <- gsub('NA,', "", split.str) split.str <- paste("(", isNullStr, ifelse(split.op.is.NOT, " AND ", " OR "), split.str, ")", sep = "") } else if (grepl(',NA', split.str)) { # NA at end of value list split.str <- gsub(',NA', "", split.str) split.str <- paste("(", isNullStr, ifelse(split.op.is.NOT, " AND ", " OR "), split.str, ")", sep = "") } else if (grepl('\\( NA \\)', split.str)) { # NA is only element of value list split.str <- isNullStr } else { # NA is not present value list... splits of the form 'x NOT IN ('v1', 'v2', ...)', with # vi != NA, need to be converted into sql clause '(x IS NULL OR x NOT IN ('v1', 'v2', ...))' if (split.op.is.NOT) { split.str <- paste("(", split.var, " IS NULL OR ", split.str, ")", sep = "") } } return(split.str) } ConvertContinuousSplitTest <- function(split.str) { # Transform splits of the form 'var OP threshold' into 'var*1.0 OP threshold' # to make sure SQL comparisons are not done in int. # Note that 'var OP threshold' should evaluate to false if var is null, and # SQL automatically provides this behavior. stopifnot(grepl(paste(kContinuousSplitTestOps, sep = "", collapse = '|'), split.str)) for (op in kContinuousSplitTestOps) { split.str <- gsub(op, paste('*1.0', op), split.str) } return(split.str) } ConvertSplitTest <- function(split.str) { # Convert split according to type: 'categorical' or 'continuous' split.str <- gsub('== NA', 'IS NULL', split.str) split.str <- gsub('!= NA', 'IS NOT NULL', split.str) if (grepl(' IN \\( ', split.str)) { return(ConvertCategoricalSplitTest(split.str)) } else if (grepl(paste(kContinuousSplitTestOps, sep = "", collapse = '|'), split.str)) { return(ConvertContinuousSplitTest(split.str)) } else { return(split.str) } } ConvertLinearTerm <- function(var, x.trims.df) { # Transform linear terms into a SQL expression that accounts for "trims." stopifnot(is.null(x.trims) || length(which((colnames(x.trims.df) == c("vname", "min2keep", "max2keep", "mean")) == T)) == 4) # Set SQL template if (db.type == "SQLServer" || db.type == "Netezza" || db.type == "HiveQL") { SQL.TMPL <- "CASE WHEN _VAR_ IS NULL THEN _MEAN_ ELSE CASE WHEN _VAR_ < _MIN_ THEN _MIN_ WHEN _VAR_ > _MAX_ THEN _MAX_ ELSE _VAR_ END END" } else if (db.type == "MySQL") { SQL.TMPL <- "IF(_VAR_ IS NULL, _MEAN_, LEAST(_MAX_, GREATEST(_VAR_, _MIN_)))" } else { error(logger, paste("ConvertLinearTerm: Unknown db.type: ", db.type)) } # Instantiate template, if appropriate if ( is.null(x.trims) ) { # Simply return var name return(var) } else { # Instantiate template with <min, mean, max> iRow <- grep(paste("^", var, "$", sep=""), x.trims.df$vname, perl=T) if ( length(iRow) == 1 ) { if (!is.null(x.trims.df$min2keep[iRow]) && !is.null(x.trims.df$max2keep[iRow]) && !is.null(x.trims.df$mean[iRow])) { sql.str <- gsub("_VAR_", var, SQL.TMPL) sql.str <- gsub("_MIN_", x.trims.df$min2keep[iRow], sql.str) sql.str <- gsub("_MEAN_", x.trims.df$mean[iRow], sql.str) sql.str <- gsub("_MAX_", x.trims.df$max2keep[iRow], sql.str) return(sql.str) } else { error(logger, paste("ConvertLinearTerm: Missing trim info for: ", var)) } } else { error(logger, paste("ConvertLinearTerm: Didn't find: ", var, "in trim list")) } } } # ----------------------------------------------------------------------- nTerms <- length(terms) if ( nTerms == 0 ) { error(logger, "ConvertTermsToSQL: 'terms' must not be empty") } # Were we given data to translate categorical split levels? x.levels <- NULL x.levels.lowcount <- NULL if (nchar(x.levels.fname) > 0) { x.levels <- ReadLevels(x.levels.fname) if (nchar(x.levels.lowcount.fname) > 0 && file.exists(x.levels.lowcount.fname) ) { x.levels.lowcount <- as.data.frame(do.call("rbind", ReadLevels(x.levels.lowcount.fname))) } } # Allocate return data-frame out.df <- data.frame(type = rep(NA, nTerms), coeff = rep(NA, nTerms), def = rep(NA, nTerms)) # Process one model term at a time according to type: linear vs rule of splits for ( iTerm in 1:nTerms ) { term <- terms[[iTerm]] out.df$type[iTerm] <- term$type out.df$coeff[iTerm] <- term$coeff if ( term$type == kRuleTypeLinear ) { termStr <- ConvertLinearTerm(term$var, x.trims) out.df$def[iTerm] <- termStr } else if ( term$type == kRuleTypeSplit ) { termStr <- SplitRule2Char(term, x.levels, x.levels.lowcount) # Join term's splits with an AND termStr.splits <- strsplit(termStr, ' AND ')[[1]] # Transform any NA test within each split out.df$def[iTerm] <- paste(lapply(termStr.splits, ConvertSplitTest), sep="", collapse = " AND ") } else { error(logger, paste("ConvertTermsToSQL: unknown term type: ", term$type)) } } return(out.df) } GetSQLRuleWrapper <- function(db.type) { # Returns SQL-specific rule "wrapper" -- e.g., IF(rule, 1, 0) stopifnot(db.type %in% c("SQLServer", "MySQL", "Netezza", "HiveQL")) if (db.type == "SQLServer" || db.type == "Netezza" || db.type == "HiveQL") { term.sql.head <- "CASE WHEN" term.sql.tail <- "THEN 1 ELSE 0 END" } else if (db.type == "MySQL") { term.sql.head <- "IF(" term.sql.tail <- ",1,0)" } return(list(head = term.sql.head, tail = term.sql.tail)) } AppendCoeffSQLWrapper <- function(term, term.sql.head, term.sql.tail) # Returns SQL version of c*rule(x) or c*x_j { if (term['type'] == kRuleTypeLinear) { rule.sql.str <- paste(term['coeff'], "*", term['def'], sep="") } else if ( term['type'] == kRuleTypeSplit ) { rule.sql.str <- paste(term['coeff'], "*", term.sql.head, "(", term['def'], ")", term.sql.tail, sep="") } else { error(logger, paste("AppendCoeffSQLWrapper: unknown rule type: ", type)) } return(rule.sql.str) } ApplySQLWrapper <- function(term, term.sql.head, term.sql.tail) # Returns SQL version of rule(x) or x_j { if (term['type'] == kRuleTypeLinear) { rule.sql.str <- paste("1.0*", term['def'], sep="") } else if ( term['type'] == kRuleTypeSplit ) { rule.sql.str <- paste("1.0*", term.sql.head, "(", term['def'], ")", term.sql.tail, sep="") } else { error(logger, paste("ApplySQLWrapper: unknown rule type: ", type)) } return(rule.sql.str) } BuildScoringClause <- function(terms.sql.df, db.type, c0) { # Concatenates SQL-like version of model terms into a single scoring expression -- i.e., # the SQL that computes c0 + c1*rule1(x) + c2*x_j +... # # Args: # terms.sql.df : data-frame with tuples <type, coeff, def> where def is the term # definition already converted into a SQL-compatible string # db.type : SQL dialect to use # Returns: # Scoring SQL clause stopifnot(class(terms.sql.df) == "data.frame") stopifnot(length(which((names(terms.sql.df) == c("type", "coeff", "def"))==T)) == 3) # Set SQL-specific rule "wrapper" term.sql.wrapper <- GetSQLRuleWrapper(db.type) # Append coefficient and SQL wrapper to each term... concatenate all terms with "+" score.str <- paste(apply(terms.sql.df, 1, AppendCoeffSQLWrapper, term.sql.wrapper$head, term.sql.wrapper$tail), sep = "", collapse = " +\n") # Add intercept to scoring string score.str <- paste(c0, score.str, sep = " +\n") return(score.str) } BuildScoringClauseNoCoeff <- function(terms.sql.df, db.type) { # Like BuildScoringClause() but without the coefficients -- i.e., constructs the SQL that computes # rule1(x) + rule3(x) + ... Primarily used for debugging purposes. # # Args: # terms.sql.df : data-frame with tuples <type, coeff, def> where def is the term # definition already converted into a SQL-compatible string # db.type : SQL dialect to use # Returns: # Scoring SQL clause as sum of indicators. stopifnot(class(terms.sql.df) == "data.frame") stopifnot(length(which((names(terms.sql.df) == c("type", "coeff", "def"))==T)) == 3) # Set SQL-specific rule "wrapper" term.sql.wrapper <- GetSQLRuleWrapper(db.type) # Append coefficient and SQL wrapper to each term... concatenate all terms with "+" score.str <- paste(apply(terms.sql.df, 1, ApplySQLWrapper, term.sql.wrapper$head, term.sql.wrapper$tail), sep = "", collapse = " +\n") # Add 0.0 intercept to scoring string -- just because java model runner expects it score.str <- paste(0.0, score.str, sep = " +\n") return(score.str) } BuildRulesOnlyClause <- function(terms.sql.df, db.type) { # Builds a SQL clause for filling the individual table columns t_i, where t_i refers # to the i-th term in the model (a term can be either a rule or a winsorized numeric # predictor). This might be useful to study the "firing" pattern of the rules in a # new data set -- i.e., drift detection. # # Args: # terms.sql.df : data-frame with tuples <type, coeff, def> where def is the term # definition already converted into a SQL-compatible string # db.type : SQL dialect to use # Returns: # Rules' SQL clause stopifnot(class(terms.sql.df) == "data.frame") stopifnot(length(which((names(terms.sql.df) == c("type", "coeff", "def"))==T)) == 3) stopifnot(db.type %in% c("SQLServer", "MySQL", "Netezza", "HiveQL")) # Set SQL-specific rule "wrapper" term.sql.wrapper <- GetSQLRuleWrapper(db.type) # Apply SQL wrapper to each rule term... concatenate all terms with "," num.terms <- nrow(terms.sql.df) rules.str <- paste(apply(terms.sql.df, 1, ApplySQLWrapper, term.sql.wrapper$head, term.sql.wrapper$tail), " t", 1:num.terms, sep = "", collapse = ",\n") return(rules.str) } BuildRulesCoeffClause <- function(terms.sql.df, db.type, c0) { # Like BuildRulesOnlyClause() but including coefficients. stopifnot(class(terms.sql.df) == "data.frame") stopifnot(length(which((names(terms.sql.df) == c("type", "coeff", "def"))==T)) == 3) # Set SQL-specific rule "wrapper" term.sql.wrapper <- GetSQLRuleWrapper(db.type) # Append coefficient and SQL wrapper to each term... concatenate all terms with "," num.terms <- nrow(terms.sql.df) score.str <- paste(apply(terms.sql.df, 1, AppendCoeffSQLWrapper, term.sql.wrapper$head, term.sql.wrapper$tail), " t", 1:num.terms, sep = "", collapse = ",\n") # Add intercept to scoring string score.str <- paste(c0, score.str, sep = " t0,\n") return(score.str) } BuildTermSumSQLExpression <- function(last.term, n.terms, max.sql.length, term.prefix = "t") { # Returns a string of the form "t_last.term + t_(last.term + 1) +...+ t_n.terms" # truncated so as not to exceed max.sql.length in length. stopifnot(n.terms >= last.term) out.str <- paste(term.prefix, last.term:n.terms, sep="", collapse="+") if (nchar(out.str) > max.sql.length) { out.str <- substr(out.str, 1, max.sql.length) stopifnot(length(grep('\\+', out.str)) > 0) while (substr(out.str, nchar(out.str), nchar(out.str)) != '+') { out.str <- substr(out.str, 1, nchar(out.str)-1) } out.str <- substr(out.str, 1, nchar(out.str)-1) } return(out.str) } BuildRulesCoeffScoringClause <- function(db.type, n.terms, max.sql.length) { # The SQL expression generated by BuildScoringClause(), c0 + c1*r1(x) + ..., can # result in an "expression too complex" error for some SQL variants. In this case, # scoring can be achieved by using BuildRulesCoeffClause() instead, followed by # a score = t_0 + t_1 +... operation. If there are too many terms, however, this # simple summing expression also needs to be split. # Args: # db.type : SQL dialect to use # n.terms : number of terms to add # max.sql.length : max sql expression length (in number of characters) # Returns: # scoring sql expression of the form: # select score = s1 + s2 + s3 + ... # from ( # select # s1 = t_1 + t_2 + t_3 + ... # ,s2 = t_j + t_j+1 + ... # ... # from RulesCoeff Table # ); stopifnot(db.type %in% c("SQLServer", "MySQL", "Netezza", "HiveQL")) AppendScoringSQLWrapper <- function(partial.sum.str, partial.sum.i, db.type, partial.sum.varname = "s") { # Returns SQL version of s_i = t_j + t_(j+1) + t_(j+2) + ... stopifnot(partial.sum.i >= 1) if (db.type == "MySQL" || db.type == "Netezza" || db.type == "HiveQL") { sql.str <- paste(partial.sum.str, "AS", paste0("s", partial.sum.i)) } else if (db.type == "SQLServer") { sql.str <- paste(paste0(partial.sum.varname, partial.sum.i), "=", partial.sum.str) } } # Build "s_i = t_j + t_j+1 + ..." expressions partial.sum.strs <- list() last.term <- 0 repeat { sum.str <- BuildTermSumSQLExpression(last.term, n.terms, max.sql.length) partial.sum.strs <- c(partial.sum.strs, sum.str) n.terms.used <- length(which(strsplit(sum.str, "")[[1]] == "+")) + 1 last.term <- last.term + n.terms.used if(last.term > n.terms) break() } partial.sum.sql <- mapply(FUN=AppendScoringSQLWrapper, partial.sum.strs, partial.sum.i=1:length(partial.sum.strs), db.type=db.type) partial.sum.sql <- paste(partial.sum.sql, collapse=",\n") # Build "score = s1 + ..." expression score.sum.sql <- BuildTermSumSQLExpression(1, length(partial.sum.strs), max.sql.length=255, term.prefix="s") #cat(partial.sum.sql) #cat("\n", score.sum.sql, "\n") # Return both expressions together return(list(score.sum.sql = score.sum.sql, partial.sum.sql = partial.sum.sql)) } BuildLCLClause <- function(model.path, levels.fname, out.path, out.fname, db.type) { # When handling the lowcount levels in the data preparation step, we need to build a a sql clause, # which is like case when var in (level1, level2, ...) then var else '_LowCountLevels_' end as var... # This function build this sql clause, and output to the file outfname_lowcount. tmp = ReadLevels(paste(model.path,levels.fname,sep="/")) if (any(grepl("_LowCountLevels_",tmp))) { dotPos <- regexpr("\\.[^\\.]*$", out.fname) out.fname_lcl <- paste0(substr(out.fname,1,dotPos[1]-1),"_lowcount",".",substr(out.fname,dotPos[1]+1,nchar(out.fname))) factorChanged = "" varUnchanged = "" for(i in 1:length(tmp)){ var = tmp[[i]]$var l = tmp[[i]]$levels valueList = paste(paste("'",l[2:length(l)], "'",sep=""), collapse = ",") if(grepl("_LowCountLevels_", tmp[[i]])[2]){ if (db.type == "Netezza" || db.type == "SQLServer" || db.type == "HiveQL") { # Find the maximum length of all levels of categorical variable, default the maximum lenghth to be 25 MaxNchar=25 for (j in 2:length(l)) { if (nchar(l[j]) > MaxNchar) MaxNchar = nchar(l[j]) } # Do the data transforming tmpStr = sprintf("case when %s in (%s) then cast(%s as varchar(%s)) else '_LowCountLevels_' end as %s", var, valueList, var, MaxNchar, var) factorChanged = sprintf("%s,\n%s", factorChanged, tmpStr) } else if (db.type == "MySQL") { print("not implement currently") } else { print(paste(db.type,"is not a supported SQL dialet")) } } else { varUnchanged = sprintf("%s%s,", varUnchanged, var) } } factorChanged = substr(factorChanged, start=2, stop=nchar(factorChanged)) query = sprintf("%s %s ", varUnchanged, factorChanged) cat(query, file=paste(out.path, out.fname_lcl, sep="/")) } } ExportModel2SQL <- function(rego_Rules, model.path, out.path = model.path, levels.fname = "xtrain_levels.txt", out.fname = "rules_forSQL.txt", merge.dups = FALSE, expand.lcl.mode = 1, export.type = "score", db.type = "SQLServer", max.sql.length = 500, x.trims = NULL) { # Generates a SQL expression corresponding to the scoring function defined by a # given RuleFit model. # # Args: # model.path : path to RuleFit model exported files # out.path : where SQL output file will be written # levels.fname : levels file name (from training phase) # out.fname : ouput file name # merge.dups : should duplicate terms be "merged"? # expand.lcl.mode : how to handle low-count level expansion # export.type : one of {"score", "rulesonly", "rulesscore", "rulescoeff"} # db.type : SQL dialect to use # max.sql.length : max sql expression length (in number of characters) # # Returns: # None. stopifnot(is.character(model.path)) stopifnot(is.character(out.path)) stopifnot(export.type %in% c("score", "rulesonly", "rulesscore", "rulescoeff")) # Read model definition -- combination of rules and linear terms terms <- rego_Rules # Merge "duplicate" terms? (if any) # Already Done this in Python! # if (merge.dups) { # terms <- MergeDuplicateTerms(terms) # } # Get SQL-compatible version of terms terms.df <- ConvertTermsToSQL(terms, db.type, x.levels.fname = file.path(model.path, kMod.x.levels.fname), x.levels.lowcount.fname = ifelse(expand.lcl.mode == 1, file.path(model.path, kMod.x.levels.lowcount.fname), ""), x.trims = x.trims) # Get intercept estimate if (file.exists(file.path(model.path, kMod.intercept.fname))) { c0 <- as.numeric(scan(file.path(model.path, kMod.intercept.fname), what='', quiet=T)) # dbg(logger, paste("ExportModel2SQL: c0 =", c0)) } else { error(logger, paste("ExportModel2SQL: couldn't find file:", file.path(model.path, kMod.intercept.fname))) } if (export.type == "score") { # Concatenate transformed terms into a scoring SQL clause sql.str <- BuildScoringClause(terms.df, db.type, c0) } else if (export.type == "rulesonly") { # Build SQL clause that creates one column per term (w/o coeff) sql.str <- BuildRulesOnlyClause(terms.df, db.type) } else if (export.type == "rulesscore") { # Build SQL clause that computes score based on adding indicator functions only (wo coeff) sql.str <- BuildScoringClauseNoCoeff(terms.df, db.type) } else { # Build SQL clause that creates one column per term (w coeff) stopifnot(export.type == "rulescoeff") sql.str <- BuildRulesCoeffClause(terms.df, db.type, c0) # ... and also the clause that adds the terms up score.str <- BuildRulesCoeffScoringClause(db.type, n.terms = nrow(terms.df), max.sql.length) } # Write out SQL clause(s) sink(file.path(out.path, out.fname)) cat(sql.str, "\n") sink() if (export.type == "rulescoeff") { dotPos <- regexpr("\\.[^\\.]*$", out.fname) out.fname1 <- paste0(substr(out.fname,1,dotPos[1]-1),"_part1",".",substr(out.fname,dotPos[1]+1,nchar(out.fname))) out.fname2 <- paste0(substr(out.fname,1,dotPos[1]-1),"_part2",".",substr(out.fname,dotPos[1]+1,nchar(out.fname))) sink(file.path(out.path, out.fname1)) cat("\n", score.str$score.sum.sql, "\n") sink() sink(file.path(out.path, out.fname2)) cat("\n", score.str$partial.sum.sql, "\n") sink() } # Low-count level expansion needed? if (expand.lcl.mode == 2) { BuildLCLClause(model.path, levels.fname, out.path, out.fname, db.type) } } <file_sep>/src/H2Oconvert2Rego.R # AUTHOR: <NAME> ############################################################################### H2Oconvert2Rego <- function(Rules, feature, reference, coef, importance, std_supp, out.path="/tmp"){ # export H2O model output into external files that could be read by REGO and RErunner for later process # Args: # Rules: list of <'continuous', var, min, max> or <'categorical', var, set, not|in> # or <'differ', var, point, not|equal> or <'isNAorLess', var, min, max> or <'isNA', var, isNA|notNA> # feature: list of feature names # reference: levels of catigorical feature, and "continuousFeature" otherwise # coef: H2O glm coefficient, including intercept, Rules, and linear term # importance: importance of Rules and linear terms, excluding intercept # # Returns: # intercept.txt # varimp.txt # xtrain_levels.txt continuousFeature = feature[which(reference=="continuousFeature")] n_linear = length(continuousFeature) n_split = length(Rules) intercept = coef[1] max_Imp = sort(abs(importance),decreasing = TRUE)[1] rescale <- function(x){100*(x-min(x))/(max_Imp-min(x))} # rescale the importance with the largest being 100 Imp = rescale(abs(importance)) idx_sorted_Rules = sort.int(Imp,decreasing = TRUE, index.return = TRUE)$ix # export rules and varimp varimp = NULL n_positive_imp = sum(Imp>0) rego_Rules = vector(mode = "list") print(paste("number of active predictors:", n_positive_imp)) for(i in 1:n_positive_imp){ idx = idx_sorted_Rules[i] if(idx <= n_split){ # Split rule rego_rule = convertSplitRule(Rules[[idx]], coef[idx+1], Imp[idx], std_supp[idx], feature) } if(idx > n_split){ # Linear rule rego_rule = convertLinearRule(continuousFeature[idx-n_split], coef[idx+1], Imp[idx], std_supp[idx]) } rego_Rules[[i]] = rego_rule } # reference output_reference = "" for(i in 1:length(reference)){ levels = reference[[i]] if(levels[[1]] == "continuousFeature"){ output_reference = paste(output_reference, "'",feature[i] ,"'\n",sep="") }else{ output_reference = paste(output_reference,"'",feature[i],"'",sep="") for(level in levels){ output_reference = paste(output_reference,",","'",level,"'",sep="") } output_reference = paste(output_reference,"\n",sep="") } } write(intercept, file = paste(out.path, "/intercept.txt", sep="")) write(output_reference, file = paste(out.path, "/xtrain_levels.txt", sep="")) return(rego_Rules) } convertSplitRule = function(rule, coef_, Imp_, std_supp_, feature){ n_terms = length(rule) splits = vector(mode = "list") for(i_term in 1:n_terms){ condition = rule[[i_term]] if(condition[[1]] == 0){ splitType = "continuous" splitVarName = feature[condition[[2]]+1] splitRangeMin = condition[[3]] splitRangeMax = condition[[4]] split <- list(type=splitType, var = splitVarName, min = splitRangeMin, max = splitRangeMax) } else if(condition[[1]] == 1){ splitType = "categorical" splitVarName = feature[condition[[2]]+1] if(condition[[4]] == 0){ categ.cond = "not" }else{ categ.cond = "in" } level.list = c() for(i in 1:length(condition[[3]])){ level.list[i] = condition[[3]][i] + 1 } split <- list(type=splitType, var = splitVarName, cond = categ.cond, levels = level.list) } else if(condition[[1]] == 2){ splitType = 'differ' splitVarName = feature[condition[[2]]+1] if(condition[[4]] == 0){ differ.cond = "unequal" }else{ differ.cond = "equal" } differ.point = condition[[3]] split <- list(type=splitType, var = splitVarName, cond = differ.cond, point = differ.point) } else if (condition[[1]] == -1){ splitType = "isNAorLess" splitVarName = feature[condition[[2]]+1] splitRangeMin = condition[[3]] splitRangeMax = condition[[4]] split <- list(type=splitType, var = splitVarName, min = splitRangeMin, max = splitRangeMax) } else if (condition[[1]] == 3){ splitType = 'isNA' splitVarName = feature[condition[[2]]+1] if(condition[[4]] == 0){ splitIs = 'notNA' } else { splitIs = 'isNA' } split <- list(type=splitType, var = splitVarName, Is = splitIs) } splits[[i_term]] = split } rego_rule = list(type="split", supp = std_supp_, coeff = coef_, imp = Imp_, splits = splits) return(rego_rule) } convertLinearRule <- function(name_feature, coef_, Imp_, std_supp_){ return(list(type="linear", std = std_supp_, coeff = coef_, imp = Imp_, var = name_feature)) } <file_sep>/src/createFunction.r # AUTHOR: <NAME> ############################################################################### createFunction <- function(rule, feature, reference){ # input: # rule: a list of rules # feature: a list of feature names # reference: "continuousFeautre" for continuous feature # enumeric level set for categorical feature # output: # a list of binary-output functions correpsonding to rules f <- function(data){ numMatch = 0 conditionIndex = 1 while(conditionIndex <= length(rule)){ numMatch = numMatch + testCondition(data, rule[[conditionIndex]], feature, reference) conditionIndex = conditionIndex + 1 } return(numMatch == length(rule)) } return(f) } testCondition <- function(data, condition, feature, reference){ featureName = feature[[condition[[2]]+1]] # linear split if(condition[[1]] == 0){ # in H2O, NA > c (NA < c) is always 0 return((data[,featureName] > condition[[3]])&(data[,featureName] < condition[[4]])) } if(condition[[1]] == -1){ return(!(data[,featureName] > condition[[3]])) } if(condition[[1]] == 3){ if(condition[[3]] == 0){ return(1 - is.na(data[,featureName])) } else { return(is.na(data[,featureName])) } } # catigorical split if(condition[[1]] == 1){ if(condition[[4]] == 0){ if('NA' %in% reference[[condition[[2]]+1]][condition[[3]]+1]){ setContain = reference[[condition[[2]]+1]][-(condition[[3]]+1)] return(data[,featureName] %in% setContain) }else{ return(1-(data[,featureName] %in% reference[[condition[[2]]+1]][condition[[3]]+1])) } }else{ if('NA' %in% reference[[condition[[2]]+1]][condition[[3]]+1]){ setContain = reference[[condition[[2]]+1]][-(condition[[3]]+1)] return(1-(data[,featureName] %in% setContain)) }else{ return(data[,featureName] %in% reference[[condition[[2]]+1]][condition[[3]]+1]) } } } # differ split (for continuous feature only) if(condition[[1]] == 2){ if(condition[[4]] == 0){ return(data[,featureName] != condition[[3]]) }else{ return(data[,featureName] == condition[[3]]) } } } <file_sep>/src/h2oPred.R # AUTHOR: <NAME> ############################################################################### LogOdds <- function(p) { # Computes the logarithm of the odds p/(1 − p).' if (p < 0.0000001) { p <- 0.0000001 } else if (p > 0.9999999) { p <- 0.9999999 } return(log(p/(1-p))) } h2oPred <- function(data, model, Rules, keep_rules, feature, reference){ # Rule Ensemble model prediction # # Args: # data # model: final rulefit regularization model # Rules # feature: input variables # reference: 'continuous' for linear input variables # level set for categoriacal variables # # Returns: # a vector of predictions (LogOdds if classification) # # Option 1 (fast): data are stored in memory instead of h2o dataframe # skip_rules = which(h2o.coef(model)[2:(length(Rules)+1)] == 0) # keep_rules = setdiff(1:length(Rules),skip_rules) # all.coef = h2o.coef(model) # intercept = all.coef[1] # rules.coef = all.coef[keep_rules+1] # linear.coef = all.coef[(2+length(Rules)):length(all.coef)] # coef = c(intercept, rules.coef, linear.coef) # # dataALL = matrix(1, nrow = nrow(data), ncol = (1+length(keep_rules)+length(linear.coef))) # for(i in 2:ncol(dataALL)){ # if(i <= (1+length(keep_rules))){ # f_rule = createFunction(Rules[[keep_rules[i-1]]], feature, reference) # dataALL[,i] = as.matrix(f_rule(data)) # } else { # linearFeature = which(reference == 'continuousFeature') # dataALL[,i] = as.matrix(data[,linearFeature[i-(1+length(keep_rules))]]) # } # print(i) # } # pred = dataALL%*%coef # if(model@model$model_summary$family == "binomial"){ # pred = 1 - exp(pred)/(1+exp(pred)) # } # # # option 2: data are stored as h2o dataframe # skip_rules = which(h2o.coef(model)[2:(length(Rules)+1)] == 0) # keep_rules = setdiff(1:length(Rules),skip_rules) # all.coef = h2o.coef(model) # intercept = all.coef[1] # rules.coef = all.coef[keep_rules+1] # linear.coef = all.coef[(2+length(Rules)):length(all.coef)] # coef = c(intercept, rules.coef, linear.coef) # # dataALL = as.h2o(matrix(intercept, nrow = nrow(data), ncol = (1+length(keep_rules)+length(linear.coef)))) # for(i in 2:ncol(dataALL)){ # if(i <= (1+length(keep_rules))){ # f_rule = createFunction(Rules[[keep_rules[i-1]]], feature, reference) # dataALL[,i] = f_rule(data) * coef[i] # } else { # linearFeature = which(reference == 'continuousFeature') # dataALL[,i] = data[,linearFeature[i-(1+length(keep_rules))]] * coef[i] # } # print(i) # } # pred = as.vector(apply(dataALL,1,sum)) # # # if(model@model$model_summary$family == "gaussian"){ # pred = pred # } else if(model@model$model_summary$family == "binomial"){ # pred = 1 - exp(pred)/(1+exp(pred)) # } else { # error(logger, "unrecognized model family") # } # option 3: using h2o.predict (the only choice with NA values) dataOnRule = list() for(i in 1:length(Rules)){ f_rule = createFunction(Rules[[i]], feature, reference) dataOnRule[[i]] = f_rule(data) colnames(dataOnRule[[i]]) = paste("rule",i,sep="") print(i) } dataALL = h2o.cbind(dataOnRule,data) pred = h2o.predict(model, dataALL) if(model@model$model_summary$family == "gaussian"){ pred = pred } else if(model@model$model_summary$family == "binomial"){ pred = pred[,2] } else { error(logger, "unrecognized model family") } return(pred) } <file_sep>/README.md # H2O-RuleEnsemble This is based on my 2016 summer intern project at Amazon/A9 (https://www.a9.com/, Palo Alto, CA), under supervision of Dr. <NAME>. This project implemented Rule Ensembles, a Machine Learning ensemble method, on top of H2O's big-data platform. H2O provides implememnntations of the Gradient Boosting Machines and Generalized Linear Regression with Regularization (e.g. LASSO), and this work built a link between these two algorithms to implement Rule Ensembles. Specifically, individual rules are generated from the output of GBM by parsing the model definition file (given as a JAVA file), and then a GLM is fitted using these rules along with linear terms and regularization. This project follows the interface and borrowed and modified some R-ultility functions from REgo(https://github.com/intuit/rego), which is developed and maintained by Dr. <NAME>, and was initially sponsored by the Data Engineering and Analytics group (IDEA) of Intuit, Inc. <file_sep>/src/POJO_extractor_main.py # -*- coding: utf-8 -*- """ Created on Fri Jun 3 14:57:13 2016 @author: <NAME> """ ################################ extracting Rules ################################## """ need to complete: automatically find the POJO file name, convert it to txt.file then read it in. """ def pojo_extractor(path): file = open(path) fileByLine = file.readlines() fileByLetter = ''.join(fileByLine) raw_Rules = getRules(fileByLetter) [feature, reference] = getReference(fileByLine) # write and read Rules # each rule may store the references for the same condition, which causes problem with cleanRules. # when update one condition, we may change other condition in the rule, as they have the same reference. # So we using the folowing tricks to solve this, by writing and then reading the raw_Rules. import json with open("/tmp/hehe.json","w") as f: json.dump(raw_Rules, f) with open("/tmp/hehe.json") as f: Rules = json.load(f) # clean rules, i.e. merging identical rules and rules split on the same continous feature Rules = cleanRules(Rules, feature, reference) return [feature, reference, Rules] ######################### getRules ################################### def getRules(textWhole): Rules = [] readIndex = 0 textSetTable = [] textModel = [] [startModel, endModel, startSetTable, endSetTable] = [0, 0, 0, 0] nTextTree = 0 #number of 'Tree' in the text as each treeModel has two 'Tree' in front while(readIndex < len(textWhole)-4): if(textWhole[readIndex:(readIndex+4)] == 'Tree'): nTextTree = nTextTree + 1 if((textWhole[readIndex:(readIndex+4)] == 'Tree' and nTextTree%2 == 0 ) or readIndex == len(textWhole)-5): endSetTable = readIndex textSetTable = textWhole[startSetTable:endSetTable] textModel = textWhole[startModel:endModel] setTable = getSetTable(textSetTable) newRules = getRulesInTree(textModel, [], setTable) Rules.extend(newRules) if(textWhole[readIndex:(readIndex+6)] == 'pred ='): add = 1 while(textWhole[readIndex+add] != '(' and readIndex+add < len(textWhole)-1): add = add+1 startModel = readIndex + add if(textWhole[readIndex:(readIndex+12)] == 'return pred;'): endModel = readIndex - 6 startSetTable = readIndex readIndex = readIndex + 1 return Rules def getRulesInTree(text, previousRule, setTable): """ text: a list of words Rules: a list of rule's previousRules: a rule corresponding to the root node rule: a list of conditions condition: a list of [0 or 1, int, realNum or set, 0 or 1] 1st entry: 0: continuous 1: categorical 2nd entry: the ith feature 3rd entry: realNum: cutoff for continuous feature set: containingSet for categorical feature 4th entry: 0: smaller or notIn, i.e. go left 1: larger or in, i.e. go right setTable: """ if len(text)<1: return [] [condition1, condition2, text1, text2] = getCondition(text, setTable) rule1 = previousRule[:] rule1.append(condition1) rule2 = previousRule[:] rule2.append(condition2) if '?' not in text1: if '?' not in text2: return [rule1, rule2] #in this case, condition1 and condition2 are basically equivalent else: return getRulesInTree(text2, rule2, setTable) + [rule1] else: if '?' not in text2: return getRulesInTree(text1, rule1, setTable) + [rule2] else: return getRulesInTree(text1, rule1, setTable) + getRulesInTree(text2, rule2, setTable) + [rule1, rule2] def decimalToBinary(textNum): """ Convert a decimal to a reverse eight-digit binary """ binary = bin(int(textNum)%256)[2:] #after bin, there will be '0b' in front binary = '0' * (8-len(binary)) + binary return binary[::-1] def getSetTable(textSetTable): """ table: a list of setRef setRef: a list of int representing spliting subset of a condition for categorical feature """ table = [] newByte = textSetTable.find('new byte') while(newByte != -1): start = textSetTable[newByte:].find('{') + newByte end = textSetTable[newByte:].find('}') + newByte textNum = textSetTable[start+1:end].split() #still has ',', e.g. '8,' textNum[-1] += ',' textBinary = [decimalToBinary(i[:-1]) for i in textNum] textSet = ''.join(textBinary) setRef = [i for i in range(len(textSet)) if textSet.startswith('1', i)] table.append(setRef) if(textSetTable[start + 3:].find('new byte') == -1): break newByte = textSetTable[start + 3:].find('new byte') + start + 3 return table def getCondition(text, setTable): """ split a text according to ()?():() syntax text: must be in the format '(...?...:...)' """ readIndex = 1 [startCondition, endCondition] = [1, 1] [startText1, endText1, startText2, endText2] = [0, 0, 0, len(text)-1] # first split into three parts shiftA = 0 #to moniter '(' and ')' for condition, i.e. get '?' shiftB = 0 #to moniter text1 and text2 after '?' shiftC = 0 #to moniter '(' and ')' for text1 and text2, i.e. get ':' while(readIndex < len(text)): if(text[readIndex] == '(' and shiftB == 0): shiftA = shiftA + 1 if(text[readIndex] == ')' and shiftB == 0): shiftA = shiftA - 1 if(text[readIndex] == '?' and shiftB == 0 and shiftA == 0): endCondition = readIndex - 1 shiftB = 1 k = 1 #to determine the next non-null entry while(text[readIndex+k] == '\n' or text[readIndex+k] == ' '): k = k + 1 startText1 = readIndex + k if(text[readIndex] == '(' and shiftB == 1): shiftC = shiftC + 1 if(text[readIndex] == ')' and shiftB == 1): shiftC = shiftC - 1 if(text[readIndex] == ':' and shiftB == 1 and shiftC == 0): endText1 = readIndex - 1 k = 1 #to determine the next non-null entry while(text[readIndex+k] == '\n' or text[readIndex+k] == ' '): k = k + 1 startText2 = readIndex + k # print([shiftA,shiftB,shiftC]) #for debugging readIndex = readIndex + 1 textCondition = text[startCondition:(endCondition)] text1 = text[startText1:(endText1)] text2 = text[startText2:(endText2)] [condition1, condition2] = interpretCondition(textCondition, setTable) return [condition1, condition2, text1, text2] def interpretCondition(textCondition, setTable): """ generate a condition for a feature, represented by [type, indexOfFeature, reference num or set, go left or right] featureType: 0: x_i < c 1: x_i in {c_1, ..., c_k} 2: x_i != c -1: x_i is NA or x_i < c 3: x_i is NA """ featureType = 0 featureIndex = 0 featureRef = 0 if '<' in textCondition: featureType = 0 idx1 = textCondition.find('data') idx2 = min(textCondition[idx1:].find(' '), textCondition[idx1:].find(']')) featureIndex = int(textCondition[(idx1+5):(idx2+idx1)]) idx = textCondition.find('<') #to make sure 'f' we found is behind of '<' cutoff = textCondition[(idx+1):(textCondition[idx:].find('f')+idx)] featureRef = float(cutoff) #a float if 'isNaN' in textCondition: featureType = -1 else: if '!=' in textCondition and 'GRPSPLIT' not in textCondition: featureType = 2 idx1 = textCondition.find('data') featureIndex = int(textCondition[(idx1+5):(textCondition[idx1:].find(']')+idx1)]) idx2 = textCondition.find('=') #to make sure 'f' we found is behind of '=' point = textCondition[(idx2+2):(textCondition[idx2:].find('f')+idx2)] featureRef = float(point) #a float elif 'GRPSPLIT' in textCondition: featureType = 1 idx1 = textCondition.find('data') find1 = textCondition[idx1:].find(' ') find2 = textCondition[idx1:].find(']') if find1 < 0: find1 = 999999 if find2 < 0: find2 = 999999 idx2 = min(find1, find2) featureIndex = int(textCondition[(idx1+5):(idx1+idx2)]) idx3 = textCondition.find('GRPSPLIT') setIndex = int(textCondition[(idx3+8):(textCondition[idx3:].find(',')+idx3)]) idx4 = textCondition[idx3:].find(',')+idx3+1 numZeros = int(textCondition[(idx4+1):(textCondition[idx4:].find(',')+idx4)]) #number of zeros in front, i.e. bitoff featureRef = [x + numZeros for x in setTable[setIndex]] #a set else: # discard unusual splits featureType = 3 idx1 = textCondition.find('data') idx2 = textCondition[idx1:].find(']') featureIndex = int(textCondition[(idx1+5):(idx2+idx1)]) featureRef = 0 condition1 = [featureType, featureIndex, featureRef, 0] condition2 = [featureType, featureIndex, featureRef, 1] return [condition1, condition2] ######################### getReference ################################### def refine(textWhole): start = textWhole.index('// The class representing training column names\n') end = textWhole.index(' static final double score0(double[] data) {\n') return textWhole[start:(end-7)] def getReference(textWhole): """ featureNames: [nameOfFeature1, nameOfFeature2, ... , nameOfFeatureP] referenceNames: [ ["", "", ... , ""], #referecneNames for feature1 . . . ["", "", ... , ""] #referecneNames for featureP ] """ text = refine(textWhole) readIndex = 0 splitIndex = [] referenceNames = [] while(readIndex < len(text)): if(text[readIndex][:25] == '// The class representing'): splitIndex.append(readIndex) readIndex += 1 splitIndex.append(len(text)) #feature names, i.e. column names featureNames = getNames(text[splitIndex[0]:splitIndex[1]]) #if a feature is continuous, its default referenceName is 'continuousFeature' referenceNames = ['continuousFeature'] * len(featureNames) #reference names for each feature for i in range(1,len(splitIndex)-1): ref = getNames(text[splitIndex[i]:splitIndex[i+1]]) feature = text[splitIndex[i]][33:-1] if(feature in featureNames): featureIndex = featureNames.index(feature) referenceNames[featureIndex] = ref return [featureNames, referenceNames] def getNames(text): ref = [] start = text.index(' static final void fill(String[] sa) {\n') end = text.index(' }\n') for i in range(start+1, end): textLine = text[i] name = textLine[textLine.find('"')+1:-3] ref.append(name) return ref ######################### cleanRules ################################### [kmin, kmax] = [-0.9900E+36, 0.9900E+36] def cleanRules(Rules, feature, reference): Rules = convertTrick1(Rules, feature, reference) # mess up cases between categorical and continuous Rules = restructureRules(Rules) idx1 = 0 while(idx1 < len(Rules)): rule1 = Rules[idx1] idx2 = 1 while(idx1+idx2 < len(Rules)): rule2 = Rules[idx1+idx2] if(compareRules(rule1, rule2) == True): Rules.pop(idx1+idx2) idx2 -= 1 idx2 += 1 idx1 += 1 return Rules def compareRules(rule1, rule2): # this is enough as a condition can's appear twice in a rule if(len(rule1) != len(rule2)): return False for condition in rule1: if(condition not in rule2): return False return True def restructureRules(Rules): # retructure the condition on continuous feature to (type, feature, min, max) for rule in Rules: for i in range(len(rule)): rule[i] = restructureCondition(rule[i]) idx1 = 0 while(idx1 < len(rule)): condition1 = rule[idx1] idx2 = 1 while(idx1+idx2<len(rule)): condition2 = rule[idx1+idx2] if(condition1[:2] == condition2[:2] and condition1[0] == 0 ): condition1[2] = max(condition1[2], condition2[2]) condition1[3] = min(condition1[3], condition2[3]) rule.pop(idx1+idx2) idx2 = idx2-1 idx2 = idx2 + 1 idx1 = idx1+1 return Rules def restructureCondition(condition): if(condition[0] == 0 or condition[0] == -1): if(condition[3] == 0): condition[3] = condition[2] condition[2] = kmin else: condition[3] = kmax condition[0] = 0 return condition def convertTrick1(raw_Rules, feature, reference): for rule in raw_Rules: for condition in rule: if(condition[0]==0 and reference[condition[1]]!="continuousFeature"): cutoff = int(condition[2]) setContain = [i for i in range(cutoff+1)] condition[2] = setContain condition[0] = 1 return raw_Rules <file_sep>/bin/trainModel.sh #! /bin/sh #=================================================================================== # FILE: trainModel.sh # # USAGE: trainModel.sh --d=<Data spec file> --m=<Model config file> --o=<H2O config file> # # DESCRIPTION: Builds a RuleFit model with the given data source and model spec files. #=================================================================================== USAGESTR="usage: trainModel.sh --d=<Data spec file> --m=<Model config file>" # Parse arguments for i in $* do case $i in --d=*) DATA_CONF=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; --m=*) MODEL_CONF=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; *) # unknown option echo $USAGESTR exit 1 ;; esac done # Validate command-line arguments if [ -z "$DATA_CONF" -o -z "$MODEL_CONF" ]; then echo $USAGESTR exit 1 fi # Invoke R code $REGO_HOME/src/rfTrain_main.R -d ${DATA_CONF} -m ${MODEL_CONF} <file_sep>/src/rfExport.R # AUTHOR: <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/winsorize.R")) # Constants kMod.fname <- "rfmod.Rdata" kMod.xyw.fname <- "xywtrain.Rdata" kMod.x.levels.fname <- "xtrain_levels.txt" kMod.x.levels.lowcount.fname <- "xtrain_levels_lowcount.txt" kMod.x.trim.fname <- "xtrain_trim.txt" kMod.yHat.fname <- "xtrain_yHat.Rdata" kMod.varimp.fname <- "varimp.txt" kMod.rules.fname <- "rules.txt" kMod.intercept.fname <- "intercept.txt" GetColType <- function(cname, col.types) { # Returns an integer from the vector of column types matching the given column name. i.col.type <- grep(paste("^", cname, "$", sep=""), names(col.types), perl=T, ignore.case=T) if ( length(i.col.type) == 1 ) { return(col.types[i.col.type]) } else { return(NA) } } WriteLevels <- function (x.df, col.types, out.fname) { # Writes out "levels" for each column of type categorical in the given data. # # Args: # x.df : data frame # col.types : vector indicating column types -- 1:continuous # 2:categorical # out.fname : ouput file name # # Returns: # None. stopifnot(is.character(out.fname)) stopifnot(class(x.df) == "data.frame") stopifnot(length(col.types) >= ncol(x.df)) # Make sure we have the appropriate quotation mark (non-directional single # quotation mark) op <- options("useFancyQuotes") options(useFancyQuotes = FALSE) outF <- file(out.fname, "w") for (i in 1:ncol(x.df)) { cname <- colnames(x.df)[i] ctype <- GetColType(cname, col.types) if (is.na(ctype)) { error(logger, paste("WriteLevels: don't know type for this var: ", cname)) } else { if ( ctype == 2 ) { clevels <- levels(as.factor(x.df[, i])) cat(sQuote(cname), sQuote(clevels), file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } else if ( ctype == 1 ) { cat(sQuote(cname), file = outF, append = T) cat("\n", file = outF, append = T) } else { error(logger, paste("WriteLevels: don't know about this var type: ", ctype)) } } } close(outF) # Restore quotation mark options(useFancyQuotes = op) } WriteLevelsLowCount <- function (x.recoded.cat.vars, out.fname) { # Writes out low-count "levels" for columns of type categorical in the given data. # # Args: # x.recoded.cat.vars : list of <var, low-count level list> pairs # out.fname : ouput file name # # Returns: # None. stopifnot(is.character(out.fname)) stopifnot(class(x.recoded.cat.vars) == "list") # Make sure we have the appropriate quotation mark (non-directional single # quotation mark) op <- options("useFancyQuotes") options(useFancyQuotes = FALSE) outF <- file(out.fname, "w") for (i.var in 1:length(x.recoded.cat.vars)) { var.name <- (x.recoded.cat.vars[[i.var]])$var var.lcount.levels <- (x.recoded.cat.vars[[i.var]])$low.count.levels cat(sQuote(var.name), sQuote(var.lcount.levels), file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } close(outF) # Restore quotation mark options(useFancyQuotes = op) } WriteTrimQuantiles <- function(x.df, col.types, beta, out.fname, feat2winz) { # Writes out "trim" quantiles for each column of type numeric in the given # data. # # Args: # x.df : data frame # col.types : vector indicating column types -- 1:continuous # 2:categorical # out.fname : ouput file name # beta : the beta and (1-beta) quantiles of the data distribution # {x_ij} for each continuous variable x_j will be written out. # Returns: # None. stopifnot(is.character(out.fname)) stopifnot(length(col.types) >= ncol(x.df)) if (!is.na(beta)) { if (beta < 0 || beta > 0.5) { error(logger, paste("WriteTrimQuantiles: Invalid 'beta' value:", beta)) } outF <- file(out.fname, "w") for (i in 1:ncol(x.df)) { cname <- colnames(x.df)[i] ctype <- GetColType(cname, col.types) if (is.na(ctype)) { error(logger, paste("WriteTrimQuantiles: don't know type for this var:", cname)) } else { if (ctype == 1) { if (is.numeric(x.df[, i])) { l.x <- winsorize(x.df[, i], beta) if (length(l.x) != 3) { error(logger, paste("WriteTrimQuantiles: expecting 3 values from call to winsorize with this var:", cname)) } x.min2keep <- l.x$min2keep x.max2keep <- l.x$max2keep x.mean <- mean(l.x$x, na.rm = T) cat(sQuote(cname), x.min2keep, x.max2keep, x.mean, file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } else { dbg(logger, paste("WriteTrimQuantiles: can't winsorize this var:", cname)) cat(sQuote(cname), NA, NA, NA, file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } } else if (ctype == 2) { cat(sQuote(cname), NA, NA, NA, file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } else { error(logger, paste("WriteTrimQuantiles: don't know about this var type: ", ctype)) } } } close(outF) } else { # trims have already been computed if ( missing(feat2winz)) { error(logger, "WriteTrimQuantiles: 'feat2winz' must not be missing when 'beta' isn't specified") } if (class(feat2winz) != "data.frame" || length(which((names(feat2winz) == c("vname", "beta", "min2keep", "max2keep", "mean"))==T)) != 5) { error(logger, "WriteTrimQuantiles: 'feat2winz' must not be missing when 'beta' isn't specified") } outF <- file(file, "w") for (i in 1:ncol(x.df)) { cname <- colnames(x.df)[i] ctype <- GetColType(cname, col.types) if (is.na(ctype)) { error(logger, paste("WriteTrimQuantiles: don't know type for this var: ", cname)) } else { if (ctype == 1) { iRow <- grep(paste("^", cname, "$", sep=""), feat2winz$vname, perl=T) if ( length(iRow) == 1 ) { cat(sQuote(cname), feat2winz$min2keep[iRow], feat2winz$max2keep[iRow], feat2winz$mean[iRow], file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } else { error(logger, paste("WriteTrimQuantiles: Didn't find: ", cname, "in trim list")) } } else if (ctype == 2) { cat(sQuote(cname), NA, NA, NA, file = outF, sep=",", append = T) cat("\n", file = outF, append = T) } else { error(logger, paste("WriteTrimQuantiles: don't know about this var type: ", ctype)) } } } close(outF) } } ReadTrimQuantiles <- function(in.fname) { # Reads in "trim" quantiles, tuples <var-name, min, max, mean>, from the specified file. trims.df <- read.csv(in.fname, header = FALSE, stringsAsFactors = FALSE, quote="'") colnames(trims.df) <- c("vname", "min2keep", "max2keep", "mean") return(trims.df) } WriteObsIdYhat <- function(out.path, obs.id, y, y.hat, field.sep = ",", file.name = "id_y_yHat.csv") { # Writes out tuples <id, y, yHat> to a text file. Useful for loading score into a db. # # Args: # out.path : where output file will be written # obs.id : row-id values from training data-frame # y : training target vector # y.hat : predicted response on training data # Returns: # None. stopifnot(is.character(out.path)) stopifnot(length(y) == length(y.hat)) stopifnot(length(y) == length(obs.id)) out.df <- data.frame(cbind(obs.id, y, y.hat)) write.table(out.df, file = file.path(out.path, file.name), row.names = F, quote = F, na ="", sep = field.sep) } ExportModel <- function(rfmod, rfmod.path, x, y, wt, y.hat, out.path, x.df, col.types, winz=0.025, x.recoded.cat.vars=NULL) { # Writes out all components of a given RuleFit model required for a "restore" # within R, or an export as ASCII text rules. # # Args: # rfmod : rulefit model object # rfmod.path : path to rfmod related files # x : training data matrix # y : training target vector # wt : training weights # y.hat : predicted response on training data # out.path : where output (exported) files will be written # x.df : training data frame # col.types : vector indicating column types -- 1:continuous # 2:categorical # winz : a data-frame, if column-specific beta was used for winsorizing; # otherwise the 'global' beta used # x.recoded.cat.vars : list of <categorical var, low count levels> # Requires: # - REGO__HOME to be already set # # Returns: # None. stopifnot(is.character(out.path)) stopifnot(class(x) == "matrix") stopifnot(length(y) == nrow(x)) stopifnot(length(y) == length(wt)) stopifnot(length(y) == length(y.hat)) stopifnot(class(x.df) == "data.frame") stopifnot(nrow(x.df) == nrow(x) && ncol(x.df) == ncol(x)) stopifnot(length(col.types) >= ncol(x.df)) GetRules <- function(rfmod.path) { # A simplified version of RuleFit's rules() function to retrieve # the model rules as text strings. mod.stats <- scan(file.path(rfmod.path, 'rfout'), what='',quiet=T) if (!"terms" %in% mod.stats) { error(logger, "GetRules: can't find #terms in 'rfout'") } n.rules <- as.numeric(mod.stats[13]) zz <- file(file.path(rfmod.path, 'intrules'), 'wb') writeBin(as.integer(c(0, 1, n.rules)), zz, size=4); close(zz) wd <- getwd(); setwd(rfmod.path) status <- rfexe('rules') if (status != 'OK') { rfstat(); stop()} ruleList <- readLines('rulesout.hlp') unlink('rulesout.hlp') setwd(wd) return(ruleList) } GetIntercept <- function(rfmod.path) { # Returns the intercept of the RuleFit model in the given directory. if (GetRF_WORKING_DIR() == rfmod.path) { c0 <- getintercept() } else { warn(logger, paste("GetIntercept: Failed to retrieve intercept from: ", rfmod.path)) c0 <- NA } return(c0) } # Save model save(rfmod, file = file.path(out.path, kMod.fname)) # Save train <x, y, wt> data; required to restore model save(x, y, wt, file = file.path(out.path, kMod.xyw.fname)) # Save yHat (on x train) -- optional save(y.hat, file = file.path(out.path, kMod.yHat.fname)) # Write out var imp statistic vi <- varimp(plot = FALSE) sink(file.path(out.path, kMod.varimp.fname)) for (i in 1:length(vi$ord)) { cat(vi$imp[i], "\t", colnames(x)[vi$ord[i]], "\n", sep = "") } sink() # Write out rules as text -- includes coefficients. rulesStr <- GetRules(rfmod.path) sink(file.path(out.path, kMod.rules.fname)) for (i in 4:length(rulesStr)) { # skip header cat(rulesStr[i], "\n") } sink() # Write out intercept c0 <- GetIntercept(rfmod.path) sink(file.path(out.path, kMod.intercept.fname)) cat(c0, "\n") sink() # Write out levels for categ vars -- needed to decode rules later on WriteLevels(x.df, col.types, file.path(out.path, kMod.x.levels.fname)) # Write out recoded categorical variables (if any) if (!is.null(x.recoded.cat.vars) && length(x.recoded.cat.vars) > 0) { WriteLevelsLowCount(x.recoded.cat.vars, file.path(out.path, kMod.x.levels.lowcount.fname)) } # Write out trim-quantiles -- needed to run model outside R if ( class(winz) == "data.frame") { WriteTrimQuantiles(x.df, col.types, beta=NA, file.path(out.path, kMod.x.trim.fname), winz) } else { WriteTrimQuantiles(x.df, col.types, beta=winz, file.path(out.path, kMod.x.trim.fname)) } } LoadModel <- function(model.path) { # Loads previously exported RuleFit model components required for a "restore" # operation. # # Args: # model.path : path to RuleFit model exported files # # Returns: # Tuple <rfmod, x, y, wt> # # Notes: # - Should be followed by rfrestore(rfmod, x=x, y=y, wt=wt). stopifnot(is.character(model.path)) if (file.access(model.path, mode=4) != 0) { error(logger, paste("LoadModel: Path: '", model.path, "' is not accessible")) } if (!file.exists(file.path(model.path, kMod.xyw.fname))) { error(logger, paste("LoadModel: Can't find file: ", kMod.xyw.fname)) } if (!file.exists(file.path(model.path, kMod.fname))) { error(logger, paste("LoadModel: Can't find file: ", kMod.fname)) } # Load <x, y> data saved.objs <- load(file = file.path(model.path, kMod.xyw.fname)) if (any(saved.objs != c("x", "y", "wt"))) { error(logger, paste("LoadModel: Failed to find required objects in: ", file.path(model.path, kMod.xyw.fname))) } # Load RuleFit model saved.objs <- load(file = file.path(model.path, kMod.fname)) if ( length(which((saved.objs == c("rfmod")) == T)) != 1 ) { error(logger, paste("LoadModel: Failed to find required objects in: ", file.path(model.path, kMod.fname))) } return(list(rfmod = rfmod, x = x, y = y, wt = wt)) } <file_sep>/src/rfLoadData.R # AUTHOR: <NAME> ############################################################################### source(file.path(REGO_HOME, "/src/rfTrain.R")) source(file.path(REGO_HOME, "/src/rfPreproc.R")) rfLoadData <- function(conf){ if (conf$data.source.type == "rdata") { print("reading RData...") envir <- new.env() load(file.path(conf$rdata.path, conf$rdata.fname), envir = envir) if (is.null(conf$rdata.dfname)) { dfname <- ls(envir) stopifnot(length(dfname) == 1) } else { dfname <- conf$rdata.dfname } data <- get(dfname, envir, inherits = FALSE) stopifnot(is.data.frame(data)) # convert to h2o data frame data = as.h2o(data) if(sum(!is.na(as.vector(h2o.unique(data[,conf$col.y])))) == 2){ data[,conf$col.y] = as.factor(data[,conf$col.y]) } rm(envir) } else if (conf$data.source.type == "csv") { col.types = scan(conf$col.types.fname, what = "character") data <- h2o.uploadFile(file.path(conf$csv.path, conf$csv.fname), sep = ",", col.types = col.types) } else if (conf$data.source.type == "hdfs") { col.types = scan(conf$col.types.fname, what = "character") data = h2o.importFile(path = paste("hdfs://", conf$hdfs.server, conf$hdfs.fname, sep=""), col.types = col.types) } else { error(logger, paste("rfTrain_main.R: unknown data source type ", conf$data.source.type)) } # data.out <- EnforceFactors(data, col.types, conf$min.level.count)$x return(data) }
aa367404f35f7c40677be2859836d718ac27ccb4
[ "Markdown", "Python", "Text", "R", "Shell" ]
21
R
xiaoyudai/H2O-RuleEnsemble
224e21388613fcc296935f46361beafca7c1be98
d6451bb2ef2f5226a0fc6340c9552b9404c6a9b1
refs/heads/master
<file_sep> const express = require("express"); const router = express.Router(); //get controllers const authController = require("../controller/auth"); const userController = require("../controller/user"); const tweetController = require("../controller/tweet"); //get user info router .route("/user/:userId") .get(authController.requireSignin, userController.getUserProfile); //get user info router .route("/users/all") .get(authController.requireSignin, userController.getAllProfile); //other user info router .route("/user/other/:userId") .get(authController.requireSignin, userController.getOtherUserProfile); //follow user router .route("/user/follow/:userId") .put(authController.requireSignin, userController.putFollowUser); //unfollow user router .route("/user/unfollow/:userId") .put(authController.requireSignin, userController.putUnFollowUser); //get user info from user id router.param("userId", userController.userByID); //get post info from post id router.param("postId", tweetController.postByID); module.exports = router;<file_sep>import React, { useState } from "react"; import { Container, Row, Col } from "react-bootstrap"; import { Link } from "react-router-dom"; import { useForm } from "react-hook-form"; import Navbar from "../Navbar/NavbarShow"; //get api import { isAuthenticate } from "../../api/auth"; import { createTweet } from "../../api/tweet"; const CreateTweet = () => { let [error, setError] = useState(0); let [success, setSuccess] = useState(0); let [tweetId, setTweetId] = useState(0); const { register, handleSubmit, setValue, formState: { errors }, } = useForm(); //get user info const { user, token } = isAuthenticate(); //handel submit const onSubmit = (data) => { createTweet(data, user._id, token).then((data) => { if (data.error) { setError(1); setSuccess(0); } else { setSuccess(1); setError(0); setTweetId(data.data._id); setValue("text", "", { shouldValidate: false }); } }); }; //show form const showTweetForm = () => ( <Container> <Row> <Col md={8} className="offset-md-2"> <h3 className="text-center">Whats on Your Mind?</h3> <form onSubmit={handleSubmit(onSubmit)}> <p> Write Your Tweet Here:{" "} <span className="text-danger"> {errors.text && "This Field is Required"} </span> </p> <textarea rows={15} style={{ minWidth: "100%" }} placeholder="Describe yourself here..." {...register("text", { required: true, maxLength: 5000 })} ></textarea> <button className="btn btn-outline-danger float-right mt-3" type="submit" > Tweet </button> </form> </Col> </Row> </Container> ); /// show success message let showSuccess = () => { if (success === 1) { return ( <Container> {" "} <Row> {" "} <Col md={12}> <p className="text-success"> Tweet Published Successfully!{" "} <Link to={`/tweet/details/${tweetId}`}>View</Link> </p> </Col>{" "} </Row>{" "} </Container> ); } else { return ""; } }; /// show error message let showError = () => { if (error === 1) { return ( <Container> {" "} <Row> {" "} <Col md={12}> <p className="text-danger"> Somting went Wrong! Please Try Again. </p>{" "} </Col>{" "} </Row>{" "} </Container> ); } else { return ""; } }; return ( <> <Navbar></Navbar> {showSuccess()} {showError()} {showTweetForm()} </> ); }; export default CreateTweet; <file_sep>const User = require("../models/User"); const Tweet = require("../models/Tweet"); //find user by id exports.userByID = (req, res, next, id) => { //console.log(id); User.findById(id).exec((err, user) => { if (err || !user) { return res.status(400).json({ error: "User not Found", }); } req.profile = user; next(); }); }; //get user profile exports.getUserProfile = (req, res, next) => { req.profile.hashPassword = <PASSWORD>; // console.log(req.profile) let user = req.profile; Tweet.find({ author: req.profile._id }) .sort( { 'createdAt' : -1 }) .exec((err, result) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { return res.json({ user: user, tweets: result, }); } }); }; //get all user data exports.getAllProfile = (req, res, next) => { //console.log("here" req.auth.id); User.find({ _id: { $ne: req.auth.id } }).exec((err, result) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { result.hashPassword = <PASSWORD>; return res.json({ users: result, }); } }); }; //get other user profile exports.getOtherUserProfile = (req, res, next) => { User.findById({ _id: req.profile._id }).exec((err, user) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { user.hashPassword = <PASSWORD>; Tweet.find({ author: req.profile._id }) .sort( { 'createdAt' : -1 }) .exec((err1, tweets) => { if (err1) { return res.status(400).json({ error: "Something went wrong", }); } else { return res.json({ user: user, tweets: tweets, }); } }); } }); }; // follow user exports.putFollowUser = (req, res, next) => { // console.log(req.auth.id); // console.log(req.profile._id); // user can't follow himself if (req.auth.id == req.profile._id) { return res.status(400).json({ error: "You Can't follow yourself", }); } User.findByIdAndUpdate( req.profile._id, { $push: { followers: req.auth.id }, }, { new: true, }, (err, result) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { User.findByIdAndUpdate( req.auth.id, { $push: { following: req.profile._id }, }, { new: true, }, (err1, result1) => { if (err1) { return res.status(400).json({ error: "Something went wrong", }); } else { result.hashPassword = undefined return res.json({ user: result }); } } ); } } ); }; //unfollow user exports.putUnFollowUser = (req,res,nex) =>{ // user can't unfollow himself if (req.auth.id == req.profile._id) { return res.status(400).json({ error: "You Can't unfollow yourself", }); } User.findByIdAndUpdate( req.profile._id, { $pull: { followers: req.auth.id }, }, { new: true, }, (err, result) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { User.findByIdAndUpdate( req.auth.id, { $pull: { following: req.profile._id }, }, { new: true, }, (err1, result1) => { if (err1) { return res.status(400).json({ error: "Something went wrong", }); } else { result.hashPassword = <PASSWORD> return res.json({ user: result }); } } ); } } ); } <file_sep>import React, { useState, useEffect } from "react"; import { Container, Row, Col } from "react-bootstrap"; import { Link, useParams } from "react-router-dom"; import Navbar from '../Navbar/NavbarShow' //api method import { getOtherProfile, putFollowUser, putUnFollowUser, } from "../../api/user"; import { isAuthenticate } from "../../api/auth.js"; const OtherUser = () => { let [error, setError] = useState(0); let [otherUserInfo, setOtherUserInfo] = useState({}); let [otherUserTweets, setOtherUserTweets] = useState([]); //get user info const { user, token } = isAuthenticate(); //url params const params = useParams(); //get user info useEffect(() => { //console.log(params) getOtherProfile(params, token).then((data) => { if (data.error) { setError(data.error); throw error; } else { setOtherUserInfo(data.user); setOtherUserTweets(data.tweets); } }); }, []); //follow user let follow = () => { putFollowUser(params, token).then((data) => { if (data.error) { setError(data.error); throw error; } else { setOtherUserInfo(data.user); } }); }; //unfollow user let unfollow = () => { putUnFollowUser(params, token).then((data) => { if (data.error) { setError(data.error); throw error; } else { setOtherUserInfo(data.user); } }); }; //show all tweets let showTweets = (tweets) => ( <Container> <Row> {tweets.map((t, i) => { return ( <Col key={i} md={12}> <div className="inline"> <h5 className="text-success">{t.text}</h5> <button className="float-right btn btn-outline-info"> <Link to={`/tweet/details/${t._id}`} className="viewDetails">View Details</Link> </button> <hr className="mt-5" /> </div> </Col> ); })} </Row> </Container> ); //show follow / unfollow button let showFollowUnfollowBtn = () => { let isFollow = false; //check if the authenticate user follow this user if (otherUserInfo.followers) { for (let i = 0; i < otherUserInfo.followers.length; i++) { if (otherUserInfo.followers[i] === user._id) { isFollow = true; break; } } } if (isFollow === true) { return ( <button className="btn btn-outline-danger float-right" onClick={unfollow} > Unfollow </button> ); } else { return ( <button className="btn btn-outline-warning float-right" onClick={follow} > Follow </button> ); } }; //show user profile let showProfile = () => ( <Container> <Row> <Col md={4}> <h3 className="text-info">User Name: <br /> {otherUserInfo.username}</h3> <Row> <Col md={6} className="text-center"> <h5 className="text-danger"> {" "} {otherUserInfo.following ? otherUserInfo.following.length : 0} </h5> <h5>Following</h5> </Col> <Col md={6} className="text-center"> <h5 className="text-danger"> {otherUserInfo.followers ? otherUserInfo.followers.length : 0} </h5> <h5>Followers</h5> </Col> <Col md={12}>{showFollowUnfollowBtn()}</Col> </Row> </Col> <Col md={8}> <h4>{otherUserInfo.username}'s All Tweets</h4> <h5>Total: {otherUserTweets ? otherUserTweets.length : 0}</h5> <hr /> { otherUserTweets && otherUserTweets.length > 0 ? "" : <h5 className="alert alert-warning text-center"> No Tweets Found :( </h5>} {otherUserTweets ? showTweets(otherUserTweets) : ""} </Col> </Row> </Container> ); return ( <> <Navbar></Navbar> {showProfile()} </> ); }; export default OtherUser; <file_sep>import React from "react"; import { Link } from "react-router-dom"; import { Navbar, Nav, } from "react-bootstrap"; import { signout, isAuthenticate } from "../../api/auth"; //css import './NavbarShow.css' const NavbarShow = () => { //get user info const { user } = isAuthenticate(); return ( <div className="navbar_nav"> <Navbar expand="lg" bg="dark" variant="dark"> <Navbar.Brand as={Link} to="/" className="brandName"> Twitter Clone </Navbar.Brand> <Navbar.Toggle aria-controls="basic-navbar-nav" /> <Navbar.Collapse id="basic-navbar-nav"> <Nav className="ml-auto"> <Nav.Link as={Link} to="/" className="navLink"> Home </Nav.Link> {!isAuthenticate() && ( <> <Nav.Link as={Link} className="navLink" to="/signin"> Signin </Nav.Link> <Nav.Link as={Link} className="navLink" to="/signup"> Signup </Nav.Link> </> )} {isAuthenticate() && ( <> <Nav.Link as={Link} className="navLink" to="/user/profile"> {user.username} </Nav.Link> <Nav.Link as={Link} className="navLink" to="/tweet"> Tweet </Nav.Link> <Nav.Link as={Link} className="navLink" to="/user/find"> Find User </Nav.Link> <Nav.Link as={Link} className="navLink" to="/" onClick={() => signout()}> Signout </Nav.Link> </> )} </Nav> </Navbar.Collapse> </Navbar> <hr /> </div> ); }; export default NavbarShow; <file_sep>const User = require("../models/User.js"); const bcrypt = require("bcryptjs"); const jwt = require("jsonwebtoken"); const expressJWT = require("express-jwt"); require('dotenv').config(); //require sign in exports.requireSignin = expressJWT({ secret: process.env.JWT_SECRET, algorithms: ["HS256"], userProperty: "auth", }); //check if the user is loged in exports.isAuth = (req, res, next) => { let user = req.profile && req.auth && req.profile._id == req.auth.id; //console.log(req.profile._id, req.auth.id); if (!user) { return res.status(403).json({ error: "Access Denied", }); } next(); }; //check if the user is the author of a tweet exports.isAuthor = (req, res, next) => { if (!req.profile._id == req.tweet.author) { return res.status(403).json({ error: "Access Denied", }); } next(); }; // create user account exports.postSignUp = (req,res,next) =>{ const { name, email, password } = req.body; //hash the password const salt = bcrypt.genSaltSync(10); const hash = bcrypt.hashSync(password, salt); const user = new User({ username: name, email: email, hashPassword: hash }); user.save((err, user) => { if (err) { //console.log(err) return res.status(400).json({ error: "Email Already in Use", }); } user.hashPassword = <PASSWORD>; return res.json({ user, }); }); } //user login exports.postSignin = (req,res,next) => { const { email, password } = req.body; User.findOne({ email }, (err, user) => { if (err || !user) { return res.status(400).json({ error: "Email is Not Registred!! Please Signup First", }); } //if user is not authenticated if (!user.authenticate(password)) { return res.status(401).json({ error: "Email and Password dont Match", }); } //create jwt token const token = jwt.sign({ id: user._id }, process.env.JWT_SECRET); res.cookie("t", token, { expire: new Date() + 9999 }); const { _id, username, email } = user; return res.json({ token, user: { _id, email, username, }, }); }); } //user signout exports.signout = (req, res, next) => { res.clearCookie('t'); res.json({ message: "Signout Successfully" }); } <file_sep>import React, { useState, useEffect } from "react"; import { Container, Row, Col, Card } from "react-bootstrap"; import { getAllProfile } from "../../api/user"; import { isAuthenticate } from "../../api/auth.js"; import { Link } from "react-router-dom"; import Navbar from '../Navbar/NavbarShow' const AllUser = () => { let [error, setError] = useState(0); let [usersInfo, setUsersInfo] = useState([]); //get user info const { token } = isAuthenticate(); //get users data useEffect(() => { getAllProfile(token).then((data) => { if (data.error) { setError(data.error); } else { setUsersInfo(data.users); } }); }, []); //show user card let showUsersCard = (users) => ( <Container> <Row> {users.map((user, i) => { return ( <Col md={4} key={i}> <Card> <Card.Body> <Card.Title>{user.username}</Card.Title> <Card.Subtitle className="mb-2 text-muted"> Total Follower:{" "} {user.followers ? user.followers.length : 0} </Card.Subtitle> <Card.Link as={Link} to={`/profile/${user._id}`}>View Profile</Card.Link> </Card.Body> </Card> </Col> ); })} </Row> </Container> ); return ( <> {" "} <Navbar></Navbar> <Container> <Row> <Col md={12}> <h1>Total User Found: <span className="text-danger"> {usersInfo ? usersInfo.length : 0} </span> </h1> {error ? <h5 className="alert alert-danger"> {error} </h5> : "" } {usersInfo && usersInfo.length >0 ? "" : <h5 className="alert alert-warning text-center"> No Other User Found :( </h5>} <hr /> </Col> </Row> </Container> {usersInfo ? ( showUsersCard(usersInfo) ) : ( <Container> <h3 className="text-warning">No User Found!</h3>{" "} </Container> )} </> ); }; export default AllUser; <file_sep> const express = require("express"); const router = express.Router(); //get controllers const authController = require("../controller/auth"); //create account router.route("/signup") .post(authController.postSignUp); //user login router.route("/signin") .post(authController.postSignin); // user logout router.route('/signout') .get(authController.signout) module.exports = router;<file_sep>import React, { useState, useEffect } from "react"; import { Container, Row, Col } from "react-bootstrap"; import Navbar from "../Navbar/NavbarShow"; import { Link } from "react-router-dom"; //api method import { getProfile } from "../../api/user"; import { isAuthenticate } from "../../api/auth"; import { deleteTweet } from "../../api/tweet"; const Profile = () => { let [error, setError] = useState(0); let [success, setSuccess] = useState(0); let [userInfo, setUserInfo] = useState({}); let [userTweets, setUserTweets] = useState([]); //get user info const { user, token } = isAuthenticate(); //get user info useEffect(() => { getProfile(user._id, token).then((data) => { if (data.error) { setError(data.error); } else { setError(0); setUserInfo(data.user); setUserTweets(data.tweets); } }); }, []); //delete a tweet let deletePost = (postId) => { console.log(postId); deleteTweet(postId, user._id, token).then((data) => { if (data.error) { setError(data.error); setSuccess(0); } else { setUserTweets(data.tweets); setError(0); setSuccess(data.message) } }); }; //show all tweets let showTweets = (tweets) => ( <Container> <Row> {tweets.map((t, i) => { return ( <Col key={i} md={12}> <div className="inline"> <h3 className="text-success">{t.text.substring(0, 10)}...</h3> <div className="float-right"> <button className="btn btn-outline-info mr-2"> {" "} <Link to={`/tweet/details/${t._id}`} className="viewDetails"> View Details </Link>{" "} </button> {t.author === user._id ? ( <button className="btn btn-outline-danger" onClick={() => deletePost(t._id)} > Delete </button> ) : ( "" )} </div> <hr className="mt-5" /> </div> </Col> ); })} </Row> </Container> ); //show user profile let showProfile = () => ( <Container> <Row> <Col md={6}> <h2>User Profile</h2> <h3 className="text-warning">{userInfo.username}</h3> </Col> <Col md={3} className="text-center"> <h2 className="text-danger"> {userInfo.following ? userInfo.following.length : 0}</h2> <h4>Following</h4> </Col> <Col md={3} className="text-center"> <h2 className="text-danger">{userInfo.followers ? userInfo.followers.length : 0}</h2> <h4>Followers</h4> </Col> <Col md={12} className="mt-5"> <hr /> { success ? <h3 className="alert alert-success">{success}</h3> : ''} { error ? <h3 className="alert alert-danger">{error}</h3> : ''} <h4>{userInfo.username}'s All Tweets</h4> <h5>Total: {userTweets ? userTweets.length : 0}</h5> <hr /> { userTweets && userTweets.length > 0 ? "" : <h5 className="alert alert-warning text-center"> No Tweets Found :( </h5>} {userTweets ? showTweets(userTweets) : ""} </Col> </Row> </Container> ); return ( <> <Navbar></Navbar> {showProfile()} </> ); }; export default Profile; <file_sep>const mongoose = require("mongoose"); const { ObjectId } = mongoose.Schema; const tweetSchema = new mongoose.Schema( { author:{ type:ObjectId, ref:"User", required: true, }, text: { type: String, trim: true, required: true, maxlenght: 5000, }, likes: [{ type: ObjectId, ref: "User" }], }, { timestamps: true } ); module.exports = mongoose.model("Tweet", tweetSchema); <file_sep>const express = require("express"); const router = express.Router(); //get controllers const authController = require("../controller/auth"); const userController = require("../controller/user"); const tweetController = require("../controller/tweet"); //create a new tweet router .route("/tweet/post/:userId") .post( authController.requireSignin, authController.isAuth, tweetController.postCreatNewTweet ); //delete tweet router .route("/tweet/delete/:postId/:userId") .delete( authController.requireSignin, authController.isAuth, authController.isAuthor, tweetController.deleteTweet ); //view details tweet router .route("/tweet/details/:postId") .get(authController.requireSignin, tweetController.getTweetDetails); //like a tweet router .route("/tweet/like/:postId") .put(authController.requireSignin, tweetController.putLike); //unlike a tweet router .route("/tweet/unlike/:postId") .put(authController.requireSignin, tweetController.putUnLike); //get tweets for home page router .route("/tweets") .get(authController.requireSignin, tweetController.getTweets); //get user info from user id router.param("userId", userController.userByID); //get post info from post id router.param("postId", tweetController.postByID); module.exports = router; <file_sep># Twitter-Clone ## .env file 1. Create a .env file and add Environment Variable in `api` folder ```env PORT=YOUR_PORT (Default port is 8000) DATABASE=YOUR_DB_URL (you can use this if you want to run it in locally: mongodb://localhost/twitter_clone) SALT=10 JWT_SECRET=RANDOM_STRING ``` 2. Create a .env file and add Environment Variable in `ui` folder ```env REACT_APP_API_URL=http://localhost:8000/api ``` ## How to Run? * Open both folder and run: `npm install` * After installation, run booth application at the same time with: `npm start` ## Check Application * Then: http://localhost:3000/ <file_sep>const mongoose = require("mongoose"); const { ObjectId } = mongoose.Schema; const bcrypt = require("bcryptjs"); const userSchema = new mongoose.Schema( { username: { type: String, trim: true, required: true, maxlenght: 32, }, email: { type: String, trim: true, required: true, unique: true, }, hashPassword: { type: String, required: true, }, followers: [{ type: ObjectId, ref: "User" }], following: [{ type: ObjectId, ref: "User" }], }, { timestamps: true } ); //add Methods userSchema.methods = { //check password authenticate: function (plainText) { return bcrypt.compareSync(plainText, this.hashPassword); }, }; module.exports = mongoose.model("User", userSchema); <file_sep>import React, { useState, useEffect } from "react"; import { Container, Row, Col } from "react-bootstrap"; import HomeSingleTweet from "../HomeSingleTweet/HomeSingleTweet"; import { Link } from "react-router-dom"; import Navbar from "../Navbar/NavbarShow"; //api method import { isAuthenticate } from "../../api/auth"; import { getTweets } from "../../api/tweet"; const Home = () => { let [error, setError] = useState(0); var [allTweets, setallTweets] = useState([]); let [next, setNext] = useState(0); let [prev, setPrev] = useState(0); //get user info const { user, token } = isAuthenticate(); //get user info useEffect(() => { if (token) { getTweets(token).then((data) => { if (data.error) { setError(data.error); } else { setError(0); setallTweets(data.tweets); setNext(data.nextPage); setPrev(data.prevPage); } }); } }, []); //render all tweets let showTweets = () => { console.log( allTweets , allTweets.length > 0); return allTweets && allTweets.length > 0? ( allTweets.map((t, i) => { return <HomeSingleTweet key={i} tweet={t}></HomeSingleTweet>; }) ) : ( <Container> <Row> <Col md={8} className="offset-md-2 text-center"> <h4 className="alert alert-warning text-center">No tweets Yet :(</h4> </Col> </Row> </Container> ); }; //show msg for un-autherized user let showWelcomeMsg = () => { return ( <Container> <Row> <Col md={8} className="offset-md-2 text-center"> <h1>Welcome to Twitter Clone</h1> <h3> Please <Link to={"/signin"}> Login </Link>for procced </h3> <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages </p> </Col> </Row> </Container> ); }; //get new page data from pagination let newPage = (page) => { setallTweets([]); getTweets(token, page).then((data_new) => { if (data_new.error) { setError(data_new.error); } else { setError(0); setallTweets(data_new.tweets); setNext(data_new.nextPage); setPrev(data_new.prevPage); } }); }; //next page button let showNext = () => { return ( <button className="btn btn-outline-info ml-2" onClick={() => newPage(next)} > Next </button> ); }; //previous page button let showPrev = () => { return ( <button className="btn btn-outline-info mr-2" onClick={() => newPage(prev)} > Prev </button> ); }; //render those pagination let showPagination = () => { return ( <Container> <Row> <Col md={8} className="offset-md-2 text-center mb-5"> <div className="inline"> {prev ? showPrev() : ""} {next ? showNext() : ""} </div> </Col> </Row> </Container> ); }; //random msg let userMessage = () => { return ( <Container> <Row> <Col md={12}> <h1 className="text-info">Get The Latest Tweet..</h1> { error ? <h4 className="alert alert-danger"> {error} </h4> : '' } </Col> </Row> </Container> ); }; return ( <div> <Navbar></Navbar> {user ? userMessage(): ''} {user ? showTweets() : showWelcomeMsg()} {showPagination()} </div> ); }; export default Home; <file_sep>const Tweet = require("../models/Tweet"); const User = require("../models/User"); //get tweet info from its id exports.postByID = (req, res, next, id) => { Tweet.findById(id).exec((err, tweet) => { if (err || !tweet) { return res.status(400).json({ error: "Tweet not Found", }); } req.tweet = tweet; next(); }); }; //create new tweet exports.postCreatNewTweet = (req, res, next) => { const { text } = req.body; const authorId = req.profile._id; //valid content if (text.length <= 0) { return res.status(400).json({ error: "Tweet Required", }); } //create tweet const post = new Tweet({ author: authorId, text: text, }); post.save((err, data) => { if (err) { //console.log(err) return res.status(400).json({ error: err, }); } return res.json({ data, }); }); }; //delete a tweet exports.deleteTweet = (req, res, next) => { let tweet = req.tweet; tweet.remove((err, result) => { if (err) { return res.status(400).json({ error: err, }); } Tweet.find({ author: result.author }).exec((err, tweets) => { if (err) { return res.status(400).json({ error: "Somting went wrong", }); } else { return res.json({ message: "Tweet deleted Successfully", tweets: tweets, }); } }); }); }; //get tweet details exports.getTweetDetails = (req, res, next) => { Tweet.findById(req.tweet._id) .populate("author", "_id username") .sort("-created") .exec((err, tweet) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { return res.json({ tweet: tweet, }); } }); }; //like a post exports.putLike = (req, res, next) => { Tweet.findByIdAndUpdate( req.tweet._id, { $push: { likes: req.auth.id }, }, { new: true, }, (err, result) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { Tweet.findById(result._id) .populate("author", "_id username") .sort("-created") .exec((err, tweet) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { return res.json({ tweet: tweet, }); } }); } } ); }; //unlike a post from like exports.putUnLike = (req, res, next) => { Tweet.findByIdAndUpdate( req.tweet._id, { $pull: { likes: req.auth.id }, }, { new: true, }, (err, result) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { Tweet.findById(result._id) .populate("author", "_id username") .sort("-created") .exec((err, tweet) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { return res.json({ tweet: tweet, }); } }); } } ); }; //get tweets exports.getTweets = (req, res, next) => { let { page = 1 } = req.query; let limit = 10; page = parseInt(page); const startIndex = (page - 1) * limit; const endIndex = page * limit; let nextPage = 0, prevPage = 0; User.findById(req.auth.id).exec((err, user) => { if (err) { throw err; } else { user.following.push(req.auth.id); Tweet.find({ author: { $in: user.following } }) .populate("author", "_id username") .sort({ createdAt: -1 }) .exec((err, tweets) => { if (err) { return res.status(400).json({ error: "Something went wrong", }); } else { if (endIndex < tweets.length) { nextPage = page + 1; } if (startIndex > 0) { prevPage = page - 1; } return res.json({ nextPage: nextPage, prevPage: prevPage, tweets: tweets.slice(startIndex, endIndex), }); } }); } }); };
6e3317a9f47d459a0becedcf7b7d70c7e9693e01
[ "JavaScript", "Markdown" ]
15
JavaScript
SabiulSabit/Twitter-Clone
755d751295ad80aea0dc604072120ceecda4a681
eb119c8b9f749350770b715cfa8d69f68fb2e15b
refs/heads/master
<file_sep>### Notes List Details 1. git clone repo into dir 2. cd dir 3. npm install 4. install http-server -g 5. from dir run http-server: hs -o <file_sep> /* ======= Model ======= */ var model = { currentNote: null, notes: [ { clickCount : 0, name : 'Note 01', description: "Das ist Text um die Notizz zu beschreiben", finished: false, category: "Html", rating: 5, dueDate:"2016-01-01", createDate:"2016-01-01" }, { clickCount : 0, name : 'Note 02', description: "Das ist Text um die Notizz zu beschreiben", finished: false, category: "Html", rating: 4, dueDate:"2016-01-02", createDate:"2016-01-01" }, { clickCount : 0, name : 'Note 03', description: "Das ist Text um die Notizz zu beschreiben", finished: false, category: "Html", rating: 3, dueDate:"2016-01-03", createDate:"2016-01-01" }, { clickCount : 0, name : 'Note 04', description: "Das ist Text um die Notizz zu beschreiben", finished: false, category: "Html", rating: 5, createDate:"2016-01-01", dueDate:"2016-01-08" }, { clickCount : 0, name : 'Note 05', description: "Das ist Text um die Notizz zu beschreiben", finished: false, category: "Html", rating: 5, createDate:"2016-01-01", dueDate:"2016-01-10" } ] }; /* ======= viewModel ======= */ var viewModel = { init: function() { // set our current note to the first one in the list model.currentNote = model.notes[0]; // tell our views to initialize noteListView.init(); noteView.init(); }, getCurrentNote: function() { return model.currentNote; }, getNotes: function() { return model.notes; }, // set the currently-selected note to the object passed in setCurrentNote: function(note) { model.currentNote = note; }, // increments the counter for the currently-selected note incrementCounter: function() { model.currentNote.clickCount++; noteView.render(); } }; /* ======= View ======= */ var noteView = { init: function() { // store pointers to our DOM elements for easy access later this.noteElem = document.getElementById('note-details'); this.noteNameElem = document.getElementById('note-name'); //this.noteImageElem = document.getElementById('note-img'); //this.countElem = document.getElementById('note-count'); // on click, increment the current note's counter //this.noteImageElem.addEventListener('click', function(){ // viewModel.incrementCounter(); //}); // render this view (update the DOM elements with the right values) this.render(); }, render: function() { // update the DOM elements with values from the current note var currentNote = viewModel.getCurrentNote(); //this.countElem.textContent = currentNote.clickCount; this.noteNameElem.textContent = currentNote.name; //this.noteImageElem.src = currentNote.imgSrc; } }; var noteListView = { init: function() { // store the DOM element for easy access later this.noteListElem = document.getElementById('note-list'); // render this view (update the DOM elements with the right values) this.render(); }, render: function() { var note, elem, i; // get the notes we'll be rendering from the viewModel var notes = viewModel.getNotes(); // empty the note list this.noteListElem.innerHTML = ''; // loop over the notes for (i = 0; i < notes.length; i++) { // this is the note we're currently looping over note = notes[i]; // make a new note list item and set its text elem = document.createElement('li'); elem.textContent = note.name; // on click, setcurrentNote and render the noteView // (this uses our closure-in-a-loop trick to connect the value // of the note variable to the click event function) elem.addEventListener('click', (function(noteCopy) { return function() { viewModel.setCurrentNote(noteCopy); noteView.render(); }; })(note)); // finally, add the element to the list this.noteListElem.appendChild(elem); } } }; // make it go! viewModel.init();
1ce38d5418894e8959d29adc9ae0fe4da89077fa
[ "Markdown", "TypeScript" ]
2
Markdown
hans-hsr/notes-clicker
d0228e02c1c1c4fbac33d75b3da76fb4a6f6e91c
fb394687846d56eabc1d13a0ccc7fd66f917827d
refs/heads/master
<repo_name>krorvik/puppet-prometheus<file_sep>/Vagrantfile # -*- mode: ruby -*- # vi: set ft=ruby : $setupdebian = <<EOF apt-get update apt-get install --yes puppet-agent git vim sudo gpg --keyserver pgp.<EMAIL> --recv-keys 670540C841468433 &> /dev/null locale-gen nb_NO.UTF-8 EOF $setupxenial = <<EOF wget -q http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb dpkg -i puppetlabs-release-pc1-xenial.deb EOF $setupjessie = <<EOF wget -q http://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb dpkg -i puppetlabs-release-pc1-jessie.deb EOF $setupcentos7 = <<EOF rpm -Uvh http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm yum -y install puppet-agent git vim EOF $puppet = <<EOF puppet apply --modulepath=/puppet /puppet/prometheus/examples/all.pp netstat -nlt EOF Vagrant.configure(2) do |config| config.vm.define "jessie" do |jessie| jessie.vm.box = "debian/jessie64" jessie.vm.synced_folder ".", "/puppet/prometheus", type: "rsync", rsync__exclude: "spec/fixtures" jessie.vm.provision "shell", inline: $setupjessie jessie.vm.provision "shell", inline: $setupdebian jessie.vm.provision "shell", inline: $puppet end config.vm.define "xenial" do |xenial| xenial.vm.box = "gbarbieru/xenial" xenial.vm.synced_folder ".", "/puppet/prometheus", type: "rsync", rsync__exclude: "spec/fixtures" xenial.vm.provision "shell", inline: $setupdebian xenial.vm.provision "shell", inline: $puppet end config.vm.define "centos7" do |centos7| centos7.vm.hostname = "pat.local.vm" centos7.vm.box = "bento/centos-7.2" centos7.vm.synced_folder ".", "/puppet/prometheus", type: "rsync", rsync__exclude: "spec/fixtures" centos7.vm.provision "shell", inline: $setupcentos7 centos7.vm.provision "shell", inline: $puppet end config.vm.provider :libvirt do |lv| lv.memory = 1536 end end <file_sep>/spec/spec_helper.rb require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-utils' #ENV['FUTURE_PARSER'] = 'yes' ENV['STRICT_VARIABLES'] = 'yes' #ENV['TRUSTED_NODE_DATA'] = 'yes' RSpec.configure do |c| #c.formatter = 'documentation' #c.mock_with :rspec c.hiera_config = File.expand_path(File.join(__FILE__, '../../hiera.yaml')) c.default_facts = { :osfamily => "Debian", :operatingsystem => "ubuntu", :operatingsystemrelease => "16.04", :lsbdistid => "Ubuntu", :lsbdistrelease => "16.04", :lsbdistcodename => "xenial", :ipaddress => "192.168.122.10", :netmask => '255.255.255.0', :network => '192.168.122.0', :hostname => 'pat.local.vm', :puppetversion => "4.10.0", } end #at_exit { RSpec::Puppet::Coverage.report! }
4f84d147925dce7078a384180d8b6a50927c41eb
[ "Ruby" ]
2
Ruby
krorvik/puppet-prometheus
86cda95ef1c6f4476dae6dc8ad43e7b5f7730a1e
08cb9648cfcb6b5f90db595d391ec20b4fb8285c
refs/heads/main
<repo_name>kristanlpruett/Python-API-Challenge<file_sep>/api_keys.py weather_api_key = '<KEY>' g_key = '<KEY>'
c7d2f1ec691cc90be384dd2361143de3d315f483
[ "Python" ]
1
Python
kristanlpruett/Python-API-Challenge
23c96afa6c90249c52154a95cda9c5213977db80
5bc1aad03203163fdebd0a5fac259c33bd72ef98
refs/heads/master
<repo_name>agegrip/FastFood<file_sep>/LunchBoxMaker/Game/Collider/SphereCollider.h #pragma once #include "Game\Collider\Collider.h" class SphereCollider : public Collider { private: float m_radius; public: SphereCollider(GameObject* owner, float radius); public: ~SphereCollider() = default; public: float GetRadius() const; void SetRadius(float radius); };<file_sep>/LunchBoxMaker/Game/GameObject/Bullet.h #pragma once #include "DirectXTK\GeometricPrimitive.h" #include "DirectXTK\SimpleMath.h" #include "GameObject.h" #include "Game\Collider\SphereCollider.h" class Bullet : public GameObject { public: static const float MOVE_SPEED; static float MOVABLE_AREA_SIZE; public: Bullet(const DirectX::SimpleMath::Vector3& position, const DirectX::SimpleMath::Vector3& azimuth ,const std::string& objectname); ~Bullet(); void Update(float elapsedTime) override; void Render(const DirectX::SimpleMath::Matrix& viewMatrix,const DirectX::SimpleMath::Matrix& projectionMatrix) override; void OnCollision(GameObject* object) override; private: std::unique_ptr<DirectX::GeometricPrimitive> m_geometricPrimitive; DirectX::SimpleMath::Vector3 m_velocity; DirectX::SimpleMath::Vector3 m_origin; std::unique_ptr<SphereCollider> m_collider; bool m_flag; };<file_sep>/LunchBoxMaker/Game/GameObject/Bullet.cpp #include "Bullet.h" #include "Game\Common\DeviceResources.h" #include "Game\Common\GameContext.h" #include "Game\Common\Utilities.h" #include "Game\Collider\CollisionManager.h" const float Bullet::MOVE_SPEED = 0.2f; float Bullet::MOVABLE_AREA_SIZE = 10.0f; Bullet::Bullet(const DirectX::SimpleMath::Vector3& position, const DirectX::SimpleMath::Vector3& azimuth, const std::string& objectname) :GameObject(objectname) ,m_velocity(azimuth * MOVE_SPEED) ,m_origin(position) ,m_flag(false) { DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>::Get(); ID3D11DeviceContext* deviceContext = deviceResources->GetD3DDeviceContext(); m_geometricPrimitive = DirectX::GeometricPrimitive::CreateSphere(deviceContext, 0.3f); m_position = position; m_collider = std::make_unique<SphereCollider>(this, m_scale.x / 5); } Bullet::~Bullet() { } void Bullet::Update(float elapsedTime) { m_position += m_velocity; m_position.x = Clamp(m_position.x, -MOVABLE_AREA_SIZE / 2, MOVABLE_AREA_SIZE / 2); m_position.z = Clamp(m_position.z, -MOVABLE_AREA_SIZE / 2, MOVABLE_AREA_SIZE / 2); GameContext<CollisionManager>::Get()->Add(m_collider.get()); if ((m_position.z < -MOVABLE_AREA_SIZE / 2) || (m_position.z > MOVABLE_AREA_SIZE / 2)) { Destroy(this); } if ((m_position.x < -MOVABLE_AREA_SIZE / 2) || (m_position.x > MOVABLE_AREA_SIZE / 2)) { Destroy(this); } if (m_flag) { Destroy(this); } } void Bullet::Render(const DirectX::SimpleMath::Matrix & viewMatrix,const DirectX::SimpleMath::Matrix & projectionMatrix) { DirectX::SimpleMath::Matrix world = DirectX::SimpleMath::Matrix::Identity; world *= DirectX::SimpleMath::Matrix::CreateTranslation(m_position); m_geometricPrimitive->Draw(world, viewMatrix, projectionMatrix, DirectX::Colors::Red); } void Bullet::OnCollision(GameObject * object) { if (object->GetTag() != GetTag()) { m_flag = true; } } <file_sep>/LunchBoxMaker/Game/Common/Utilities.h #pragma once #include <algorithm> template<class T> inline constexpr const T& Clamp(const T& v, const T& low, const T& high) { return std::min(std::max(v, low), high); } <file_sep>/LunchBoxMaker/Game/Collider/CollisionManager.cpp #include "pch.h" #include "Game\Collider\CollisionManager.h" #include <typeinfo> #include "BoxCollider.h" #include "SphereCollider.h" #include "CapsuleCollider.h" #include "Game\Common\Utilities.h" CollisionManager::CollisionManager() : m_colliders() { } CollisionManager::~CollisionManager() { } void CollisionManager::DetectCollision() { int numObjects = static_cast<int>(m_colliders.size()); for (int i = 0; i < numObjects - 1; i++) { for (int j = i + 1; j < numObjects; j++) { if (IsCollided(m_colliders[i], m_colliders[j])) { m_colliders[i]->OnCollision(m_colliders[j]); m_colliders[j]->OnCollision(m_colliders[i]); } } } m_colliders.clear(); } void CollisionManager::Add(Collider* collider) { m_colliders.push_back(collider); } bool CollisionManager::IsCollided(const Collider* collider1, const Collider* collider2) const { static const size_t TYPE_SPHERE = typeid(SphereCollider).hash_code(); static const size_t TYPE_BOX = typeid(BoxCollider).hash_code(); size_t collider1Type = typeid(*collider1).hash_code(); size_t collider2Type = typeid(*collider2).hash_code(); if ((collider1Type == TYPE_SPHERE) && (collider2Type == TYPE_SPHERE)) { return IsCollided(dynamic_cast<const SphereCollider*>(collider1), dynamic_cast<const SphereCollider*>(collider2)); } if ((collider1Type == TYPE_BOX) && (collider2Type == TYPE_BOX)) { return IsCollided(dynamic_cast<const BoxCollider*>(collider1), dynamic_cast<const BoxCollider*>(collider2)); } if ((collider1Type == TYPE_SPHERE) && (collider2Type == TYPE_BOX)) { return IsCollided(dynamic_cast<const SphereCollider*>(collider1), dynamic_cast<const BoxCollider*>(collider2)); } if ((collider1Type == TYPE_BOX) && (collider2Type == TYPE_SPHERE)) { return IsCollided(dynamic_cast<const BoxCollider*>(collider1), dynamic_cast<const SphereCollider*>(collider2)); } return false; } bool CollisionManager::IsCollided(const SphereCollider* collider1, const SphereCollider* collider2) const { // 中心間の距離の平方を計算 DirectX::SimpleMath::Vector3 d = collider1->GetPosition() - collider2->GetPosition(); float dist2 = d.Dot(d); // 平方した距離が平方した半径の合計よりも小さい場合に球は交差している float radiusSum = collider1->GetRadius() - collider2->GetRadius(); return dist2 <= radiusSum * radiusSum; } bool CollisionManager::IsCollided(const BoxCollider* collider1, const BoxCollider* collider2) const { if (fabsf(collider1->GetPosition().x - collider2->GetPosition().x) > (collider1->GetSize().x + collider2->GetSize().x)) return false; if (fabsf(collider1->GetPosition().y - collider2->GetPosition().y) > (collider1->GetSize().y + collider2->GetSize().y)) return false; if (fabsf(collider1->GetPosition().z - collider2->GetPosition().z) > (collider1->GetSize().z + collider2->GetSize().z)) return false; return true; } bool CollisionManager::IsCollided(const SphereCollider* collider1, const BoxCollider* collider2) const { if (fabsf(collider1->GetPosition().x - collider2->GetPosition().x) > (collider1->GetRadius() + collider2->GetSize().x)) return false; if (fabsf(collider1->GetPosition().y - collider2->GetPosition().y) > (collider1->GetRadius() + collider2->GetSize().y)) return false; if (fabsf(collider1->GetPosition().z - collider2->GetPosition().z) > (collider1->GetRadius() + collider2->GetSize().z)) return false; return true; } bool CollisionManager::IsCollided(const BoxCollider* collider1, const SphereCollider* collider2) const { return IsCollided(collider2, collider1); } bool CollisionManager::IsCollided(const CapsuleCollider* collider1, const CapsuleCollider* collider2) const { float s, t; DirectX::SimpleMath::Vector3 c1, c2; // カプセルの中心の線分間の距離の平方を計算 float dist2 = ClosestPtSegmentSegment(collider1->GetStart(), collider1->GetEnd(), collider2->GetStart(), collider2->GetEnd(), s, t, c1, c2); float radius = collider1->GetRadius() + collider2->GetRadius(); return dist2 <= radius * radius; } bool CollisionManager::IsCollided(const CapsuleCollider * collider1, const SphereCollider * collider2) const { return IsCollided(collider2, collider1); } bool CollisionManager::IsCollided(const SphereCollider * collider1, const CapsuleCollider * collider2) const { // 球の中心とカプセルの中心の線分との距離の平方を計算 float dist2 = SqDistPointSegment(collider2->GetStart(), collider2->GetEnd(), collider1->GetPosition()); float radius = collider1->GetRadius() + collider2->GetRadius(); return dist2 <= radius * radius; } float SqDistPointBox(const DirectX::SimpleMath::Vector3 & p, const BoxCollider * b) { float point[3] = { p.x, p.y, p.z }; float min[3] = { b->GetPosition().x - b->GetSize().x,b->GetPosition().y - b->GetSize().y , b->GetPosition().z - b->GetSize().z }; float max[3] = { b->GetPosition().x + b->GetSize().x,b->GetPosition().y + b->GetSize().y , b->GetPosition().z + b->GetSize().z }; float sqDist = 0.0f; for (int i = 0; i < 3; i++) { float v = point[i]; if (v < min[i]) sqDist += (min[i] - v) * (min[i] - v); if (v > max[i]) sqDist += (v - max[i]) * (v - max[i]); } return sqDist; }<file_sep>/LunchBoxMaker/Game/GameObject/Enemy.h #pragma once #include "DirectXTK\GeometricPrimitive.h" #include "DirectXTK\SimpleMath.h" #include "Game\GameObject\GameObject.h" #include "Game\Collider\BoxCollider.h" class Enemy : public GameObject { public: Enemy(const DirectX::SimpleMath::Vector3& position); ~Enemy(); void Update(float elapsedTime) override; void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix)override; void OnCollision(GameObject* object) override; private: float m_elapsedTime; std::unique_ptr<DirectX::GeometricPrimitive> m_enemyGeometric; std::unique_ptr<BoxCollider> m_collider; bool m_flag; };<file_sep>/LunchBoxMaker/Game/Common/FollowComera.h #pragma once class FollowComera { public: FollowComera(); ~FollowComera(); }; <file_sep>/LunchBoxMaker/Game/GameObject/Box.cpp #include "pch.h" #include "Game\GameObject\Box.h" #include <random> #include "Game\Common\DeviceResources.h" #include "Game\Common\GameContext.h" #include "Game\Common\Utilities.h" #include "Game\Collider\CollisionManager.h" float Box::MOVABLE_AREA_SIZE = 10.0f; Box::Box() : GameObject("Box") , m_flag(false) { std::random_device seedGenerator; std::mt19937 randomGenerator(seedGenerator()); std::uniform_real_distribution<float> randPosition(-MOVABLE_AREA_SIZE / 2, MOVABLE_AREA_SIZE / 2); float px = randPosition(randomGenerator); float pz = randPosition(randomGenerator); m_position = DirectX::SimpleMath::Vector3(px, 0.0f, pz); std::uniform_real_distribution<float> randVelocity(-0.2f, 0.2f); float vx = randVelocity(randomGenerator); m_velocity = DirectX::SimpleMath::Vector3(vx, 0.0f, 0.0f); std::uniform_int_distribution<> randColor(0, 255); float r = static_cast<float>(randColor(randomGenerator)) / 255; float g = static_cast<float>(randColor(randomGenerator)) / 255; float b = static_cast<float>(randColor(randomGenerator)) / 255; float a = 1.0f; m_color = DirectX::SimpleMath::Color(r, g, b, a); DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>::Get(); m_geometricPrimitive = DirectX::GeometricPrimitive::CreateBox(deviceResources->GetD3DDeviceContext(), m_scale); //m_collider = std::make_unique<BoxCollider>(this, m_scale); } Box::~Box() { } void Box::Update(float elapsedTime) { } void Box::Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) { DirectX::SimpleMath::Matrix world = DirectX::SimpleMath::Matrix::Identity; world *= DirectX::SimpleMath::Matrix::CreateScale(m_scale); world *= DirectX::SimpleMath::Matrix::CreateTranslation(m_position); DirectX::SimpleMath::Color color = m_color; if (m_flag) { color = DirectX::Colors::Black; } m_geometricPrimitive->Draw(world, viewMatrix, projectionMatrix, color); } void Box::OnCollision(GameObject* object) { if (object->GetTag() != GetTag()) { m_flag = true; } }<file_sep>/LunchBoxMaker/Game/GameObject/Humberger.h //#pragma once //#include "DirectXTK\GeometricPrimitive.h" //#include "DirectXTK\SimpleMath.h" //#include "GameObject.h" //#include "Game\Collider\SphereCollider.h" // //class Humberger : public GameObject //{ //public: // Humberger(const DirectX::SimpleMath::Vector3& position, const DirectX::SimpleMath::Vector3& azimuth); // ~Humberger(); // void Update(float elapsedTime) override; // void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) override; // void OnCollision(GameObject* object) override; //private: // std::unique_ptr<DirectX::GeometricPrimitive> m_geomrtricPrimitive; // DirectX::SimpleMath::Vector3 m_velocty; // DirectX::SimpleMath::Vector3 m_origin; // std::unique_ptr<SphereCollider> m_collider; // bool m_flag; //};<file_sep>/LunchBoxMaker/Game/Collider/Collider.h #pragma once #include "DirectXTK\SimpleMath.h" class GameObject; class Collider { protected: GameObject* m_owner; DirectX::SimpleMath::Vector3 m_offset; public: Collider(GameObject* owner); public: virtual ~Collider() = default; public: void OnCollision(const Collider* object); const DirectX::SimpleMath::Vector3 GetPosition() const; const DirectX::SimpleMath::Vector3 GetOffset() const; void SetOffset(const DirectX::SimpleMath::Vector3& offset); };<file_sep>/LunchBoxMaker/Game/Common/FixCamera.h #pragma once #include <3rdParty\DirectXTK\Include\DirectXTK\SimpleMath.h> class FixCamera { public: // ビュー行列取得 DirectX::SimpleMath::Matrix getViewMatrix() { return m_viewMatrix; } // 射影行列取得 DirectX::SimpleMath::Matrix getProjectionMatrix() { return m_projectionMatrix; } // カメラの位置取得 DirectX::SimpleMath::Vector3 getEyePosition() { return m_eye; } // カメラの注視点取得 DirectX::SimpleMath::Vector3 getTargetPosition() { return m_target; } // カメラの射影行列取得 FixCamera(); ~FixCamera(); void Initialize(); void Update(); void Create(float fovAngle, float aspectRatio, float nearPlane, float farPlane); private: // ビュー行列 DirectX::SimpleMath::Matrix m_viewMatrix; // 射影行列 DirectX::SimpleMath::Matrix m_projectionMatrix; // 視点 DirectX::SimpleMath::Vector3 m_eye; // 注視点 DirectX::SimpleMath::Vector3 m_target; }; <file_sep>/LunchBoxMaker/Game/GameObject/Part.cpp #include "Part.h" #include "Game\Common\DeviceResources.h" #include "Game\Common\GameContext.h" #include "Game\Common\Utilities.h" #include "Game\Collider\CollisionManager.h" const float Part::MOVE_SPEED = 0.2f; float Part::MOVABLE_AREA_SIZE = 10.0f; Part::Part(const DirectX::SimpleMath::Vector3& position, const DirectX::SimpleMath::Vector3& azimuth) :GameObject("Part") ,m_velocity(azimuth*MOVE_SPEED) ,m_origin(position) ,m_flag(false) { DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>::Get(); ID3D11DeviceContext* deviceContext = deviceResources->GetD3DDeviceContext(); m_geometricPrimitive = DirectX::GeometricPrimitive::CreateSphere(deviceContext, 0.3f); m_position = position; m_collider = std::make_unique<BoxCollider>(this); } Part::~Part() { } void Part::Update(float elapsedTime) { GameContext<CollisionManager>::Get()->Add(m_collider.get()); if ((m_position.z < -MOVABLE_AREA_SIZE / 2) || (m_position.z > MOVABLE_AREA_SIZE / 2)) { Destroy(this); } if ((m_position.x < -MOVABLE_AREA_SIZE / 2) || (m_position.x > MOVABLE_AREA_SIZE / 2)) { Destroy(this); } if (m_flag) { Destroy(this); } } void Part::Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) { DirectX::SimpleMath::Matrix world = DirectX::SimpleMath::Matrix::Identity; world *= DirectX::SimpleMath::Matrix::CreateTranslation(m_position); m_geometricPrimitive->Draw(world, viewMatrix, projectionMatrix, DirectX::Colors::Red); } void Part::OnCollision(GameObject* object) { if (object->GetTag() != GetTag()) { m_flag = true; } }<file_sep>/LunchBoxMaker/Game/Scene/SceneManager.cpp #include "Game\Scene\SceneManager.h" #include "Game\Scene\BaseScene.h" SceneManager* SceneManager::GetInstance() { static SceneManager instance; return &instance; } SceneManager::SceneManager() { m_pScene = nullptr; } SceneManager::~SceneManager() { delete m_pScene; } void SceneManager::RequestState(Scene scene) { } void SceneManager::ChangeState(Scene scene) { if (m_pScene != nullptr) { m_pScene->Finalize(); delete m_pScene; m_pScene = nullptr; } switch (scene) { case Scene::LOGO: m_pScene = new LogoScene(); m_pScene->Initialize(); break; case Scene::TITLE: m_pScene = new TitleScene(); m_pScene->Initialize(); break; case Scene::PLAY: m_pScene = new PlayScene(); m_pScene->Initialize(); break; case Scene::RESULT: m_pScene = new ResultScene(); m_pScene->Initialize(); break; break; default: break; } } void SceneManager::Update(float elapsedTime) { m_pScene->Update(elapsedTime); } void SceneManager::Render() { m_pScene->Render(); } void SceneManager::Finalize() { m_pScene->Finalize(); } void SceneManager::Create() { }<file_sep>/LunchBoxMaker/Game/Collider/BoxCollider.cpp #include "Game\Collider\BoxCollider.h" BoxCollider::BoxCollider(GameObject* owner, const DirectX::SimpleMath::Vector3& size) : Collider(owner) , m_size(size) { } void BoxCollider::SetSize(const DirectX::SimpleMath::Vector3& size) { m_size = size; } const DirectX::SimpleMath::Vector3& BoxCollider::GetSize() const { return m_size; } <file_sep>/LunchBoxMaker/Game/Scene/SceneManager.h #pragma once #include "Game\Scene\BaseScene.h" #include "Game\Scene\LogoScene.h" #include "Game\Scene\TitleScene.h" #include "Game\Scene\PlayScene.h" #include "Game\Scene\ResultScene.h" // シーン遷移 class SceneManager { public: enum Scene { NONE = -1, LOGO, TITLE, PLAY, RESULT, NUM_SCENES }; public: static SceneManager* GetInstance(); // シーン管理オブジェクトの取得 SceneManager(); ~SceneManager(); void RequestState(Scene scene); void ChangeState(Scene scene); void Update(float elapsedTime); void Render(); void Finalize(); void Create(); private: BaseScene* m_pScene; BaseScene* m_nextScene; };<file_sep>/LunchBoxMaker/Game/Scene/BaseScene.h #pragma once #include "Game\Common\DeviceResources.h" class BaseScene { public: BaseScene(); virtual ~BaseScene(); virtual void Initialize() = 0; virtual void Update(float elapsedTime) = 0; virtual void Render() = 0; virtual void Finalize() = 0; };<file_sep>/LunchBoxMaker/Game/Scene/TitleScene.cpp #include "Game\Scene\TitleScene.h" #include "Game\Scene\SceneManager.h" #include "Game\Common\GameContext.h" TitleScene::TitleScene() { m_deviceResources = std::make_unique<DX::DeviceResources>(); } TitleScene::~TitleScene() { } void TitleScene::Initialize() { // デバイスリソース作成 DirectX::CommonStates* state = GameContext<DirectX::CommonStates>().Get(); DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>().Get(); ID3D11Device* device = deviceResources->GetD3DDevice(); ID3D11DeviceContext* deviceContext = deviceResources->GetD3DDeviceContext(); //ステート作成 m_state = std::make_unique<DirectX::CommonStates>(device); //スプライト作成 m_spriteBatch = std::make_unique<DirectX::SpriteBatch>(deviceContext); //フォント作成 m_spriteFont = std::make_unique <DirectX::SpriteFont>(device, L"Resources\\Fonts\\SegoeUI_18.spritefont"); } void TitleScene::Update(float elapsedTime) { DirectX::Keyboard::State keystate = GameContext<DirectX::Keyboard>::Get()->GetState(); if (keystate.Z) { SceneManager* scene = GameContext<SceneManager>().Get(); scene->ChangeState(SceneManager::PLAY); } } void TitleScene::Render() { wchar_t text[50]; swprintf(text, L"TitleScene\n Presing Z Key", m_pos.x, m_pos.y); m_spriteBatch->Begin(DirectX::SpriteSortMode_Deferred, m_state->NonPremultiplied()); m_spriteFont->DrawString(m_spriteBatch.get(), text, DirectX::SimpleMath::Vector2(0, 0)); m_spriteBatch->End(); } void TitleScene::Finalize() { }<file_sep>/LunchBoxMaker/Game/Common/FixCamera.cpp #include "pch.h" #include "FixCamera.h" FixCamera::FixCamera() { } FixCamera::~FixCamera() { } void FixCamera::Initialize() { } void FixCamera::Update() { DirectX::SimpleMath::Vector3 eye(0.0f, 10.0f, 10.0f); DirectX::SimpleMath::Vector3 target(0.0f, 0.0f, 0.0f); DirectX::SimpleMath::Vector3 up(0.0f, 1.0f, 0.0f); m_eye = eye; m_target = target; m_viewMatrix = DirectX::SimpleMath::Matrix::CreateLookAt(eye, target, up); } void FixCamera::Create(float fovAngle, float aspectRatio, float nearPlane, float farPlane) { m_projectionMatrix = DirectX::SimpleMath::Matrix::CreatePerspectiveFieldOfView(fovAngle, aspectRatio, nearPlane, farPlane); }<file_sep>/LunchBoxMaker/Game/Scene/PlayScene.h #pragma once #include "DirectXTK\CommonStates.h" #include "DirectXTK\SpriteBatch.h" #include "DirectXTK\SpriteFont.h" #include "DirectXTK\SimpleMath.h" #include "DirectXTK\Keyboard.h" #include "DirectXTK\Mouse.h" #include "DirectXTK\Model.h" #include "Game\Scene\BaseScene.h" #include "Game\Common\DeviceResources.h" #include "Game\Common\StepTimer.h" #include "Game\Common\FixCamera.h" #include "Game\GameObject\Player.h" #include "Game\GameObject\Enemy.h" class GameObjectManager; class GridFloor; class CollisionManager; class PlayScene:public BaseScene { public: PlayScene(); ~PlayScene(); void Initialize()override; void Update(float elapsedTime)override; void Render()override; void Finalize()override; // MouseWorld Matrix CreateMatrix_Screen2World(int screen_w, int screen_h, Matrix view, Matrix projection); private: // FixCameraの取得 FixCamera* m_fixcamera; // テクスチャ Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_texture; // Textポジション DirectX::SimpleMath::Vector2 m_pos; // コモンステート std::unique_ptr<DirectX::CommonStates> m_state; // 射影行列 DirectX::SimpleMath::Matrix m_projection; //スプライトバッチ std::unique_ptr<DirectX::SpriteBatch> m_spriteBatch; //スプライトフォント std::unique_ptr<DirectX::SpriteFont> m_spriteFont; //デバイスリソース std::unique_ptr<DX::DeviceResources> m_deviceResources; // 射影行列 DirectX::SimpleMath::Matrix m_skydomeworld; DirectX::SimpleMath::Matrix m_Floorworld; // グリッド床 std::unique_ptr<GridFloor> m_pGridFloor; // プレイヤー Player* m_pPlayer; // エネミー Enemy* m_pEnemy; // プレイヤーポジション DirectX::SimpleMath::Vector3 m_pPlayerPos; };<file_sep>/LunchBoxMaker/Game/GameObject/Humberger.cpp //#include "Humberger.h" //#include "Game\Common\DeviceResources.h" //#include "Game\Common\GameContext.h" //#include "Game\Common\Utilities.h" //#include "Game\Collider\CollisionManager.h" // // //Humberger::Humberger(const DirectX::SimpleMath::Vector3& position, const DirectX::SimpleMath::Vector3& azimuth) // :GameObject("Humberger") //{ // //} // //Humberger::~Humberger() //{ // //} // //void Humberger::Update(float elapsedTime) //{ // //} // <file_sep>/LunchBoxMaker/Game/Scene/TitleScene.h #pragma once #include "Game\Scene\BaseScene.h" #include "Game\Common\DeviceResources.h" #include "Game\Common\StepTimer.h" #include "DirectXTK\CommonStates.h" #include "DirectXTK\SpriteBatch.h" #include "DirectXTK\SpriteFont.h" #include "DirectXTK\SimpleMath.h" #include "DirectXTK\Keyboard.h" #include "DirectXTK\Model.h" class TitleScene:public BaseScene { public: TitleScene(); ~TitleScene(); void Initialize()override; void Update(float elapsedTime)override; void Render()override; void Finalize()override; private: // テクスチャ Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_texture; // Textポジション DirectX::SimpleMath::Vector2 m_pos; // コモンステート std::unique_ptr<DirectX::CommonStates> m_state; // 射影行列 DirectX::SimpleMath::Matrix m_projection; //スプライトバッチ std::unique_ptr<DirectX::SpriteBatch> m_spriteBatch; //スプライトフォント std::unique_ptr<DirectX::SpriteFont> m_spriteFont; //デバイスリソース std::unique_ptr<DX::DeviceResources> m_deviceResources; // ワールド DirectX::SimpleMath::Matrix m_skydomeworld; DirectX::SimpleMath::Matrix m_Floorworld; };<file_sep>/LunchBoxMaker/Game/GameObject/GameObject.h #pragma once #include "DirectXTK\SimpleMath.h" #include <string> #include <functional> class GameObject { private: bool m_isValid; std::string m_tag; protected: DirectX::SimpleMath::Vector3 m_position; DirectX::SimpleMath::Vector3 m_rotation; DirectX::SimpleMath::Vector3 m_scale; public: GameObject(const std::string& tag = "GameObject"); public: virtual ~GameObject(); public: virtual void Update(float elapsedTime) = 0; virtual void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) = 0; virtual void OnCollision(GameObject* object); public: void Invalidate(); bool IsValid() const; bool IsInvalid() const; const std::string& GetTag() const; const DirectX::SimpleMath::Vector3& GetPosition() const; const DirectX::SimpleMath::Vector3& GetRotation() const; const DirectX::SimpleMath::Vector3& GetScale() const; void SetTag(const std::string& tag); void SetPosition(const DirectX::SimpleMath::Vector3& position); void SetRotation(const DirectX::SimpleMath::Vector3& rotation); void SetScale(const DirectX::SimpleMath::Vector3& scale); public: static void Destroy(GameObject* object); }; inline bool GameObject::IsValid() const { return m_isValid; } inline bool GameObject::IsInvalid() const { return !m_isValid; } inline const std::string& GameObject::GetTag() const { return m_tag; } inline const DirectX::SimpleMath::Vector3& GameObject::GetPosition() const { return m_position; } inline const DirectX::SimpleMath::Vector3 & GameObject::GetRotation() const { return m_rotation; } inline const DirectX::SimpleMath::Vector3 & GameObject::GetScale() const { return m_scale; } inline void GameObject::SetTag(const std::string& tag) { m_tag = tag; } inline void GameObject::SetPosition(const DirectX::SimpleMath::Vector3& position) { m_position = position; } inline void GameObject::SetRotation(const DirectX::SimpleMath::Vector3& rotation) { m_rotation = rotation; } inline void GameObject::SetScale(const DirectX::SimpleMath::Vector3& scale) { m_scale = scale; }<file_sep>/LunchBoxMaker/Game/GameObject/Box.h #pragma once #include "DirectXTK\GeometricPrimitive.h" #include "DirectXTK\SimpleMath.h" #include <memory> #include "Game\GameObject\GameObject.h" #include "Game\Collider\BoxCollider.h" class Box : public GameObject { private: static float MOVABLE_AREA_SIZE; private: std::unique_ptr<DirectX::GeometricPrimitive> m_geometricPrimitive; DirectX::SimpleMath::Color m_color; DirectX::SimpleMath::Vector3 m_velocity; std::unique_ptr<BoxCollider> m_collider; bool m_flag; public: Box(); public: ~Box(); public: void Update(float elapsedTime) override; void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) override; void OnCollision(GameObject* object) override; }; <file_sep>/LunchBoxMaker/Game/Collider/CollisionManager.h #pragma once #include "DirectXTK\SimpleMath.h" #include <vector> class Collider; class SphereCollider; class BoxCollider; class CapsuleCollider; class CollisionManager final { using ColliderList = std::vector<Collider*>; private: ColliderList m_colliders; public: CollisionManager(); public: ~CollisionManager(); public: void Add(Collider* collider); void DetectCollision(); private: bool IsCollided(const Collider* collider1, const Collider* collider2) const; bool IsCollided(const SphereCollider* collider1, const SphereCollider* collider2) const; bool IsCollided(const BoxCollider* collider1, const BoxCollider* collider2) const; bool IsCollided(const SphereCollider* collider1, const BoxCollider* collider2) const; bool IsCollided(const BoxCollider* collider1, const SphereCollider* collider2) const; bool IsCollided(const CapsuleCollider* collider1, const CapsuleCollider* collider2) const; bool IsCollided(const CapsuleCollider* collider1, const SphereCollider* collider2) const; bool IsCollided(const SphereCollider* collider1, const CapsuleCollider* collider2) const; private: // cとab間の距離の平方 static float SqDistPointSegment(DirectX::SimpleMath::Vector3 a, DirectX::SimpleMath::Vector3 b, DirectX::SimpleMath::Vector3 c) { DirectX::SimpleMath::Vector3 ab = b - a; DirectX::SimpleMath::Vector3 ac = c - a; DirectX::SimpleMath::Vector3 bc = c - b; float e = ac.Dot(ab); if (e <= 0.0f) return ac.Dot(ac); float f = ab.Dot(ab); if (e >= f) return bc.Dot(bc); return ac.Dot(ac) - e * e / f; } // クランプ関数 static inline float Clamp(float n, float max, float min) { if (n < min) return min; if (n > max) return max; return n; } // 2つの線分の最短距離の平方を返す関数 static float ClosestPtSegmentSegment(DirectX::SimpleMath::Vector3 p1, DirectX::SimpleMath::Vector3 q1 , DirectX::SimpleMath::Vector3 p2, DirectX::SimpleMath::Vector3 q2 , float &s, float &t , DirectX::SimpleMath::Vector3& c1, DirectX::SimpleMath::Vector3& c2) { DirectX::SimpleMath::Vector3 d1 = q1 - p1; DirectX::SimpleMath::Vector3 d2 = q2 - p2; DirectX::SimpleMath::Vector3 r = p1 - p2; float a = d1.Dot(d1); float e = d2.Dot(d2); float f = d2.Dot(r); if (a <= FLT_EPSILON && e <= FLT_EPSILON) { s = t = 0.0f; c1 = p1; c2 = p2; return (c1 - c2).Dot(c1 - c2); } if (a <= FLT_EPSILON) { s = 0.0f; t = f / e; t = Clamp(t, 0.0f, 1.0f); } else { float c = d1.Dot(r); if (e <= FLT_EPSILON) { t = 0.0f; s = Clamp(-c / a, 0.0f, 1.0f); } else { float b = d1.Dot(d2); float denom = a * e - b * b; if (denom != 0.0f) { s = Clamp((b * f - c * e) / denom, 0.0f, 1.0f); } else { s = 0.0f; } float tnom = (b * s + f); if (tnom < 0.0f) { t = 0.0f; s = Clamp(-c / a, 0.0f, 1.0f); } else if (tnom > e) { t = 1.0f; s = Clamp((b - c) / a, 0.0f, 1.0f); } else { t = tnom / e; } } } c1 = p1 + d1 * s; c2 = p2 + d2 * t; return (c1 - c2).Dot(c1 - c2); } }; // 点とボックスの間の最短距離の平方を計算する関数 static float SqDistPointBox(const DirectX::SimpleMath::Vector3& p, const BoxCollider* b); // 三角形の構造体(線分と三角形の交差判定用) struct Triangle { // 三角形の平面方程式 DirectX::SimpleMath::Plane p; // 辺BCの平面方程式(重心座標の頂点aに対する重みuを与える) DirectX::SimpleMath::Plane edgePlaneBC; // 辺CAの平面方程式(重心座標の頂点bに対する重みvを与える) DirectX::SimpleMath::Plane edgePlaneCA; // コンストラクタ内で衝突判定を軽くするために前処理で計算しておく Triangle(DirectX::SimpleMath::Vector3 a, DirectX::SimpleMath::Vector3 b, DirectX::SimpleMath::Vector3 c) { DirectX::SimpleMath::Vector3 n = (c - a).Cross(b - a); p = DirectX::SimpleMath::Plane(a, n); DirectX::SimpleMath::Plane pp = DirectX::SimpleMath::Plane(b, n); edgePlaneBC = DirectX::SimpleMath::Plane(b, n.Cross(b - c)); edgePlaneCA = DirectX::SimpleMath::Plane(c, n.Cross(c - a)); p.Normalize(); edgePlaneBC.Normalize(); edgePlaneCA.Normalize(); float bc_scale = 1.0f / (a.Dot(edgePlaneBC.Normal()) + edgePlaneBC.D()); float ca_scale = 1.0f / (b.Dot(edgePlaneCA.Normal()) + edgePlaneCA.D()); edgePlaneBC.x *= bc_scale; edgePlaneBC.y *= bc_scale; edgePlaneBC.z *= bc_scale; edgePlaneBC.w *= bc_scale; edgePlaneCA.x *= ca_scale; edgePlaneCA.y *= ca_scale; edgePlaneCA.z *= ca_scale; edgePlaneCA.w *= ca_scale; } }; // 浮動小数点の誤差で当たりぬけするので少し余裕をもつ #define EPSILON 1.0e-06F static bool IntersectSegmentTriangle(DirectX::SimpleMath::Vector3 p, DirectX::SimpleMath::Vector3 q, Triangle tri, DirectX::SimpleMath::Vector3* s) { float distp = p.Dot(tri.p.Normal()) + tri.p.D(); if (distp < 0.0f) return false; float distq = q.Dot(tri.p.Normal()) + tri.p.D(); if (distq >= 0.0f) return false; float denom = distp - distq; float t = distp / denom; *s = p + t * (q - p); float u = s->Dot(tri.edgePlaneBC.Normal()) + tri.edgePlaneBC.D(); if (fabsf(u) < EPSILON) u = 0.0f; if (u < 0.0f || u > 1.0f) return false; float v = s->Dot(tri.edgePlaneCA.Normal()) + tri.edgePlaneCA.D(); if (fabsf(v) < EPSILON) v = 0.0f; if (v < 0.0f) return false; float w = 1.0f - u - v; if (fabsf(w) < EPSILON) w = 0.0f; if (w < 0.0f) return false; return true; }<file_sep>/LunchBoxMaker/Game/Scene/BaseScene.cpp #include "Game\Scene\BaseScene.h" BaseScene::BaseScene() { } BaseScene::~BaseScene() { }<file_sep>/LunchBoxMaker/Game/GameObject/GameObject.cpp #include "pch.h" #include "Game\GameObject\GameObject.h" GameObject::GameObject(const std::string& tag) : m_isValid(true) , m_tag(tag) , m_position(0.0f,0.0f,0.0f) , m_rotation(0.0f,0.0f,0.0f) , m_scale(1.0f,1.0f,1.0f) { } GameObject::~GameObject() { } void GameObject::Invalidate() { m_isValid = false; } void GameObject::OnCollision(GameObject * object) { } void GameObject::Destroy(GameObject * object) { object->Invalidate(); }<file_sep>/LunchBoxMaker/Game/GameObject/GameObjectManager.h #pragma once #include "DirectXTK\SimpleMath.h" #include <list> #include <memory> #include <vector> #include <functional> class GameObject; class GameObjectManager final { using GameObjectPtr = std::unique_ptr<GameObject>; using GameObjectList = std::list<GameObjectPtr>; private: GameObjectList m_objects; GameObjectList m_objectQueue; public: GameObjectManager(); public: ~GameObjectManager(); public: void Update(float elapsedTime); void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix); void Add(GameObjectPtr&& object); std::vector<GameObject*> Find(const std::string& tag) const; std::vector<GameObject*> Find(std::function<bool(GameObject*)> predicate) const; private: void UpdateObjects(float elapsedTime); void AcceptObjects(); void DestroyObjects(); }; <file_sep>/LunchBoxMaker/Game/Common/FollowComera.cpp #include "pch.h" #include "FollowComera.h" FollowComera::FollowComera() { } FollowComera::~FollowComera() { } <file_sep>/LunchBoxMaker/Game/Scene/PlayScene.cpp #include "Game\Scene\PlayScene.h" #include "Game\Scene\SceneManager.h" #include "Game\Common\GameContext.h" #include "Game\\GameObject\GameObjectManager.h" #include "Game\Debug\GridFloor.h" #include "Game\Collider\CollisionManager.h" PlayScene::PlayScene() :m_pGridFloor() ,m_pPlayerPos(0.f,0.f,5.f) { m_deviceResources = std::make_unique<DX::DeviceResources>(); } PlayScene::~PlayScene() { if (m_fixcamera != nullptr) { delete m_fixcamera; m_fixcamera = nullptr; } } void PlayScene::Initialize() { // デバイスリソース作成 DirectX::CommonStates* state = GameContext<DirectX::CommonStates>().Get(); DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>().Get(); ID3D11Device* device = deviceResources->GetD3DDevice(); ID3D11DeviceContext* deviceContext = deviceResources->GetD3DDeviceContext(); //ステート作成 m_state = std::make_unique<DirectX::CommonStates>(device); //スプライト作成 m_spriteBatch = std::make_unique<DirectX::SpriteBatch>(deviceContext); //フォント作成 m_spriteFont = std::make_unique <DirectX::SpriteFont>(device, L"Resources\\Fonts\\SegoeUI_18.spritefont"); // ウィンドウサイズからアスペクト比を算出する RECT size = m_deviceResources->GetOutputSize(); float aspectRatio = float(size.right) / float(size.bottom); // 画角を設定 float fovAngleY = DirectX::XMConvertToRadians(45.0f); // FixCamera作成 m_fixcamera = new FixCamera(); m_fixcamera->Create(fovAngleY, aspectRatio, 0.1f, 100.0f); // GridFloor作成 m_pGridFloor = std::make_unique<GridFloor>(device, deviceContext, state, 10.0f, 10); // プレイヤー作成 std::unique_ptr<Player> pPlayer = std::make_unique<Player>(m_pPlayerPos,0.2f); m_pPlayer = pPlayer.get(); GameContext<GameObjectManager>().Get()->Add(std::move(pPlayer)); // エネミー作成 std::unique_ptr<Enemy> pEnemy = std::make_unique<Enemy>(DirectX::SimpleMath::Vector3(0.f, 0.f, 0.f)); m_pEnemy = pEnemy.get(); GameContext<GameObjectManager>().Get()->Add(std::move(pEnemy)); } void PlayScene::Update(float elapsedTime) { DirectX::Keyboard::State keystate = GameContext<DirectX::Keyboard>::Get()->GetState(); DirectX::Mouse::State mouseState = GameContext<DirectX::Mouse>::Get()->GetState(); if (mouseState.positionMode == DirectX::Mouse::MODE_RELATIVE) return; // カメラの更新 m_fixcamera->Update(); // ゲームオブジェクトの更新 GameContext<GameObjectManager>::Get()->Update(GameContext<DX::StepTimer>::Get()->GetElapsedSeconds()); // コライダーの更新 GameContext<CollisionManager>::Get()->DetectCollision(); if (keystate.X) { SceneManager* scene = GameContext<SceneManager>().Get(); scene->ChangeState(SceneManager::RESULT); } } void PlayScene::Render() { DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>::Get(); ID3D11DeviceContext* context = deviceResources->GetD3DDeviceContext(); wchar_t text[50]; swprintf(text, L"PlayScene\nPresing X Key", m_pos.x, m_pos.y); m_spriteBatch->Begin(DirectX::SpriteSortMode_Deferred, m_state->NonPremultiplied()); m_spriteFont->DrawString(m_spriteBatch.get(), text, DirectX::SimpleMath::Vector2(0, 0)); // ゲームオブジェクトの表示 GameContext<GameObjectManager>::Get()->Render(m_fixcamera->getViewMatrix(), m_fixcamera->getProjectionMatrix()); m_pGridFloor->draw(deviceResources->GetD3DDeviceContext(), m_fixcamera->getViewMatrix(), m_fixcamera->getProjectionMatrix()); m_spriteBatch->End(); } void PlayScene::Finalize() { m_state.reset(); m_spriteBatch.reset(); m_spriteFont.reset(); } Matrix PlayScene::CreateMatrix_Screen2World(int screen_w, int screen_h, Matrix view, Matrix projection) { // ビューポートスケーリング行列を作成 Matrix viewport; viewport._11 = screen_w / 2.0f; viewport._22 = -screen_h / 2.0f; viewport._41 = screen_w / 2.0f; viewport._42 = screen_h / 2.0f; // 逆行列を作成 Matrix invS = viewport.Invert(); Matrix invP = projection.Invert(); Matrix invV = view.Invert(); // 『ビューポートスケーリング行列の逆行列』 × 『射影行列の逆行列』 × 『ビュー行列の逆行列』 return invS * invP * invV; }<file_sep>/LunchBoxMaker/Game/GameObject/Player.h #pragma once #include "DirectXTK\GeometricPrimitive.h" #include "DirectXTK\SimpleMath.h" #include "DirectXTK\SpriteBatch.h" #include "DirectXTK\SpriteFont.h" #include "GameObject.h" using namespace DirectX; using namespace DirectX::SimpleMath; class Player : public GameObject { public: Player(const DirectX::SimpleMath::Vector3& position,float fireInterval); ~Player(); void Update(float elapsedTime) override; void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) override; void Fire(); private: float m_elapsedTime; float m_fireInterval; bool m_isLoading; float m_horizontalAngle; std::unique_ptr<DirectX::GeometricPrimitive> m_playerGeometric; std::string m_bulletName; DirectX::SimpleMath::Vector2 m_stringpos; //スプライトバッチ std::unique_ptr<DirectX::SpriteBatch> m_spriteBatch; //スプライトフォント std::unique_ptr<DirectX::SpriteFont> m_spriteFont; // コモンステート std::unique_ptr<DirectX::CommonStates> m_state; };<file_sep>/LunchBoxMaker/Game/Collider/CapsuleCollider.cpp #include "Game\Collider\CapsuleCollider.h" CapsuleCollider::CapsuleCollider(GameObject * owner, float radius, DirectX::SimpleMath::Vector3 start, DirectX::SimpleMath::Vector3 end) : Collider(owner) , m_radius(radius) , m_start(start) , m_end(end) { } float CapsuleCollider::GetRadius() const { return m_radius; } void CapsuleCollider::SetRadius(float radius) { m_radius = radius; } DirectX::SimpleMath::Vector3 CapsuleCollider::GetStart() const { return m_start; } void CapsuleCollider::SetStart(DirectX::SimpleMath::Vector3 start) { m_start = start; } DirectX::SimpleMath::Vector3 CapsuleCollider::GetEnd() const { return m_end; } void CapsuleCollider::SetEnd(DirectX::SimpleMath::Vector3 end) { m_end = end; }<file_sep>/LunchBoxMaker/Game/GameObject/Part.h #pragma once #include "DirectXTK\GeometricPrimitive.h" #include "DirectXTK\SimpleMath.h" #include "GameObject.h" #include "Game\Collider\BoxCollider.h" class Part : public GameObject { public: static const float MOVE_SPEED; static float MOVABLE_AREA_SIZE; public: Part(const DirectX::SimpleMath::Vector3& position, const DirectX::SimpleMath::Vector3& azimuth); ~Part(); void Update(float elapsedTime) override; void Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) override; void OnCollision(GameObject* object) override; private: std::unique_ptr<DirectX::GeometricPrimitive> m_geometricPrimitive; DirectX::SimpleMath::Vector3 m_velocity; DirectX::SimpleMath::Vector3 m_origin; std::unique_ptr<BoxCollider> m_collider; bool m_flag; };<file_sep>/LunchBoxMaker/Game/GameObject/Enemy.cpp #include "Enemy.h" #include <memory> #include "Game\Common\DeviceResources.h" #include "Game\Common\GameContext.h" #include "Game\GameObject\GameObjectManager.h" #include "Game\Collider\CollisionManager.h" Enemy::Enemy(const DirectX::SimpleMath::Vector3& position) :GameObject("Enemy") ,m_enemyGeometric() ,m_elapsedTime() ,m_flag(false) { DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>::Get(); ID3D11DeviceContext* deviceContext = deviceResources->GetD3DDeviceContext(); // オブジェクト位置 m_position = position; // ジオメトリ作成 m_enemyGeometric = DirectX::GeometricPrimitive::CreateBox(deviceContext, DirectX::SimpleMath::Vector3(1.f, 1.f, 1.f)); // コライダー作成 m_collider = std::make_unique<BoxCollider>(this,DirectX::SimpleMath::Vector3(1.0f,1.0f,1.0f)); } Enemy::~Enemy() { } void Enemy::Update(float elapsedTime) { GameContext<CollisionManager>::Get()->Add(m_collider.get()); if (m_flag) { Destroy(this); } } void Enemy::Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) { DirectX::SimpleMath::Matrix world = DirectX::SimpleMath::Matrix::Identity; world *= DirectX::SimpleMath::Matrix::CreateTranslation(m_position); m_enemyGeometric->Draw(world, viewMatrix, projectionMatrix); } void Enemy::OnCollision(GameObject* object) { if (object->GetTag() == "Humberger") { m_flag = true; } }<file_sep>/LunchBoxMaker/Game/Collider/Collider.cpp #include "pch.h" #include "Game\Collider\Collider.h" #include "Game\GameObject\GameObject.h" Collider::Collider(GameObject* owner) : m_owner(owner) , m_offset(DirectX::SimpleMath::Vector3(0.0f, 0.0f, 0.0f)) { } void Collider::OnCollision(const Collider* object) { m_owner->OnCollision(object->m_owner); } const DirectX::SimpleMath::Vector3 Collider::GetPosition() const { return m_owner->GetPosition() + m_offset; } const DirectX::SimpleMath::Vector3 Collider::GetOffset() const { return m_offset; } void Collider::SetOffset(const DirectX::SimpleMath::Vector3 & offset) { m_offset = offset; } <file_sep>/LunchBoxMaker/Game/Game.h // // Game.h // #pragma once #include "Common\DeviceResources.h" #include "Common\StepTimer.h" #include "Game\Scene\SceneManager.h" #include "Game\GameObject\GameObjectManager.h" #include "Game\Collider\CollisionManager.h" #include "DirectXTK\CommonStates.h" #include "DirectXTK\Keyboard.h" #include "DirectXTK\Mouse.h" // A basic game implementation that creates a D3D11 device and // provides a game loop. class Game final : public DX::IDeviceNotify { public: static const wchar_t* WINDOW_TITLE; static const int WINDOW_WIDTH; static const int WINDOW_HEIGHT; public: Game() noexcept(false); // Initialization and management void Initialize(HWND window, int width, int height); // Basic game loop void Tick(); // IDeviceNotify virtual void OnDeviceLost() override; virtual void OnDeviceRestored() override; // Messages void OnActivated(); void OnDeactivated(); void OnSuspending(); void OnResuming(); void OnWindowMoved(); void OnWindowSizeChanged(int width, int height); // Properties void GetDefaultSize(int& width, int& height) const; private: void Update(const DX::StepTimer& timer); void Render(); void Clear(); void CreateDeviceDependentResources(); void CreateWindowSizeDependentResources(); // Device resources. std::unique_ptr<DX::DeviceResources> m_deviceResources; // Rendering loop timer. DX::StepTimer m_timer; // CommonStates std::unique_ptr<DirectX::CommonStates> m_state; // SceneManager std::unique_ptr<SceneManager> m_sceneManager; // ObjectManager std::unique_ptr<GameObjectManager> m_gameObjectManager; // CollisionManager std::unique_ptr<CollisionManager> m_collisionManager; // キーボード std::unique_ptr<DirectX::Keyboard> m_pkeyboard; // マウス std::unique_ptr<DirectX::Mouse> m_pMouse; }; <file_sep>/LunchBoxMaker/Game/Collider/SphereCollider.cpp #include "Game\Collider\SphereCollider.h" SphereCollider::SphereCollider(GameObject* owner, float radius) : Collider(owner) , m_radius(radius) { } void SphereCollider::SetRadius(float radius) { m_radius = radius; } float SphereCollider::GetRadius() const { return m_radius; } <file_sep>/LunchBoxMaker/Game/Collider/CapsuleCollider.h #pragma once #include "Game\Collider\Collider.h" class CapsuleCollider : public Collider { private: DirectX::SimpleMath::Vector3 m_start; DirectX::SimpleMath::Vector3 m_end; float m_radius; public: CapsuleCollider(GameObject* owner, float radius, DirectX::SimpleMath::Vector3 start, DirectX::SimpleMath::Vector3 end); ~CapsuleCollider() = default; public: float GetRadius() const; void SetRadius(float radius); DirectX::SimpleMath::Vector3 GetStart() const; void SetStart(DirectX::SimpleMath::Vector3 start); DirectX::SimpleMath::Vector3 GetEnd() const; void SetEnd(DirectX::SimpleMath::Vector3 end); }; <file_sep>/LunchBoxMaker/Game/GameObject/Player.cpp #include "Player.h" #include <memory> #include "DirectXTK\Keyboard.h" #include "Game\Common\DeviceResources.h" #include "Game\Common\GameContext.h" #include "Game\GameObject\GameObjectManager.h" #include "Game\GameObject\Bullet.h" using namespace DirectX; using namespace DirectX::SimpleMath; Player::Player(const DirectX::SimpleMath::Vector3& position, float fireInterval) :GameObject("Player") , m_playerGeometric() , m_fireInterval(fireInterval) , m_elapsedTime(0.f) , m_horizontalAngle(-90.0f) , m_isLoading(false) , m_bulletName("Humberger") { DX::DeviceResources* deviceResources = GameContext<DX::DeviceResources>::Get(); ID3D11Device* device = deviceResources->GetD3DDevice(); ID3D11DeviceContext* deviceContext = deviceResources->GetD3DDeviceContext(); // ポジション m_position = position; // ジオメトリ m_playerGeometric = DirectX::GeometricPrimitive::CreateBox(deviceContext, DirectX::SimpleMath::Vector3(1.0f, 2.0f, 1.0f)); //ステート作成 m_state = std::make_unique<DirectX::CommonStates>(device); //スプライト作成 m_spriteBatch = std::make_unique<DirectX::SpriteBatch>(deviceContext); //フォント作成 m_spriteFont = std::make_unique <DirectX::SpriteFont>(device, L"Resources\\Fonts\\SegoeUI_18.spritefont"); } Player::~Player() { } void Player::Update(float elapsedTime) { DirectX::Keyboard::State keyState = DirectX::Keyboard::Get().GetState(); DirectX::Mouse::State mouseState = DirectX::Mouse::Get().GetState(); if (keyState.A) { m_horizontalAngle -= 1.0f; } if (keyState.D) { m_horizontalAngle += 1.0f; } if (m_isLoading) { m_elapsedTime += elapsedTime; if (m_elapsedTime > m_fireInterval) { m_isLoading = false; } } if (!m_isLoading) { if (keyState.Space) { Fire(); } } } void Player::Render(const DirectX::SimpleMath::Matrix& viewMatrix, const DirectX::SimpleMath::Matrix& projectionMatrix) { DirectX::SimpleMath::Matrix world = DirectX::SimpleMath::Matrix::Identity; world *= DirectX::SimpleMath::Matrix::CreateTranslation(m_position); m_playerGeometric->Draw(world, viewMatrix, projectionMatrix); wchar_t text[50]; std::wstring ws = std::wstring(m_bulletName.begin(), m_bulletName.end()); swprintf(text, ws.c_str(), m_stringpos.x, m_stringpos.y); m_spriteBatch->Begin(DirectX::SpriteSortMode_Deferred, m_state->NonPremultiplied()); m_spriteFont->DrawString(m_spriteBatch.get(), text, DirectX::SimpleMath::Vector2(0, 0)); m_spriteBatch->End(); } void Player::Fire() { float rad = DirectX::XMConvertToRadians(m_horizontalAngle); DirectX::SimpleMath::Vector3 direction(cos(rad), 0.f, sin(rad)); std::unique_ptr<Bullet> bullet = std::make_unique<Bullet>(m_position, direction,m_bulletName); GameContext<GameObjectManager>::Get()->Add(std::move(bullet)); m_elapsedTime = 0.f; m_isLoading = true; }
b1ddf979c7682b58e306a118792af66464c5e260
[ "C++" ]
38
C++
agegrip/FastFood
3eb8eb6f40b04f1eda7f77bfacf8cf5ca99cd609
ff4d9d78504a8a0cbbec69a31b7a4af52116decf
refs/heads/master
<repo_name>roboterclubaachen/xpcc.io<file_sep>/docs/api/group__memory__traits.js var group__memory__traits = [ [ "MemoryTraits", "group__memory__traits.html#ga74257e68b9e0da2d06db359aed1dd5a5", null ], [ "MemoryTrait", "group__memory__traits.html#gaf78ee5e9a679ece9f82231bd739751f7", [ [ "AccessSBus", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7a2291ccc152726cc20596b2285652d62c", null ], [ "AccessDBus", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7aed8b74346d3c30eb0bfba02ea1668d5a", null ], [ "AccessIBus", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7ac98de80f4a69b523be5ea5ca459cfde0", null ], [ "AccessDMA", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7a1416ef8ef2a4f38fdd03331f0698e60e", null ], [ "AccessDMA2D", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7a9ccbe929604e239e1504859b6e33ac1f", null ], [ "TypeCoreCoupled", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7aeef51bb2d1e7149e4566bd16de722868", null ], [ "TypeNonVolatile", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7af2d06005be47e5ee3d4c34c005bc04f1", null ], [ "TypeExternal", "group__memory__traits.html#ggaf78ee5e9a679ece9f82231bd739751f7acefab87526157a6bad0e9f4af729c61b", null ] ] ], [ "operator new", "group__memory__traits.html#ga0d1e7b1682a743c61669c3ada2396b12", null ], [ "operator new[]", "group__memory__traits.html#ga42d6bcfd14aacfdd0555d3222235ae3e", null ], [ "MemoryFastCode", "group__memory__traits.html#gab0d5846621a913675ef0c8954d4d6baf", null ], [ "MemoryFastData", "group__memory__traits.html#ga0bc207b39c5d4c8b0625ef0afb42085f", null ], [ "MemoryDMA", "group__memory__traits.html#gabfb9780b63867a322724c4ed2e47f176", null ], [ "MemoryDMA2D", "group__memory__traits.html#gae46aa8049fd733e31f274890b503ea99", null ], [ "MemoryExternal", "group__memory__traits.html#ga0d88867c6d5e933db9befd3c88bf6a0c", null ], [ "MemoryBackup", "group__memory__traits.html#ga11f7ed5300a3ad4eecb4315caf92ce84", null ], [ "MemoryDefault", "group__memory__traits.html#ga600ac5ab65254f263142c15b3e335504", null ] ];<file_sep>/docs/api/group__math.js var group__math = [ [ "Saturated", "classxpcc_1_1_saturated.html", [ [ "Saturated", "classxpcc_1_1_saturated.html#aa8c12c0a646449c4c27c96a73fc45ef0", null ], [ "Saturated", "classxpcc_1_1_saturated.html#a4e33eb32d57c9d4d435dc23f4ae6a1e2", null ], [ "getValue", "classxpcc_1_1_saturated.html#ad5e15b07ecefe9cf4515626c18016bc3", null ], [ "operator+=", "classxpcc_1_1_saturated.html#a468c112d6ff737f842f7fb3b09822a80", null ], [ "operator-=", "classxpcc_1_1_saturated.html#a124402c79f88e60a8add8409c28104d7", null ], [ "absolute", "classxpcc_1_1_saturated.html#ae13ec568e4b464339b5c69bee3757994", null ], [ "operator-", "classxpcc_1_1_saturated.html#ad3c1d1016da4a9f48ee8d357b4de3c8a", null ], [ "abs", "classxpcc_1_1_saturated.html#a29321a0fcf37a4d88292830593460a91", null ], [ "operator-", "classxpcc_1_1_saturated.html#a1cb3572bff02c15241305c741f0da7fd", null ], [ "operator+", "classxpcc_1_1_saturated.html#a992f08b0aa2a0f5bce837a1fe557d6de", null ], [ "operator==", "classxpcc_1_1_saturated.html#a976457c8ac01a2c7d2c93acb2a9cd4c3", null ], [ "operator!=", "classxpcc_1_1_saturated.html#aa1f21025d903b7239f9d92c33e0d0af7", null ] ] ], [ "Tolerance", "classxpcc_1_1_tolerance.html", null ], [ "Filter", "group__filter.html", "group__filter" ], [ "Geometry", "group__geometry.html", "group__geometry" ], [ "Interpolation", "group__interpolation.html", "group__interpolation" ], [ "Matrix", "group__matrix.html", "group__matrix" ], [ "swap", "group__math.html#ga70d3f6d9574cfbe69cad407cb5da6b22", null ], [ "swap", "group__math.html#gaab5a61452b72062182d76f0edbbb6399", null ], [ "swap", "group__math.html#gae93483edc53187a912a02baa99279b10", null ], [ "swap", "group__math.html#gaa0cbade3bb0f69bf58ecd2a065d7bb9c", null ], [ "bitReverse", "group__math.html#gac4cfb3ea7685f7b0ab57a74e78a9258f", null ], [ "bitReverse", "group__math.html#ga2a1624a838c6d1436095ecfa7e29f17a", null ], [ "bitReverse", "group__math.html#ga9a387da4e05c0f71e823c896549a3d9e", null ], [ "leftmostBit", "group__math.html#ga27276df9ac7db1230fb33cfc041b2860", null ], [ "bitCount", "group__math.html#ga52c5a2acd054c39f9e5219831c5d7112", null ], [ "bitCount", "group__math.html#gaba096bae304eaa8fafef30563c6f45dd", null ], [ "bitCount", "group__math.html#ga2d400b7e4b36bf9a3c026758c03af6e9", null ], [ "isBigEndian", "group__math.html#ga85d7f16af4f3abcd334c74eac1eef52b", null ], [ "isLittleEndian", "group__math.html#gad969b2004a680c915a015cd9b8f562f4", null ], [ "isPositive", "group__math.html#ga63f685e695ec0f51e61979ae7b95c887", null ], [ "pow", "group__math.html#ga6bcf763f8de63592be9e68522d58989e", null ], [ "sqrt", "group__math.html#ga5912a20d3a851ddb1dc339fb6a4a0015", null ], [ "mul", "group__math.html#gadeafcd9563d112d2bbc292c7277e69d7", null ], [ "mul", "group__math.html#ga7f188ecb8995ac3de830032479d7d72e", null ], [ "mac", "group__math.html#ga77b487445dfb8560217bad7023551a46", null ] ];<file_sep>/docs/api/classxpcc_1_1_gpio_expander.js var classxpcc_1_1_gpio_expander = [ [ "PortType", "classxpcc_1_1_gpio_expander.html#aa702b30418310116232380603428ea84", null ], [ "setOutput", "classxpcc_1_1_gpio_expander.html#ae5f6095f4bf74be0839a199c72229947", null ], [ "set", "classxpcc_1_1_gpio_expander.html#a28f63c0270bd36bf913bf352524c252e", null ], [ "reset", "classxpcc_1_1_gpio_expander.html#a427da23931023c452349a6c54dd161f0", null ], [ "toggle", "classxpcc_1_1_gpio_expander.html#a902fb9a564568fa7d8565c041f84de94", null ], [ "set", "classxpcc_1_1_gpio_expander.html#ae3882e40403291d3f2925ddea2d46206", null ], [ "isSet", "classxpcc_1_1_gpio_expander.html#a8221bffb6fdc760e2069e2ec2dcf46f6", null ], [ "getDirection", "classxpcc_1_1_gpio_expander.html#a4bacb401635b0335c1d74e12870df732", null ], [ "setInput", "classxpcc_1_1_gpio_expander.html#a2ad68ccb1c8191e47c2bd5031b37c9b5", null ], [ "read", "classxpcc_1_1_gpio_expander.html#abef33e75be29d2c9951a387647755179", null ], [ "readInput", "classxpcc_1_1_gpio_expander.html#a7c91e2bcb75e6017de1c1dae7900b1f7", null ], [ "writePort", "classxpcc_1_1_gpio_expander.html#aafbfe97865cb2a28aaee03c956360b02", null ], [ "readPort", "classxpcc_1_1_gpio_expander.html#a0659fc2cdfab9b63827135d64af3e7d9", null ], [ "getDirections", "classxpcc_1_1_gpio_expander.html#aa7e9958a8cae8c8df538788d57b623c9", null ], [ "getOutputs", "classxpcc_1_1_gpio_expander.html#a24ed82d97e42c14d2e434578d495ad99", null ], [ "getInputs", "classxpcc_1_1_gpio_expander.html#a43a1b16d9fa80cd237b9765d45765ac9", null ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_string_field.js var classxpcc_1_1gui_1_1_string_field = [ [ "StringField", "classxpcc_1_1gui_1_1_string_field.html#a044407a8748729333a67bea9c64f59d6", null ], [ "render", "classxpcc_1_1gui_1_1_string_field.html#a092128214c35661fd49a88d0bc36899e", null ], [ "setValue", "classxpcc_1_1gui_1_1_string_field.html#a5918bd44462f4f47762ff0eba10bdc08", null ], [ "getValue", "classxpcc_1_1gui_1_1_string_field.html#a85afd80baf8c25b19e24fe4ada69f218", null ] ];<file_sep>/docs/api/structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier_short.js var structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier_short = [ [ "StandardIdentifierShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier_short.html#a057de947f8959ab726a1d3fadda06fed", null ] ];<file_sep>/docs/api/classxpcc_1_1sab_1_1_transmitter.js var classxpcc_1_1sab_1_1_transmitter = [ [ "~Transmitter", "classxpcc_1_1sab_1_1_transmitter.html#a7ee5e021ed85db73aafa7d797aaba881", null ], [ "send", "classxpcc_1_1sab_1_1_transmitter.html#a44aff63923edf55b6f30064101ec2a7f", null ] ];<file_sep>/docs/api/search/typedefs_4.js var searchData= [ ['enumtype',['EnumType',['../structxpcc_1_1_flags_operators.html#acf3e7988c89b5a464e075d20d6334d33',1,'xpcc::FlagsOperators::EnumType()'],['../structxpcc_1_1_flags.html#ad36f975972b7533b6efea7fa35f41c6c',1,'xpcc::Flags::EnumType()']]] ]; <file_sep>/docs/api/classxpcc_1_1atomic_1_1_flag.js var classxpcc_1_1atomic_1_1_flag = [ [ "Flag", "classxpcc_1_1atomic_1_1_flag.html#a88cccd24d8fce27c77b53c10227e2dcd", null ], [ "Flag", "classxpcc_1_1atomic_1_1_flag.html#a1954904513dcc19a43ff069b156bccf8", null ], [ "operator=", "classxpcc_1_1atomic_1_1_flag.html#a65e051915968137a4dabb226070f1397", null ], [ "test", "classxpcc_1_1atomic_1_1_flag.html#ac0747105d682d96e0e17a61d92f46a4f", null ], [ "set", "classxpcc_1_1atomic_1_1_flag.html#a97efcd8ae4faf230173324a332e7d376", null ], [ "reset", "classxpcc_1_1atomic_1_1_flag.html#a4f17381d256a3b8a60beae3b360cbf5c", null ], [ "testAndSet", "classxpcc_1_1atomic_1_1_flag.html#a7bd017500f1ad2f9c82c867fca966587", null ] ];<file_sep>/docs/api/classxpcc_1_1_linked_list_1_1const__iterator.js var classxpcc_1_1_linked_list_1_1const__iterator = [ [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html#a5ca6f222cad4128e040a414c03fddfcd", null ], [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html#a2e86a58d9282e74606a59b278e08d100", null ], [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html#a48454a8b849b4dab7d281ab7a286e441", null ], [ "operator=", "classxpcc_1_1_linked_list_1_1const__iterator.html#a853968739b0cd93424657936ff4ab86f", null ], [ "operator++", "classxpcc_1_1_linked_list_1_1const__iterator.html#abc3058f226040ef3ca552060662aefe8", null ], [ "operator==", "classxpcc_1_1_linked_list_1_1const__iterator.html#a3ad2aa187824f52f86092aa61f1f4612", null ], [ "operator!=", "classxpcc_1_1_linked_list_1_1const__iterator.html#a7e9f1a9ac766a3a3b797d63f67c5908d", null ], [ "operator*", "classxpcc_1_1_linked_list_1_1const__iterator.html#a64c504096e1c45957d95ef16df5566d9", null ], [ "operator->", "classxpcc_1_1_linked_list_1_1const__iterator.html#acfca38b707206e63ece974956eeb2727", null ], [ "LinkedList", "classxpcc_1_1_linked_list_1_1const__iterator.html#af71fad9f4990e232af55c73aeddb3823", null ] ];<file_sep>/docs/api/classxpcc_1_1_gpio_port.js var classxpcc_1_1_gpio_port = [ [ "PortType", "classxpcc_1_1_gpio_port.html#af382edca85322af5077cbb1e1ac73807", null ], [ "DataOrder", "classxpcc_1_1_gpio_port.html#a0b4a485a4d4707e54663853b527c3ea3", [ [ "Normal", "classxpcc_1_1_gpio_port.html#a0b4a485a4d4707e54663853b527c3ea3a960b44c579bc2f6818d2daaf9e4c16f0", null ], [ "Reversed", "classxpcc_1_1_gpio_port.html#a0b4a485a4d4707e54663853b527c3ea3a030aa94015bd11d183b897ddb541e4e3", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1sab_1_1_master.js var classxpcc_1_1sab_1_1_master = [ [ "QueryStatus", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19e", [ [ "IN_PROGRESS", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19eaa4948cfaa8fdec73d93a76a440ad9bbe", null ], [ "SUCCESS", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19eaff605fbba4deec1238ba1c29b4f94d7b", null ], [ "ERROR_RESPONSE", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19ea6cf7fe3489e39ad3725e8bef16253a7d", null ], [ "ERROR_TIMEOUT", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19eae6b2a73c759746e25365104303388f1a", null ], [ "ERROR_PAYLOAD", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19ea4986cfbdbe65d727729ff32f9c5b04ea", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_software_gpio_port.js var classxpcc_1_1_software_gpio_port = [ [ "PortType", "classxpcc_1_1_software_gpio_port.html#a5b425bc5c577792a05b21e481dd959f9", null ], [ "PortType", "classxpcc_1_1_software_gpio_port.html#a5b425bc5c577792a05b21e481dd959f9", null ] ];<file_sep>/src/reference/build-system.md # Build system xpcc uses the [SCons build system][scons] to generate, build and program your application. We've extended it with many utilities to allow a smooth integration of embedded tools. ## Build commands You can use these command in all our examples to get a feel of how it works. ### Common - `build`: Generates the HAL and compiles your program into an executable. - `size`: Displays the static Flash and RAM consumption. - `program`: Writes the executable onto your target. <!-- - `doc`: Generates the doxygen documentation for xpcc with your configuration. --> By default `scons` executes `scons build size`. - `listing`: Decompiles your executable into an annotated assembly listing. - `symbols`: Displays the symbol table for your executable. - `-c`: Cleans the project's build files. - `verbose=1`: Makes the printout more verbose. - `optimization=[0,1,2,3,s]`: Forces compilation with specified optimization level. Can be used for debug builds. ### AVR only: - `fuse`: Writes the fuse bits onto your target. - `eeprom`: Writes the EEPROM memory onto your target. ### ARM Cortex-M only: - `debug`: Starts the GDB debug session of your current application in text UI mode. You must execute `openocd-debug` or `lpclink-debug` before running this command! - `openocd-debug`: Starts the OpenOCD debug server for your target. - `lpclink-debug`: Starts the LPC-Link debug server for your target. - `lpclink-init`: Initialize the LPC-Link with its proprietary firmware. ## Project configuration Your `project.cfg` file contains configuration information for your target. For the device identify naming scheme, see the [Device File reference](../reference/device-files/#device-identifier). ```ini [build] # use a predefined board config file from xpcc/architecture/platform/board/ # it defines the configuration for a board, which you can overwrite here. board = stm32f4_discovery # declare the name of your project. Default is enclosing folder name. name = blinky # the target of your project, use the full name of the device here device = stm32f407vg # AVR only: declare the clock frequency in Hz clock = 16000000 # overwrite the default `./build/` folder path buildpath = ../../build/${name} # optimization level for compilation [0,1,2,3,s] optimization = 0 # declare additional compilation flags for your project ccflags = -Werror -Wall -Wextra # parametrize HAL drivers here, see section on Parameters [parameters] uart.stm32.3.tx_buffer = 2048 uart.stm32.3.rx_buffer = 256 # AVR only: declare fuse bits for use with $ scons fuse [fusebits] # only the fuses declared here are written efuse = 0x41 hfuse = 0x42 lfuse = 0x43 # AVR only: configure avrdude for $ scons program # Consult the avrdude documentation for options. [avrdude] # using the AVR ISP mk2 programmer port = usb programmer = avrispmkII # or using a serial bootloader port = /dev/ttyUSB0 programmer = arduino # baudrate only required for serial bootloaders baudrate = 115200 # ARM only: configure OpenOCD for $ scons program [openocd] # OpenOCD has predefined configs in its searchpaths configfile = board/stm32f4discovery.cfg # but you can also use your own special config file configfile = openocd.cfg # the commands to run on $ scons program. Defaults are: commands = init reset halt flash write_image erase $SOURCE reset run shutdown # ARM only: configure Black Magic Probe for $ scons program [black_magic_probe] # using a serial port port = /dev/ttyUSB0 # LPC targets with LPC-Linkv2 programmer only [lpclink] # base path of the lpcxpresso installation # Default on Linux: /opt/lpcxpresso/ # Default on OS X: /Applications/lcpxpresso_*/ (first match) basepath = ../lpcxpresso ``` ### Parameters In order to customize drivers further, driver parameters may be declared. These follow the naming scheme `type.name.instance.parameter` and are restrictive in the values they accept. Here is an overview of the available parameters. Set the software queue size for CAN messages for peripheral instance `N` in addition to the hardware queues: - `can.stm32.N.tx_buffer ∈ [0,254] = 32` - `can.stm32.N.rx_buffer ∈ [0,254] = 32` Sets the main stack size. Note that the linkerscript may increase this to satisfy alignment requirements, especially with the vector table mapped to RAM. Default size is `3kB - 32B`. - `core.cortex.0.main_stack_size ∈ [512, 8192] = 3040` Places the vector table in RAM. When your stack and interrupt vector table reside in the _same_ RAM section, this will _increase_ interrupt response time! The default setting is the fastest setting. - `core.cortex.0.vector_table_in_ram ∈ bool = false (true on STM32F3/STM32F7)` Enables the blinking LED inside the hard fault handler. Use this feature to easily identify a crashed processor! - `core.cortex.0.enable_hardfault_handler_led ∈ bool = false` - `core.cortex.0.hardfault_handler_led_port ∈ {A,B,C,D,E,F,G,H,I,J,K}` - `core.cortex.0.hardfault_handler_led_pin ∈ [0,15]` Enables the serial logger inside the hard fault handler. Use `basic` for a minimal failure trace or `true` for a complete trace. You must provide the peripheral instance of the used serial port as well as a `XPCC_LOG_ERROR` output stream! - `core.cortex.0.enable_hardfault_handler_log ∈ {false,basic,true} = false` - `core.cortex.0.hardfault_handler_uart ∈ [1,8]` Sets the size of the transaction buffer for peripheral instance `N`. Increase this if you have many connected I2C slaves. - `i2c.stm32.N.transaction_buffer ∈ [1,100] = 8` Forces the SPI driver on AVRs to poll for transfer completion rather than to delegate execution back to the main loop. Enabling this only makes sense for very high SPI frequencies. - `spi.at90_tiny_mega.0.busywait ∈ bool = false` Set the software buffer for UART data for peripheral instance `N`. The size is limited on AVRs, due to atomicity requirements! - `uart.at90_tiny_mega.N.tx_buffer ∈ [1,254] = 64` - `uart.at90_tiny_mega.N.rx_buffer ∈ [1,254] = 8` - `uart.lpc.0.tx_buffer ∈ [1,65534] = 250` - `uart.lpc.0.rx_buffer ∈ [1,65534] = 16` - `uart.stm32.N.tx_buffer ∈ [1,65534] = 250` - `uart.stm32.N.rx_buffer ∈ [1,65534] = 16` [scons]: http://www.scons.org/ <file_sep>/docs/api/structxpcc_1_1hmc5843.js var structxpcc_1_1hmc5843 = [ [ "Gain", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1", [ [ "Ga0_7", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1aeb0aa48b102464a18908bddf9577b086", null ], [ "Ga1_0", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1a8c3df50216846980981e96faa754b314", null ], [ "Ga1_5", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1a42c6ad0d79ff9f2c15a9380aaedce261", null ], [ "Ga2_0", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1a1f9c49678e32a9cb0402acd6e8fb59c7", null ], [ "Ga3_2", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1a0fe1a051b945124d93ae84c47867b8d7", null ], [ "Ga3_8", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1ae31a006475c06fe3cc7f9e392ae5d0a3", null ], [ "Ga4_5", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1a60b36dc8d1ce0a1c3f907ffad64bf03c", null ], [ "Ga6_5", "structxpcc_1_1hmc5843.html#a4feef3890a35759c443afa9a315e7eb1a67f54e58759098297ff87c962dced707", null ] ] ], [ "MeasurementRate", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3", [ [ "Hz0_5", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3a17c477332ee295c46542ce0d1d074e3f", null ], [ "Hz1", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3a42294b2d3765eba368632a6156ebbf74", null ], [ "Hz2", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3a6f7f321ff8c22055996fbc172f4345a3", null ], [ "Hz5", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3a8b174e282eb19025ebfbf8e82ba0c4dd", null ], [ "Hz10", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3aeea5e98ba2a18623c87216a225ee4e0d", null ], [ "Hz20", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3a59e319e6a3fefbb95ad69c8c28ec349e", null ], [ "Hz50", "structxpcc_1_1hmc5843.html#a397ac616c23676932a27703c3e3eabc3a380af569aed89ba6de57c1d9d3779bed", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1_value.js var structxpcc_1_1_value = [ [ "Value", "structxpcc_1_1_value.html#a3a1a113c845e482023cda938e9fc10d9", null ], [ "Value", "structxpcc_1_1_value.html#ad7431a7a8a330bc6e5f731d73f3e65d1", null ], [ "Value", "structxpcc_1_1_value.html#a91e700c71206382d1edb9f4ab668c46b", null ] ];<file_sep>/docs/api/group__logger.js var group__logger = [ [ "Logger", "classxpcc_1_1log_1_1_logger.html", [ [ "Logger", "classxpcc_1_1log_1_1_logger.html#a9c35b6446cd6a7809948a90e098fc6e7", null ], [ "operator<<", "classxpcc_1_1log_1_1_logger.html#a5fa309ec2b4c002fb250c103f01564a1", null ] ] ], [ "DefaultStyle", "classxpcc_1_1log_1_1_default_style.html", [ [ "parseArg", "classxpcc_1_1log_1_1_default_style.html#a664f38c4e1b759d29597a0fa6a9e0412", null ], [ "write", "classxpcc_1_1log_1_1_default_style.html#a0e099c0a6ae764991ce102f1f21e3a9d", null ], [ "write", "classxpcc_1_1log_1_1_default_style.html#a2ab82a484b5baab7773f4aac491d1c95", null ], [ "flush", "classxpcc_1_1log_1_1_default_style.html#a94dd1a64666098a891beefe30b09d7cf", null ] ] ], [ "StyleWrapper", "classxpcc_1_1log_1_1_style_wrapper.html", [ [ "StyleWrapper", "classxpcc_1_1log_1_1_style_wrapper.html#ab802ef7b4004b4bb94fe0ed8884b0437", null ], [ "~StyleWrapper", "classxpcc_1_1log_1_1_style_wrapper.html#a3798576d91b11c9c5543c944ad7b676f", null ], [ "write", "classxpcc_1_1log_1_1_style_wrapper.html#a0d7ee7df577a561bafd5f21b05b05570", null ], [ "write", "classxpcc_1_1log_1_1_style_wrapper.html#abb70f56eeb225066532cd02a3243d43b", null ], [ "flush", "classxpcc_1_1log_1_1_style_wrapper.html#a53ae6e69eca9313b91c5bbb09880ec5a", null ], [ "read", "classxpcc_1_1log_1_1_style_wrapper.html#a43487b63caaf11561df77af7ee7e1733", null ] ] ], [ "Prefix", "classxpcc_1_1log_1_1_prefix.html", [ [ "Prefix", "classxpcc_1_1log_1_1_prefix.html#adcee1012a689c4db0a40ebb54eedd323", null ], [ "Prefix", "classxpcc_1_1log_1_1_prefix.html#a5a2fab3bb153f649cdc20476421f3790", null ], [ "write", "classxpcc_1_1log_1_1_prefix.html#aef98c3f1bf176b022bc9aecc36cbde47", null ], [ "write", "classxpcc_1_1log_1_1_prefix.html#a60c4bce1a04e054668480feeae7db46e", null ], [ "flush", "classxpcc_1_1log_1_1_prefix.html#a4625db244244de5872fbc08b75183fcf", null ] ] ], [ "StdColour", "classxpcc_1_1log_1_1_std_colour.html", [ [ "StdColour", "classxpcc_1_1log_1_1_std_colour.html#a941a12bac6f13b28bb08e2099686f089", null ], [ "StdColour", "classxpcc_1_1log_1_1_std_colour.html#a6acd7b20474f02c791762f3bacf38389", null ], [ "~StdColour", "classxpcc_1_1log_1_1_std_colour.html#a70181475b9079d29a2a1be4cb181f601", null ], [ "parseArg", "classxpcc_1_1log_1_1_std_colour.html#a8f256936948849d2a5e033639975e2b5", null ], [ "write", "classxpcc_1_1log_1_1_std_colour.html#a4ed6346b0a1bb8a0b3b68a2031ff5c65", null ], [ "write", "classxpcc_1_1log_1_1_std_colour.html#af2f25dc980685907c8ce2a3e27ea32d9", null ], [ "flush", "classxpcc_1_1log_1_1_std_colour.html#a4c93dc890a68706a82835e370c4f7f62", null ] ] ], [ "Style", "classxpcc_1_1log_1_1_style.html", [ [ "Type", "classxpcc_1_1log_1_1_style.html#a29c36c1a9d87a30bf22d1acb5d1dc7ba", null ], [ "Style", "classxpcc_1_1log_1_1_style.html#af2b04985cbd249c44bf758d03f1fa3e4", null ], [ "Style", "classxpcc_1_1log_1_1_style.html#ae4a36208c2265232177e74077ada5155", null ], [ "~Style", "classxpcc_1_1log_1_1_style.html#aff9a85ed67ec64e50388e5b0af452e61", null ], [ "parseArg", "classxpcc_1_1log_1_1_style.html#a140c55ad563d65e7371392c4b0e46970", null ], [ "write", "classxpcc_1_1log_1_1_style.html#a4180df119ff3e81c94e6243f15f31ea1", null ], [ "write", "classxpcc_1_1log_1_1_style.html#a836f02c8edcdef51ef310c94bfdfa55f", null ], [ "flush", "classxpcc_1_1log_1_1_style.html#a5ddec71ad0547e9c91b6c3b7843e69a6", null ] ] ], [ "log", "namespacexpcc_1_1log.html", null ], [ "XPCC_LOG_LEVEL", "group__logger.html#ga6ef0e3741c3d03cde574b20ff00a1dd3", null ], [ "XPCC_LOG_OFF", "group__logger.html#gacbc3f288110e37bd887d3705f757808f", null ], [ "XPCC_LOG_DEBUG", "group__logger.html#gaad3c2190e2b74204cd1df91ce3a5b3f8", null ], [ "XPCC_LOG_INFO", "group__logger.html#ga309b84adce42d7effb1f8377e8b93a47", null ], [ "XPCC_LOG_WARNING", "group__logger.html#ga19c1c5298a72f7057a218a654145ff38", null ], [ "XPCC_LOG_ERROR", "group__logger.html#ga5af042b181684d177bcf45500d4d55b4", null ], [ "FILENAME", "group__logger.html#ga8de29f7c8bbf1a81cc6e71ac602032d3", null ], [ "XPCC_FILE_INFO", "group__logger.html#gaed180a532bac512e94b4cc521b302160", null ], [ "Level", "group__logger.html#ga0e669c355fdfbae96f31a0b6e4fa36ad", null ] ];<file_sep>/docs/api/navtreeindex1.js var NAVTREEINDEX1 = { "classxpcc_1_1_button_group.html#a543afb9661099587cbd62104958d5a1d":[1,10,1,3], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443":[1,10,1,0], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a0dc3a3d66507ed667d89a1d33e533156":[1,10,1,0,2], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a2139cda31544d0b80da8f588d3d0a79c":[1,10,1,0,0], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a220077f6136cc38fbf86f82568da5480":[1,10,1,0,6], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a33513b77d3f86bf7635367737f00ad23":[1,10,1,0,4], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a413bc4f5e448b2bf02a57e138518dd08":[1,10,1,0,9], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a479e3e7ce77a1c1c6423881d8eac795a":[1,10,1,0,5], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443ad08910ad36221c826164908220c33a48":[1,10,1,0,1], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443ad79aa7626e66943e85f6faa141c75b75":[1,10,1,0,7], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443adb42beb7d50000bab9e158cafa46e9d0":[1,10,1,0,8], "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443afc1b8badc7f2ade3f038c83c0d09be3c":[1,10,1,0,3], "classxpcc_1_1_button_group.html#a650056c1955240d1785c3581176444e9":[1,10,1,4], "classxpcc_1_1_button_group.html#a7d37e81e07826d5b112eb3f1a5cd70e1":[1,10,1,13], "classxpcc_1_1_button_group.html#a8522cd5724ac3a84ed3d601c64ae3f57":[1,10,1,15], "classxpcc_1_1_button_group.html#a8e1bbec435f7ccc245382533302255a5":[1,10,1,11], "classxpcc_1_1_button_group.html#aa3cef6ff7d391454d8dfb628a0ef58fa":[1,10,1,2], "classxpcc_1_1_button_group.html#aa9b8544d7314ad738386a4772876b48f":[1,10,1,14], "classxpcc_1_1_button_group.html#ab5442ca6572d259525ce9f7de31f7ac1":[1,10,1,8], "classxpcc_1_1_button_group.html#ac627e9ed0df16256bca2bacff57146ef":[1,10,1,7], "classxpcc_1_1_button_group.html#adafb23682a9fa77ece5adf1200bf8cdf":[1,10,1,10], "classxpcc_1_1_button_group.html#ae444915a84bf4d45abaa915450273703":[1,10,1,1], "classxpcc_1_1_button_group.html#af2d47cca97ecbb0d40b463fa405631f6":[1,10,1,9], "classxpcc_1_1_can.html":[1,1,4,2,0], "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50f":[1,1,4,2,0,2], "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50fa2ec0d16e4ca169baedb9b2d50ec5c6d7":[1,1,4,2,0,2,0], "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50fad15305d7a4e34e02489c74a5ef542f36":[1,1,4,2,0,2,3], "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50faf2dddaa52fc350a733bae4d166aed1fe":[1,1,4,2,0,2,2], "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50faf6838fe3c9b719640b817473e714ac47":[1,1,4,2,0,2,1], "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709":[1,1,4,2,0,0], "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a2bedeeb051e4212e3c53f13f85845fde":[1,1,4,2,0,0,2], "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a3db5be2c0f1a2c52d4efc1d475551ba9":[1,1,4,2,0,0,1], "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a45987c21827015f2000fff5769b231a2":[1,1,4,2,0,0,3], "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a960b44c579bc2f6818d2daaf9e4c16f0":[1,1,4,2,0,0,0], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720":[1,1,4,2,0,1], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a0ae5bab196b9c076bdece0b35e411a8a":[1,1,4,2,0,1,7], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a0ce272ee0320cb7aa1e28afd17936a18":[1,1,4,2,0,1,0], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a21b1eb7094856ae8fcc15cef6ca4b97d":[1,1,4,2,0,1,4], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a4b81755cfe03fc72a30846c917723a1b":[1,1,4,2,0,1,1], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a53db17dcb6f1e88fcc120560305c1984":[1,1,4,2,0,1,2], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a67edaa773e5936d4c85dc0437f809c60":[1,1,4,2,0,1,5], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720ab2f64d661215c80110a9836abb473302":[1,1,4,2,0,1,3], "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720abb2693a7cd71b19a9bb56efdee7e3ceb":[1,1,4,2,0,1,6], "classxpcc_1_1_can_bit_timing.html":[1,1,4,2,2], "classxpcc_1_1_can_connector.html":[1,2,4,10,0], "classxpcc_1_1_can_connector.html#a16230c052c033b65a0853b4548d295e0":[1,2,4,10,0,9], "classxpcc_1_1_can_connector.html#a2b3a59b2b096060dc50009c071288d3c":[1,2,4,10,0,19], "classxpcc_1_1_can_connector.html#a371f1cc4792ad4fe7c5b1208aa2b12a2":[1,2,4,10,0,10], "classxpcc_1_1_can_connector.html#a453226e9ddc1ada57007afcfc7bac175":[1,2,4,10,0,13], "classxpcc_1_1_can_connector.html#a466b6962a240b03f6dad9b11e14bdcd5":[1,2,4,10,0,11], "classxpcc_1_1_can_connector.html#a51e51cf95a071972c83dc2dd233503a8":[1,2,4,10,0,7], "classxpcc_1_1_can_connector.html#a78cf5e581214b6eedb09707f49da17f9":[1,2,4,10,0,6], "classxpcc_1_1_can_connector.html#a7bf080715613f06a2ad171e39ba3d526":[1,2,4,10,0,5], "classxpcc_1_1_can_connector.html#a7d50b34462e7aae4a6f4f83d9c94285c":[1,2,4,10,0,15], "classxpcc_1_1_can_connector.html#a83db3f5d921e1a45dcd0395e97519b46":[1,2,4,10,0,14], "classxpcc_1_1_can_connector.html#a98dc3c73bb7cb6910eb3dae53719aabb":[1,2,4,10,0,2], "classxpcc_1_1_can_connector.html#aa11aeaa0cc2c0a0e521ffb93dbed1cf8":[1,2,4,10,0,17], "classxpcc_1_1_can_connector.html#aaac9b5ee9d72377067d13870a329f582":[1,2,4,10,0,8], "classxpcc_1_1_can_connector.html#aad89382cacf6e57f2eb940574838c32e":[1,2,4,10,0,18], "classxpcc_1_1_can_connector.html#ad1775869231f13e62e05d1966e854299":[1,2,4,10,0,16], "classxpcc_1_1_can_connector.html#adabb35a09557972dc56557b5e925e176":[1,2,4,10,0,4], "classxpcc_1_1_can_connector.html#aed553a76f0c265cf448d350b6b1cd94c":[1,2,4,10,0,3], "classxpcc_1_1_can_connector.html#afc0d4f1b928abc38760639834a7e46b0":[1,2,4,10,0,20], "classxpcc_1_1_can_connector.html#afdf56a3c9b08ebd0b1a71ab483b64c45":[1,2,4,10,0,12], "classxpcc_1_1_can_connector_1_1_receive_list_item.html":[1,2,4,10,0,0], "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a01e4a3ffc0f3b6daf9c122ed7ef629d3":[1,2,4,10,0,0,3], "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a0db7a8077fabae052c924f74d62a47e1":[1,2,4,10,0,0,4], "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a22c699216fe80273836d32e9faac1925":[1,2,4,10,0,0,0], "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a7525dfac072127535afa2cfe65189b8c":[1,2,4,10,0,0,2], "classxpcc_1_1_can_connector_1_1_receive_list_item.html#ab5a8fa3970541a2120db18a8ec5ab993":[1,2,4,10,0,0,1], "classxpcc_1_1_can_connector_1_1_receive_list_item.html#ab8ff05e1950351cbc562aaababe89f28":[1,2,4,10,0,0,5], "classxpcc_1_1_can_connector_1_1_send_list_item.html":[1,2,4,10,0,1], "classxpcc_1_1_can_connector_1_1_send_list_item.html#a3cd3c5d3b6fbcbc4ef2cb06029a33f00":[1,2,4,10,0,1,2], "classxpcc_1_1_can_connector_1_1_send_list_item.html#a8c882891a3b9c996c12a368074f82a92":[1,2,4,10,0,1,0], "classxpcc_1_1_can_connector_1_1_send_list_item.html#a9b22499ffbe4c7d1363d192117af1126":[1,2,4,10,0,1,1], "classxpcc_1_1_can_connector_1_1_send_list_item.html#aa7062797edd1e15fc85f07c2738faebc":[1,2,4,10,0,1,3], "classxpcc_1_1_can_connector_1_1_send_list_item.html#ac4e46b0500c622eece086b5bd2e5a33f":[1,2,4,10,0,1,4], "classxpcc_1_1_can_connector_base.html":[2,0,3,77], "classxpcc_1_1_can_lawicel_formatter.html":[1,5,3,0], "classxpcc_1_1_character_display.html":[1,10,5,1], "classxpcc_1_1_character_display.html#a0276abbb90317c62fc428822bfc5cdcd":[1,10,5,1,6], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0":[1,10,5,1,1], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a0cb0d40da01c2ae5cc2b7287052f6ef1":[1,10,5,1,1,4], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a1a82b1d70eea710a28dbba0209dbd879":[1,10,5,1,1,1], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a1f16a2de041b2e2f8910bde411d90d95":[1,10,5,1,1,2], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a22691142072c12a5f3f39726f34135e4":[1,10,5,1,1,3], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a2ea75e17b3c34f52750a546476c7b192":[1,10,5,1,1,5], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a35fd544613db4d2b17346ad0de30e1fe":[1,10,5,1,1,9], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a566f39825525b02bb8205e9c21ce49ba":[1,10,5,1,1,8], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a99a0b8e0b0748b3c47dda118a3f4d4fa":[1,10,5,1,1,7], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a9a7b87e52c4767dbd6954c48782d738f":[1,10,5,1,1,0], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0ab9e5e9d500575890e5f5e40e8223f71b":[1,10,5,1,1,6], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0ac1f48ddc1265a19050d806f52f661a6b":[1,10,5,1,1,11], "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0ae8d02d24476456a7160f1ecfc832f42d":[1,10,5,1,1,10], "classxpcc_1_1_character_display.html#a22478619ebb2df603c63c4ff894bbd14":[1,10,5,1,13], "classxpcc_1_1_character_display.html#a226a741abd176f94ec1f38488e174948":[1,10,5,1,7], "classxpcc_1_1_character_display.html#a547d0c7b21f4e68733da49da9756f423":[1,10,5,1,5], "classxpcc_1_1_character_display.html#a594bdf678d3048565b9f1b553263bd17":[1,10,5,1,10], "classxpcc_1_1_character_display.html#a5bbefbc3408c7817c9fa2c4c88c9f80a":[1,10,5,1,8], "classxpcc_1_1_character_display.html#a6fa309ca48eab3029aa78b1b7ccb918b":[1,10,5,1,4], "classxpcc_1_1_character_display.html#a9ebbf448ed717dbc9f15f1f76b400fdc":[1,10,5,1,11], "classxpcc_1_1_character_display.html#aa287ad296b902d33e8bcca9285b65a4f":[1,10,5,1,9], "classxpcc_1_1_character_display.html#ad1dae2ec85c742bda2fffc7e8206cc00":[1,10,5,1,2], "classxpcc_1_1_character_display.html#ad2d9211cd6ade790647e5fc55329cb2b":[1,10,5,1,12], "classxpcc_1_1_character_display.html#ae1fbaf039f27b25cc707ffc9718460e9":[1,10,5,1,3], "classxpcc_1_1_character_display_1_1_writer.html":[1,10,5,1,0], "classxpcc_1_1_character_display_1_1_writer.html#a46095de6897d013589dea346294e0fc3":[1,10,5,1,0,0], "classxpcc_1_1_character_display_1_1_writer.html#a4c02916bc4a8040b1ed8f227aa4e8cde":[1,10,5,1,0,2], "classxpcc_1_1_character_display_1_1_writer.html#aebea58e9cf37dfd59ba7b9845fddd8c6":[1,10,5,1,0,1], "classxpcc_1_1_character_display_1_1_writer.html#aee75fc32b674d8970d16714fcd2f64f3":[1,10,5,1,0,3], "classxpcc_1_1_choice_menu.html":[1,10,8,2], "classxpcc_1_1_choice_menu.html#a0cf84e208376772e6841a9c4b596432f":[1,10,8,2,5], "classxpcc_1_1_choice_menu.html#a1760d449d6b7c0ca082b7eb8458f43b7":[1,10,8,2,0], "classxpcc_1_1_choice_menu.html#a22200691f4cbe53204fff90cb9b46de0":[1,10,8,2,10], "classxpcc_1_1_choice_menu.html#a23cff61305df901c6c036494f7588d65":[1,10,8,2,7], "classxpcc_1_1_choice_menu.html#a3977d0a20dee914c2c18f5392337f95d":[1,10,8,2,1], "classxpcc_1_1_choice_menu.html#a5f342d7dfbd4fe58d94d31877ed69299":[1,10,8,2,3], "classxpcc_1_1_choice_menu.html#a6b043d5e3f16a7789576adfc506957c4":[1,10,8,2,2], "classxpcc_1_1_choice_menu.html#a7fcd0b1a3011c40eaa96be78cb6dfedb":[1,10,8,2,4], "classxpcc_1_1_choice_menu.html#ada78ebf9a556dbd48bff56bda377767c":[1,10,8,2,9], "classxpcc_1_1_choice_menu.html#ae6eae417776ea0fe703b20e1c126ae6c":[1,10,8,2,6], "classxpcc_1_1_choice_menu.html#af98b0d9e97b2852fb154446210624c5e":[1,10,8,2,8], "classxpcc_1_1_choice_menu_entry.html":[2,0,3,81], "classxpcc_1_1_choice_menu_entry.html#a1b23217fa1208aa33cd10fac8ca62cb2":[2,0,3,81,2], "classxpcc_1_1_choice_menu_entry.html#a2db8b7272eef42a2255b7ea81f1fcb69":[2,0,3,81,1], "classxpcc_1_1_choice_menu_entry.html#a443e8bae4159e9e5edc5b8634fd112e1":[2,0,3,81,0], "classxpcc_1_1_choice_menu_entry.html#a969054f5c9a7cdbdfe2d1b798ba597c2":[2,0,3,81,3], "classxpcc_1_1_circle2_d.html":[1,8,3,1], "classxpcc_1_1_circle2_d.html#a0b60aa8d1b4591560210ef8ddf863b9b":[1,8,3,1,13], "classxpcc_1_1_circle2_d.html#a0bdfde722d098db2934f819a8eba8e19":[1,8,3,1,6], "classxpcc_1_1_circle2_d.html#a1e46360ed224b3a5ba68f4f72b2a9ee1":[1,8,3,1,10], "classxpcc_1_1_circle2_d.html#a3cbb7a885a83927f773bf3226e6cefc4":[1,8,3,1,8], "classxpcc_1_1_circle2_d.html#a49e2f334143b18f7a0a1510d2f350649":[1,8,3,1,9], "classxpcc_1_1_circle2_d.html#a4f872b9c18343c0cee60217e3b1365d2":[1,8,3,1,7], "classxpcc_1_1_circle2_d.html#a5698f4ce9c4fd381e1c8a9b0a0124eeb":[1,8,3,1,5], "classxpcc_1_1_circle2_d.html#a99750dca82d94a1626a680f33173a719":[1,8,3,1,2], "classxpcc_1_1_circle2_d.html#a9eadf9affbc8affbcedc4a5b6c9076a3":[1,8,3,1,3], "classxpcc_1_1_circle2_d.html#ac5bde1b53413089e1ffc0110c0f0126e":[1,8,3,1,1], "classxpcc_1_1_circle2_d.html#ad8a4ca1044213db6f3044c817b17c4d2":[1,8,3,1,4], "classxpcc_1_1_circle2_d.html#ae40ed5af41f7bd4a9226e517ebd790d5":[1,8,3,1,11], "classxpcc_1_1_circle2_d.html#afd51e07f33732d73ecd099a6aa526660":[1,8,3,1,0], "classxpcc_1_1_circle2_d.html#aff6928015e8524807c88f8f703be4e1d":[1,8,3,1,12], "classxpcc_1_1_clock.html":[1,1,0], "classxpcc_1_1_clock.html#ab3aed6148f43a2bfecb5861c2ab10e0e":[1,1,0,0], "classxpcc_1_1_clock_dummy.html":[2,0,3,84], "classxpcc_1_1_clock_dummy.html#a3460221e479fa1350c0391f913091444":[2,0,3,84,0], "classxpcc_1_1_communicatable.html":[1,2,4,2], "classxpcc_1_1_communicatable_task.html":[2,0,3,86], "classxpcc_1_1_communicatable_task.html#a47a8808eb8901a6b479dda672df3005d":[2,0,3,86,0], "classxpcc_1_1_communicatable_task.html#a6b8f50b5f1ee52836b8e4b5f8c4fb40a":[2,0,3,86,1], "classxpcc_1_1_communicating_view.html":[2,0,3,87], "classxpcc_1_1_communicating_view.html#a0025589da3e60672a084044282d6cfc3":[2,0,3,87,0], "classxpcc_1_1_communicating_view.html#a63931b6dad38bb9693c269286b73b636":[2,0,3,87,1], "classxpcc_1_1_communicating_view_stack.html":[2,0,3,88], "classxpcc_1_1_communicating_view_stack.html#a4aaba862fbc63f3c80687bba6f465993":[2,0,3,88,0], "classxpcc_1_1_communicating_view_stack.html#a64d50b2cb2be1703449f9984490bcf6c":[2,0,3,88,2], "classxpcc_1_1_communicating_view_stack.html#ad8321f19b4b230091e650bace67e9655":[2,0,3,88,1], "classxpcc_1_1_communicator.html":[1,2,4,3], "classxpcc_1_1_communicator.html#a0d033d977d29f763272be80bbd178288":[1,2,4,3,11], "classxpcc_1_1_communicator.html#a0f0230f5449351fa9404da5b691c90ce":[1,2,4,3,7], "classxpcc_1_1_communicator.html#a1faafaf06f201866a32a1c1463f570e5":[1,2,4,3,8], "classxpcc_1_1_communicator.html#a2d2c66a52913b7b689582ea186e2fde8":[1,2,4,3,1], "classxpcc_1_1_communicator.html#a3102b10abdd000e5005bd584978cd5a5":[1,2,4,3,4], "classxpcc_1_1_communicator.html#a552202127c9dec5a17b7c1c00a17bd79":[1,2,4,3,5], "classxpcc_1_1_communicator.html#a697395d2bbfc33059f926b4b239da12e":[1,2,4,3,0], "classxpcc_1_1_communicator.html#a9f4eeb2d993bb8e6d3dcd5ddd90dc30f":[1,2,4,3,2], "classxpcc_1_1_communicator.html#ab222748848709ee3a665fa3eaf96df42":[1,2,4,3,9], "classxpcc_1_1_communicator.html#abe44e3da50807ff7d85b5b69c30fd434":[1,2,4,3,10], "classxpcc_1_1_communicator.html#ac52693f62fcb91aa0b95f7001e32ba61":[1,2,4,3,6], "classxpcc_1_1_communicator.html#ae51a6194725481cd2673a1de0e861ce4":[1,2,4,3,3], "classxpcc_1_1_date.html":[1,10,3], "classxpcc_1_1_date.html#a3e8fd18760f0f34f4dd79b0582477fd0":[1,10,3,8], "classxpcc_1_1_date.html#a4386667477b13897edae5cb498f3a084":[1,10,3,6], "classxpcc_1_1_date.html#a4b39cc587f72a772b8aa03a269783d1d":[1,10,3,3], "classxpcc_1_1_date.html#a7a5cf60c1964ed80db860fb31de0d228":[1,10,3,1], "classxpcc_1_1_date.html#aa8e96e3a7eb20fb3f572fbd1279a5d62":[1,10,3,5], "classxpcc_1_1_date.html#ab7fe455ab93917a403b6ae6b9cbd6804":[1,10,3,2], "classxpcc_1_1_date.html#ad936b70a10c10e94b7444f35acd3f31a":[1,10,3,7], "classxpcc_1_1_date.html#aea31871fca3acd678fd9c49ad4a6039f":[1,10,3,4], "classxpcc_1_1_date.html#af7b4cfdc4534fbd9b69843b7d63d193f":[1,10,3,0], "classxpcc_1_1_dispatcher.html":[1,2,4,4], "classxpcc_1_1_dispatcher.html#a13b5cfb2629f958a29ae00410d131fa2":[1,2,4,4,0], "classxpcc_1_1_dispatcher.html#a4dcd5febf1c36b2e450940200e8720a1":[1,2,4,4,1], "classxpcc_1_1_dispatcher.html#ade690b78412fb1a6414ce3a7a81bfa32":[1,2,4,4,2], "classxpcc_1_1_dog_l128.html":[2,0,3,93], "classxpcc_1_1_dog_l128.html#a024c6b843eefb93db0ff331b415346f6":[2,0,3,93,0], "classxpcc_1_1_dog_m081.html":[2,0,3,94], "classxpcc_1_1_dog_m128.html":[2,0,3,95], "classxpcc_1_1_dog_m128.html#a625f4bfe13f8edfebc615c68eb5aa3c1":[2,0,3,95,0], "classxpcc_1_1_dog_m132.html":[2,0,3,96], "classxpcc_1_1_dog_m132.html#ab2d0c3b9f0333b0afc55d0be844620a5":[2,0,3,96,0], "classxpcc_1_1_dog_m162.html":[2,0,3,97], "classxpcc_1_1_dog_m163.html":[2,0,3,98], "classxpcc_1_1_dog_s102.html":[1,5,0,0], "classxpcc_1_1_dog_s102.html#a61ed2621e5902e68693b17897b5eb53b":[1,5,0,0,0], "classxpcc_1_1_doubly_linked_list.html":[1,3,1], "classxpcc_1_1_doubly_linked_list.html#a030b94a8852e729eef9cfbbb16aaf9c5":[1,3,1,15], "classxpcc_1_1_doubly_linked_list.html#a0426f041ad12dfc2ab4ee347197911c7":[1,3,1,8], "classxpcc_1_1_doubly_linked_list.html#a19b63ba9f1eccc03e562623e3ebe47e8":[1,3,1,7], "classxpcc_1_1_doubly_linked_list.html#a256985e646a1d228cd080d551bf4e192":[1,3,1,6], "classxpcc_1_1_doubly_linked_list.html#a2f59547cd1ea8c04f089f7d1c03296d4":[1,3,1,13], "classxpcc_1_1_doubly_linked_list.html#a3598ce2bc9fc423eb35aa0515f08f563":[1,3,1,17], "classxpcc_1_1_doubly_linked_list.html#a44658487886ea776bcaaa848d600ce15":[1,3,1,2,2], "classxpcc_1_1_doubly_linked_list.html#a67171474c4da6cc8efe0c7fafefd2b2d":[1,3,1,20], "classxpcc_1_1_doubly_linked_list.html#a7193731e1158b080c38672539b4cddf5":[1,3,1,21], "classxpcc_1_1_doubly_linked_list.html#a737bffabe85c9901949c42035200d605":[1,3,1,2,1], "classxpcc_1_1_doubly_linked_list.html#a81520a31188c2a7fcdae67a329fdf830":[1,3,1,2,0], "classxpcc_1_1_doubly_linked_list.html#a8afbc40c458ef42a58633e83f58269b3":[1,3,1,18], "classxpcc_1_1_doubly_linked_list.html#a95f614ffcdcc6aed1b370bc2ae0156e3":[1,3,1,3], "classxpcc_1_1_doubly_linked_list.html#a9c646a89d4713fb1db8a0d945b9c9930":[1,3,1,16], "classxpcc_1_1_doubly_linked_list.html#ab329a46b97cba6724961e88fa348726f":[1,3,1,10], "classxpcc_1_1_doubly_linked_list.html#ac173d68175eb07dd8adeeca35376cccd":[1,3,1,22], "classxpcc_1_1_doubly_linked_list.html#ac220ce1c155db1ac44146c12d178056f":[1,3,1,19], "classxpcc_1_1_doubly_linked_list.html#ac241dd57997d49b901685d37dcd126b4":[1,3,1,12], "classxpcc_1_1_doubly_linked_list.html#ac769e838e547d99cdd6dc77b82488079":[1,3,1,11], "classxpcc_1_1_doubly_linked_list.html#ad0dfde3a9638f7786eb04a4eb1592afa":[1,3,1,9], "classxpcc_1_1_doubly_linked_list.html#ad475aacf96e3c20c280b6e13093bdf62":[1,3,1,5], "classxpcc_1_1_doubly_linked_list.html#ae13d96f3b094875fe4ae051090053119":[1,3,1,4], "classxpcc_1_1_doubly_linked_list.html#ae539d0076584c05a69b2ebf7865da8cd":[1,3,1,14], "classxpcc_1_1_doubly_linked_list.html#aee784b541f756f7bd4721c16a6d24663":[1,3,1,23], "classxpcc_1_1_doubly_linked_list.html#structxpcc_1_1_doubly_linked_list_1_1_node":[1,3,1,2], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html":[1,3,1,0], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a25c39619f1b0aff8508a702de4502c8a":[1,3,1,0,8], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a31df8514327ddb17692aaa066f6609eb":[1,3,1,0,3], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a50d8ec97c4181dec87b6ded9aed86287":[1,3,1,0,9], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a7bb79d59482685bea4a3a5929a740dbc":[1,3,1,0,6], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a8518425fc192346c00bedb825184bcf1":[1,3,1,0,10], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a8b053cbdb489192760d3e7c177d67622":[1,3,1,0,2], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a9acb244001f7f2b19299c2cd8d04548f":[1,3,1,0,0], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#ad271ff40b7992838c3bb458fa084a70a":[1,3,1,0,1], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#adf71dc25e1d4d7c29b04fcf2af2bef63":[1,3,1,0,7], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#aeb514825566f668d903e054f1e5b4158":[1,3,1,0,4], "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#aec54905c7df608c98856a12e7398440e":[1,3,1,0,5], "classxpcc_1_1_doubly_linked_list_1_1iterator.html":[1,3,1,1], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a02e3480d80fcabee390832912facbb2b":[1,3,1,1,0], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a0cd66f210c065c508055f965feca468c":[1,3,1,1,6], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a28faa210baff0cdc1a9bbb72f53ee089":[1,3,1,1,5], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a3434e148ba87561fc0a799403b5badd8":[1,3,1,1,3], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a8518425fc192346c00bedb825184bcf1":[1,3,1,1,9], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a92e7747e7fdbbbae4b776f60ae95616f":[1,3,1,1,8], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa5225f3035f8a5f8aa510b63f4846ae8":[1,3,1,1,1], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa5ba9f050ddb46f6b8ee01bb09f05af4":[1,3,1,1,7], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa82ae6f76457e4c7a0b080a9b56127b6":[1,3,1,1,2], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f":[1,3,1,1,10], "classxpcc_1_1_doubly_linked_list_1_1iterator.html#ad5d5726920b2fb8b61496c63a416f5e4":[1,3,1,1,4], "classxpcc_1_1_ds1302.html":[1,6,0], "classxpcc_1_1_ds1631.html":[1,5,13,0], "classxpcc_1_1_ds1631.html#a0749aa5b90523ac4b1d996f30c8e9e6a":[1,5,13,0,13], "classxpcc_1_1_ds1631.html#a1660a7a6792a6a3dc6c53ac00587c2b4":[1,5,13,0,11], "classxpcc_1_1_ds1631.html#a1c732a744a7fd33ad96690ec11b1f599":[1,5,13,0,10] }; <file_sep>/docs/api/search/functions_19.js var searchData= [ ['zeromatrix',['zeroMatrix',['../classxpcc_1_1_matrix.html#ac8151d252570ed6eeb44bf2754c13bf0',1,'xpcc::Matrix']]] ]; <file_sep>/docs/api/search/enums_c.js var searchData= [ ['nominalintegrationtime',['NominalIntegrationTime',['../structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11',1,'xpcc::tcs3414']]], ['nr',['NR',['../structxpcc_1_1lis3dsh.html#a0e79106d9accd66b124d1d0feb213cbb',1,'xpcc::lis3dsh']]], ['nrfregister',['NrfRegister',['../structxpcc_1_1_nrf24_register.html#a4e55b6fe723da36de893bddba2832755',1,'xpcc::Nrf24Register']]] ]; <file_sep>/docs/api/classxpcc_1_1atmega_1_1_uart_spi_master0.js var classxpcc_1_1atmega_1_1_uart_spi_master0 = [ [ "DataMode", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bf", [ [ "Mode0", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ab1deb21db3ae3384e8c67c0bbabc202a", [ [ "MsbFirst", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ab1deb21db3ae3384e8c67c0bbabc202aaee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ab1deb21db3ae3384e8c67c0bbabc202aabdb340581a62499a27a78804ea99a99a", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_siemens_s75_landscape_left.js var classxpcc_1_1_siemens_s75_landscape_left = [ [ "SiemensS75LandscapeLeft", "classxpcc_1_1_siemens_s75_landscape_left.html#a1857d6fd7a17a75be67c2f8e5e49fef2", null ] ];<file_sep>/docs/api/classxpcc_1_1_itg3200.js var classxpcc_1_1_itg3200 = [ [ "Itg3200", "classxpcc_1_1_itg3200.html#a1e32ca2dc9448c2f30fbb6527a40955b", null ], [ "configure", "classxpcc_1_1_itg3200.html#a44834fbe420fe21ba292be56bec9b825", null ], [ "readRotation", "classxpcc_1_1_itg3200.html#a2ff7ca522f896de5e62f0f9a705c5d1b", null ], [ "setLowPassFilter", "classxpcc_1_1_itg3200.html#a9d3426d70839981a67f584340990e8b8", null ], [ "setSampleRateDivider", "classxpcc_1_1_itg3200.html#a11e87babe7339225361a5bd04d393c1d", null ], [ "updateInterrupt", "classxpcc_1_1_itg3200.html#acf7c281e71c75b0b508df63622dd3972", null ], [ "updatePower", "classxpcc_1_1_itg3200.html#a46aff23392cd1ae3ee162ffde0f8bf55", null ], [ "getLowPassFilter", "classxpcc_1_1_itg3200.html#a2875d89ac7204d5f4fea70ee964a3a1f", null ], [ "getInterrupt", "classxpcc_1_1_itg3200.html#aff5cc625fea900af4aab07a045c83c2a", null ], [ "getPower", "classxpcc_1_1_itg3200.html#a56e81e274ac0e1650af503e98fa5b1c6", null ], [ "getStatus", "classxpcc_1_1_itg3200.html#ad1b07c5a74784d4c206684787a6408aa", null ], [ "readStatus", "classxpcc_1_1_itg3200.html#aa808d83558809c4b62730d19cb54f7b0", null ], [ "getData", "classxpcc_1_1_itg3200.html#a8e6c56a71b4db2d46bdca8032549313b", null ] ];<file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01int16__t_01_4.js var structxpcc_1_1_arithmetic_traits_3_01int16__t_01_4 = [ [ "WideType", "group__arithmetic__trais.html#ga4d0c5ad5eaf142ae93fa3b73e7f997c8", null ], [ "SignedType", "group__arithmetic__trais.html#ga85e382a4df923c89085958a6b35c187f", null ], [ "UnsignedType", "group__arithmetic__trais.html#gab111a52b182e3c198c16ef32a672026b", null ] ];<file_sep>/docs/api/group__driver__can.js var group__driver__can = [ [ "CanLawicelFormatter", "classxpcc_1_1_can_lawicel_formatter.html", null ], [ "MCP2515", "group__mcp2515.html", "group__mcp2515" ] ];<file_sep>/docs/api/classxpcc_1_1_hd44780_base.js var classxpcc_1_1_hd44780_base = [ [ "LineMode", "classxpcc_1_1_hd44780_base.html#a5409703f6d8546f86c342f7eedeef9c7", [ [ "OneLine", "classxpcc_1_1_hd44780_base.html#a5409703f6d8546f86c342f7eedeef9c7afd7bef95d1da340729389a414e97ae70", null ], [ "TwoLines", "classxpcc_1_1_hd44780_base.html#a5409703f6d8546f86c342f7eedeef9c7a0ce46e04b6e89853897a4e8cf0d72b1f", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_angle.js var classxpcc_1_1_angle = [ [ "Type", "classxpcc_1_1_angle.html#adfdd030c52e037e1e807e239827476d3", null ] ];<file_sep>/docs/api/group__stm32f407vg__random.js var group__stm32f407vg__random = [ [ "RandomNumberGenerator", "classxpcc_1_1stm32_1_1_random_number_generator.html", null ] ];<file_sep>/docs/api/search/typedefs_7.js var searchData= [ ['memorytraits',['MemoryTraits',['../group__memory__traits.html#ga74257e68b9e0da2d06db359aed1dd5a5',1,'xpcc']]] ]; <file_sep>/docs/api/namespacexpcc_1_1log.js var namespacexpcc_1_1log = [ [ "DefaultStyle", "classxpcc_1_1log_1_1_default_style.html", "classxpcc_1_1log_1_1_default_style" ], [ "Logger", "classxpcc_1_1log_1_1_logger.html", "classxpcc_1_1log_1_1_logger" ], [ "Prefix", "classxpcc_1_1log_1_1_prefix.html", "classxpcc_1_1log_1_1_prefix" ], [ "StdColour", "classxpcc_1_1log_1_1_std_colour.html", "classxpcc_1_1log_1_1_std_colour" ], [ "Style", "classxpcc_1_1log_1_1_style.html", "classxpcc_1_1log_1_1_style" ], [ "StyleWrapper", "classxpcc_1_1log_1_1_style_wrapper.html", "classxpcc_1_1log_1_1_style_wrapper" ] ];<file_sep>/docs/api/structxpcc_1_1sab_1_1_action.js var structxpcc_1_1sab_1_1_action = [ [ "Callback", "structxpcc_1_1sab_1_1_action.html#a4a6ee56b0e471e8541d73cf73b8ba2c7", null ], [ "call", "structxpcc_1_1sab_1_1_action.html#ae8702820db9acadc1ff013af6755263e", null ], [ "object", "structxpcc_1_1sab_1_1_action.html#af3158bb1dfc8ba7d87d6a2260ad90942", null ], [ "function", "structxpcc_1_1sab_1_1_action.html#a29131f7f1cfeb83f1294eeb511c1eac3", null ], [ "payloadLength", "structxpcc_1_1sab_1_1_action.html#a4386a8b3d63630be58718400eb73f24a", null ], [ "command", "structxpcc_1_1sab_1_1_action.html#abe12752f1c7bea7daffc325958003c01", null ] ];<file_sep>/docs/api/classxpcc_1_1_a_d840x.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>xpcc: xpcc::AD840x&lt; Spi, Cs, Rs, Shdn &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">xpcc </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classxpcc_1_1_a_d840x.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="classxpcc_1_1_a_d840x-members.html">List of all members</a> &#124; <a href="#pub-static-methods">Static Public Member Functions</a> </div> <div class="headertitle"> <div class="title">xpcc::AD840x&lt; Spi, Cs, Rs, Shdn &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__driver.html">Device drivers</a> &raquo; <a class="el" href="group__driver__other.html">Other</a></div></div> </div> </div><!--header--> <div class="contents"> <p>AD8400/2/3 Digital Potentiometers (1-,2-,4-Channel) <a href="classxpcc_1_1_a_d840x.html#details">More...</a></p> <p><code>#include &lt;xpcc/driver/other/ad840x.hpp&gt;</code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:ad23b04f3e8cb238a427b54bc4d96a2e2"><td class="memItemLeft" align="right" valign="top"><a id="ad23b04f3e8cb238a427b54bc4d96a2e2"></a> static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_a_d840x.html#ad23b04f3e8cb238a427b54bc4d96a2e2">initialize</a> ()</td></tr> <tr class="memdesc:ad23b04f3e8cb238a427b54bc4d96a2e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize SPI interface and set pins. <br /></td></tr> <tr class="separator:ad23b04f3e8cb238a427b54bc4d96a2e2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7f4fab3c7fe1826dd2d2bf064f749fe4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_a_d840x.html#a7f4fab3c7fe1826dd2d2bf064f749fe4">reset</a> ()</td></tr> <tr class="memdesc:a7f4fab3c7fe1826dd2d2bf064f749fe4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset channels. <a href="#a7f4fab3c7fe1826dd2d2bf064f749fe4">More...</a><br /></td></tr> <tr class="separator:a7f4fab3c7fe1826dd2d2bf064f749fe4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aab96e6384c48b7ab3c13f0cd6cdc8ece"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_a_d840x.html#aab96e6384c48b7ab3c13f0cd6cdc8ece">shutdown</a> ()</td></tr> <tr class="memdesc:aab96e6384c48b7ab3c13f0cd6cdc8ece"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enter shutdown mode. <a href="#aab96e6384c48b7ab3c13f0cd6cdc8ece">More...</a><br /></td></tr> <tr class="separator:aab96e6384c48b7ab3c13f0cd6cdc8ece"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a93f270aa2f22497183a54a7c90d93369"><td class="memItemLeft" align="right" valign="top"><a id="a93f270aa2f22497183a54a7c90d93369"></a> static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_a_d840x.html#a93f270aa2f22497183a54a7c90d93369">resume</a> ()</td></tr> <tr class="memdesc:a93f270aa2f22497183a54a7c90d93369"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resume normal mode after shutdown. <br /></td></tr> <tr class="separator:a93f270aa2f22497183a54a7c90d93369"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3ded5a84f5cda5947a60cccd6948bef8"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_a_d840x.html#a3ded5a84f5cda5947a60cccd6948bef8">setValue</a> (<a class="el" href="group__driver__other.html#ga4c936afae0f4c1ab27a131d65711d4ae">ad840x::Channel</a> channel, uint8_t data)</td></tr> <tr class="memdesc:a3ded5a84f5cda5947a60cccd6948bef8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a new register value. <a href="#a3ded5a84f5cda5947a60cccd6948bef8">More...</a><br /></td></tr> <tr class="separator:a3ded5a84f5cda5947a60cccd6948bef8"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;typename Spi, typename Cs, typename Rs, typename Shdn&gt;<br /> class xpcc::AD840x&lt; Spi, Cs, Rs, Shdn &gt;</h3> <h2>Features</h2> <ul> <li>256-position variable resistance device</li> <li>Replaces 1, 2, or 4 potentiometers</li> <li>1 kΩ, 10 kΩ, 50 kΩ, 100 kΩ nominal resistance</li> <li>3-wire, SPI-compatible serial data input</li> <li>10 MHz update data loading rate</li> <li>2.7 V to 5.5 V single-supply operation</li> </ul> <p>The nominal resistance of the VR (Variable Resistor) (RDAC) between Terminal A and Terminal B is available with values of 1 kΩ, 10 kΩ, 50 kΩ, and 100 kΩ. The final digits of the part number determine the nominal resistance value; that is, 10 kΩ = 10; 100 kΩ = 100 etc.</p> <p>The nominal resistance (RAB) of the VR has 256 contact points accessible by the wiper terminal. The <a class="el" href="classxpcc_1_1_a_d840x.html" title="AD8400/2/3 Digital Potentiometers (1-,2-,4-Channel) ">AD840x</a> do not have power-on midscale preset, so the wiper can be at any random position at power-up.</p> <h2>Serial Connection</h2> <p>Data is shifted in on the positive edges of the clock (SPI Mode 0). Maximum SPI frequency is 10 MHz.</p> <p>The output is updated after the time ts after the rising edge of CS. ts depends on the nominal resistance value.</p> <div class="fragment"><div class="line">Version | Time ts</div><div class="line">--------+---------</div><div class="line"> 10 kΩ | 2 µs</div><div class="line"> 50 kΩ | 9 µs</div><div class="line"> 100 kΩ | 18 µs</div></div><!-- fragment --><p>The serial data output (SDO) pin, which exists only on the AD8403 and not on the AD8400 or AD8402, contains an open-drain, n-channel FET that requires a pull-up resistor to transfer data to the SDI pin of the next package.</p> <p>The pull-up resistor termination voltage may be larger than the VDD supply (but less than the max VDD of 8 V) of the AD8403 SDO output device.</p> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname"><a class="el" href="structxpcc_1_1_spi.html">Spi</a></td><td>SPI interface (MISO pin is not used) </td></tr> <tr><td class="paramname">Cs</td><td>Chip-Select pin </td></tr> <tr><td class="paramname">Rs</td><td>Reset (low active), use xpcc::Unused for the AD8400 </td></tr> <tr><td class="paramname">Shdn</td><td>Shutdown (low active), use xpcc::Unused for the AD8400</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd>ad840x </dd></dl> <dl class="section author"><dt>Author</dt><dd><NAME> </dd></dl> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a7f4fab3c7fe1826dd2d2bf064f749fe4"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7f4fab3c7fe1826dd2d2bf064f749fe4">&#9670;&nbsp;</a></span>reset()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs , typename Rs , typename Shdn &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_a_d840x.html">xpcc::AD840x</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs, Rs, Shdn &gt;::reset </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Forces the whiper positions to 0x80 = 128 = midscale. </p> </div> </div> <a id="<KEY>8ece"></a> <h2 class="memtitle"><span class="permalink"><a href="#aab96e6384c48b7ab3c13f0cd6cdc8ece">&#9670;&nbsp;</a></span>shutdown()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs , typename Rs , typename Shdn &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_a_d840x.html">xpcc::AD840x</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs, Rs, Shdn &gt;::shutdown </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section warning"><dt>Warning</dt><dd>Only for AD8402 and AD8403</dd></dl> <p>Both parts have a power shutdown SHDN pin that places the VR (variable resistor) in a zero-power-consumption state where Terminal Ax is open-circuited and the Wiper Wx is connected to Terminal Bx, resulting in the consumption of only the leakage current in the VR.</p> <p>The digital interface is still active in shutdown, except that SDO is deactivated. Code changes in the registers can be made during shutdown that will produce new wiper positions when the device is taken out of shutdown. </p> </div> </div> <a id="a3ded5a84f5cda5947a60cccd6948bef8"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3ded5a84f5cda5947a60cccd6948bef8">&#9670;&nbsp;</a></span>setValue()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs , typename Rs , typename Shdn &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_a_d840x.html">xpcc::AD840x</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs, Rs, Shdn &gt;::setValue </td> <td>(</td> <td class="paramtype"><a class="el" href="group__driver__other.html#ga4c936afae0f4c1ab27a131d65711d4ae">ad840x::Channel</a>&#160;</td> <td class="paramname"><em>channel</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t&#160;</td> <td class="paramname"><em>data</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>The wiper’s first connection starts at the B terminal for data 00H. This B terminal connection has a wiper contact resistance of 50 Ω. The second connection (for the 10 kΩ part) is the first tap point located at 89 Ω = [RAB (nominal resistance) + RW = 39 Ω + 50 Ω] for data 01H. The third connection is the next tap point representing 78 Ω + 50 Ω = 128 Ω for data 02H. Each LSB data value increase moves the wiper up the resistor ladder until the last tap point is reached at 10,011 Ω.</p> <p>Note that the wiper does not directly connect to the B terminal even for data 00H.</p> <div class="fragment"><div class="line">data | Rwb (Ohm) | Output State</div><div class="line">-----+-----------+-----------------</div><div class="line"> 255 | 10 011 | Full scale</div><div class="line"> 128 | 5 050 | Midscale (<a class="code" href="classxpcc_1_1_a_d840x.html#a7f4fab3c7fe1826dd2d2bf064f749fe4">reset</a>() condition)</div><div class="line"> 1 | 89 | 1 LSB</div><div class="line"> 0 | 50 | Zero-scale (wiper contact resistance)</div></div><!-- fragment --><p>Rwb is the resistance between the wiper and Terminal B. The resitance for Terminal A is symmetrical:</p> <div class="fragment"><div class="line">data | Rwa (Ohm) | Output State</div><div class="line">-----+-----------+-----------------</div><div class="line"> 255 | 89 | Full scale</div><div class="line"> 128 | 5 050 | Midscale (<a class="code" href="classxpcc_1_1_a_d840x.html#a7f4fab3c7fe1826dd2d2bf064f749fe4">reset</a>() condition)</div><div class="line"> 1 | 10 011 | 1 LSB</div><div class="line"> 0 | 10 050 | Zero-scale</div></div><!-- fragment --><p>It is possible to set up all four channels at once by using the shutdown mode and then setting all four channels individually. After resuming normal operation the wipers will take their new positions.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">channel</td><td>Channel which should be changed </td></tr> <tr><td class="paramname">data</td><td>New wiper value </td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>ad840x.hpp</li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespacexpcc.html">xpcc</a></li><li class="navelem"><a class="el" href="classxpcc_1_1_a_d840x.html">AD840x</a></li> <li class="footer">Generated on Tue Jun 27 2017 20:03:52 for xpcc by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html> <file_sep>/docs/api/structxpcc_1_1atmega_1_1_gpio.js var structxpcc_1_1atmega_1_1_gpio = [ [ "InputType", "structxpcc_1_1atmega_1_1_gpio.html#ae53887e3733d80be60fb543deee97d9a", [ [ "Floating", "structxpcc_1_1atmega_1_1_gpio.html#ae53887e3733d80be60fb543deee97d9aac8df43648942ec3a9aec140f07f47b7c", null ], [ "PullUp", "structxpcc_1_1atmega_1_1_gpio.html#ae53887e3733d80be60fb543deee97d9aadbe269e26d8282186a4163a2424e3361", null ] ] ], [ "InputTrigger", "structxpcc_1_1atmega_1_1_gpio.html#a6ccb29159ce98ea852e8ca5bec90d343", [ [ "LowLevel", "structxpcc_1_1atmega_1_1_gpio.html#a6ccb29159ce98ea852e8ca5bec90d343afc95fd21f661b220b8cce14419f2d352", null ], [ "BothEdges", "structxpcc_1_1atmega_1_1_gpio.html#a6ccb29159ce98ea852e8ca5bec90d343abc2634359d039750febf9ba58e1643ad", null ], [ "FallingEdge", "structxpcc_1_1atmega_1_1_gpio.html#a6ccb29159ce98ea852e8ca5bec90d343aa3919f129620bfcb6ba26d6e5dc1aa64", null ], [ "RisingEdge", "structxpcc_1_1atmega_1_1_gpio.html#a6ccb29159ce98ea852e8ca5bec90d343a5b0a1c3bcd3397b6e692a26fe8427564", null ] ] ], [ "Port", "structxpcc_1_1atmega_1_1_gpio.html#a5af6a800eaf2fd2a3dc193488f237d2e", [ [ "C", "structxpcc_1_1atmega_1_1_gpio.html#a5af6a800eaf2fd2a3dc193488f237d2ea0d61f8370cad1d412f80b84d143e1257", null ], [ "B", "structxpcc_1_1atmega_1_1_gpio.html#a5af6a800eaf2fd2a3dc193488f237d2ea9d5ed678fe57bcca610140957afab571", null ], [ "D", "structxpcc_1_1atmega_1_1_gpio.html#a5af6a800eaf2fd2a3dc193488f237d2eaf623e75af30e62bbd73d6df5b50bb7b5", null ] ] ] ];<file_sep>/docs/api/group__tmp_structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01void_01_4.js var group__tmp_structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01void_01_4 = [ [ "value", "group__tmp.html#a52a6184bb1ee44f01a329088ab5bf0a8a9138d1a4f43f6f84b2322383cf54c21f", null ] ];<file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01float_01_4.js var structxpcc_1_1_arithmetic_traits_3_01float_01_4 = [ [ "WideType", "group__arithmetic__trais.html#ga6d3edc5fc4e50fe75d2ca61c6fd9f865", null ], [ "SignedType", "group__arithmetic__trais.html#ga00da1c4c1810eac87d0631548b5c5d05", null ], [ "UnsignedType", "group__arithmetic__trais.html#gaf165b34f6e33d76ea0ebabc02126e79c", null ] ];<file_sep>/docs/api/classxpcc_1_1_buffered_graphic_display.js var classxpcc_1_1_buffered_graphic_display = [ [ "~BufferedGraphicDisplay", "classxpcc_1_1_buffered_graphic_display.html#a471c0ebc52c59887c46477098522f3c8", null ], [ "getWidth", "classxpcc_1_1_buffered_graphic_display.html#a3d140f5ed168e0f71c7fdaa07080dc26", null ], [ "getHeight", "classxpcc_1_1_buffered_graphic_display.html#a6e27b4cce968e65f0a8973d0eb1e28d7", null ], [ "clear", "classxpcc_1_1_buffered_graphic_display.html#a55729a9b5cd313886ca42ad29498c36c", null ], [ "drawImageRaw", "classxpcc_1_1_buffered_graphic_display.html#a2396ef36141759b2579558b20f6d17ab", null ], [ "drawHorizontalLine", "classxpcc_1_1_buffered_graphic_display.html#ae525b78a671d9bc318f605fa77ec7d58", null ], [ "setPixel", "classxpcc_1_1_buffered_graphic_display.html#abda3c8c8c264d01b494b65f93754dc4b", null ], [ "clearPixel", "classxpcc_1_1_buffered_graphic_display.html#a353598d6769984a4e4fb2fe57e46d458", null ], [ "getPixel", "classxpcc_1_1_buffered_graphic_display.html#a4d1934411448299a6d37e3e230aa7215", null ], [ "display_buffer", "classxpcc_1_1_buffered_graphic_display.html#abe2e54d8570e0b52d9782794408bb5a0", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_gpio_port.js var classxpcc_1_1stm32_1_1_gpio_port = [ [ "PortType", "classxpcc_1_1stm32_1_1_gpio_port.html#ae82517edfa69b5ccbec65331d264fc5b", null ] ];<file_sep>/docs/api/search/enums_12.js var searchData= [ ['timeoutstate',['TimeoutState',['../group__software__timer.html#ga754c92822637441260564830a6759603',1,'xpcc']]], ['tmr_5fccr',['TMR_CCR',['../namespacexpcc_1_1lpc.html#a63dac55b16a58c27d0d0e4b00132ffff',1,'xpcc::lpc']]], ['tmr_5fctcr',['TMR_CTCR',['../namespacexpcc_1_1lpc.html#a531d6b8b0e8811be3f0313906b677b4b',1,'xpcc::lpc']]], ['tmr_5femr',['TMR_EMR',['../namespacexpcc_1_1lpc.html#a6e7e4e8d9b744a1a3889bc65d0f51627',1,'xpcc::lpc']]], ['tmr_5fmcr',['TMR_MCR',['../namespacexpcc_1_1lpc.html#a0d72ef96db02894ba8e0b8fbedc11914',1,'xpcc::lpc']]], ['tmr_5fpwmc',['TMR_PWMC',['../namespacexpcc_1_1lpc.html#a9bf20028693dfc500907c1df1ed881b6',1,'xpcc::lpc']]], ['tmr_5ftcr',['TMR_TCR',['../namespacexpcc_1_1lpc.html#a3ed227ba168e38cdef0fac05a3f45e17',1,'xpcc::lpc']]], ['transactionstate',['TransactionState',['../structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6',1,'xpcc::I2c']]], ['txbnctrl',['TXBnCTRL',['../group__mcp2515.html#gaf74bdd1523bb66b9284df0873a42aa7b',1,'xpcc::mcp2515']]], ['txbnsidl',['TXBnSIDL',['../group__mcp2515.html#gaa208ef6c2d4c6f054e26b84e9c255c1d',1,'xpcc::mcp2515']]], ['txrtsctrl',['TXRTSCTRL',['../group__mcp2515.html#ga8014c6221c8c43f35ebc44e76fcef4fb',1,'xpcc::mcp2515']]] ]; <file_sep>/docs/api/search/variables_a.js var searchData= [ ['ne1',['Ne1',['../classxpcc_1_1stm32_1_1_fsmc.html#a446acc3d15633a5f537040d1262227f7',1,'xpcc::stm32::Fsmc']]], ['nl',['Nl',['../classxpcc_1_1stm32_1_1_fsmc.html#a12652a20a169c00fb01d302cca911c7d',1,'xpcc::stm32::Fsmc']]], ['noe',['Noe',['../classxpcc_1_1stm32_1_1_fsmc.html#a6ca234553dd8785baa15a60dd7ec4e3a',1,'xpcc::stm32::Fsmc']]], ['numbers14x32',['Numbers14x32',['../group__font.html#ga95649b45b685e1712891f1c93238b6bb',1,'xpcc::font']]], ['numbers40x57',['Numbers40x57',['../group__font.html#gafe72f8c025ad0c1b49fd0305b2b8e6be',1,'xpcc::font']]], ['numbers46x64',['Numbers46x64',['../group__font.html#ga54118cee96b5e3aac7d41aa8aefcb0dd',1,'xpcc::font']]], ['nwe',['Nwe',['../classxpcc_1_1stm32_1_1_fsmc.html#a1108891758a872c58e319d8afcbdc901',1,'xpcc::stm32::Fsmc']]] ]; <file_sep>/docs/api/classxpcc_1_1_abstract_component.js var classxpcc_1_1_abstract_component = [ [ "AbstractComponent", "classxpcc_1_1_abstract_component.html#a11ee9013bc3f9c4fc47a8945bf25300c", null ], [ "update", "classxpcc_1_1_abstract_component.html#a6363980d50fb5391b8beef5ac0fb36ff", null ], [ "getCommunicator", "classxpcc_1_1_abstract_component.html#a6a4612874847d8ac11d81ce0fc1ef185", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#a09a497c6a4e124d1c32b144197e3f603", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#a21d3925a34e3238ea49269bba5da30b0", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#ae7aa1f7238f9fa1635d82d60a76162ac", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#af447b8a4f597009c9f558b43cbe64436", null ], [ "publishEvent", "classxpcc_1_1_abstract_component.html#afe089710068346a116d04982fa04b5a6", null ], [ "publishEvent", "classxpcc_1_1_abstract_component.html#a2b60d7705fb3cf7938071a6641396866", null ], [ "sendResponse", "classxpcc_1_1_abstract_component.html#aba064776b749079b1f0c1e0edd8f9d6d", null ], [ "sendResponse", "classxpcc_1_1_abstract_component.html#a0fcc436e2539763a0f0e400a7f90ea47", null ], [ "sendNegativeResponse", "classxpcc_1_1_abstract_component.html#abeab3a15e23337d9e5287b58a09e4aba", null ], [ "sendNegativeResponse", "classxpcc_1_1_abstract_component.html#aa3e4281cd915ca20470e5ec87b47dede", null ] ];<file_sep>/src/guide/testing.md # Testing xpcc xpcc has seen some significant changes in the past and the level of maturity varies between "does not compile" and "very reliable". There are different explicit and implicit test strategies in place for testing xpcc. ## Manual tests When some new drivers were developed the developer often (not always!) tests the new driver with some real hardware (eval board) and a real peripheral at least on one platform with one compiler. The results on different platforms (AVR instead of ARM) and different hardware (eval board) may vary, although by design should not. Mostly, these tests are only conducted when the development takes place. ## Manual integration tests xpcc is the major platform for all programming efforts of the Robot Association Aachen (Roboterclub Aachen, RCA) at RWTH Aachen University. Some parts of xpcc run on real robots in real competitions. The maturity of these parts at least for RCA's hardware can be expected to be very high. This includes: - The XPCC communication protocol - The target platforms used in the specific season, e.g. - STM32F407 in seasons 2014ff, but only under very specific test conditions, e.g. - external 8 MHz oscillator - core running at 168 MHz - only using UART0, not UART1 - the hardware drivers build in the robots (e.g. CAN, VL6180, ...) The test coverage is unknown but the system has proved to be reliable under conditions of the competition. Nevertheless, some unforseen problems may still occur at any time. Always fasten your seatbelt. ## Continous integration xpcc on Github uses TravisCI for CI. A set of test jobs is run with every commit. These include release tests and unit tests. ## Release test xpcc covers many different platforms and a huge number of chips. To make sure that at the code at least compiles for all platforms a TravisCI test job is in place as part of the Continous Integration. This only tests compiling on the TravisCI Linux virtual machine. Compiling may fail with different compilers and on different hosts. To check if simple programs compile for a large set of microcontrollers call scons check=devices The test programs that are compiled are located in `xpcc/release/tests` and differ for each platform. To compile all examples from `xpcc/examples`, run scons check=examples This does **not** include actually running the examples. To compile device checks and examples simply run scons check ## Unit tests on hosted Some parts of xpcc which do not access hardware directly (like communication protocols, mathematical and logical functions) are tested with a xpcc specific unit test framework. Tests can be found in the `test` direcotry of each component, e.g. `xpcc/src/xpcc/math/filter/test`. These test check for logic errors in the components. They are compiled for the targed `hosted` (your computer) and run to check the expected result against a predifined and expected result. The test coverage of these tests vary. Every new software component is expected to have these checks in place when contributed to xpcc. Unit tests for hosted can be run with scons unittest ## Unit tests on target A very unique feature of the xpcc unit test framework is that the unit tests can be run on the target platform. This matters because in most cases xpcc is used for cross compiling and the target platform differs at least in one of the following features: - compiler - gcc/clang for x86 vs. arm-none-eabi-gcc vs. avr-gcc - word size - 64 bits vs. 8 bits or 32 bits - presence of a FPU - i7 vs. AVR vs. ARM Cortex-M4f To cross-compile the set of unit tests for STM32 run scons unittest target=stm32 This will create a binary `xpcc/build/unittest_stm32/executable.elf` that can be manually programmed to STM32 F4 Discovery board. After reset, the unit tests are run and the result of the test is echoed to the serial console (USART2 in case of the STM32 F4 Discovery Board, see runner.cpp for details). The test runner is created from `xpcc/templates/unittest/runner_stm32.cpp.in` and located in `xpcc/build/unittest_stm32/runner.cpp` These tests are not automatically run and must therefore be run and interpreted manually from time to time. All platform and hardware drivers still lack these kind of tests, including external stimuli and waveform verification. scons unittest target=atmega scons unittest target=atxmega ## Conclusions and Outlook xpcc has a varity of testing strategies in place, is being used on a regular basis by Roboterclub Aachen e. V., receives updates and bug fixes frequently and test coverage is constantly improved. <file_sep>/docs/api/search/enums_a.js var searchData= [ ['level',['Level',['../group__logger.html#ga0e669c355fdfbae96f31a0b6e4fa36ad',1,'xpcc::log']]] ]; <file_sep>/docs/api/search/files_0.js var searchData= [ ['tcs3414_2ehpp',['tcs3414.hpp',['../tcs3414_8hpp.html',1,'']]], ['tcs3472_2ehpp',['tcs3472.hpp',['../tcs3472_8hpp.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1_i_o_device_wrapper.js var classxpcc_1_1_i_o_device_wrapper = [ [ "IODeviceWrapper", "classxpcc_1_1_i_o_device_wrapper.html#ae20f03b681d72c5f34685ab8010fa8c9", null ], [ "IODeviceWrapper", "classxpcc_1_1_i_o_device_wrapper.html#a9c64cc168507a3e3d9b42919acd349b6", null ], [ "write", "classxpcc_1_1_i_o_device_wrapper.html#a886af16adaf020f96f4a34b49d73301b", null ], [ "write", "classxpcc_1_1_i_o_device_wrapper.html#a9b5953fbd6acaf055b3f8a328eb166f3", null ], [ "flush", "classxpcc_1_1_i_o_device_wrapper.html#a1a37dd42da7cfbaf23c92187d6fe44c1", null ], [ "read", "classxpcc_1_1_i_o_device_wrapper.html#ace02e9f956254a06a0ea81f1e4bdad93", null ] ];<file_sep>/docs/api/classxpcc_1_1_can_connector.js var classxpcc_1_1_can_connector = [ [ "ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html", "classxpcc_1_1_can_connector_1_1_receive_list_item" ], [ "SendListItem", "classxpcc_1_1_can_connector_1_1_send_list_item.html", "classxpcc_1_1_can_connector_1_1_send_list_item" ], [ "SendList", "classxpcc_1_1_can_connector.html#a98dc3c73bb7cb6910eb3dae53719aabb", null ], [ "ReceiveList", "classxpcc_1_1_can_connector.html#aed553a76f0c265cf448d350b6b1cd94c", null ], [ "CanConnector", "classxpcc_1_1_can_connector.html#adabb35a09557972dc56557b5e925e176", null ], [ "~CanConnector", "classxpcc_1_1_can_connector.html#a7bf080715613f06a2ad171e39ba3d526", null ], [ "CanConnector", "classxpcc_1_1_can_connector.html#a78cf5e581214b6eedb09707f49da17f9", null ], [ "sendPacket", "classxpcc_1_1_can_connector.html#a51e51cf95a071972c83dc2dd233503a8", null ], [ "isPacketAvailable", "classxpcc_1_1_can_connector.html#aaac9b5ee9d72377067d13870a329f582", null ], [ "getPacketHeader", "classxpcc_1_1_can_connector.html#a16230c052c033b65a0853b4548d295e0", null ], [ "getPacketPayload", "classxpcc_1_1_can_connector.html#a371f1cc4792ad4fe7c5b1208aa2b12a2", null ], [ "dropPacket", "classxpcc_1_1_can_connector.html#a466b6962a240b03f6dad9b11e14bdcd5", null ], [ "update", "classxpcc_1_1_can_connector.html#afdf56a3c9b08ebd0b1a71ab483b64c45", null ], [ "operator=", "classxpcc_1_1_can_connector.html#a453226e9ddc1ada57007afcfc7bac175", null ], [ "sendMessage", "classxpcc_1_1_can_connector.html#a83db3f5d921e1a45dcd0395e97519b46", null ], [ "sendWaitingMessages", "classxpcc_1_1_can_connector.html#a7d50b34462e7aae4a6f4f83d9c94285c", null ], [ "retrieveMessage", "classxpcc_1_1_can_connector.html#ad1775869231f13e62e05d1966e854299", null ], [ "sendList", "classxpcc_1_1_can_connector.html#aa11aeaa0cc2c0a0e521ffb93dbed1cf8", null ], [ "pendingMessages", "classxpcc_1_1_can_connector.html#aad89382cacf6e57f2eb940574838c32e", null ], [ "receivedMessages", "classxpcc_1_1_can_connector.html#a2b3a59b2b096060dc50009c071288d3c", null ], [ "canDriver", "classxpcc_1_1_can_connector.html#afc0d4f1b928abc38760639834a7e46b0", null ] ];<file_sep>/docs/api/classxpcc_1_1_stack.js var classxpcc_1_1_stack = [ [ "Size", "classxpcc_1_1_stack.html#a17dcd51b812b942797b83075b7b76a69", null ], [ "isEmpty", "classxpcc_1_1_stack.html#af84856b68f903d913bf7e8551618a48f", null ], [ "isFull", "classxpcc_1_1_stack.html#a7586b9e4ebdede5d70b5e34de81efc9e", null ], [ "getSize", "classxpcc_1_1_stack.html#af1ef507c0745d83a11ca5a413482a87d", null ], [ "getMaxSize", "classxpcc_1_1_stack.html#aca2efee6371a52f7d02fe1d4fe956d6b", null ], [ "get", "classxpcc_1_1_stack.html#a17f71b2b820103aef042eb85398e00ea", null ], [ "get", "classxpcc_1_1_stack.html#af87ce6aa0785150bebdda6b5fcda6643", null ], [ "push", "classxpcc_1_1_stack.html#afbb89e64f93644d5a60253deb870c642", null ], [ "pop", "classxpcc_1_1_stack.html#a170739384306575a1888929d2acf5d6a", null ], [ "c", "classxpcc_1_1_stack.html#ac050d548462c218e76d27c831d90523d", null ] ];<file_sep>/docs/api/search/enums_4.js var searchData= [ ['eflg',['EFLG',['../group__mcp2515.html#gaaa656e18aaf05cfa9d0290f9b12cf660',1,'xpcc::mcp2515']]], ['error',['Error',['../classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2e',1,'xpcc::I2cMaster::Error()'],['../group__amnb.html#gac3b87049713c290d3ae496621d7536b4',1,'xpcc::amnb::Error()'],['../group__sab.html#ga09e1ac402e543afef644055934ad7511',1,'xpcc::sab::Error()'],['../group__sab2.html#ga1ab854ba60b4975df7aa3f5254a1203d',1,'xpcc::sab2::Error()']]] ]; <file_sep>/docs/api/functions_func_c.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>xpcc: Class Members - Functions</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">xpcc </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('functions_func_c.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> &#160; <h3><a id="index_c"></a>- c -</h3><ul> <li>calculateCalibratedHumidity() : <a class="el" href="classxpcc_1_1bme280data_1_1_data.html#a37df18e4986c59ece61804151b9f6757">xpcc::bme280data::Data</a> </li> <li>calculateCalibratedPressure() : <a class="el" href="classxpcc_1_1bme280data_1_1_data.html#a9ba1d1498fa7f0f0b952e8eecc92c32e">xpcc::bme280data::Data</a> , <a class="el" href="classxpcc_1_1bmp085data_1_1_data.html#a034c7a46907ed97028e98c51eaf5148d">xpcc::bmp085data::Data</a> </li> <li>calculateCalibratedTemperature() : <a class="el" href="classxpcc_1_1bme280data_1_1_data.html#ace71838d1b6c87ed09a94656f904006e">xpcc::bme280data::Data</a> , <a class="el" href="classxpcc_1_1bmp085data_1_1_data.html#a911fcc7ad99ccdf045aadf156e1aca12">xpcc::bmp085data::Data</a> </li> <li>call() : <a class="el" href="classxpcc_1_1_response_callback.html#a314dcc04e697ad783e5eb296a992f3cc">xpcc::ResponseCallback</a> </li> <li>CAN_error() : <a class="el" href="classxpcc_1_1lpc_1_1_can.html#a629c9fa0d0430fc741019ec5deaa7462">xpcc::lpc::Can</a> </li> <li>CAN_rx() : <a class="el" href="classxpcc_1_1lpc_1_1_can.html#abc320189e75e2bc8b4f904b85bf3a999">xpcc::lpc::Can</a> </li> <li>CAN_tx() : <a class="el" href="classxpcc_1_1lpc_1_1_can.html#a1eb22db231045a2d60595a6a4f76c5c4">xpcc::lpc::Can</a> </li> <li>cancel() : <a class="el" href="classxpcc_1_1ui_1_1_key_frame_animation.html#a1da874de029d944b151c0990651486bb">xpcc::ui::KeyFrameAnimation&lt; T, N &gt;</a> </li> <li>ccw() : <a class="el" href="classxpcc_1_1_ray2_d.html#a9b68a3c338ac08fea270fd2ed8f82461">xpcc::Ray2D&lt; T &gt;</a> , <a class="el" href="classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a41cfabbba7b72c710976dcf612a4aefc">xpcc::Vector&lt; T, 2 &gt;</a> </li> <li>CharacterDisplay() : <a class="el" href="classxpcc_1_1_character_display.html#ad1dae2ec85c742bda2fffc7e8206cc00">xpcc::CharacterDisplay</a> </li> <li>checkIntersection() : <a class="el" href="classxpcc_1_1gui_1_1_widget.html#a58b855eafeb0b53ad388b69d41b34cd2">xpcc::gui::Widget</a> </li> <li>chipErase() : <a class="el" href="classxpcc_1_1_at45db0x1d.html#a5d200bbe89d078f46924dc1b759356ad">xpcc::At45db0x1d&lt; Spi, Cs &gt;</a> </li> <li>clear() : <a class="el" href="classxpcc_1_1_bounded_deque.html#afa56fa09f5ab18a6c2eeda8e67173158">xpcc::BoundedDeque&lt; T, N &gt;</a> , <a class="el" href="classxpcc_1_1_buffered_graphic_display.html#a55729a9b5cd313886ca42ad29498c36c">xpcc::BufferedGraphicDisplay&lt; Width, Height &gt;</a> , <a class="el" href="classxpcc_1_1_character_display.html#a5bbefbc3408c7817c9fa2c4c88c9f80a">xpcc::CharacterDisplay</a> , <a class="el" href="classxpcc_1_1_dynamic_array.html#a88855d0b6d2bf609cdc54f1402cd35f2">xpcc::DynamicArray&lt; T, Allocator &gt;</a> , <a class="el" href="classxpcc_1_1_graphic_display.html#a36162f3d9576f28e8003b19a09aca98c">xpcc::GraphicDisplay</a> , <a class="el" href="classxpcc_1_1_hd44780_base.html#a4e0eb50ec3cdc2b28a0b78eba32cb282">xpcc::Hd44780Base&lt; DATA, RW, RS, E &gt;</a> , <a class="el" href="classxpcc_1_1_parallel_tft.html#a0e6f5e783873a16119d63ed06e991b70">xpcc::ParallelTft&lt; INTERFACE &gt;</a> , <a class="el" href="classxpcc_1_1_s_d_l_display.html#a178c707767469f3701f632bdb3ba5088">xpcc::SDLDisplay</a> , <a class="el" href="classxpcc_1_1_virtual_graphic_display.html#a714a7a67ea663bc424396642fa9dcd3d">xpcc::VirtualGraphicDisplay</a> </li> <li>clearBits() : <a class="el" href="classxpcc_1_1_nrf24_phy.html#a49aba3e87563f77e8f82a94bce42e7e5">xpcc::Nrf24Phy&lt; Spi, Csn, Ce &gt;</a> </li> <li>clearInterruptFlag() : <a class="el" href="classxpcc_1_1lpc_1_1_adc_manual_single.html#ac64c6fda14e2d16d2a9ddd8e83a1de5c">xpcc::lpc::AdcManualSingle</a> </li> <li>close() : <a class="el" href="classxpcc_1_1hosted_1_1_serial_interface.html#a5082e095e0607e92f31ffa8a0e53c4ed">xpcc::hosted::SerialInterface</a> </li> <li>Color() : <a class="el" href="classxpcc_1_1glcd_1_1_color.html#ac63d0c695f344cd3a8ae06308e88ddf1">xpcc::glcd::Color</a> </li> <li>comparePageToBuffer() : <a class="el" href="classxpcc_1_1_at45db0x1d.html#a8f27be4a3cd86663c6f78bb3720557ab">xpcc::At45db0x1d&lt; Spi, Cs &gt;</a> </li> <li>Configuration() : <a class="el" href="structxpcc_1_1_configuration.html#a88976ae52646048862d332258ee4880c">xpcc::Configuration&lt; Parent, Enum, Mask, Position &gt;</a> </li> <li>configure() : <a class="el" href="classxpcc_1_1_adxl345.html#a621fb7cdf6c28e7d951637c9985986da">xpcc::Adxl345&lt; I2cMaster &gt;</a> , <a class="el" href="classxpcc_1_1_bma180.html#a1351d98faca2c640d59b70d5996c0ece">xpcc::Bma180&lt; I2cMaster &gt;</a> , <a class="el" href="classxpcc_1_1_mcp23s08.html#ab95b0685e45bb2d89528ae3fe984e265">xpcc::Mcp23s08&lt; Spi, Cs, Int &gt;</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream0.html#aa4abcf9ddf0d462a670617b7dd38d84d">xpcc::stm32::Dma1::Stream0</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream1.html#afc475e65fc58b3341bb9e66fab24dffe">xpcc::stm32::Dma1::Stream1</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream2.html#a7d75fda9853d09d2b4d11c7009831d88">xpcc::stm32::Dma1::Stream2</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream3.html#ae56311141d38c1127f39f27208d7dff6">xpcc::stm32::Dma1::Stream3</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream4.html#acc5fad526693cef208c8a655216bfa44">xpcc::stm32::Dma1::Stream4</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream5.html#a7a2fd3b58114faecca8de405188a8bcb">xpcc::stm32::Dma1::Stream5</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream6.html#a301b678db48d781c386fbb24571482ab">xpcc::stm32::Dma1::Stream6</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma1_1_1_stream7.html#abf541d716a333c6d9a175481be05fb0b">xpcc::stm32::Dma1::Stream7</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream0.html#a16b080dcc78c9068b8d51f66b0c21dda">xpcc::stm32::Dma2::Stream0</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream1.html#a9a39fbe97c473d3b6162ef25f6ad7dbb">xpcc::stm32::Dma2::Stream1</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream2.html#ae98615c39892f7515ff31daf4db0b675">xpcc::stm32::Dma2::Stream2</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream3.html#a59e308390bd1185cd88edc185617ec88">xpcc::stm32::Dma2::Stream3</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream4.html#a85c2da6c194594553d4d34d7ffb38af0">xpcc::stm32::Dma2::Stream4</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream5.html#a6087a53088da62a1b7b3cdb8c0b404a0">xpcc::stm32::Dma2::Stream5</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream6.html#a11436129e7cc257feca43403d8201c48">xpcc::stm32::Dma2::Stream6</a> , <a class="el" href="classxpcc_1_1stm32_1_1_dma2_1_1_stream7.html#ab4e7948cb17ba5deabc446aa993aae09">xpcc::stm32::Dma2::Stream7</a> , <a class="el" href="classxpcc_1_1_tcs3414.html#a64c00ab9880794f009cb4ed71a109043">xpcc::Tcs3414&lt; I2cMaster &gt;</a> </li> <li>configureInputChannel() : <a class="el" href="classxpcc_1_1stm32_1_1_general_purpose_timer.html#ac5e45294f06e74797e76452c4a389024">xpcc::stm32::GeneralPurposeTimer</a> </li> <li>configureOutputChannel() : <a class="el" href="classxpcc_1_1stm32_1_1_general_purpose_timer.html#a1799e2de8d5c70269d64a16ca9eb25c2">xpcc::stm32::GeneralPurposeTimer</a> </li> <li>configurePing() : <a class="el" href="classxpcc_1_1_i2c_transaction.html#a532854ec0f80eb0c8cc223f526d6f769">xpcc::I2cTransaction</a> </li> <li>configurePins() : <a class="el" href="classxpcc_1_1lpc_1_1_adc.html#af15a523ea9c2f7adc19b31ea1b62be44">xpcc::lpc::Adc</a> , <a class="el" href="classxpcc_1_1_xilinx_spartan3.html#ab28bc9ef314745fbe266be3182eff369">xpcc::XilinxSpartan3&lt; Cclk, Din, ProgB, InitB, Done, DataSource &gt;</a> </li> <li>configureRead() : <a class="el" href="classxpcc_1_1_i2c_transaction.html#a592285870134ed9825ec5e825dc697d1">xpcc::I2cTransaction</a> , <a class="el" href="classxpcc_1_1_i2c_write_read_transaction.html#abb0262c229902e7891c1df01beac8fe8">xpcc::I2cWriteReadTransaction</a> </li> <li>configureSynchronousRegion() : <a class="el" href="classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#adeeeace14e51e19ab328354bfe901393">xpcc::stm32::fsmc::NorSram</a> </li> <li>configureWrite() : <a class="el" href="classxpcc_1_1_i2c_transaction.html#ad74f75bbc6b6ba4f3c4cd9648635b663">xpcc::I2cTransaction</a> , <a class="el" href="classxpcc_1_1_i2c_write_read_transaction.html#a2c22c06916b9744e82b66664d885d8c5">xpcc::I2cWriteReadTransaction</a> </li> <li>configureWriteRead() : <a class="el" href="classxpcc_1_1_i2c_transaction.html#a76f3fa7846b315f234a43b28c62a54e5">xpcc::I2cTransaction</a> </li> <li>connect() : <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a0.html#a5fddcd54e1dddfae29fed0efb1c9798c">xpcc::stm32::GpioA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a10.html#a3edcdba71e2a21470c06f7ae3aad7e31">xpcc::stm32::GpioA10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a11.html#ab9a877d11f11a87f235ac8edd1ede704">xpcc::stm32::GpioA11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a12.html#af19a1df3f5ec64d187fdea7c79a8316e">xpcc::stm32::GpioA12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a13.html#a4aa7f6cbaa617632fba3942b95c35e41">xpcc::stm32::GpioA13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a14.html#acf7441592ffd37b2cf683220c482bc93">xpcc::stm32::GpioA14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a15.html#a97fbd5edc8824839b677c77215a32dad">xpcc::stm32::GpioA15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a1.html#addbc591d472841e3620fd87e2cbea558">xpcc::stm32::GpioA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a2.html#abba72a4aa6bbb175d34b47fa5614bc5b">xpcc::stm32::GpioA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a3.html#a84ea801d8c89b1452b39ea96ff33516b">xpcc::stm32::GpioA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a4.html#a03fdac046d4ea367445e175e894590d0">xpcc::stm32::GpioA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a5.html#aac737964626482b660bd0da218ac8383">xpcc::stm32::GpioA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a6.html#abc53812383e53fdac4f6e80dc468d25d">xpcc::stm32::GpioA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a7.html#a4528eb311b1a3086cef8612709a658e3">xpcc::stm32::GpioA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a8.html#acab69335ba7e91723b4f7b6f1769c2ae">xpcc::stm32::GpioA8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a9.html#a352837d6876a1be69e8d98a19d92ae1f">xpcc::stm32::GpioA9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b0.html#a95aaadde99259b4fc1eb9768f8eba398">xpcc::stm32::GpioB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b10.html#a8555b3d5867105856ef4eab50ae36608">xpcc::stm32::GpioB10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b11.html#ad1053aff5ba48a067cf43e0f6f861239">xpcc::stm32::GpioB11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b12.html#a5d8ce06c995bc61653148a9205c9f768">xpcc::stm32::GpioB12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b13.html#a4311972382e724628add220ce751154d">xpcc::stm32::GpioB13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b14.html#a40dcc9555b2fb253938fd25c9017ed1e">xpcc::stm32::GpioB14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b15.html#adcd297ad2ab7beab182edfd1e47b40d1">xpcc::stm32::GpioB15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b1.html#a2217c97c98c78c28a867c5907cbb4a97">xpcc::stm32::GpioB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b2.html#aabae707de04dafef8e450ba0d86b2e77">xpcc::stm32::GpioB2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b3.html#a0030fa2985a9803cbdf19fc6b65b1e4f">xpcc::stm32::GpioB3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b4.html#a42e7258ec53b7c2823fd1a23d0277fe7">xpcc::stm32::GpioB4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b5.html#a6225ac8673403e045c1fecbc42583c01">xpcc::stm32::GpioB5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b6.html#a36a1d8f13b810e2786ae01f82f260eb7">xpcc::stm32::GpioB6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b7.html#af2b79e6f4405e7286c6f1328a8d8a2a0">xpcc::stm32::GpioB7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b8.html#a6b05ee936d7a247a79edf51cd10ac379">xpcc::stm32::GpioB8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b9.html#a2dd8ab87bb0056ca57e9a87fa630e38c">xpcc::stm32::GpioB9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c0.html#a25f62bf9069263e9388a46096f0b7777">xpcc::stm32::GpioC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c10.html#aba69883687247fe16da06254d05aa7d7">xpcc::stm32::GpioC10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c11.html#ab3e7289bd9e3b49bb1e8c222f0746d07">xpcc::stm32::GpioC11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c12.html#a4f0a557b497675dd517a0cd0f270be5b">xpcc::stm32::GpioC12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c13.html#ac8cc98a5de27aa97e4f7cfc9b47ec4f1">xpcc::stm32::GpioC13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c14.html#a4d8e9cdb3dca5c5405c7eaa8df1014c7">xpcc::stm32::GpioC14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c15.html#af3c1310b8a4c8039e15c6273d1bd5550">xpcc::stm32::GpioC15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c1.html#a54f3042d66312f85256db970ee5e9166">xpcc::stm32::GpioC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c2.html#aa607a70a1bfc8756aa76dc8dba722177">xpcc::stm32::GpioC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c3.html#a299d76c15aa57bd7979a4ae06145e0ff">xpcc::stm32::GpioC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c4.html#a5f8d22e920af77f09268342d2c1d0776">xpcc::stm32::GpioC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c5.html#a408f7362370aec63a721826081aa93de">xpcc::stm32::GpioC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c6.html#aa478116182a7f036ce58e437890bc950">xpcc::stm32::GpioC6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c7.html#a63f58c4a01c679b7f27394018664ba3f">xpcc::stm32::GpioC7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c8.html#a0f321846d906180b5ac29e9fb8ad6f36">xpcc::stm32::GpioC8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c9.html#ac66e9bd8b06c80a8e1e67a9a3c0a7993">xpcc::stm32::GpioC9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d0.html#adf83fab1833f51ea787d2da9316e1c34">xpcc::stm32::GpioD0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d10.html#acf7eac4fe56e04cc78c714796d4966bb">xpcc::stm32::GpioD10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d11.html#a6a3d2c8929c501a3c4b1d5285648ae44">xpcc::stm32::GpioD11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d12.html#af0ea8560670accfe5579474bfd18b7e9">xpcc::stm32::GpioD12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d13.html#a1374ad9d7cb1284fe4c5506a47df1896">xpcc::stm32::GpioD13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d14.html#a39f5d660fd2ecfde46ddd21f985b5143">xpcc::stm32::GpioD14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d15.html#a4c882d5e4410e881461d8b081eadcdd0">xpcc::stm32::GpioD15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d1.html#a05d361cd30e3fbe53917df1bb005f657">xpcc::stm32::GpioD1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d2.html#a6943a3175ef8924a018039c22c40fad2">xpcc::stm32::GpioD2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d3.html#a6cfece942c0cb85d1b8dbcb22ae3f1c4">xpcc::stm32::GpioD3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d4.html#a390de850abf2e3a189570f0a61ef2b95">xpcc::stm32::GpioD4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d5.html#ada988461f28b8e5168745a5f383a317c">xpcc::stm32::GpioD5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d6.html#a99e723a2d7e57d468a76fea0b833c140">xpcc::stm32::GpioD6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d7.html#a126e9224233c239a037e2968c2471e7c">xpcc::stm32::GpioD7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d8.html#a942b1acebf018c3fa9e32e9f775e2927">xpcc::stm32::GpioD8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d9.html#abbbbd35c4fd7e2019d1a84ca406ace1b">xpcc::stm32::GpioD9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e0.html#ac87b07ebc40f3361dfc2d2d072073ff7">xpcc::stm32::GpioE0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e10.html#a0b1a10f9a322a03c9050a441b4850d18">xpcc::stm32::GpioE10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e11.html#ac1236d8ba2389232ca4d072498ed1e67">xpcc::stm32::GpioE11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e12.html#a04657e28bef9bea1601473fb56dadcec">xpcc::stm32::GpioE12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e13.html#af176954d43340b1484ccbf490b8bc2cb">xpcc::stm32::GpioE13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e14.html#a0a409240a2a2c759b18364a8e39e8102">xpcc::stm32::GpioE14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e15.html#a5071539e4bd2c8bab636e5816de5443d">xpcc::stm32::GpioE15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e1.html#aeca9b9f0888609b1ca759bb42df62e06">xpcc::stm32::GpioE1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e2.html#ae96bf44a86fce60adcc841dcfa1fe46f">xpcc::stm32::GpioE2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e3.html#a427186c85d26b1ee9d229eaf7ec4fdda">xpcc::stm32::GpioE3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e4.html#ae9ad60bc011cfd62288c284b79b45d39">xpcc::stm32::GpioE4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e5.html#a356b6e23b97402086d9a5379ba0d4e54">xpcc::stm32::GpioE5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e6.html#a26c667108b016aaac37b54d604a7eac1">xpcc::stm32::GpioE6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e7.html#a43cdf68135e74491a1d6a5755e3b40bc">xpcc::stm32::GpioE7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e8.html#abf0de68a4955bb863a1dfc8b89f96adb">xpcc::stm32::GpioE8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e9.html#ac6b700806e28a1b82801e7d125c215f1">xpcc::stm32::GpioE9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_h0.html#a0b32b1639630f4dc5ec2f80722c74258">xpcc::stm32::GpioH0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_h1.html#afb34eb05cbddbb0ebd56d291a88f2905">xpcc::stm32::GpioH1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a0.html#a1ad0f3903ee8cd1c84a2e0fef1d9470b">xpcc::stm32::GpioInputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a10.html#aacbb5d2e9fcf67ae2abf792c024b08cd">xpcc::stm32::GpioInputA10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a11.html#a2e0c5f61991b3e92337b7482f78b35bb">xpcc::stm32::GpioInputA11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a12.html#a041d19772775341f3ce17696ab6fa022">xpcc::stm32::GpioInputA12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a13.html#a94d919e2bbe15a7c32ecba26db78d029">xpcc::stm32::GpioInputA13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a14.html#a21e65aa161bcb01484f7108fe9716842">xpcc::stm32::GpioInputA14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a15.html#ae0902a744007882d50cba02234f3e593">xpcc::stm32::GpioInputA15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a1.html#a9fd041cd35c75a7d2127e420a082c2bc">xpcc::stm32::GpioInputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a2.html#a668a54c9d6d944b2b15f64b6a2033a3f">xpcc::stm32::GpioInputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a3.html#af40420c3fcf6c2812741c68d1d3c41e5">xpcc::stm32::GpioInputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a4.html#adc1d3c0102639ebe2c99f54c7d288e0a">xpcc::stm32::GpioInputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a5.html#ae8e5218cd6639a338baf6b50dacab990">xpcc::stm32::GpioInputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a6.html#ac1415ec893ed9a1b19e7a5c0c7ca1d6c">xpcc::stm32::GpioInputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a7.html#a672562d7c88d59a9f06662cc104520ce">xpcc::stm32::GpioInputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a8.html#a6157c37f53111c253aa69c1e6195a15c">xpcc::stm32::GpioInputA8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a9.html#aeb2fae11c61101e1466010e2fc50b1be">xpcc::stm32::GpioInputA9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b0.html#af5868ae6e842fcd84b9bd96087baa7d9">xpcc::stm32::GpioInputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b10.html#a41a4e2621b2777abe30f10d73d186cdd">xpcc::stm32::GpioInputB10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b11.html#a809bc6f3f0a4071908afdcf9ba3df0a7">xpcc::stm32::GpioInputB11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b12.html#a20c85fb41a4fa4a650e0cb354257071b">xpcc::stm32::GpioInputB12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b13.html#aee0fb17717d973c47200b6f96b79af7b">xpcc::stm32::GpioInputB13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b14.html#ae557183bb03fc1c75e2553551ff004e3">xpcc::stm32::GpioInputB14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b15.html#aa40d21182bf0c6a37a6a19eed83d82eb">xpcc::stm32::GpioInputB15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b1.html#ac4abd049e6de2850635d840c4108e7bb">xpcc::stm32::GpioInputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b2.html#aa667442cd371db305e94f442b5584295">xpcc::stm32::GpioInputB2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b3.html#a784b8df1dabe3b9c186b36107a10f928">xpcc::stm32::GpioInputB3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b4.html#a55222f4f990f0edd22a53a03e00f6c13">xpcc::stm32::GpioInputB4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b5.html#a31843016376b0ce1f34822f684ab9a7c">xpcc::stm32::GpioInputB5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b6.html#a8a89e5641303b1fc18d71f3fa08cd15b">xpcc::stm32::GpioInputB6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b7.html#a57856ba421896b06e69c9f86ca7f1c64">xpcc::stm32::GpioInputB7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b8.html#aa2cd369876aef8c0f894383d9ce41436">xpcc::stm32::GpioInputB8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b9.html#a74f2b7df7d09eb5ca1cddf774864b34d">xpcc::stm32::GpioInputB9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c0.html#a9aab9955f893dd90fc071465f28f2649">xpcc::stm32::GpioInputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c10.html#a261e8d0ee74f30eb0f2598a888fd6d52">xpcc::stm32::GpioInputC10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c11.html#aa086be7281a2182dc53a2d9f899b37da">xpcc::stm32::GpioInputC11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c12.html#ac6e12d5c9446fbf563052b5410ca8f44">xpcc::stm32::GpioInputC12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c13.html#a68426d0c0f4b01e59715657b76f4d7b0">xpcc::stm32::GpioInputC13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c14.html#a6f78fef7713b7a863db214375498dec6">xpcc::stm32::GpioInputC14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c15.html#a2b173023a7acd2c366154d9e810bb1f9">xpcc::stm32::GpioInputC15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c1.html#ac569e071324a6aa4932fb14144018785">xpcc::stm32::GpioInputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c2.html#a8b664c11cfb56a192e699f3e533f8daf">xpcc::stm32::GpioInputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c3.html#a69a85b2e5690f2991fe5abf48627ec7d">xpcc::stm32::GpioInputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c4.html#a5202bdf12322c9cd4b069a271fbf3129">xpcc::stm32::GpioInputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c5.html#afd5441ff05a2bebe25683c679dbf1f51">xpcc::stm32::GpioInputC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c6.html#a7f6b4207661b659b84567f71edcabe3c">xpcc::stm32::GpioInputC6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c7.html#a016dc10c46152ade30f2986a1d04f00f">xpcc::stm32::GpioInputC7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c8.html#a1e9ccb6f6833243211458d5fd644d61e">xpcc::stm32::GpioInputC8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c9.html#ab3e6ab6a6be832e85ebf94310e7d6213">xpcc::stm32::GpioInputC9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d0.html#a21ef343baf6c74cb5c05a6d91328e440">xpcc::stm32::GpioInputD0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d10.html#a26d2ed511b705b42b0802d71b21aae7a">xpcc::stm32::GpioInputD10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d11.html#a27f31ab0ae1d3f5cde200580482183bd">xpcc::stm32::GpioInputD11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d12.html#a299e80fd89e7413f1b8ee5c5bb7de997">xpcc::stm32::GpioInputD12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d13.html#ade54ee85bd7290da0c555b33db90e7cd">xpcc::stm32::GpioInputD13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d14.html#a455e07da5e98f8014239303ae88b97b4">xpcc::stm32::GpioInputD14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d15.html#a825ce9c30df36959987b667e1667ea81">xpcc::stm32::GpioInputD15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d1.html#a5168652ddffb026da995012ca5c0fba9">xpcc::stm32::GpioInputD1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d2.html#a28ade080f4f83d550fbb07d60429c57a">xpcc::stm32::GpioInputD2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d3.html#a00a5a5bb7d134903d4f72fc6c4b3258a">xpcc::stm32::GpioInputD3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d4.html#a4ce7a54367e56baccb7f810d15fbe7c3">xpcc::stm32::GpioInputD4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d5.html#aea92a3e126f008d6284740afdb41e934">xpcc::stm32::GpioInputD5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d6.html#a52d6caf3b0320b807be52daafc8bd278">xpcc::stm32::GpioInputD6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d7.html#a2029f54a4caecb3c7a7119bbbfdd2850">xpcc::stm32::GpioInputD7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d8.html#a8a2423611e21e7899e519731fb6adcf3">xpcc::stm32::GpioInputD8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d9.html#a2527fe5de9ab811acead161740918d0f">xpcc::stm32::GpioInputD9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e0.html#a9321985f09f075c409f85df2b785a908">xpcc::stm32::GpioInputE0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e10.html#a374c5ee30fee3a56f7af088e9f75d257">xpcc::stm32::GpioInputE10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e11.html#ae442070a9041a5defa584d454b37cbc8">xpcc::stm32::GpioInputE11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e12.html#a15051141c0aa3623eedd1afcc0acf1c9">xpcc::stm32::GpioInputE12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e13.html#a8665fba7fec376773478355c4bf69fc6">xpcc::stm32::GpioInputE13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e14.html#a6b7aeacea3b58be507e00ba2aab06eaf">xpcc::stm32::GpioInputE14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e15.html#ac336126fa44019e9832ac3ccd40be0fd">xpcc::stm32::GpioInputE15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e1.html#a7a568c7ad89c3bd646daf1cc85301114">xpcc::stm32::GpioInputE1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e2.html#a4bc9960d8d73c0df9f3e9563a27d44c8">xpcc::stm32::GpioInputE2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e3.html#abfeb0dcac9285718a8f377caeee24c8a">xpcc::stm32::GpioInputE3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e4.html#a74c4ea86d167e84c458c5d57de69e04f">xpcc::stm32::GpioInputE4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e5.html#a898c6b631ea13a96a4e0b4aaf7620d96">xpcc::stm32::GpioInputE5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e6.html#afd3c2aac46ad481c10f4ee39fb4bca48">xpcc::stm32::GpioInputE6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e7.html#adacf7de48f3f968c2263093290773974">xpcc::stm32::GpioInputE7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e8.html#af0da78470401190bd7535defa84ee206">xpcc::stm32::GpioInputE8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e9.html#a601a069e74e00105b6a7074d490a2817">xpcc::stm32::GpioInputE9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_h0.html#aa7f33b7ee852ca3f877bb55e188ce04f">xpcc::stm32::GpioInputH0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_h1.html#a083d1c0248ea19ae4796d74b9989161f">xpcc::stm32::GpioInputH1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a0.html#a9c61e7c5e35e3a602e0124bd44df5015">xpcc::stm32::GpioOutputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a10.html#a72e35b3e0d600e7a5ec3f56d44bc4798">xpcc::stm32::GpioOutputA10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a11.html#afe1417ed68ba8c9fc16215650e048886">xpcc::stm32::GpioOutputA11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a12.html#aa27261f8baf52492cdaa79be01376725">xpcc::stm32::GpioOutputA12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a13.html#a13cb61759742baa997e70c5189a70717">xpcc::stm32::GpioOutputA13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a14.html#a6cc32f44d01a48bb3f3fb3d65abe4b77">xpcc::stm32::GpioOutputA14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a15.html#af9fe244029b042011a3786f72b7d56e8">xpcc::stm32::GpioOutputA15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a1.html#a6261ffbe40ffb8930e6dae84468be68f">xpcc::stm32::GpioOutputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a2.html#a922dc0b8d948c47576225fc0f783634d">xpcc::stm32::GpioOutputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a3.html#a827c31183fe462080d4e1407ea3b8914">xpcc::stm32::GpioOutputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a4.html#a75856f811b4e9720536b3d5ba8f97224">xpcc::stm32::GpioOutputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a5.html#a1424df65f19d133d777d6a741cbae4f2">xpcc::stm32::GpioOutputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a6.html#a3afa1dbf976dc7afd3440ea44c8576de">xpcc::stm32::GpioOutputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a7.html#a36b6a852ee80480108e7a07f10388578">xpcc::stm32::GpioOutputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a8.html#a0df5fd11dd329f7780def2592eb4077b">xpcc::stm32::GpioOutputA8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a9.html#a3287d029047a9049b54e9187b84c6862">xpcc::stm32::GpioOutputA9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b0.html#a53cb180b0968595bf1b04cc8e06e0cca">xpcc::stm32::GpioOutputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b10.html#a42eaeecfda11c73a306141255ae3f75c">xpcc::stm32::GpioOutputB10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b11.html#ad58301e12c021a80584231cf5fa5927a">xpcc::stm32::GpioOutputB11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b12.html#acc049a91034f52d52fb1578dfe579e44">xpcc::stm32::GpioOutputB12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b13.html#a3cffa58e5dd6a352cc08db8759d7a919">xpcc::stm32::GpioOutputB13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b14.html#ad40820c6b1e4e782eab6aebf191b3c8a">xpcc::stm32::GpioOutputB14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b15.html#a96e59fd5213eab0c5082d46a19613499">xpcc::stm32::GpioOutputB15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b1.html#abceaf7428628eab9b4ae55a7e2c5543c">xpcc::stm32::GpioOutputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b2.html#acd7b6eea6b64790bce47c3ab6a75cd5c">xpcc::stm32::GpioOutputB2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b3.html#a9b5ec429c04d2eb671e17b6d5b769ab7">xpcc::stm32::GpioOutputB3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b4.html#a43b8c3537070e1c5fc01947dbc4a2ce6">xpcc::stm32::GpioOutputB4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b5.html#ae0a5378eb4f7b895eeb8d2a244b018c2">xpcc::stm32::GpioOutputB5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b6.html#a47a6a3623965585f0c38bf567a361109">xpcc::stm32::GpioOutputB6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b7.html#ab06d99392bacb1541efc28ee5ea4a74a">xpcc::stm32::GpioOutputB7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b8.html#add3fd78c46e68f1afcc4a7d14ecd16c0">xpcc::stm32::GpioOutputB8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b9.html#a931c466be0685075429e41a420d9fbfb">xpcc::stm32::GpioOutputB9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c0.html#a26eb9ace2ea4007d65e10024a089fef7">xpcc::stm32::GpioOutputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c10.html#ac439b681cf2c57684479bbc54cfdb947">xpcc::stm32::GpioOutputC10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c11.html#adf050dea6b7b4d8c3849d6e2912ff34d">xpcc::stm32::GpioOutputC11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c12.html#aa7d03f65345011653e9635aba2c697de">xpcc::stm32::GpioOutputC12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c13.html#aa6ad5abdf6e0c8d48b707764e4268d17">xpcc::stm32::GpioOutputC13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c14.html#a0cbd1e10312f4e7f5d0fd8d16fc58ef1">xpcc::stm32::GpioOutputC14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c15.html#a3fa1f00d4ea9a1bda72e9ff8e66fe3e1">xpcc::stm32::GpioOutputC15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c1.html#af1e5d28da8eeb4cdc4a65105aecd6a3e">xpcc::stm32::GpioOutputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c2.html#aeb1aebb48698a50040bcb06b0799220d">xpcc::stm32::GpioOutputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c3.html#a77dcdf593c69b2b443619ee47f0d99f1">xpcc::stm32::GpioOutputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c4.html#af182761bcbfe33590797bcddcdcd8eb6">xpcc::stm32::GpioOutputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c5.html#a9821bf6a664580de5d9094c41eefa99a">xpcc::stm32::GpioOutputC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c6.html#adc34a6a95c070d0900015157e4544f34">xpcc::stm32::GpioOutputC6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c7.html#a85f46b741ecf5e015d22f14701d29a1e">xpcc::stm32::GpioOutputC7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c8.html#aeef5b0677aa0c903935334bb3143f00d">xpcc::stm32::GpioOutputC8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c9.html#aca5a9492276252eb58fd18615dc5987a">xpcc::stm32::GpioOutputC9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d0.html#a2f902326a7643181dcd0d3ed37139149">xpcc::stm32::GpioOutputD0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d10.html#a61401a026ea66243c9fd628b70c44e54">xpcc::stm32::GpioOutputD10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d11.html#a0e6abb18ab94acbfa148d89f246f9908">xpcc::stm32::GpioOutputD11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d12.html#a40e8649e075a67f0d7766148be6f6123">xpcc::stm32::GpioOutputD12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d13.html#aea81b7215e2a71f3916247781e328a21">xpcc::stm32::GpioOutputD13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d14.html#a4fcdbcca4dd608bf61f1969d8221f655">xpcc::stm32::GpioOutputD14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d15.html#ae324335f1521ba444d814a17678a5158">xpcc::stm32::GpioOutputD15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d1.html#a80c5a24db1a4fc440c0bac70c9cc4e9c">xpcc::stm32::GpioOutputD1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d2.html#a20dc63f582e6ffea22624236e6d065be">xpcc::stm32::GpioOutputD2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d3.html#a2b91371a7c350f7284190e8e2af97e54">xpcc::stm32::GpioOutputD3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d4.html#a60190307540d33c92716f2d467c1f5a5">xpcc::stm32::GpioOutputD4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d5.html#a35fe5c65e1435905afb5515993bd3ea0">xpcc::stm32::GpioOutputD5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d6.html#ad7b92539ffdd9c0f1d581c1d99bfeaf4">xpcc::stm32::GpioOutputD6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d7.html#a0b7d93b10566b7a4d5c4452b1aeedc69">xpcc::stm32::GpioOutputD7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d8.html#ad4c350c931e82885b6e012c8e58f6077">xpcc::stm32::GpioOutputD8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_d9.html#ad6ed57db250a5cbe07044283f768ceff">xpcc::stm32::GpioOutputD9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e0.html#a5a8b1231357e1716305a72d493b478bb">xpcc::stm32::GpioOutputE0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e10.html#aa1f2e9f6117476de6e2928d6638a31e7">xpcc::stm32::GpioOutputE10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e11.html#ac90034353d1e3a57b814b4cb58cb1543">xpcc::stm32::GpioOutputE11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e12.html#a03c276472dd3f4da97afe46a21e02ee2">xpcc::stm32::GpioOutputE12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e13.html#a83c69ce1f09fb5770dabb4cef834c7e4">xpcc::stm32::GpioOutputE13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e14.html#a24a7359569275d94c7718b0e3b987022">xpcc::stm32::GpioOutputE14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e15.html#aaa49736343917beeb36f244a0d2e4844">xpcc::stm32::GpioOutputE15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e1.html#ae7bb50c7ddeec734c74ebbdad52da57c">xpcc::stm32::GpioOutputE1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e2.html#ab1cd5bd16484ccc4e71cf0a8913fb167">xpcc::stm32::GpioOutputE2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e3.html#a27592f03f175832cb3a61c12444c2e27">xpcc::stm32::GpioOutputE3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e4.html#a5577186cd764591389b87fb0d6410c3c">xpcc::stm32::GpioOutputE4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e5.html#a72e5373f0bfe09d1baf782f3cef00439">xpcc::stm32::GpioOutputE5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e6.html#a6501512c6798a45c8b911e3393841edc">xpcc::stm32::GpioOutputE6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e7.html#a5f5ef0f20cac3266e0e2db79432e0df8">xpcc::stm32::GpioOutputE7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e8.html#a706bde1a3bfc3f4f5d8734572e4174aa">xpcc::stm32::GpioOutputE8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_e9.html#a5483545d3934e49aef4ad2bfee05bc0b">xpcc::stm32::GpioOutputE9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_h0.html#a62b8865b9b0d4d1adfc41642eff00416">xpcc::stm32::GpioOutputH0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_h1.html#aede825c35ba401f4e9c3be261c374ab6">xpcc::stm32::GpioOutputH1</a> </li> <li>const_iterator() : <a class="el" href="classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a8b053cbdb489192760d3e7c177d67622">xpcc::DoublyLinkedList&lt; T, Allocator &gt;::const_iterator</a> , <a class="el" href="classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6799ad652564e60de4186e4043e8427b">xpcc::DynamicArray&lt; T, Allocator &gt;::const_iterator</a> , <a class="el" href="classxpcc_1_1_linked_list_1_1const__iterator.html#a48454a8b849b4dab7d281ab7a286e441">xpcc::LinkedList&lt; T, Allocator &gt;::const_iterator</a> </li> <li>construct() : <a class="el" href="classxpcc_1_1allocator_1_1_allocator_base.html#af041d72f33d395239b7a9dda050e6511">xpcc::allocator::AllocatorBase&lt; T &gt;</a> </li> <li>convert() : <a class="el" href="classxpcc_1_1_location2_d.html#af66488c5237442d6eaedefa98506f8a5">xpcc::Location2D&lt; T &gt;</a> , <a class="el" href="classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ab8083daadc9c2d0fd75102315f51e82b">xpcc::Vector&lt; T, 2 &gt;</a> </li> <li>convertToHeader() : <a class="el" href="classxpcc_1_1_can_connector_base.html#a6fd8c15060e43a8754180d7eed5efee4">xpcc::CanConnectorBase</a> </li> <li>convertToIdentifier() : <a class="el" href="classxpcc_1_1_can_connector_base.html#aad2c88f6d1111c81877575b1401eb109">xpcc::CanConnectorBase</a> </li> <li>copyBufferToPage() : <a class="el" href="classxpcc_1_1_at45db0x1d.html#a86e1772ec815d07f40e62c5f5ceb94f0">xpcc::At45db0x1d&lt; Spi, Cs &gt;</a> </li> <li>copyBufferToPageWithoutErase() : <a class="el" href="classxpcc_1_1_at45db0x1d.html#ad38503382ad8a17ff098bb7cf4aebdb5">xpcc::At45db0x1d&lt; Spi, Cs &gt;</a> </li> <li>copyPageToBuffer() : <a class="el" href="classxpcc_1_1_at45db0x1d.html#a9f3f2983edd52e854bbfe7fa48412758">xpcc::At45db0x1d&lt; Spi, Cs &gt;</a> </li> <li>cross() : <a class="el" href="classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aa009f18eff0a0387e029f0be83b045ad">xpcc::Vector&lt; T, 2 &gt;</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Tue Jun 27 2017 20:04:00 for xpcc by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html> <file_sep>/docs/api/classxpcc_1_1color_1_1_rgb_t.js var classxpcc_1_1color_1_1_rgb_t = [ [ "RgbT", "classxpcc_1_1color_1_1_rgb_t.html#a7b2f71a19c01dce910d34bb7e1b765b8", null ], [ "RgbT", "classxpcc_1_1color_1_1_rgb_t.html#a4395b9f051fecc0f6c9d8028ff0bde5c", null ], [ "getRelative", "classxpcc_1_1color_1_1_rgb_t.html#a552843fa5abdc9466058155f790dc726", null ], [ "getRelativeRed", "classxpcc_1_1color_1_1_rgb_t.html#a2810ec14b6ba33d9b92cdc08e0806e91", null ], [ "getRelativeGreen", "classxpcc_1_1color_1_1_rgb_t.html#a026246b26dc4c9dc4df92bd6359b1312", null ], [ "getRelativeBlue", "classxpcc_1_1color_1_1_rgb_t.html#a4ada77108b50278d42c15d18e329b49f", null ], [ "getRelativeColors", "classxpcc_1_1color_1_1_rgb_t.html#a02f9c3f84a97638359a228bfe836acab", null ], [ "toHsv", "classxpcc_1_1color_1_1_rgb_t.html#af1dc0a4a85e04e53c7db3f854e23ef2a", null ], [ "operator<<", "classxpcc_1_1color_1_1_rgb_t.html#a32d7bf9d5b0357ea9871fcecdbdeb9af", null ], [ "red", "classxpcc_1_1color_1_1_rgb_t.html#a1144bc610abb6f11e88863017f85b0cc", null ], [ "green", "classxpcc_1_1color_1_1_rgb_t.html#a32f8ee4bd1e228c239188dcfff5970e0", null ], [ "blue", "classxpcc_1_1color_1_1_rgb_t.html#a4559519abb23993606512deba1dbaed6", null ] ];<file_sep>/docs/api/classxpcc_1_1_bme280.js var classxpcc_1_1_bme280 = [ [ "Bme280", "classxpcc_1_1_bme280.html#a64c038a7449c33ad0913c7070184b66f", null ], [ "initialize", "classxpcc_1_1_bme280.html#a3d3acd4713304376bfca6990822592b3", null ], [ "readout", "classxpcc_1_1_bme280.html#ab30ae8de7e007cebec7f9437345bbc53", null ], [ "getData", "classxpcc_1_1_bme280.html#ad1ffa1e1c323efac48fd8fb4768d4783", null ] ];<file_sep>/docs/api/classxpcc_1_1pt_1_1_protothread.js var classxpcc_1_1pt_1_1_protothread = [ [ "Protothread", "classxpcc_1_1pt_1_1_protothread.html#a60c9acd2c0f6fe5cfe8f04c4c08b78f4", null ], [ "restart", "classxpcc_1_1pt_1_1_protothread.html#a3c9892ebfbed1112dd5a7dc8882c0e94", null ], [ "stop", "classxpcc_1_1pt_1_1_protothread.html#a61c7c84a815782e69d7d0c33d76c4b9e", null ], [ "isRunning", "classxpcc_1_1pt_1_1_protothread.html#aa460b28764fb4d53541bd93fe703e0dc", null ] ];<file_sep>/docs/api/navtreeindex5.js var NAVTREEINDEX5 = { "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba36986d495d85b1af840228e334e5d245":[1,5,4,2,0,0], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba42343001afbb02de43274df05718b52d":[1,5,4,2,0,5], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba4ae271df65ed5cd4f7112535e0a044eb":[1,5,4,2,0,1], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba61f4bda0ca985ab68c1c1fe0f2251088":[1,5,4,2,0,4], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba91db699975c9b60951726da6bb8f3f90":[1,5,4,2,0,2], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbac9313c76784ffb6d96748d5e5fcecbdb":[1,5,4,2,0,10], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbadf2a4d99939f4c795e73233d916e9b16":[1,5,4,2,0,8], "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbafd6ed4d66203b40267636ebbd1725aa9":[1,5,4,2,0,3], "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304a":[1,5,4,2,1], "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304aa336c2dfd66cf1330e508bf3d17eeec83":[1,5,4,2,1,0], "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304aacf0fafbe6ee82b6adc4d6de724a40cf9":[1,5,4,2,1,1], "classxpcc_1_1_mcp23x17.html":[1,5,4,3], "classxpcc_1_1_mcp23x17.html#a0abc1e68b2aea8b8681aee72e125446a":[1,5,4,3,27], "classxpcc_1_1_mcp23x17.html#a0abc59a04214818da58b53fb6cafc5b3":[1,5,4,3,8], "classxpcc_1_1_mcp23x17.html#a0cb4b5316010a2536318a3f98ac486af":[1,5,4,3,39], "classxpcc_1_1_mcp23x17.html#a11a95ef92cbba1e7e39f1ad06eb40916":[1,5,4,3,34], "classxpcc_1_1_mcp23x17.html#a12fc9541b3657f842789b5d7bc54a642":[1,5,4,3,26], "classxpcc_1_1_mcp23x17.html#a1e632925d891b647890b72d5343b5478":[1,5,4,3,30], "classxpcc_1_1_mcp23x17.html#a21626559ca81c7d76caa89e88a03673c":[1,5,4,3,5], "classxpcc_1_1_mcp23x17.html#a278bf672d8684a509527328d2207480e":[1,5,4,3,3], "classxpcc_1_1_mcp23x17.html#a30c36e301acd230b2d69704f647a4159":[1,5,4,3,37], "classxpcc_1_1_mcp23x17.html#a375f7d421ac2350631405ccda1b7b6e1":[1,5,4,3,32], "classxpcc_1_1_mcp23x17.html#a3de9757207e3ad0836448c3829ed6ab5":[1,5,4,3,20], "classxpcc_1_1_mcp23x17.html#a3e85d77aefc4cca47449491533a388b0":[1,5,4,3,38], "classxpcc_1_1_mcp23x17.html#a40045b541aa56f58e6a8a615c8f00b10":[1,5,4,3,2], "classxpcc_1_1_mcp23x17.html#a495da5416177a88abe5d6d3725d2597a":[1,5,4,3,11], "classxpcc_1_1_mcp23x17.html#a4964e4879d7671ef130658dbc66b2186":[1,5,4,3,12], "classxpcc_1_1_mcp23x17.html#a5a07133503ec590dd6013f5683905be0":[1,5,4,3,4], "classxpcc_1_1_mcp23x17.html#a5b178aba539b4b5f9a879858132b62a4":[1,5,4,3,6], "classxpcc_1_1_mcp23x17.html#a61fe458a657e793a4deca98e7911d97c":[1,5,4,3,1], "classxpcc_1_1_mcp23x17.html#a6be5550de53e0167f857b9d5488d6c94":[1,5,4,3,35], "classxpcc_1_1_mcp23x17.html#a769350efb948a997f93ac817863beaec":[1,5,4,3,16], "classxpcc_1_1_mcp23x17.html#a7851ab787d5e0408bb251d9c21dab06c":[1,5,4,3,23], "classxpcc_1_1_mcp23x17.html#a7d2d4f3a9563fd5c7834a8aebdc1a20a":[1,5,4,3,25], "classxpcc_1_1_mcp23x17.html#a97f0bf3710596d7fe90b7805b03cccd9":[1,5,4,3,10], "classxpcc_1_1_mcp23x17.html#a9b5757e6a4c4f146d05e6e2f14f52435":[1,5,4,3,29], "classxpcc_1_1_mcp23x17.html#a9e976ff7822d2dc654e1d2d744e88d61":[1,5,4,3,17], "classxpcc_1_1_mcp23x17.html#aa2fb25942af7f834c608e8d5eb901078":[1,5,4,3,31], "classxpcc_1_1_mcp23x17.html#aa7d9dda870a54034c256f826b9efd7de":[1,5,4,3,7], "classxpcc_1_1_mcp23x17.html#aae596572bbe4e95b967d43195b9f532b":[1,5,4,3,9], "classxpcc_1_1_mcp23x17.html#ab017c4e4ac6d377fc0e2c421dcb2dfe7":[1,5,4,3,22], "classxpcc_1_1_mcp23x17.html#ab1d01bc3b697fafa4de60a605133948e":[1,5,4,3,14], "classxpcc_1_1_mcp23x17.html#abb2cc6c1a0e696e92ec4b4649675ccbf":[1,5,4,3,18], "classxpcc_1_1_mcp23x17.html#abc7a79ab13f254b33828278eb7c52419":[1,5,4,3,19], "classxpcc_1_1_mcp23x17.html#abd792fa7d2d40eab1d7cb93680d41f7c":[1,5,4,3,33], "classxpcc_1_1_mcp23x17.html#abff94e16fa79d8d115e1ea6134555f55":[1,5,4,3,15], "classxpcc_1_1_mcp23x17.html#ac0403f1d2953f2ec590265ddac4e3666":[1,5,4,3,36], "classxpcc_1_1_mcp23x17.html#ac0c568fdd8d28ca720bcdd9e629400e6":[1,5,4,3,28], "classxpcc_1_1_mcp23x17.html#adf307aa29e3fcabba7c494d4216afa99":[1,5,4,3,13], "classxpcc_1_1_mcp23x17.html#ae1e3f2c10e21eec2393853e6e80dbead":[1,5,4,3,0], "classxpcc_1_1_mcp23x17.html#ae348a377c64685287ba898b8d4fa7b23":[1,5,4,3,24], "classxpcc_1_1_mcp23x17.html#aea9fe2354cd0860c0c0f6db489373e1d":[1,5,4,3,21], "classxpcc_1_1_mcp2515.html":[1,5,3,1,0], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68":[1,5,3,1,0,0], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68a8c6984304f341bf66ffa4478066ab77c":[1,5,3,1,0,0,6], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68aae51ece4ce832937b636cf37c1aebe3b":[1,5,3,1,0,0,2], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ac4c41f65b63f86c138f7fde81903ff2e":[1,5,3,1,0,0,3], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ad6564b6bc88869910920adece16956e2":[1,5,3,1,0,0,1], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ae12f7a67ab5087b2206b64cbefb9b56e":[1,5,3,1,0,0,0], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68af2ef3880a6e98104f78dca881eb79397":[1,5,3,1,0,0,5], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68af7df8965bf007f2c37dbe2068bf84b7f":[1,5,3,1,0,0,4], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68afa75320b54228e407ce1947998e8c029":[1,5,3,1,0,0,7], "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68afe25d9967d9577841207ef05eeebc411":[1,5,3,1,0,0,8], "classxpcc_1_1_mcp4922.html":[1,5,2,0], "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096":[1,5,2,0,0], "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a10db7c0b0c5f0e324c25a95eded4ea4d":[1,5,2,0,0,0], "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a4540dd7de906a9d42035091b8044125c":[1,5,2,0,0,3], "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a6591404651030ca167eb7b748fe6d5f6":[1,5,2,0,0,1], "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a74a0db48cc9895782a8888f832f805d1":[1,5,2,0,0,2], "classxpcc_1_1_memory_bus.html":[1,5,7,3], "classxpcc_1_1_menu_entry_callback.html":[2,0,3,194], "classxpcc_1_1_menu_entry_callback.html#a7309bd2faf23cd110a361738d15db36d":[2,0,3,194,0], "classxpcc_1_1_menu_entry_callback.html#a7b124c6584319fe6526511a779a04279":[2,0,3,194,2], "classxpcc_1_1_menu_entry_callback.html#abb8965294432acb470908edfef5cc290":[2,0,3,194,1], "classxpcc_1_1_menu_entry_callback.html#aca9e280a9950cd5079c857058d7f03a1":[2,0,3,194,4], "classxpcc_1_1_menu_entry_callback.html#afc349a78de3f3fb5b8bba628570d6da7":[2,0,3,194,3], "classxpcc_1_1_nested_resumable.html":[1,9,3,0], "classxpcc_1_1_nested_resumable.html#a0c3b3d2db6cc352c351b661773ddf228":[1,9,3,0,2], "classxpcc_1_1_nested_resumable.html#a484d5699e2e38fa7635911fcbfa27ef8":[1,9,3,0,0], "classxpcc_1_1_nested_resumable.html#a69d709c2fc46674945ef502b068d8cb1":[1,9,3,0,3], "classxpcc_1_1_nested_resumable.html#ae55408162e3606d174c9391c9fc82d0c":[1,9,3,0,1], "classxpcc_1_1_nokia5110.html":[1,5,0,5], "classxpcc_1_1_nokia5110.html#a22430204f41efd8181f02694865fd165":[1,5,0,5,0], "classxpcc_1_1_nokia5110.html#a66db56821c3f6088b5d1353a6c94de42":[1,5,0,5,2], "classxpcc_1_1_nokia5110.html#aa10513fbb0a50303f049c2ea77d9dcfc":[1,5,0,5,1], "classxpcc_1_1_nokia6610.html":[1,5,0,6], "classxpcc_1_1_nokia6610.html#a5102cc66afb05df2363515279f48b6bd":[1,5,0,6,2], "classxpcc_1_1_nokia6610.html#a8975a8c641333d6a4f77de1ba0570b1d":[1,5,0,6,1], "classxpcc_1_1_nokia6610.html#ad124a150d657d53aded45659ddaac3ca":[1,5,0,6,0], "classxpcc_1_1_nrf24_config.html":[1,5,10,0,0], "classxpcc_1_1_nrf24_config.html#a3d2202831d1dd0a705cb512e3ee2c0ca":[1,5,10,0,0,3], "classxpcc_1_1_nrf24_config.html#a3d2202831d1dd0a705cb512e3ee2c0caa1bbdcebab838cddccc9e4d3b3e5bd4ac":[1,5,10,0,0,3,0], "classxpcc_1_1_nrf24_config.html#a3d2202831d1dd0a705cb512e3ee2c0caad62adf8b920500ccb928fda1922da0c4":[1,5,10,0,0,3,1], "classxpcc_1_1_nrf24_config.html#a3d2202831d1dd0a705cb512e3ee2c0caafbcd13274aaacbca65351fde7bdbdc75":[1,5,10,0,0,3,2], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1":[1,5,10,0,0,6], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a0e57e6463ba345ff879f5b0d7e66e203":[1,5,10,0,0,6,7], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a28572bf326df6ecf17be9c888cbc3c3b":[1,5,10,0,0,6,4], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a2e8ca585ffc7028f43121145b23ba78c":[1,5,10,0,0,6,1], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a35f3777c580f72f11046277dcf3e76d9":[1,5,10,0,0,6,10], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a5171dafd796cb3ec8a656e646b61d81c":[1,5,10,0,0,6,11], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a6f01f360e2c1fbde0f26eb1d30ed610b":[1,5,10,0,0,6,2], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a6f0745bbe1392a012dbf2eb4d7ab8cf1":[1,5,10,0,0,6,6], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a74ab2b26f48e0bd4087990dd25974379":[1,5,10,0,0,6,14], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a7d9b947096eb6b91b4b581d7e678a86d":[1,5,10,0,0,6,3], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a807380aad3958a921b93aeb5de491761":[1,5,10,0,0,6,15], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a860010801e3c1aa2210eac1c0a282f95":[1,5,10,0,0,6,13], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a8e5787775d258f38b721c1cf47313cb5":[1,5,10,0,0,6,12], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a94ea0a8824b1c5a1afa05e4c9fd3d62d":[1,5,10,0,0,6,5], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1a99f0ab1eec55149f2c77009bf97ba260":[1,5,10,0,0,6,8], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1abcfaccebf745acfd5e75351095a5394a":[1,5,10,0,0,6,0], "classxpcc_1_1_nrf24_config.html#a65790dfaf7cfed0c659f114dfd2cdca1ad7a7b6ccae807623042df09a07326a79":[1,5,10,0,0,6,9], "classxpcc_1_1_nrf24_config.html#a68ad49f0e8d8a4d9fd485646297a0912":[1,5,10,0,0,4], "classxpcc_1_1_nrf24_config.html#a68ad49f0e8d8a4d9fd485646297a0912a146385264e57435b39a1db2da505bef7":[1,5,10,0,0,4,3], "classxpcc_1_1_nrf24_config.html#a68ad49f0e8d8a4d9fd485646297a0912a2d90c2c80153d223b697cb8efa137263":[1,5,10,0,0,4,0], "classxpcc_1_1_nrf24_config.html#a68ad49f0e8d8a4d9fd485646297a0912aa4b2eb8fc271ea484927ffe6e024b907":[1,5,10,0,0,4,2], "classxpcc_1_1_nrf24_config.html#a68ad49f0e8d8a4d9fd485646297a0912aee160226e92cdbd5c1a2a536e76a0508":[1,5,10,0,0,4,1], "classxpcc_1_1_nrf24_config.html#a72b70009ee1e88b7225a8ff421509095":[1,5,10,0,0,2], "classxpcc_1_1_nrf24_config.html#a72b70009ee1e88b7225a8ff421509095a101bdcb58750a841a2da8a4572eea44a":[1,5,10,0,0,2,2], "classxpcc_1_1_nrf24_config.html#a72b70009ee1e88b7225a8ff421509095a940904429b87460006317f80e6743a01":[1,5,10,0,0,2,1], "classxpcc_1_1_nrf24_config.html#a72b70009ee1e88b7225a8ff421509095ad408fd73e9a550c1f3fe4b51651f9f0a":[1,5,10,0,0,2,0], "classxpcc_1_1_nrf24_config.html#a85b8d05692b6ec9e9d70f55e19c29986":[1,5,10,0,0,0], "classxpcc_1_1_nrf24_config.html#a85b8d05692b6ec9e9d70f55e19c29986a4393102620f7750d259e3f050f32ba0b":[1,5,10,0,0,0,1], "classxpcc_1_1_nrf24_config.html#a85b8d05692b6ec9e9d70f55e19c29986ac8600a0cc45fe853cb446a96bb8eae35":[1,5,10,0,0,0,0], "classxpcc_1_1_nrf24_config.html#af6a07496b9e383f291422a932b66580a":[1,5,10,0,0,1], "classxpcc_1_1_nrf24_config.html#af6a07496b9e383f291422a932b66580aad1d81ef803fc239840aaf2cd72b85f4b":[1,5,10,0,0,1,2], "classxpcc_1_1_nrf24_config.html#af6a07496b9e383f291422a932b66580aae14994706223167f4f71f5a6184b1b58":[1,5,10,0,0,1,0], "classxpcc_1_1_nrf24_config.html#af6a07496b9e383f291422a932b66580aaed06e6777268e04f5af17a735ea5e08e":[1,5,10,0,0,1,1], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883b":[1,5,10,0,0,5], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba063a046f425649288192292707609514":[1,5,10,0,0,5,6], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba0dd6f0013c25a2d9d25a20450c1bb330":[1,5,10,0,0,5,9], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba3890a43a97ed1d22a849d93962a553ee":[1,5,10,0,0,5,1], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba397eaf07c81d3be1547a3cbeef74fb14":[1,5,10,0,0,5,7], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba4460e952cacdc5e66a0dbd22551c1c36":[1,5,10,0,0,5,8], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba4a203e530c4db643a05914cd6cb99ac6":[1,5,10,0,0,5,14], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba578612dc89a6c31f2705cad2a55cad4b":[1,5,10,0,0,5,2], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba5e64da56352e6a428074ed076e49e88d":[1,5,10,0,0,5,0], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba62ea00b8230ad9d9ad52a6340d81cd23":[1,5,10,0,0,5,15], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba64bb2e70d2c816095e55748e26cb942e":[1,5,10,0,0,5,5], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba6c0a01c65bb2c98e5f9bb42ca1a4c078":[1,5,10,0,0,5,11], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba83492a8f83844b8b47f8e66b88f4d8a6":[1,5,10,0,0,5,4], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba849e0cf6c867604b293e585b226c608d":[1,5,10,0,0,5,10], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883ba8ae1aacb41776fd127aea7df88adb5b5":[1,5,10,0,0,5,12], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883baf62731626a4d51b818d33ca43dd27fde":[1,5,10,0,0,5,3], "classxpcc_1_1_nrf24_config.html#afb84827d50deb86de7290f229237883bafee9ebb7a89d71f528b34b3fbb6b7ae7":[1,5,10,0,0,5,13], "classxpcc_1_1_nrf24_data.html":[1,5,10,0,2], "classxpcc_1_1_nrf24_data.html#a34d85febacb9bcea5f936c55e3b72295":[1,5,10,0,2,0,0], "classxpcc_1_1_nrf24_data.html#a5bdd78cb1214f25bb5b33580b61d420f":[1,5,10,0,2,1,0], "classxpcc_1_1_nrf24_data.html#a818f43163684241b2bde7b43d965023d":[1,5,10,0,2,5], "classxpcc_1_1_nrf24_data.html#a8ea760892284becfbab92751adc233bf":[1,5,10,0,2,0,1], "classxpcc_1_1_nrf24_data.html#aaa45d822886be1edec9789785e82069c":[1,5,10,0,2,4], "classxpcc_1_1_nrf24_data.html#afae268b88862e5f5f09c0b7b32bed5b0":[1,5,10,0,2,1,1], "classxpcc_1_1_nrf24_data.html#structxpcc_1_1_nrf24_data_1_1_frame":[1,5,10,0,2,0], "classxpcc_1_1_nrf24_data.html#structxpcc_1_1_nrf24_data_1_1_header":[1,5,10,0,2,1], "classxpcc_1_1_nrf24_phy.html":[1,5,10,0,3], "classxpcc_1_1_pair.html":[1,3,4], "classxpcc_1_1_pair.html#a5215e5567410d2c770d13e701c4422da":[1,3,4,4], "classxpcc_1_1_pair.html#a59ea7074c39966f3c596a782034bdb15":[1,3,4,5], "classxpcc_1_1_pair.html#a6a62c80f31555fffc8f2f8e14bd9c5b0":[1,3,4,3], "classxpcc_1_1_pair.html#a8878863fb28f9a46c28c63d7704881d8":[1,3,4,6], "classxpcc_1_1_pair.html#a99ea08d424b9f1d7008dba2866f63e9a":[1,3,4,7], "classxpcc_1_1_pair.html#aaef2ef1af1dc3c22171cfdc1d7cf973a":[1,3,4,0], "classxpcc_1_1_pair.html#acd085a5ab8b5841b568da62b65e09936":[1,3,4,1], "classxpcc_1_1_pair.html#adb57dab5672820c5e4740f31987d3d59":[1,3,4,2], "classxpcc_1_1_parallel_tft.html":[1,5,0,7], "classxpcc_1_1_parallel_tft.html#a0e6f5e783873a16119d63ed06e991b70":[1,5,0,7,4], "classxpcc_1_1_parallel_tft.html#a36a25880bd8aa3a24f8a6e91cfa89d5f":[1,5,0,7,1], "classxpcc_1_1_parallel_tft.html#a38bc34f54aba20f94b05e1acbbd4c2e2":[1,5,0,7,0], "classxpcc_1_1_parallel_tft.html#aae13ad60ef5562286ea2481aa4df7f40":[1,5,0,7,3], "classxpcc_1_1_parallel_tft.html#ad7a85e7edec372f601f40a0a9ef0ee45":[1,5,0,7,5], "classxpcc_1_1_parallel_tft.html#ae3647856dddf0f3ca4bb64ff2b842328":[1,5,0,7,2], "classxpcc_1_1_pca8574.html":[1,5,4,4], "classxpcc_1_1_pca8574.html#a060bf0d1e06a068ab7c70feed15d951c":[1,5,4,4,8], "classxpcc_1_1_pca8574.html#a0d198f52e4047c19fe23f1283a5a7ef0":[1,5,4,4,5], "classxpcc_1_1_pca8574.html#a18c06c3b251616b19c01d1629638b9b0":[1,5,4,4,4], "classxpcc_1_1_pca8574.html#a1916898a3833418d5c56d96f29d3a12a":[1,5,4,4,14], "classxpcc_1_1_pca8574.html#a2f33ad584ba0c9b7c6e7a885bebd7a6d":[1,5,4,4,22], "classxpcc_1_1_pca8574.html#a3547594d474525b58338776a49f197a8":[1,5,4,4,11], "classxpcc_1_1_pca8574.html#a37831039ace21054efd36e78634d04ef":[1,5,4,4,23], "classxpcc_1_1_pca8574.html#a43ad947a29cb1df6bd8b59044d5889ae":[1,5,4,4,20], "classxpcc_1_1_pca8574.html#a4a006024aad9a426cf2da0639c5f452d":[1,5,4,4,25], "classxpcc_1_1_pca8574.html#a5854d5531d1090d428113f51f73d67c6":[1,5,4,4,12], "classxpcc_1_1_pca8574.html#a6baca731e9f8cc4f197bb038f1201c05":[1,5,4,4,10], "classxpcc_1_1_pca8574.html#a81301c887b89bb923dd31e2f04e7d36a":[1,5,4,4,17], "classxpcc_1_1_pca8574.html#a88587012dd5e4c17fd49aca33f3988a0":[1,5,4,4,3], "classxpcc_1_1_pca8574.html#a8a5ee733fdd3165af6bac4b840ff154b":[1,5,4,4,6], "classxpcc_1_1_pca8574.html#a9b709a4fde2185f00816ddb77483fa42":[1,5,4,4,13], "classxpcc_1_1_pca8574.html#a9bd6c93650dcc5f83fd93f2c3b429b56":[1,5,4,4,19], "classxpcc_1_1_pca8574.html#a9e5ca3948ef11f5585f89ebd61412aab":[1,5,4,4,0], "classxpcc_1_1_pca8574.html#aa08b3cb71040c596296a8b95c75558a3":[1,5,4,4,7], "classxpcc_1_1_pca8574.html#aa342e233cede3933cd1e0320026386d0":[1,5,4,4,18], "classxpcc_1_1_pca8574.html#aa54da2ccbb3a43e93aa8169b495a3d89":[1,5,4,4,24], "classxpcc_1_1_pca8574.html#aa9f5f82b0302b3410920f8fc6d9b12d2":[1,5,4,4,16], "classxpcc_1_1_pca8574.html#aada76b4da52de631ad3dc3f35a8558ac":[1,5,4,4,1], "classxpcc_1_1_pca8574.html#ada28360fef197f85cf530603b6c2752e":[1,5,4,4,15], "classxpcc_1_1_pca8574.html#ae0f39eaaa80cb23d7367526aae8f186f":[1,5,4,4,21], "classxpcc_1_1_pca8574.html#ae13e3f94ccc719ae0e06755c303dc621":[1,5,4,4,2], "classxpcc_1_1_pca8574.html#af8e3c8f3f24ebd570b930581a8a87123":[1,5,4,4,9], "classxpcc_1_1_pca9535.html":[1,5,4,5], "classxpcc_1_1_pca9535.html#a0e943c81ceb32f1e4bec35fceaed16d1":[1,5,4,5,5], "classxpcc_1_1_pca9535.html#a1ed4f9571dd0c65e1e1a38cce05b7d17":[1,5,4,5,17], "classxpcc_1_1_pca9535.html#a274252daa55eef226a41e0406eb349c3":[1,5,4,5,25], "classxpcc_1_1_pca9535.html#a2b8a52d8329c09cf467572f7332c3525":[1,5,4,5,26], "classxpcc_1_1_pca9535.html#a2c1f54e2420c75d8cae8c68505468476":[1,5,4,5,6], "classxpcc_1_1_pca9535.html#a2f769b1b421925709a351ca84ccd763e":[1,5,4,5,1], "classxpcc_1_1_pca9535.html#a31fad4c165ba0be83c4e16c2ea3a957b":[1,5,4,5,14], "classxpcc_1_1_pca9535.html#a334d1ae6fcd9b67a37590d75324650bf":[1,5,4,5,19], "classxpcc_1_1_pca9535.html#a3526f9ce826259c356c14cf17ee4cd82":[1,5,4,5,20], "classxpcc_1_1_pca9535.html#a3a0d60e75f2606f22e1e51b0e2d5f006":[1,5,4,5,36], "classxpcc_1_1_pca9535.html#a3c943edbffd9068b047c60ea37d831c4":[1,5,4,5,4], "classxpcc_1_1_pca9535.html#a49552cd2c572fafbc3cf947889f8a288":[1,5,4,5,10], "classxpcc_1_1_pca9535.html#a4efc7e323cd6bb5988aeedbb5b6fc194":[1,5,4,5,34], "classxpcc_1_1_pca9535.html#a51d99e4430a40c4e6b3f07464a188180":[1,5,4,5,21], "classxpcc_1_1_pca9535.html#a5e1837020d540715556d31cecceb2bee":[1,5,4,5,13], "classxpcc_1_1_pca9535.html#a5f2b63be438a9d64834af3f240338e0a":[1,5,4,5,15], "classxpcc_1_1_pca9535.html#a69cf1e72e85a85c0adffdf8847e5b48b":[1,5,4,5,0], "classxpcc_1_1_pca9535.html#a6ad51b65966a90755fc0109d569e4874":[1,5,4,5,3], "classxpcc_1_1_pca9535.html#a6f44801d9f8a18110375d955f9790006":[1,5,4,5,7], "classxpcc_1_1_pca9535.html#a73e5be660d5e4e124a25e11a9bfb4f73":[1,5,4,5,24], "classxpcc_1_1_pca9535.html#a75d8cdedb189376d7f327a2b18de9c0a":[1,5,4,5,2], "classxpcc_1_1_pca9535.html#a760d674de82659d390754a29ec7ac838":[1,5,4,5,22], "classxpcc_1_1_pca9535.html#a783619fe79ddef5a66cc842249811a46":[1,5,4,5,32], "classxpcc_1_1_pca9535.html#a899ed1f4e2ca830e1f5d19348dd51352":[1,5,4,5,28], "classxpcc_1_1_pca9535.html#a984d811255bb73c896b06ed86b9b3f1f":[1,5,4,5,35], "classxpcc_1_1_pca9535.html#a9cd71b24deda01c81dc6a05a004847c6":[1,5,4,5,16], "classxpcc_1_1_pca9535.html#a9ec051b824c15afd435293c7d3ad9096":[1,5,4,5,31], "classxpcc_1_1_pca9535.html#aa108e7b2085fc4396edc5e2feb474d1e":[1,5,4,5,30], "classxpcc_1_1_pca9535.html#aa51bfa581d1b455d9aea80451e5edeab":[1,5,4,5,33], "classxpcc_1_1_pca9535.html#aa9eb284cb297ce177bd3bb0a23579599":[1,5,4,5,23], "classxpcc_1_1_pca9535.html#ac91abbaf07bf17197e9ff96907302540":[1,5,4,5,12], "classxpcc_1_1_pca9535.html#acd51a6ea42ecbc7dc18cd3e0579e2ab7":[1,5,4,5,9], "classxpcc_1_1_pca9535.html#ad37ff03af0a74d0b2c41dce6d6704396":[1,5,4,5,8], "classxpcc_1_1_pca9535.html#ad5149f41021b13e3d38b50c9adb78dd4":[1,5,4,5,29], "classxpcc_1_1_pca9535.html#aebb3a7ba593883dff1ee9f9865ca4ee6":[1,5,4,5,27], "classxpcc_1_1_pca9535.html#aee9aeb61a7cae32b2209d7c49f703d23":[1,5,4,5,11], "classxpcc_1_1_pca9535.html#aefda6ec632a5b691074eb17e1d58fafb":[1,5,4,5,18], "classxpcc_1_1_pca9685.html":[1,5,14,1], "classxpcc_1_1_pca9685.html#a13a240f38991c4f88aa3d7c722c9c597":[1,5,14,1,1], "classxpcc_1_1_pca9685.html#a2b0a4787639276888dbd628eaf0105d2":[1,5,14,1,2], "classxpcc_1_1_pca9685.html#a723212c0f1a461c47a918901624ceeb3":[1,5,14,1,0], "classxpcc_1_1_pca9685.html#aa275555c38a1d2224993793d33b7f035":[1,5,14,1,3], "classxpcc_1_1_peripheral.html":[2,0,3,210], "classxpcc_1_1_pid.html":[1,8,2,3], "classxpcc_1_1_pid.html#a01002e02163cabe5d5540cd7c0051b09":[1,8,2,3,2], "classxpcc_1_1_pid.html#a02dc1f6185871c70b2c97d3e2e72b2a7":[1,8,2,3,3], "classxpcc_1_1_pid.html#a24b30e20caa7f5b15ec70ded5f149f9e":[1,8,2,3,5], "classxpcc_1_1_pid.html#a24c314ebc19bec2e3599d5d8fb5092ea":[1,8,2,3,7], "classxpcc_1_1_pid.html#a32e8bfda7701a5cf921a6da172b17552":[1,8,2,3,6], "classxpcc_1_1_pid.html#a6d6fb641b46d65837817ed5aa6a5d71b":[1,8,2,3,1], "classxpcc_1_1_pid.html#a7e6337dab435ebd62e10f4f42eda347d":[1,8,2,3,8], "classxpcc_1_1_pid.html#a8a83d52516d5c66e8144c27d326d9d82":[1,8,2,3,4] }; <file_sep>/docs/api/structxpcc_1_1tipc_1_1_header.js var structxpcc_1_1tipc_1_1_header = [ [ "DOMAIN_ID_UNDEFINED", "structxpcc_1_1tipc_1_1_header.html#a67aa79f9eec3ed7357d650981c38f1e1a23c5d24a117117c2cf01ea4eac87942d", null ], [ "Header", "structxpcc_1_1tipc_1_1_header.html#ad46dac70927dda979efa123157301e7c", null ], [ "Header", "structxpcc_1_1tipc_1_1_header.html#a52cbd9ed5345ffe1d05847d6991fb39e", null ], [ "size", "structxpcc_1_1tipc_1_1_header.html#a0f0f6bc69dff6d2f86cc13a7ec6a380c", null ], [ "domainId", "structxpcc_1_1tipc_1_1_header.html#a6afe38ead813cfd4def6420c9ad279d0", null ] ];<file_sep>/docs/api/group__i2c.js var group__i2c = [ [ "I2c", "structxpcc_1_1_i2c.html", [ [ "ConfigurationHandler", "structxpcc_1_1_i2c.html#a1e2ee33e8c5cba6b043367ff032c2e59", null ], [ "DetachCause", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fe", [ [ "NormalStop", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fea391c51df2024fa2c540672812faaf879", null ], [ "ErrorCondition", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fea170dca6f1128c602c1ad7423e4e0f672", null ], [ "FailedToAttach", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fea57871f61ec9b5f775a524aada612d196", null ] ] ], [ "Operation", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8e", [ [ "Stop", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea11a755d598c0c417f9a36758c3da7481", null ], [ "Restart", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea51cfbcff36da74a9fc47f3a5140f99f2", null ], [ "Write", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea1129c0e4d43f2d121652a7302712cff6", null ], [ "Read", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea7a1a5f3e79fdc91edf2f5ead9d66abb4", null ] ] ], [ "OperationAfterStart", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345", [ [ "Stop", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345a11a755d598c0c417f9a36758c3da7481", null ], [ "Write", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345a1129c0e4d43f2d121652a7302712cff6", null ], [ "Read", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345a7a1a5f3e79fdc91edf2f5ead9d66abb4", null ] ] ], [ "OperationAfterWrite", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9", [ [ "Stop", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9a11a755d598c0c417f9a36758c3da7481", null ], [ "Restart", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9a51cfbcff36da74a9fc47f3a5140f99f2", null ], [ "Write", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9a1129c0e4d43f2d121652a7302712cff6", null ] ] ], [ "OperationAfterRead", "structxpcc_1_1_i2c.html#a43522b92da7496888a156e3499df194f", [ [ "Stop", "structxpcc_1_1_i2c.html#a43522b92da7496888a156e3499df194fa11a755d598c0c417f9a36758c3da7481", null ], [ "Restart", "structxpcc_1_1_i2c.html#a43522b92da7496888a156e3499df194fa51cfbcff36da74a9fc47f3a5140f99f2", null ] ] ], [ "TransactionState", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6", [ [ "Idle", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6ae599161956d626eda4cb0a5ffb85271c", null ], [ "Busy", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6ad8a942ef2b04672adfafef0ad817a407", null ], [ "Error", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6a902b0d55fddef6f8d651fe1035b7d4bd", null ] ] ] ] ], [ "I2cDevice", "classxpcc_1_1_i2c_device.html", [ [ "I2cDevice", "classxpcc_1_1_i2c_device.html#a09abce83fa61a572309c13e0c5266f5d", null ], [ "setAddress", "classxpcc_1_1_i2c_device.html#a47e4fd0871621f214b0d3771c3ec5ddc", null ], [ "attachConfigurationHandler", "classxpcc_1_1_i2c_device.html#a809b5250bf81a5830c6a8b4ef39ab888", null ], [ "ping", "classxpcc_1_1_i2c_device.html#a3ca64a70c91935d0f5d153c63ff87ca7", null ], [ "startWriteRead", "classxpcc_1_1_i2c_device.html#a0b13e9fcf825b7d0c88ccc4a59d19080", null ], [ "startWrite", "classxpcc_1_1_i2c_device.html#afdb549d00d958b757341ac5c762d44e8", null ], [ "startRead", "classxpcc_1_1_i2c_device.html#a006f0f238b7380b14a86cc59b9d7da29", null ], [ "startTransaction", "classxpcc_1_1_i2c_device.html#a472c22865063403b4c02d509d33a528f", null ], [ "startTransaction", "classxpcc_1_1_i2c_device.html#a3b4fb54ba42f60a0ec2d1ba6bbf5c6f5", null ], [ "isTransactionRunning", "classxpcc_1_1_i2c_device.html#a4c60e3fa5abb429f6efafb49b3f30841", null ], [ "wasTransactionSuccessful", "classxpcc_1_1_i2c_device.html#a1580e1dfed9a8747ae6a5799aee0facf", null ], [ "runTransaction", "classxpcc_1_1_i2c_device.html#a6959a124c81aa2fa3ba7a4b043db4702", null ], [ "transaction", "classxpcc_1_1_i2c_device.html#a2fa619bb91332a26686b8b7661fe47d3", null ] ] ], [ "I2cMaster", "classxpcc_1_1_i2c_master.html", [ [ "Error", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2e", [ [ "NoError", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ea70a47cae4eb221930f2663fd244369ea", null ], [ "SoftwareReset", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ead1d43f321d5a6d263a887e033e3e1145", null ], [ "AddressNack", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ea56f991230a68b28c915c9edf0a29e9eb", null ], [ "DataNack", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ea2cfa78cc4ecdfe41a0ab44e8d53bc602", null ], [ "ArbitrationLost", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ea2dd6ed6c891cbb02a2919b02931d31a4", null ], [ "BusCondition", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2eac61259eafa8417c3438d27e43dd087fb", null ], [ "BusBusy", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2eaa2575641a386e96d4981f9069a59dbfa", null ], [ "Unknown", "classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ea88183b946cc5f0e8c96b2e66e1c74a7e", null ] ] ], [ "Baudrate", "classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3d", [ [ "LowSpeed", "classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3dabbbd5c5d80c45e455bf55be94e991b7b", null ], [ "Standard", "classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3da55ddace7d840a8a278724743420f8e6a", null ], [ "Fast", "classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3da17fca5b9f276665e92b015b57febe4e0", null ], [ "FastPlus", "classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3daf2750e26561e514f6d955453c49626cf", null ], [ "High", "classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3da6672c21dfd6ee6faf8866b87342b9c82", null ] ] ] ] ], [ "I2cTransaction", "classxpcc_1_1_i2c_transaction.html", [ [ "Reading", "structxpcc_1_1_i2c_transaction_1_1_reading.html", [ [ "Reading", "structxpcc_1_1_i2c_transaction_1_1_reading.html#a533c90c6d320206e3c83cb64d739780e", null ], [ "buffer", "structxpcc_1_1_i2c_transaction_1_1_reading.html#a23eabcd18afc267e07bf35eb0a38f284", null ], [ "length", "structxpcc_1_1_i2c_transaction_1_1_reading.html#a242f1807d47620cd5ed8eaf8c9dcdddd", null ], [ "next", "structxpcc_1_1_i2c_transaction_1_1_reading.html#ac4ee8f93b536ec03b2a95cd568e83481", null ] ] ], [ "Starting", "structxpcc_1_1_i2c_transaction_1_1_starting.html", [ [ "Starting", "structxpcc_1_1_i2c_transaction_1_1_starting.html#a5f6ff356fdf897b9175333bde75fb474", null ], [ "address", "structxpcc_1_1_i2c_transaction_1_1_starting.html#a341e91ed00b16c729efc586ca91c93eb", null ], [ "next", "structxpcc_1_1_i2c_transaction_1_1_starting.html#a0d9dc6dfe4867c4c74de4d76e957c213", null ] ] ], [ "Writing", "structxpcc_1_1_i2c_transaction_1_1_writing.html", [ [ "Writing", "structxpcc_1_1_i2c_transaction_1_1_writing.html#a91a98ed32eaa91459c194f1a0d355b1a", null ], [ "buffer", "structxpcc_1_1_i2c_transaction_1_1_writing.html#afff0ae8b30c62b9bc414e6413b01b5f2", null ], [ "length", "structxpcc_1_1_i2c_transaction_1_1_writing.html#ae9cfb2906f10a2cd01321604dab7de35", null ], [ "next", "structxpcc_1_1_i2c_transaction_1_1_writing.html#ab88ca96e4551d2e0729b0a048ab03846", null ] ] ], [ "I2cTransaction", "classxpcc_1_1_i2c_transaction.html#a67f836bb353d09218bd2dede16ccafb9", null ], [ "setAddress", "classxpcc_1_1_i2c_transaction.html#a75afd89f80317613927157eff521f3cb", null ], [ "getState", "classxpcc_1_1_i2c_transaction.html#a386f7e0a805810a8111a62e4e57c229e", null ], [ "isBusy", "classxpcc_1_1_i2c_transaction.html#af39f49e27adc6cbcee967ce1c187afbe", null ], [ "configurePing", "classxpcc_1_1_i2c_transaction.html#a532854ec0f80eb0c8cc223f526d6f769", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_transaction.html#a76f3fa7846b315f234a43b28c62a54e5", null ], [ "configureWrite", "classxpcc_1_1_i2c_transaction.html#ad74f75bbc6b6ba4f3c4cd9648635b663", null ], [ "configureRead", "classxpcc_1_1_i2c_transaction.html#a592285870134ed9825ec5e825dc697d1", null ], [ "attaching", "classxpcc_1_1_i2c_transaction.html#a3100e67a72238989387a20ff2958ac8e", null ], [ "starting", "classxpcc_1_1_i2c_transaction.html#a5cf564f7137d4c2f57a2eb3c5899742d", null ], [ "writing", "classxpcc_1_1_i2c_transaction.html#a0504a062f919583246747c077fdcff01", null ], [ "reading", "classxpcc_1_1_i2c_transaction.html#aa1e4c2ea1c002fde4d9edcb177d0ff55", null ], [ "detaching", "classxpcc_1_1_i2c_transaction.html#a43ca5751c55b6a4a7c748dbaf64c40be", null ], [ "address", "classxpcc_1_1_i2c_transaction.html#a5c6800ddc76c72df9e2f234b40899894", null ], [ "state", "classxpcc_1_1_i2c_transaction.html#ab03c507c03f82f24979bb9eb785f442a", null ] ] ], [ "I2cWriteReadTransaction", "classxpcc_1_1_i2c_write_read_transaction.html", [ [ "I2cWriteReadTransaction", "classxpcc_1_1_i2c_write_read_transaction.html#ab3f62ee9419532f00030f2982e19acae", null ], [ "configurePing", "classxpcc_1_1_i2c_write_read_transaction.html#a25c93b4478ec79326268b780c3cef69e", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_write_read_transaction.html#af0913945a35675cb51b522ee2e44e480", null ], [ "configureWrite", "classxpcc_1_1_i2c_write_read_transaction.html#a2c22c06916b9744e82b66664d885d8c5", null ], [ "configureRead", "classxpcc_1_1_i2c_write_read_transaction.html#abb0262c229902e7891c1df01beac8fe8", null ], [ "starting", "classxpcc_1_1_i2c_write_read_transaction.html#a3a4f30320a8b692b007b58536fc502d4", null ], [ "writing", "classxpcc_1_1_i2c_write_read_transaction.html#a0d91dcb3e1fffb2353ca5616fb19cccb", null ], [ "reading", "classxpcc_1_1_i2c_write_read_transaction.html#aa94124d2db4cef832330659e0c75ac29", null ], [ "readSize", "classxpcc_1_1_i2c_write_read_transaction.html#af2effa198a9ae077b47dfa4f938b93f3", null ], [ "writeSize", "classxpcc_1_1_i2c_write_read_transaction.html#ae1e4a3c92f1ba7cdc9c397209b527a3c", null ], [ "readBuffer", "classxpcc_1_1_i2c_write_read_transaction.html#a0dfc4fee597b08b2c6981c36e80e898b", null ], [ "writeBuffer", "classxpcc_1_1_i2c_write_read_transaction.html#a7fa738a224df5afe8d8e0bad522e92d6", null ], [ "isReading", "classxpcc_1_1_i2c_write_read_transaction.html#a26f1adaca63c74078b4ea6b3a3b22ec6", null ] ] ], [ "I2cWriteTransaction", "classxpcc_1_1_i2c_write_transaction.html", [ [ "I2cWriteTransaction", "classxpcc_1_1_i2c_write_transaction.html#a85862b1392ec606070d7af6e3163e75c", null ], [ "configurePing", "classxpcc_1_1_i2c_write_transaction.html#a4f4fad7aae59837dc4d7be5d2ac951eb", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_write_transaction.html#acaea1e334a64697e8d1b80c43aa4cf30", null ], [ "configureWrite", "classxpcc_1_1_i2c_write_transaction.html#a513a8ef9dbad4fa7cf9d62656906d650", null ], [ "configureRead", "classxpcc_1_1_i2c_write_transaction.html#a70431bf50933f5839b5354e83a14147f", null ], [ "starting", "classxpcc_1_1_i2c_write_transaction.html#a3e57950536774e241ca96e94f16735a0", null ], [ "writing", "classxpcc_1_1_i2c_write_transaction.html#aee8e78b1cc67d58f49153c675b81c5cb", null ], [ "reading", "classxpcc_1_1_i2c_write_transaction.html#ab41e9dd3f0d10faaa836cdc922fc2cfe", null ], [ "size", "classxpcc_1_1_i2c_write_transaction.html#abdc4ecb12403a4f78038fbab7ee51a1d", null ], [ "buffer", "classxpcc_1_1_i2c_write_transaction.html#aabbc15813de4019dc42b7d4ea40f72e5", null ] ] ], [ "I2cReadTransaction", "classxpcc_1_1_i2c_read_transaction.html", [ [ "I2cReadTransaction", "classxpcc_1_1_i2c_read_transaction.html#ac5e0a1783cc2bd8fa78ed509a77532aa", null ], [ "configurePing", "classxpcc_1_1_i2c_read_transaction.html#a2f35d3755da096d82341db97afc1226d", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_read_transaction.html#a0a1771b472f859a6fd6fbb5591563efe", null ], [ "configureWrite", "classxpcc_1_1_i2c_read_transaction.html#ab2666bc0daaf025b9c1e357593fdf9b6", null ], [ "configureRead", "classxpcc_1_1_i2c_read_transaction.html#a5f7b9d64207541733686bbea04bdf0e9", null ], [ "starting", "classxpcc_1_1_i2c_read_transaction.html#a7312adeab9bd39c37d471f5e1f5ddd13", null ], [ "writing", "classxpcc_1_1_i2c_read_transaction.html#a6d2251720be59d717580e2248eaf92fe", null ], [ "reading", "classxpcc_1_1_i2c_read_transaction.html#ae0711ff497a0be391eb70b0042d9642a", null ], [ "size", "classxpcc_1_1_i2c_read_transaction.html#af2a0490c9e63045f83ba71e7f70305bc", null ], [ "buffer", "classxpcc_1_1_i2c_read_transaction.html#a173d662234917be77a3abfa61e4654b2", null ] ] ], [ "SoftwareI2cMaster", "classxpcc_1_1_software_i2c_master.html", null ] ];<file_sep>/docs/api/group__graphics.js var group__graphics = [ [ "BufferedGraphicDisplay", "classxpcc_1_1_buffered_graphic_display.html", [ [ "~BufferedGraphicDisplay", "classxpcc_1_1_buffered_graphic_display.html#a471c0ebc52c59887c46477098522f3c8", null ], [ "getWidth", "classxpcc_1_1_buffered_graphic_display.html#a3d140f5ed168e0f71c7fdaa07080dc26", null ], [ "getHeight", "classxpcc_1_1_buffered_graphic_display.html#a6e27b4cce968e65f0a8973d0eb1e28d7", null ], [ "clear", "classxpcc_1_1_buffered_graphic_display.html#a55729a9b5cd313886ca42ad29498c36c", null ], [ "drawImageRaw", "classxpcc_1_1_buffered_graphic_display.html#a2396ef36141759b2579558b20f6d17ab", null ], [ "drawHorizontalLine", "classxpcc_1_1_buffered_graphic_display.html#ae525b78a671d9bc318f605fa77ec7d58", null ], [ "setPixel", "classxpcc_1_1_buffered_graphic_display.html#abda3c8c8c264d01b494b65f93754dc4b", null ], [ "clearPixel", "classxpcc_1_1_buffered_graphic_display.html#a353598d6769984a4e4fb2fe57e46d458", null ], [ "getPixel", "classxpcc_1_1_buffered_graphic_display.html#a4d1934411448299a6d37e3e230aa7215", null ], [ "display_buffer", "classxpcc_1_1_buffered_graphic_display.html#abe2e54d8570e0b52d9782794408bb5a0", null ] ] ], [ "CharacterDisplay", "classxpcc_1_1_character_display.html", [ [ "Writer", "classxpcc_1_1_character_display_1_1_writer.html", [ [ "Writer", "classxpcc_1_1_character_display_1_1_writer.html#a46095de6897d013589dea346294e0fc3", null ], [ "write", "classxpcc_1_1_character_display_1_1_writer.html#aebea58e9cf37dfd59ba7b9845fddd8c6", null ], [ "flush", "classxpcc_1_1_character_display_1_1_writer.html#a4c02916bc4a8040b1ed8f227aa4e8cde", null ], [ "read", "classxpcc_1_1_character_display_1_1_writer.html#aee75fc32b674d8970d16714fcd2f64f3", null ] ] ], [ "Command", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0", [ [ "ClearDisplay", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a9a7b87e52c4767dbd6954c48782d738f", null ], [ "ResetCursor", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a1a82b1d70eea710a28dbba0209dbd879", null ], [ "IncrementCursor", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a1f16a2de041b2e2f8910bde411d90d95", null ], [ "DecrementCursor", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a22691142072c12a5f3f39726f34135e4", null ], [ "DisableDisplay", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a0cb0d40da01c2ae5cc2b7287052f6ef1", null ], [ "EnableDisplay", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a2ea75e17b3c34f52750a546476c7b192", null ], [ "DisableCursor", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0ab9e5e9d500575890e5f5e40e8223f71b", null ], [ "EnableCursor", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a99a0b8e0b0748b3c47dda118a3f4d4fa", null ], [ "DisableCursorBlink", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a566f39825525b02bb8205e9c21ce49ba", null ], [ "EnableCursorBlink", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0a35fd544613db4d2b17346ad0de30e1fe", null ], [ "ShiftCursorLeft", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0ae8d02d24476456a7160f1ecfc832f42d", null ], [ "ShiftCursorRight", "classxpcc_1_1_character_display.html#a0f39ee990503a252e38a2ded7b2febd0ac1f48ddc1265a19050d806f52f661a6b", null ] ] ], [ "CharacterDisplay", "classxpcc_1_1_character_display.html#ad1dae2ec85c742bda2fffc7e8206cc00", null ], [ "initialize", "classxpcc_1_1_character_display.html#ae1fbaf039f27b25cc707ffc9718460e9", null ], [ "write", "classxpcc_1_1_character_display.html#a6fa309ca48eab3029aa78b1b7ccb918b", null ], [ "writeRaw", "classxpcc_1_1_character_display.html#a547d0c7b21f4e68733da49da9756f423", null ], [ "execute", "classxpcc_1_1_character_display.html#a0276abbb90317c62fc428822bfc5cdcd", null ], [ "setCursor", "classxpcc_1_1_character_display.html#a226a741abd176f94ec1f38488e174948", null ], [ "clear", "classxpcc_1_1_character_display.html#a5bbefbc3408c7817c9fa2c4c88c9f80a", null ], [ "writer", "classxpcc_1_1_character_display.html#aa287ad296b902d33e8bcca9285b65a4f", null ], [ "lineWidth", "classxpcc_1_1_character_display.html#a594bdf678d3048565b9f1b553263bd17", null ], [ "lineCount", "classxpcc_1_1_character_display.html#a9ebbf448ed717dbc9f15f1f76b400fdc", null ], [ "column", "classxpcc_1_1_character_display.html#ad2d9211cd6ade790647e5fc55329cb2b", null ], [ "line", "classxpcc_1_1_character_display.html#a22478619ebb2df603c63c4ff894bbd14", null ] ] ], [ "GraphicDisplay", "classxpcc_1_1_graphic_display.html", [ [ "Writer", "classxpcc_1_1_graphic_display_1_1_writer.html", [ [ "Writer", "classxpcc_1_1_graphic_display_1_1_writer.html#ae459703edd121abb7293173ae160c57a", null ], [ "write", "classxpcc_1_1_graphic_display_1_1_writer.html#a70c09ba1e43cb7ee698a214d0aa4da38", null ], [ "flush", "classxpcc_1_1_graphic_display_1_1_writer.html#a0b4a81a06ef182a33e2bc0780b9962e0", null ], [ "read", "classxpcc_1_1_graphic_display_1_1_writer.html#a79d7bf17def1dd612c7a9fba7730d4cc", null ] ] ], [ "GraphicDisplay", "classxpcc_1_1_graphic_display.html#a8b0c8c5ffc9187b877efc95bb743a4df", null ], [ "~GraphicDisplay", "classxpcc_1_1_graphic_display.html#af2b8191843d6c4b18243306b5ea2c6ee", null ], [ "getWidth", "classxpcc_1_1_graphic_display.html#aaf37d1b5e9a5f4fffc1985becf2ddc53", null ], [ "getHeight", "classxpcc_1_1_graphic_display.html#aa2fb1241965b009f2cef0ff7b4d28206", null ], [ "clear", "classxpcc_1_1_graphic_display.html#a36162f3d9576f28e8003b19a09aca98c", null ], [ "update", "classxpcc_1_1_graphic_display.html#a8026e322b12e7afa2e5e0c5bfe514941", null ], [ "setColor", "classxpcc_1_1_graphic_display.html#a288a7b7dd5e33431eb506342f48f7d4e", null ], [ "getForegroundColor", "classxpcc_1_1_graphic_display.html#a2ff86e1c14b850f3758c5c53c00ca9ac", null ], [ "setBackgroundColor", "classxpcc_1_1_graphic_display.html#acd026faee2a53e4156527ec676b3c1d6", null ], [ "drawPixel", "classxpcc_1_1_graphic_display.html#a465e1f8a48a1c65fda623079c3270d02", null ], [ "drawPixel", "classxpcc_1_1_graphic_display.html#a1cba8dab7972492a6517946502d47382", null ], [ "drawLine", "classxpcc_1_1_graphic_display.html#a2e3898fd2582d9e3e14cc4f941b1b19c", null ], [ "drawLine", "classxpcc_1_1_graphic_display.html#acaefc7240a5c705b1b2c220d247a40e4", null ], [ "drawRectangle", "classxpcc_1_1_graphic_display.html#a603f91f8bd6396e9bd1bb76297478dd7", null ], [ "drawRectangle", "classxpcc_1_1_graphic_display.html#ae4862b93f979da7a79408c3dfe313b8c", null ], [ "drawRoundedRectangle", "classxpcc_1_1_graphic_display.html#a084a48fcb4f3feff132642bc135908e5", null ], [ "drawCircle", "classxpcc_1_1_graphic_display.html#aa53cc5dd6595156cf17acc5bf453f3b7", null ], [ "drawEllipse", "classxpcc_1_1_graphic_display.html#aa4aaba641edf8b57c4ef1fdce378762b", null ], [ "drawImage", "classxpcc_1_1_graphic_display.html#ac2d4a9e5884d800e198879a6ab3eab16", null ], [ "drawImageRaw", "classxpcc_1_1_graphic_display.html#a95f462ea9a24bedc4e3956e045818754", null ], [ "fillRectangle", "classxpcc_1_1_graphic_display.html#a1ddc1fc5f3c84f3ceac27e4dd5c21e62", null ], [ "fillRectangle", "classxpcc_1_1_graphic_display.html#a8d3ac8b3b9e547659f1dfd2d3f246c10", null ], [ "fillCircle", "classxpcc_1_1_graphic_display.html#a33b7e21083a231f634214cf0005674b1", null ], [ "setFont", "classxpcc_1_1_graphic_display.html#ad2399bd0b0cecce12fd1792d0a1e779e", null ], [ "setFont", "classxpcc_1_1_graphic_display.html#a0cde79f37d6e201c4d75e8d4407223d1", null ], [ "getFontHeight", "classxpcc_1_1_graphic_display.html#a146611ceb4b5d2aa64e657c56fce4bbe", null ], [ "getStringWidth", "classxpcc_1_1_graphic_display.html#a0085ce02669899ba1b81336e0ce2250c", null ], [ "setCursor", "classxpcc_1_1_graphic_display.html#ad301bae1251bce5b8a7ff3930c7fae54", null ], [ "setCursor", "classxpcc_1_1_graphic_display.html#ac64532dda1867da4d092f97840d70f45", null ], [ "setCursorX", "classxpcc_1_1_graphic_display.html#aab8bdb0535bb15c61eefa3621807ffe4", null ], [ "setCursorY", "classxpcc_1_1_graphic_display.html#a2bcc50d1d0fde8031a54fd3a2dd59273", null ], [ "getCursor", "classxpcc_1_1_graphic_display.html#a139865301cab0b7b2720953316483217", null ], [ "write", "classxpcc_1_1_graphic_display.html#abb0777c72eafcff4b3a6e2078c170182", null ], [ "drawCircle4", "classxpcc_1_1_graphic_display.html#aa1cfa980d81716b049208aec221c3ca5", null ], [ "drawHorizontalLine", "classxpcc_1_1_graphic_display.html#a20ddbbf4ac042977b0950fc8735de8d7", null ], [ "drawVerticalLine", "classxpcc_1_1_graphic_display.html#acd8c28125a5dce0450ffad7532f0c395", null ], [ "setPixel", "classxpcc_1_1_graphic_display.html#a424fcd9c033e0c1d4352ad4e4fc2c8ed", null ], [ "clearPixel", "classxpcc_1_1_graphic_display.html#a88af6be71366993d4367708c710b3413", null ], [ "getPixel", "classxpcc_1_1_graphic_display.html#a5f829d66551cfde98520cc98e324768a", null ], [ "VirtualGraphicDisplay", "classxpcc_1_1_graphic_display.html#a866bdba794c686162724960895c0c66f", null ], [ "writer", "classxpcc_1_1_graphic_display.html#ac05851329360834084f70e065c22fc04", null ], [ "draw", "classxpcc_1_1_graphic_display.html#a41d8810e166e5ce3c5d608bf8f2d3017", null ], [ "foregroundColor", "classxpcc_1_1_graphic_display.html#ac604b7c2ad6e94699f3a6eb004dbc335", null ], [ "backgroundColor", "classxpcc_1_1_graphic_display.html#a07dba8c0855e6234e11a7c8cb63d9b8d", null ], [ "font", "classxpcc_1_1_graphic_display.html#ac1713568b19395f086eacb645f5f1a0a", null ], [ "cursor", "classxpcc_1_1_graphic_display.html#a682cd5f666e4120d55c6be4f2a11e7c0", null ] ] ], [ "VirtualGraphicDisplay", "classxpcc_1_1_virtual_graphic_display.html", [ [ "VirtualGraphicDisplay", "classxpcc_1_1_virtual_graphic_display.html#a72231f42c990c9565e82b28678e6775c", null ], [ "setDisplay", "classxpcc_1_1_virtual_graphic_display.html#ad7db8f2b43af22c1978f32672f83c5c7", null ], [ "getWidth", "classxpcc_1_1_virtual_graphic_display.html#a8f3229a1865ee7d860cea7dd18a20796", null ], [ "getHeight", "classxpcc_1_1_virtual_graphic_display.html#aa6f83069371a5a8890034da69557d039", null ], [ "clear", "classxpcc_1_1_virtual_graphic_display.html#a714a7a67ea663bc424396642fa9dcd3d", null ], [ "update", "classxpcc_1_1_virtual_graphic_display.html#aecf7e5c7dab4adcf7aef9f342ba8aa13", null ], [ "setPixel", "classxpcc_1_1_virtual_graphic_display.html#a8596b2121f4d36a7cbb061d90a1447b2", null ], [ "clearPixel", "classxpcc_1_1_virtual_graphic_display.html#a39a651a420df8a92ba5663055346ef24", null ], [ "getPixel", "classxpcc_1_1_virtual_graphic_display.html#a2dc8a2dfdb7a7b841ed282b07a98b507", null ] ] ], [ "Fonts", "group__font.html", "group__font" ], [ "Images", "group__image.html", "group__image" ] ];<file_sep>/docs/api/structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01_t_01_4.js var structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01_t_01_4 = [ [ "exists", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01_t_01_4.html#a8cf60ba5d0a0f2e88d1a1b8ab8491965a0bb412ba7982843dc7a44b904c3a75e5", null ], [ "existsBothWays", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01_t_01_4.html#a8cf60ba5d0a0f2e88d1a1b8ab8491965ad90b2d21182d0e0dab1888ca0a66c14d", null ], [ "isSameType", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01_t_01_4.html#a8cf60ba5d0a0f2e88d1a1b8ab8491965afc49d53d39fcb440e62d95b3a127b749", null ] ];<file_sep>/docs/api/classxpcc_1_1_response_callback.js var classxpcc_1_1_response_callback = [ [ "Function", "classxpcc_1_1_response_callback.html#a0b7e7e6d9cffe0b122f56751b4a60865", null ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html#a4d16f35e54364a2bcc014e7af88c121d", null ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html#a34f0a1e2d26a29a35b4498e3127b4abe", null ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html#a56f79eb2533f0a9c741ebb3f43f3056b", null ], [ "isCallable", "classxpcc_1_1_response_callback.html#aec694ee5c7aede7229181eb52895e317", null ], [ "call", "classxpcc_1_1_response_callback.html#a314dcc04e697ad783e5eb296a992f3cc", null ], [ "component", "classxpcc_1_1_response_callback.html#acbd75a3b2fecbef8c9e211c5ae6fbbbc", null ], [ "function", "classxpcc_1_1_response_callback.html#a166429ecbae95a0fe188e09d85ee2001", null ] ];<file_sep>/docs/api/classxpcc_1_1filter_1_1_debounce.js var classxpcc_1_1filter_1_1_debounce = [ [ "Debounce", "classxpcc_1_1filter_1_1_debounce.html#a2d189eb7711e48fbc9aab3c8efc64a90", null ], [ "update", "classxpcc_1_1filter_1_1_debounce.html#ae38dce0e417ef273c27d083ece126a51", null ], [ "getValue", "classxpcc_1_1filter_1_1_debounce.html#a908ae23d3060e4cc0282f349123ec3e2", null ], [ "reset", "classxpcc_1_1filter_1_1_debounce.html#a636af4c40daff593e51b0d8112c6514c", null ] ];<file_sep>/docs/api/search/typedefs_6.js var searchData= [ ['lock',['Lock',['../classxpcc_1_1rtos_1_1_thread.html#a469d88e6ead0200286793207b5041d0f',1,'xpcc::rtos::Thread']]] ]; <file_sep>/docs/api/search/groups_1.js var searchData= [ ['accessor_20classes',['Accessor classes',['../group__accessor.html',1,'']]], ['analog_2dto_2ddigital_20converter',['Analog-to-Digital Converter',['../group__adc.html',1,'']]], ['allocator',['Allocator',['../group__allocator.html',1,'']]], ['asynchronous_20multi_2dnode_20bus_20_28amnb_29',['Asynchronous Multi-Node Bus (AMNB)',['../group__amnb.html',1,'']]], ['animators',['Animators',['../group__animation.html',1,'']]], ['architecture',['Architecture',['../group__architecture.html',1,'']]], ['arithmetic_20traits',['Arithmetic Traits',['../group__arithmetic__trais.html',1,'']]], ['assertions',['Assertions',['../group__assert.html',1,'']]], ['atomic_20operations_20and_20container',['Atomic operations and container',['../group__atomic.html',1,'']]], ['analog_2fdigital_20converters',['Analog/Digital Converters',['../group__driver__adc.html',1,'']]], ['architecture_20interfaces',['Architecture Interfaces',['../group__interface.html',1,'']]], ['adc',['ADC',['../group__stm32f407vg__adc.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1allocator_1_1_dynamic.js var classxpcc_1_1allocator_1_1_dynamic = [ [ "rebind", "classxpcc_1_1allocator_1_1_dynamic.html#structxpcc_1_1allocator_1_1_dynamic_1_1rebind", [ [ "other", "classxpcc_1_1allocator_1_1_dynamic.html#a5a6caffc206b25aea12c0ce4b039048a", null ] ] ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html#ab87ce8c11041d2cefffbe3115795337f", null ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html#a308696d41335f1a7a5d6a9b5f764ab23", null ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html#a7d04384ff750678c567e21ce29edfe4d", null ], [ "allocate", "classxpcc_1_1allocator_1_1_dynamic.html#ad336ce5d65493b43d06cacea90622afa", null ], [ "deallocate", "classxpcc_1_1allocator_1_1_dynamic.html#a265acd75638f9a30d48aa09b6373a94f", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_uart_spi_master3.js var classxpcc_1_1stm32_1_1_uart_spi_master3 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7a", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1amnb_1_1_node.js var classxpcc_1_1amnb_1_1_node = [ [ "QueryStatus", "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333", [ [ "IN_PROGRESS", "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333aff3c3f218dd95c6db43bae2782049e3e", null ], [ "SUCCESS", "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333a76ef9a2ebce1353ffb106b73c53fb751", null ], [ "ERROR_RESPONSE", "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333a49e6655539e557083dca0c46cea0284f", null ], [ "ERROR_TIMEOUT", "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333afa3db10471a2c95094c584b2775023e0", null ], [ "ERROR_PAYLOAD", "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333a8fc443dda8e11f6616d2e849df672fb0", null ] ] ], [ "Node", "classxpcc_1_1amnb_1_1_node.html#ae936cf7987bea962772d3e73e8881eb8", null ], [ "Node", "classxpcc_1_1amnb_1_1_node.html#abfd5792cb23b8986d605bb29060f1438", null ], [ "Node", "classxpcc_1_1amnb_1_1_node.html#aa1909d5d561d55216dbd00420f9a7096", null ], [ "query", "classxpcc_1_1amnb_1_1_node.html#ad345c91a18be6e7f5e00aec211c525b9", null ], [ "query", "classxpcc_1_1amnb_1_1_node.html#af196220f90cbc3bb31d64565789ea112", null ], [ "query", "classxpcc_1_1amnb_1_1_node.html#ae55496ee36f53fb7c4fedde5febf80b0", null ], [ "broadcast", "classxpcc_1_1amnb_1_1_node.html#a57e8841891b14af9210d0e01012fe8de", null ], [ "broadcast", "classxpcc_1_1amnb_1_1_node.html#ac76d10594603b70104f9f2d3895acede", null ], [ "broadcast", "classxpcc_1_1amnb_1_1_node.html#af3e6acf729d401af8ecb294c99b4bc9d", null ], [ "isQueryCompleted", "classxpcc_1_1amnb_1_1_node.html#afb84bff683eecab64d0815aba3f7493d", null ], [ "isSuccess", "classxpcc_1_1amnb_1_1_node.html#a2eb086eba942e3f09adaf007b4c7e939", null ], [ "getErrorCode", "classxpcc_1_1amnb_1_1_node.html#a6c4b0a4312b74ac998653af01c9ce660", null ], [ "getResponse", "classxpcc_1_1amnb_1_1_node.html#ab699e712b4e53c7ea952235e553c517e", null ], [ "getResponse", "classxpcc_1_1amnb_1_1_node.html#a6803b4d0e9a3cb54c81bb9fe93a131c8", null ], [ "update", "classxpcc_1_1amnb_1_1_node.html#a11cd638d7765551179ec48b1d1196c0b", null ], [ "send", "classxpcc_1_1amnb_1_1_node.html#a71cff7e507bc6b2bee1f18b738786d58", null ], [ "checkErrorHandlers", "classxpcc_1_1amnb_1_1_node.html#af20733ed4e8f0e68bc8fd6e884efda61", null ], [ "ownAddress", "classxpcc_1_1amnb_1_1_node.html#a74b29ff33be04abef401a36e3525874f", null ], [ "actionList", "classxpcc_1_1amnb_1_1_node.html#a936a5bbb54c627279052065c6e5c8f3a", null ], [ "actionCount", "classxpcc_1_1amnb_1_1_node.html#accb9e2c2b4b29593ae8fd88ae804ad23", null ], [ "listenList", "classxpcc_1_1amnb_1_1_node.html#a42ae6d09f8ef366975b461da590dba0b", null ], [ "listenCount", "classxpcc_1_1amnb_1_1_node.html#af1c6e47cacbe13d05e496855d6a90b46", null ], [ "errorHandlerList", "classxpcc_1_1amnb_1_1_node.html#a22b2afdc8bed2435aa60077e293ff07b", null ], [ "errorHandlerCount", "classxpcc_1_1amnb_1_1_node.html#aa442d7b79e8b93f8559f1f966dbb2e3c", null ], [ "currentCommand", "classxpcc_1_1amnb_1_1_node.html#abcf6746d0ca765b9864f4c8f92b28989", null ], [ "response", "classxpcc_1_1amnb_1_1_node.html#a5474f5caa00e518c905b866029646bee", null ], [ "queryStatus", "classxpcc_1_1amnb_1_1_node.html#ae48e8bbabdf664ec785d641bb2f27066", null ], [ "expectedAddress", "classxpcc_1_1amnb_1_1_node.html#a11155ee0be37d9e09798c16c06df3114", null ], [ "expectedResponseLength", "classxpcc_1_1amnb_1_1_node.html#a0477269104ecf8130f4f454b40c04895", null ], [ "timer", "classxpcc_1_1amnb_1_1_node.html#a049f5df8acd29368b764b91bee6adae3", null ] ];<file_sep>/docs/api/classxpcc_1_1_action_result_3_01void_01_4.js var classxpcc_1_1_action_result_3_01void_01_4 = [ [ "ActionResult", "classxpcc_1_1_action_result_3_01void_01_4.html#a32b9b8937e492ed7035fc217804dcf72", null ], [ "ActionResult", "classxpcc_1_1_action_result_3_01void_01_4.html#a8a7f7ac3631f0895f84ac5c845020ee3", null ], [ "response", "classxpcc_1_1_action_result_3_01void_01_4.html#a1b08d3ccb841323091db18c957a4f78a", null ] ];<file_sep>/docs/api/classxpcc_1_1log_1_1_prefix.js var classxpcc_1_1log_1_1_prefix = [ [ "Prefix", "classxpcc_1_1log_1_1_prefix.html#adcee1012a689c4db0a40ebb54eedd323", null ], [ "Prefix", "classxpcc_1_1log_1_1_prefix.html#a5a2fab3bb153f649cdc20476421f3790", null ], [ "write", "classxpcc_1_1log_1_1_prefix.html#aef98c3f1bf176b022bc9aecc36cbde47", null ], [ "write", "classxpcc_1_1log_1_1_prefix.html#a60c4bce1a04e054668480feeae7db46e", null ], [ "flush", "classxpcc_1_1log_1_1_prefix.html#a4625db244244de5872fbc08b75183fcf", null ] ];<file_sep>/docs/api/classxpcc_1_1_linked_list_1_1iterator.js var classxpcc_1_1_linked_list_1_1iterator = [ [ "iterator", "classxpcc_1_1_linked_list_1_1iterator.html#ab8bb7f268a6d0b7cdf09b86df2130500", null ], [ "iterator", "classxpcc_1_1_linked_list_1_1iterator.html#a349b2812c03fc1e485b95003f2e59277", null ], [ "operator=", "classxpcc_1_1_linked_list_1_1iterator.html#a2b280b98751d0f72a747e701d2337a94", null ], [ "operator++", "classxpcc_1_1_linked_list_1_1iterator.html#a9f5db15218bd4ee7a52803664a22a48a", null ], [ "operator==", "classxpcc_1_1_linked_list_1_1iterator.html#a1757fa18c9e1597126d65fbe6566e225", null ], [ "operator!=", "classxpcc_1_1_linked_list_1_1iterator.html#a670bd2f494a95501ba60b4e0424dc702", null ], [ "operator*", "classxpcc_1_1_linked_list_1_1iterator.html#a56201fb7e5fe71e8c64cd260d315f275", null ], [ "operator->", "classxpcc_1_1_linked_list_1_1iterator.html#a192748345412791d20e9f5dc5ed688f6", null ], [ "LinkedList", "classxpcc_1_1_linked_list_1_1iterator.html#af71fad9f4990e232af55c73aeddb3823", null ], [ "const_iterator", "classxpcc_1_1_linked_list_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f", null ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_checkbox_widget.js var classxpcc_1_1gui_1_1_checkbox_widget = [ [ "CheckboxWidget", "classxpcc_1_1gui_1_1_checkbox_widget.html#ae76d3ee68616815649ce3b11e8dcaf8f", null ], [ "render", "classxpcc_1_1gui_1_1_checkbox_widget.html#a94da4fec9a09eeaf6ea94be5789c9653", null ], [ "getState", "classxpcc_1_1gui_1_1_checkbox_widget.html#a0518963d892dbd8f0b9d37ea791bb0ea", null ], [ "setState", "classxpcc_1_1gui_1_1_checkbox_widget.html#a0899e18a243d557b3e1e32ca584ecfbb", null ] ];<file_sep>/docs/api/classxpcc_1_1attiny_1_1_gpio_port.js var classxpcc_1_1attiny_1_1_gpio_port = [ [ "PortType", "classxpcc_1_1attiny_1_1_gpio_port.html#a07f135746bdfc0fa6deaf9c107b98710", null ] ];<file_sep>/docs/api/search/typedefs_0.js var searchData= [ ['a0',['A0',['../classxpcc_1_1_mcp23x17.html#a61fe458a657e793a4deca98e7911d97c',1,'xpcc::Mcp23x17']]], ['a1',['A1',['../classxpcc_1_1_mcp23x17.html#a40045b541aa56f58e6a8a615c8f00b10',1,'xpcc::Mcp23x17']]], ['a2',['A2',['../classxpcc_1_1_mcp23x17.html#a278bf672d8684a509527328d2207480e',1,'xpcc::Mcp23x17']]], ['a3',['A3',['../classxpcc_1_1_mcp23x17.html#a5a07133503ec590dd6013f5683905be0',1,'xpcc::Mcp23x17']]], ['a4',['A4',['../classxpcc_1_1_mcp23x17.html#a21626559ca81c7d76caa89e88a03673c',1,'xpcc::Mcp23x17']]], ['a5',['A5',['../classxpcc_1_1_mcp23x17.html#a5b178aba539b4b5f9a879858132b62a4',1,'xpcc::Mcp23x17']]], ['a6',['A6',['../classxpcc_1_1_mcp23x17.html#aa7d9dda870a54034c256f826b9efd7de',1,'xpcc::Mcp23x17']]], ['a7',['A7',['../classxpcc_1_1_mcp23x17.html#a0abc59a04214818da58b53fb6cafc5b3',1,'xpcc::Mcp23x17']]], ['assertionhandler',['AssertionHandler',['../group__assert.html#ga988cd3b4cd071fe274541cc7c1254aa0',1,'xpcc']]] ]; <file_sep>/docs/api/structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e_3_01true_01_4.js var structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e_3_01true_01_4 = [ [ "value", "structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e_3_01true_01_4.html#a09f892b9f1e0433465f63ed2445d2c97af5e36f8619fd7812a280313a665a3bfa", null ] ];<file_sep>/docs/api/classxpcc_1_1_virtual_graphic_display.js var classxpcc_1_1_virtual_graphic_display = [ [ "VirtualGraphicDisplay", "classxpcc_1_1_virtual_graphic_display.html#a72231f42c990c9565e82b28678e6775c", null ], [ "setDisplay", "classxpcc_1_1_virtual_graphic_display.html#ad7db8f2b43af22c1978f32672f83c5c7", null ], [ "getWidth", "classxpcc_1_1_virtual_graphic_display.html#a8f3229a1865ee7d860cea7dd18a20796", null ], [ "getHeight", "classxpcc_1_1_virtual_graphic_display.html#aa6f83069371a5a8890034da69557d039", null ], [ "clear", "classxpcc_1_1_virtual_graphic_display.html#a714a7a67ea663bc424396642fa9dcd3d", null ], [ "update", "classxpcc_1_1_virtual_graphic_display.html#aecf7e5c7dab4adcf7aef9f342ba8aa13", null ], [ "setPixel", "classxpcc_1_1_virtual_graphic_display.html#a8596b2121f4d36a7cbb061d90a1447b2", null ], [ "clearPixel", "classxpcc_1_1_virtual_graphic_display.html#a39a651a420df8a92ba5663055346ef24", null ], [ "getPixel", "classxpcc_1_1_virtual_graphic_display.html#a2dc8a2dfdb7a7b841ed282b07a98b507", null ] ];<file_sep>/docs/api/classxpcc_1_1_i_o_device.js var classxpcc_1_1_i_o_device = [ [ "IODevice", "classxpcc_1_1_i_o_device.html#a7d8080e515ff312351b3884de5600e03", null ], [ "~IODevice", "classxpcc_1_1_i_o_device.html#aa8db857c3e7116bb983b420483e163c1", null ], [ "write", "classxpcc_1_1_i_o_device.html#a1cf77f9920038b7f68d95d8c7e1d34fb", null ], [ "write", "classxpcc_1_1_i_o_device.html#ada9a1c497ff96f02997f389b365ac3a5", null ], [ "flush", "classxpcc_1_1_i_o_device.html#a970503a5a58d4189c9949f026ce4c892", null ], [ "read", "classxpcc_1_1_i_o_device.html#a43544a0c576c5a8f3825080b3222f551", null ] ];<file_sep>/docs/api/group__processing.js var group__processing = [ [ "Scheduler", "classxpcc_1_1_scheduler.html", [ [ "Task", "classxpcc_1_1_scheduler_1_1_task.html", [ [ "run", "classxpcc_1_1_scheduler_1_1_task.html#ae7b1822261e1eb25baa06045d7de55cc", null ] ] ], [ "Priority", "classxpcc_1_1_scheduler.html#ad87181bd99f0b09ff3a3e3fe29f4f35b", null ], [ "Scheduler", "classxpcc_1_1_scheduler.html#ab0d844b0ec238ebf83875d450a772d8f", null ], [ "scheduleTask", "classxpcc_1_1_scheduler.html#ab7f41ccb1d219cc4cfeb7c417e057873", null ], [ "schedule", "classxpcc_1_1_scheduler.html#a7f068894aec0ac632ee58a9551d175ce", null ], [ "scheduleInterupt", "classxpcc_1_1_scheduler.html#a8e57f2e7be649cd78da0003b1411b70d", null ] ] ], [ "Task", "classxpcc_1_1_task.html", [ [ "~Task", "classxpcc_1_1_task.html#a52dab0d6749729fb7220b2ff92558282", null ], [ "start", "classxpcc_1_1_task.html#ad16aba6a103d3120fa432936f7d85940", null ], [ "isFinished", "classxpcc_1_1_task.html#a6084a0f4d6307771136f9b66953f3773", null ], [ "update", "classxpcc_1_1_task.html#a26bf847d086d18efb62a1b1980622e4e", null ] ] ], [ "Protothreads", "group__protothread.html", "group__protothread" ], [ "Resumables", "group__resumable.html", "group__resumable" ], [ "FreeRTOS", "group__freertos.html", "group__freertos" ], [ "Software Timers", "group__software__timer.html", "group__software__timer" ] ];<file_sep>/docs/api/search/classes_9.js var searchData= [ ['keyframe',['KeyFrame',['../structxpcc_1_1ui_1_1_key_frame.html',1,'xpcc::ui']]], ['keyframe_3c_20t_20_3e',['KeyFrame&lt; T &gt;',['../structxpcc_1_1ui_1_1_key_frame.html',1,'xpcc::ui']]], ['keyframeanimation',['KeyFrameAnimation',['../classxpcc_1_1ui_1_1_key_frame_animation.html',1,'xpcc::ui']]], ['keyframeanimation_3c_20t_20_3e',['KeyFrameAnimation&lt; T &gt;',['../classxpcc_1_1ui_1_1_key_frame_animation.html',1,'xpcc::ui']]], ['ks0108',['Ks0108',['../classxpcc_1_1_ks0108.html',1,'xpcc']]] ]; <file_sep>/docs/api/classxpcc_1_1_lm75.js var classxpcc_1_1_lm75 = [ [ "Lm75", "classxpcc_1_1_lm75.html#acf25af478db3ab766573699911fbb1fd", null ], [ "configureAlertMode", "classxpcc_1_1_lm75.html#a3c24f02a644e2a03d7d6eff3a90b21b6", null ], [ "setUpperLimit", "classxpcc_1_1_lm75.html#a333e54ed5e6023d9deaec92f5de5e73f", null ], [ "setLowerLimit", "classxpcc_1_1_lm75.html#a32dea4d533a35a58f1b274969222817c", null ], [ "readTemperature", "classxpcc_1_1_lm75.html#a400708890dc02fca931fca13a7fae64f", null ], [ "getData", "classxpcc_1_1_lm75.html#a40be0f5678d7238c584d971becf7ec8b", null ], [ "Tmp102", "classxpcc_1_1_lm75.html#a997cb64bdb2014224d7b50f1fb6ec1d5", null ], [ "Tmp175", "classxpcc_1_1_lm75.html#ad3765b93aa0ec6990ab8811ebe4902f0", null ] ];<file_sep>/docs/api/navtreeindex9.js var NAVTREEINDEX9 = { "classxpcc_1_1_vl53l0.html#a393c549390eb6045d1a8d66072fa554c":[1,5,11,0,4], "classxpcc_1_1_vl53l0.html#a493d95fb46e4743d48654cc29cdf1436":[1,5,11,0,0], "classxpcc_1_1_vl53l0.html#a6314ddf84c8d8f62c833f2adc0e43c2a":[1,5,11,0,3], "classxpcc_1_1_vl53l0.html#a6aed3c7b2a489c440beb381a8219aefe":[1,5,11,0,2], "classxpcc_1_1_vl53l0.html#a7690693dc3320b0aee5424db103a8fa1":[1,5,11,0,1], "classxpcc_1_1_vl53l0.html#aa3b72e103f5459a22c9232229b17096b":[1,5,11,0,6], "classxpcc_1_1_vl53l0.html#abc6deef8aff2cfebb3c5d35d2b26bb61":[1,5,11,0,9], "classxpcc_1_1_vl53l0.html#ad77eba332a9ba2f102236f2c989cd634":[1,5,11,0,7], "classxpcc_1_1_vl6180.html":[1,5,11,1], "classxpcc_1_1_vl6180.html#a118c595804903888754f24575c2f8b39":[1,5,11,1,2], "classxpcc_1_1_vl6180.html#a2b77bcdf2f878325cf7fb4f543f37b6c":[1,5,11,1,5], "classxpcc_1_1_vl6180.html#a3c9a55742fe6b19676397ebb367da379":[1,5,11,1,10], "classxpcc_1_1_vl6180.html#a50252a5cfdda3f6d5fe703a8b5f3b3d7":[1,5,11,1,0], "classxpcc_1_1_vl6180.html#a520a59a2d7d7d4e8332f0afd15309bf3":[1,5,11,1,3], "classxpcc_1_1_vl6180.html#a5d7a734a6b7d5c8a4da7857be7e1a052":[1,5,11,1,7], "classxpcc_1_1_vl6180.html#a6cbaa740d7046de158364d6a3e9575c6":[1,5,11,1,6], "classxpcc_1_1_vl6180.html#a71b56e4b8bb3059ef74a4ece8e766d9e":[1,5,11,1,8], "classxpcc_1_1_vl6180.html#a7a5daebdce51bd6f2a3e3e27dcc4b960":[1,5,11,1,9], "classxpcc_1_1_vl6180.html#a7c8597829fc80232846aa75553c27cf3":[1,5,11,1,1], "classxpcc_1_1_vl6180.html#a86e8c0d2eec0c00984017e093a092c46":[1,5,11,1,13], "classxpcc_1_1_vl6180.html#a8e1f25d95eefd1583885118fd83f8206":[1,5,11,1,4], "classxpcc_1_1_vl6180.html#ac377545c8032f1480acf0401e8955927":[1,5,11,1,11], "classxpcc_1_1_vl6180.html#ac656029ca190e42b844fdaf91b0ab17b":[1,5,11,1,12], "classxpcc_1_1_xilinx_spartan3.html":[1,5,8,4], "classxpcc_1_1_xilinx_spartan6_parallel.html":[1,5,8,5], "classxpcc_1_1_zero_m_q_connector.html":[1,2,4,10,3], "classxpcc_1_1_zero_m_q_connector.html#a4956a3c202012af87365cf028abf9fde":[1,2,4,10,3,7], "classxpcc_1_1_zero_m_q_connector.html#a69b6998df64c439730439e90eb6e373f":[1,2,4,10,3,4], "classxpcc_1_1_zero_m_q_connector.html#a7353598b7a2ec64beae5125cfaa4e122":[1,2,4,10,3,3], "classxpcc_1_1_zero_m_q_connector.html#a8677e124ff8fbeeeb74d995b226527d4":[1,2,4,10,3,10], "classxpcc_1_1_zero_m_q_connector.html#a937b3218e2a8ffa8e6c748d2b84d131c":[1,2,4,10,3,9], "classxpcc_1_1_zero_m_q_connector.html#a93f7e85aef9340361f3c9cda8fd3977d":[1,2,4,10,3,8], "classxpcc_1_1_zero_m_q_connector.html#a967551aa0f8d845f111cb42473563c62":[1,2,4,10,3,11], "classxpcc_1_1_zero_m_q_connector.html#a9dd08bd8a48e537bea471862fc1c811f":[1,2,4,10,3,2], "classxpcc_1_1_zero_m_q_connector.html#aa5731d201c5611e1333e8aa289dd3793":[1,2,4,10,3,6], "classxpcc_1_1_zero_m_q_connector.html#ab5c0cf01d64e35ed3f0d8cf4e08a01c6":[1,2,4,10,3,5], "classxpcc_1_1_zero_m_q_connector.html#ad5234fe1fee59e5fb75e3f1e611b327d":[1,2,4,10,3,0], "classxpcc_1_1_zero_m_q_connector.html#ad8342473c74376c8df9deb65c6f26ee8":[1,2,4,10,3,1], "classxpcc_1_1_zero_m_q_connector_base.html":[2,0,3,290], "classxpcc_1_1_zero_m_q_connector_base.html#ae58a11e9ba6204918bc0312f34723c05":[2,0,3,290,0], "classxpcc_1_1_zero_m_q_connector_base.html#ae58a11e9ba6204918bc0312f34723c05a4c5754922d2133644c9dc2fb14e1164d":[2,0,3,290,0,1], "classxpcc_1_1_zero_m_q_connector_base.html#ae58a11e9ba6204918bc0312f34723c05aae33bb35eee3fb88873a98d2c645c761":[2,0,3,290,0,0], "classxpcc_1_1_zero_m_q_reader.html":[1,2,4,10,4], "classxpcc_1_1_zero_m_q_reader.html#a0208ced3d7d6e0832b87280116001824":[1,2,4,10,4,7], "classxpcc_1_1_zero_m_q_reader.html#a492cfe28c37b6b55f5e1fa6df78afd16":[1,2,4,10,4,2], "classxpcc_1_1_zero_m_q_reader.html#a7567d275133cb0b39dd016988bc160b5":[1,2,4,10,4,3], "classxpcc_1_1_zero_m_q_reader.html#a76f99d7fd74eb28828ec1484a174243e":[1,2,4,10,4,5], "classxpcc_1_1_zero_m_q_reader.html#a7ea837cc9c87d1d4fb02435f9fd09d01":[1,2,4,10,4,9], "classxpcc_1_1_zero_m_q_reader.html#a91f5a0d223bf5fd79a0e0eff27bf645d":[1,2,4,10,4,4], "classxpcc_1_1_zero_m_q_reader.html#ac911c0df669ad316d5689e1804eb5f08":[1,2,4,10,4,1], "classxpcc_1_1_zero_m_q_reader.html#acd64f824345c7ce22dc69d3b9f130627":[1,2,4,10,4,8], "classxpcc_1_1_zero_m_q_reader.html#af37c7fb70ad6609dc88532e906e4d2ae":[1,2,4,10,4,6], "classxpcc_1_1accessor_1_1_flash.html":[1,1,1,0], "classxpcc_1_1accessor_1_1_flash.html#a0461119ccb0f03f87b8badce22a6f7d3":[1,1,1,0,4], "classxpcc_1_1accessor_1_1_flash.html#a1813231f42ee8dba205efd74ea363eab":[1,1,1,0,5], "classxpcc_1_1accessor_1_1_flash.html#a22b9e5c2d5e3dc273c27075b00a60343":[1,1,1,0,10], "classxpcc_1_1accessor_1_1_flash.html#a302f88ac6457061de711ec981a6a6566":[1,1,1,0,1], "classxpcc_1_1accessor_1_1_flash.html#a37192c8215618adadd21751020882eac":[1,1,1,0,6], "classxpcc_1_1accessor_1_1_flash.html#a42384253ab8b1b455ce018721ca9be45":[1,1,1,0,12], "classxpcc_1_1accessor_1_1_flash.html#a4b6c3231ae556e97f0f94e1e7383e6e3":[1,1,1,0,11], "classxpcc_1_1accessor_1_1_flash.html#a71ac2520b5bf2760adeaf119be6a05ed":[1,1,1,0,3], "classxpcc_1_1accessor_1_1_flash.html#ac11c2c9049d65be443f4fc078c019233":[1,1,1,0,2], "classxpcc_1_1accessor_1_1_flash.html#ac9ea092c730bb96c218ceecc7d618803":[1,1,1,0,9], "classxpcc_1_1accessor_1_1_flash.html#acd3e355730792c871f7873d4ff93cd17":[1,1,1,0,7], "classxpcc_1_1accessor_1_1_flash.html#aef4c0b8b68e1b6ae86e59a419cca3fd4":[1,1,1,0,8], "classxpcc_1_1accessor_1_1_flash.html#af32bffbc19e3f29d03812f4abb84134f":[1,1,1,0,0], "classxpcc_1_1accessor_1_1_ram.html":[1,1,1,1], "classxpcc_1_1accessor_1_1_ram.html#a4f762a1cdd31d96a1a1c9fe132e1d75a":[1,1,1,1,3], "classxpcc_1_1accessor_1_1_ram.html#a5837bf7c7729b953a4f624b033df8dd5":[1,1,1,1,0], "classxpcc_1_1accessor_1_1_ram.html#a71524ddc621e85c4c9d67bc99907af3f":[1,1,1,1,6], "classxpcc_1_1accessor_1_1_ram.html#a73087d18770f0ae8c2fffb25aa979aa8":[1,1,1,1,4], "classxpcc_1_1accessor_1_1_ram.html#a7cfc5c18ebf41f17e2041ede4696309d":[1,1,1,1,7], "classxpcc_1_1accessor_1_1_ram.html#a8337234da98abf11955e273a1a340b5e":[1,1,1,1,2], "classxpcc_1_1accessor_1_1_ram.html#aa5897c9f7306603d974588af1d20113c":[1,1,1,1,5], "classxpcc_1_1accessor_1_1_ram.html#aa98110371ec76487e9127cd18454f23f":[1,1,1,1,9], "classxpcc_1_1accessor_1_1_ram.html#aad1a2dc3a0b8d717d218165eaeb6c4a2":[1,1,1,1,8], "classxpcc_1_1accessor_1_1_ram.html#ad0afa291abfedefc6591f1fade6f7e76":[1,1,1,1,1], "classxpcc_1_1accessor_1_1_ram.html#af5069316e88b52356f5ddadf61ad40b3":[1,1,1,1,10], "classxpcc_1_1allocator_1_1_allocator_base.html":[2,0,3,2,0], "classxpcc_1_1allocator_1_1_allocator_base.html#a20fcb136e216797227d9b32e07cc6c4c":[2,0,3,2,0,0], "classxpcc_1_1allocator_1_1_block.html":[1,11,0,0], "classxpcc_1_1allocator_1_1_block.html#a26447c559d96d9ae5fd5842171b62a22":[1,11,0,0,3], "classxpcc_1_1allocator_1_1_block.html#a2c8ce105225973a9a66d9c6b921ce7e0":[1,11,0,0,0,0], "classxpcc_1_1allocator_1_1_block.html#a4adbb2e3d7fd6765c6debac177757c07":[1,11,0,0,5], "classxpcc_1_1allocator_1_1_block.html#a5c9aeedb12b87696b4bc6fed071a6e49":[1,11,0,0,4], "classxpcc_1_1allocator_1_1_block.html#a6c82b10d9e18a0b80b01154b657513c5":[1,11,0,0,1], "classxpcc_1_1allocator_1_1_block.html#a7a7405aa33260fe500a0942f64c73ce4":[1,11,0,0,2], "classxpcc_1_1allocator_1_1_block.html#structxpcc_1_1allocator_1_1_block_1_1rebind":[1,11,0,0,0], "classxpcc_1_1allocator_1_1_dynamic.html":[1,11,0,1], "classxpcc_1_1allocator_1_1_dynamic.html#a265acd75638f9a30d48aa09b6373a94f":[1,11,0,1,5], "classxpcc_1_1allocator_1_1_dynamic.html#a308696d41335f1a7a5d6a9b5f764ab23":[1,11,0,1,2], "classxpcc_1_1allocator_1_1_dynamic.html#a5a6caffc206b25aea12c0ce4b039048a":[1,11,0,1,0,0], "classxpcc_1_1allocator_1_1_dynamic.html#a7d04384ff750678c567e21ce29edfe4d":[1,11,0,1,3], "classxpcc_1_1allocator_1_1_dynamic.html#ab87ce8c11041d2cefffbe3115795337f":[1,11,0,1,1], "classxpcc_1_1allocator_1_1_dynamic.html#ad336ce5d65493b43d06cacea90622afa":[1,11,0,1,4], "classxpcc_1_1allocator_1_1_dynamic.html#structxpcc_1_1allocator_1_1_dynamic_1_1rebind":[1,11,0,1,0], "classxpcc_1_1allocator_1_1_static.html":[1,11,0,2], "classxpcc_1_1allocator_1_1_static.html#a44dc04c214703fcbc4064feaeb7ed979":[1,11,0,2,5], "classxpcc_1_1allocator_1_1_static.html#a4f919a234b77474092bb01f97e7f841c":[1,11,0,2,0,0], "classxpcc_1_1allocator_1_1_static.html#a514f9bf841927f374e90d84277631de5":[1,11,0,2,2], "classxpcc_1_1allocator_1_1_static.html#a6fb1ef279139d02cb69259237b46cce2":[1,11,0,2,1], "classxpcc_1_1allocator_1_1_static.html#a70e47dd4914abbf97150dc39490d5ea5":[1,11,0,2,3], "classxpcc_1_1allocator_1_1_static.html#ac2479755a473e0ff255b3329621193d8":[1,11,0,2,4], "classxpcc_1_1allocator_1_1_static.html#structxpcc_1_1allocator_1_1_static_1_1rebind":[1,11,0,2,0], "classxpcc_1_1amnb_1_1_clock.html":[2,0,3,3,2], "classxpcc_1_1amnb_1_1_interface.html":[1,2,0,0], "classxpcc_1_1amnb_1_1_node.html":[1,2,0,6], "classxpcc_1_1amnb_1_1_node.html#a0477269104ecf8130f4f454b40c04895":[1,2,0,6,29], "classxpcc_1_1amnb_1_1_node.html#a049f5df8acd29368b764b91bee6adae3":[1,2,0,6,30], "classxpcc_1_1amnb_1_1_node.html#a11155ee0be37d9e09798c16c06df3114":[1,2,0,6,28], "classxpcc_1_1amnb_1_1_node.html#a11cd638d7765551179ec48b1d1196c0b":[1,2,0,6,15], "classxpcc_1_1amnb_1_1_node.html#a22b2afdc8bed2435aa60077e293ff07b":[1,2,0,6,23], "classxpcc_1_1amnb_1_1_node.html#a2eb086eba942e3f09adaf007b4c7e939":[1,2,0,6,11], "classxpcc_1_1amnb_1_1_node.html#a42ae6d09f8ef366975b461da590dba0b":[1,2,0,6,21], "classxpcc_1_1amnb_1_1_node.html#a5474f5caa00e518c905b866029646bee":[1,2,0,6,26], "classxpcc_1_1amnb_1_1_node.html#a57e8841891b14af9210d0e01012fe8de":[1,2,0,6,7], "classxpcc_1_1amnb_1_1_node.html#a6803b4d0e9a3cb54c81bb9fe93a131c8":[1,2,0,6,14], "classxpcc_1_1amnb_1_1_node.html#a6c4b0a4312b74ac998653af01c9ce660":[1,2,0,6,12], "classxpcc_1_1amnb_1_1_node.html#a71cff7e507bc6b2bee1f18b738786d58":[1,2,0,6,16], "classxpcc_1_1amnb_1_1_node.html#a74b29ff33be04abef401a36e3525874f":[1,2,0,6,18], "classxpcc_1_1amnb_1_1_node.html#a936a5bbb54c627279052065c6e5c8f3a":[1,2,0,6,19], "classxpcc_1_1amnb_1_1_node.html#aa1909d5d561d55216dbd00420f9a7096":[1,2,0,6,3], "classxpcc_1_1amnb_1_1_node.html#aa442d7b79e8b93f8559f1f966dbb2e3c":[1,2,0,6,24], "classxpcc_1_1amnb_1_1_node.html#ab699e712b4e53c7ea952235e553c517e":[1,2,0,6,13], "classxpcc_1_1amnb_1_1_node.html#abcf6746d0ca765b9864f4c8f92b28989":[1,2,0,6,25], "classxpcc_1_1amnb_1_1_node.html#abfd5792cb23b8986d605bb29060f1438":[1,2,0,6,2], "classxpcc_1_1amnb_1_1_node.html#ac76d10594603b70104f9f2d3895acede":[1,2,0,6,8], "classxpcc_1_1amnb_1_1_node.html#accb9e2c2b4b29593ae8fd88ae804ad23":[1,2,0,6,20], "classxpcc_1_1amnb_1_1_node.html#ad345c91a18be6e7f5e00aec211c525b9":[1,2,0,6,4], "classxpcc_1_1amnb_1_1_node.html#ae48e8bbabdf664ec785d641bb2f27066":[1,2,0,6,27], "classxpcc_1_1amnb_1_1_node.html#ae55496ee36f53fb7c4fedde5febf80b0":[1,2,0,6,6], "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333":[1,2,0,6,0], "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333a49e6655539e557083dca0c46cea0284f":[1,2,0,6,0,2], "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333a76ef9a2ebce1353ffb106b73c53fb751":[1,2,0,6,0,1], "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333a8fc443dda8e11f6616d2e849df672fb0":[1,2,0,6,0,4], "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333afa3db10471a2c95094c584b2775023e0":[1,2,0,6,0,3], "classxpcc_1_1amnb_1_1_node.html#ae7e9e6652ebadb03487fd0274224c333aff3c3f218dd95c6db43bae2782049e3e":[1,2,0,6,0,0], "classxpcc_1_1amnb_1_1_node.html#ae936cf7987bea962772d3e73e8881eb8":[1,2,0,6,1], "classxpcc_1_1amnb_1_1_node.html#af196220f90cbc3bb31d64565789ea112":[1,2,0,6,5], "classxpcc_1_1amnb_1_1_node.html#af1c6e47cacbe13d05e496855d6a90b46":[1,2,0,6,22], "classxpcc_1_1amnb_1_1_node.html#af20733ed4e8f0e68bc8fd6e884efda61":[1,2,0,6,17], "classxpcc_1_1amnb_1_1_node.html#af3e6acf729d401af8ecb294c99b4bc9d":[1,2,0,6,9], "classxpcc_1_1amnb_1_1_node.html#afb84bff683eecab64d0815aba3f7493d":[1,2,0,6,10], "classxpcc_1_1amnb_1_1_response.html":[1,2,0,1], "classxpcc_1_1amnb_1_1_response.html#a00e04039280562fd0e914c76bc2162a5":[1,2,0,1,4], "classxpcc_1_1amnb_1_1_response.html#a66a95cc90f612deeda1ed6030c7f46ac":[1,2,0,1,9], "classxpcc_1_1amnb_1_1_response.html#a6700b8805238947877135eb4213121d5":[1,2,0,1,8], "classxpcc_1_1amnb_1_1_response.html#a87d9f8ecaab3b4619b0b543e314314ad":[1,2,0,1,0], "classxpcc_1_1amnb_1_1_response.html#a8f2f90ee3748c75580578f242cb09994":[1,2,0,1,5], "classxpcc_1_1amnb_1_1_response.html#a9e0424f1f615a57a37b8320e75a14862":[1,2,0,1,6], "classxpcc_1_1amnb_1_1_response.html#aabd360dbcc19750c5d574dd2cf463e7d":[1,2,0,1,2], "classxpcc_1_1amnb_1_1_response.html#abf40a63a7c5d8c3f853cdc705ddee3de":[1,2,0,1,3], "classxpcc_1_1amnb_1_1_response.html#ac4f5b381637b238ca72e43aff0c5b242":[1,2,0,1,7], "classxpcc_1_1amnb_1_1_response.html#afb89fe810885cdd570078ef7899c0211":[1,2,0,1,1], "classxpcc_1_1amnb_1_1_transmitter.html":[2,0,3,3,8], "classxpcc_1_1amnb_1_1_transmitter.html#a94f2da9f9ea25285e5fd41e849bfc7da":[2,0,3,3,8,0], "classxpcc_1_1atomic_1_1_container.html":[1,1,2,0], "classxpcc_1_1atomic_1_1_container.html#a883247c4f80ce56afaf7670d859bbd9e":[1,1,2,0,4], "classxpcc_1_1atomic_1_1_container.html#aa50d1983723edbf909021209b93587fc":[1,1,2,0,0], "classxpcc_1_1atomic_1_1_container.html#aad42f7d2612b007667e1c50809cec6d8":[1,1,2,0,1], "classxpcc_1_1atomic_1_1_container.html#ada8298b45d93eaae32d83d0031c27cf5":[1,1,2,0,3], "classxpcc_1_1atomic_1_1_container.html#aec061949215458e0a4c226e58876758e":[1,1,2,0,2], "classxpcc_1_1atomic_1_1_flag.html":[1,1,2,1], "classxpcc_1_1atomic_1_1_flag.html#a1954904513dcc19a43ff069b156bccf8":[1,1,2,1,1], "classxpcc_1_1atomic_1_1_flag.html#a4f17381d256a3b8a60beae3b360cbf5c":[1,1,2,1,5], "classxpcc_1_1atomic_1_1_flag.html#a65e051915968137a4dabb226070f1397":[1,1,2,1,2], "classxpcc_1_1atomic_1_1_flag.html#a7bd017500f1ad2f9c82c867fca966587":[1,1,2,1,6], "classxpcc_1_1atomic_1_1_flag.html#a88cccd24d8fce27c77b53c10227e2dcd":[1,1,2,1,0], "classxpcc_1_1atomic_1_1_flag.html#a97efcd8ae4faf230173324a332e7d376":[1,1,2,1,4], "classxpcc_1_1atomic_1_1_flag.html#ac0747105d682d96e0e17a61d92f46a4f":[1,1,2,1,3], "classxpcc_1_1atomic_1_1_lock.html":[1,1,2,2], "classxpcc_1_1atomic_1_1_lock.html#a39e568b208543897f176a52ffcf22307":[1,1,2,2,0], "classxpcc_1_1atomic_1_1_lock.html#a723be159d4912bdd1287e5020966643c":[1,1,2,2,1], "classxpcc_1_1atomic_1_1_queue.html":[1,1,2,4], "classxpcc_1_1atomic_1_1_queue.html#a03e60ddbc6a7120732b113e4be83d338":[1,1,2,4,3], "classxpcc_1_1atomic_1_1_queue.html#a12f6356350ecf0eac4d43c0b4fb72c0a":[1,1,2,4,9], "classxpcc_1_1atomic_1_1_queue.html#a1386b2287f8e4547e216ee8f86609cdb":[1,1,2,4,5], "classxpcc_1_1atomic_1_1_queue.html#a2e3ae55c3528d48ee8c48b3a971b3ec9":[1,1,2,4,10], "classxpcc_1_1atomic_1_1_queue.html#a330cf801491d3a6675041e2987145d53":[1,1,2,4,1], "classxpcc_1_1atomic_1_1_queue.html#a39b184917cdbe5eb5d07a11f7b903668":[1,1,2,4,0], "classxpcc_1_1atomic_1_1_queue.html#a40f5e3589e1cbe5c67fece75199ee296":[1,1,2,4,4], "classxpcc_1_1atomic_1_1_queue.html#a94e6807aa598bff9cd39f97167bba185":[1,1,2,4,7], "classxpcc_1_1atomic_1_1_queue.html#a9fa2bc4ecf3c021b80e387fc2a9bb6d7":[1,1,2,4,2], "classxpcc_1_1atomic_1_1_queue.html#ad393604167ad689e417e257794483fb2":[1,1,2,4,11], "classxpcc_1_1atomic_1_1_queue.html#ae7e8c9f1742c9113e5d53a13eb6340b7":[1,1,2,4,6], "classxpcc_1_1atomic_1_1_queue.html#aea55414369c43a4c2c501592c6e9bb9e":[1,1,2,4,8], "classxpcc_1_1atomic_1_1_unlock.html":[1,1,2,3], "classxpcc_1_1atomic_1_1_unlock.html#a21351db379a83d2ac5ca17cce8dfecdf":[1,1,2,3,1], "classxpcc_1_1atomic_1_1_unlock.html#a8f00e4906c137838243e6bcb37cd88e1":[1,1,2,3,0], "classxpcc_1_1avr_1_1_system_clock.html":[2,0,3,5,0], "classxpcc_1_1bme280data_1_1_data.html":[2,0,3,6,1], "classxpcc_1_1bme280data_1_1_data.html#a00710bb189c6b18893d32c429b953347":[2,0,3,6,1,0], "classxpcc_1_1bme280data_1_1_data.html#a0112022bad399e35d7ae030c83a3434d":[2,0,3,6,1,2], "classxpcc_1_1bme280data_1_1_data.html#a12e9aa83f4915712be963de9e77ebdb6":[2,0,3,6,1,4], "classxpcc_1_1bme280data_1_1_data.html#a2bcaa327aa53d510baf3639f7efdbccd":[2,0,3,6,1,5], "classxpcc_1_1bme280data_1_1_data.html#a37df18e4986c59ece61804151b9f6757":[2,0,3,6,1,8], "classxpcc_1_1bme280data_1_1_data.html#a39b7d3554153a81b5d0dc5fdbb1d1f01":[2,0,3,6,1,1], "classxpcc_1_1bme280data_1_1_data.html#a9ba1d1498fa7f0f0b952e8eecc92c32e":[2,0,3,6,1,7], "classxpcc_1_1bme280data_1_1_data.html#ace71838d1b6c87ed09a94656f904006e":[2,0,3,6,1,6], "classxpcc_1_1bme280data_1_1_data.html#af15c61fa8d8a41a1016c491cbc07f244":[2,0,3,6,1,3], "classxpcc_1_1bme280data_1_1_data_double.html":[2,0,3,6,3], "classxpcc_1_1bme280data_1_1_data_double.html#a2c3451cc8296cff8ed8f262d832ca689":[2,0,3,6,3,7], "classxpcc_1_1bme280data_1_1_data_double.html#a79774deca7925d45afb60fc57c66470c":[2,0,3,6,3,5], "classxpcc_1_1bme280data_1_1_data_double.html#a931d309aa69566b582619c98c0110b1a":[2,0,3,6,3,4], "classxpcc_1_1bme280data_1_1_data_double.html#aba965cab260a82f89b0ede978e122de7":[2,0,3,6,3,2], "classxpcc_1_1bme280data_1_1_data_double.html#abd40971579a10cc1272ec9060e29ad3d":[2,0,3,6,3,3], "classxpcc_1_1bme280data_1_1_data_double.html#ac184bfbba7488476c8a513e3ba52a4e8":[2,0,3,6,3,0], "classxpcc_1_1bme280data_1_1_data_double.html#ad3676e2828b5815832aa5ea623c31e1e":[2,0,3,6,3,1], "classxpcc_1_1bme280data_1_1_data_double.html#ade2b197f54d1e37b70dce0f3ad40a0b2":[2,0,3,6,3,8], "classxpcc_1_1bme280data_1_1_data_double.html#afef9b42d890cef3a267c5b613fe52c49":[2,0,3,6,3,6], "classxpcc_1_1bmp085data_1_1_data.html":[2,0,3,7,1], "classxpcc_1_1bmp085data_1_1_data.html#a00261c9606f8d1008bf7591a93d43394":[2,0,3,7,1,1], "classxpcc_1_1bmp085data_1_1_data.html#a034c7a46907ed97028e98c51eaf5148d":[2,0,3,7,1,6], "classxpcc_1_1bmp085data_1_1_data.html#a1bf92c3d20a0383594da38d2f154418f":[2,0,3,7,1,3], "classxpcc_1_1bmp085data_1_1_data.html#a3a46b71cdaac8464725789c9138d74c8":[2,0,3,7,1,4], "classxpcc_1_1bmp085data_1_1_data.html#a6aa3f5915ad99185968e775242a25542":[2,0,3,7,1,0], "classxpcc_1_1bmp085data_1_1_data.html#a89f5ecdb46bdab77e8ccbab6eff93603":[2,0,3,7,1,2], "classxpcc_1_1bmp085data_1_1_data.html#a911fcc7ad99ccdf045aadf156e1aca12":[2,0,3,7,1,5], "classxpcc_1_1bmp085data_1_1_data_base.html":[2,0,3,7,2], "classxpcc_1_1bmp085data_1_1_data_base.html#a4d9e4ddb2f12344a8132fc8809ebe594":[2,0,3,7,2,7], "classxpcc_1_1bmp085data_1_1_data_base.html#a56f14c59484db0a9257ccfb396423fea":[2,0,3,7,2,8], "classxpcc_1_1bmp085data_1_1_data_base.html#a5dbffb06c849b468012f82ebc9d437ea":[2,0,3,7,2,5], "classxpcc_1_1bmp085data_1_1_data_base.html#a618c640d7e0083c656d1ccc5ba28a0c5":[2,0,3,7,2,10], "classxpcc_1_1bmp085data_1_1_data_base.html#a8e035012cafbaac7e33a7a50d19e1d5b":[2,0,3,7,2,6], "classxpcc_1_1bmp085data_1_1_data_base.html#ac18c8b94117aa8e9433406586462f660":[2,0,3,7,2,9], "classxpcc_1_1bmp085data_1_1_data_base.html#acd5e6a1ca9d51259723be56133246765a4cf35690c3ba632b15292cceeeb82547":[2,0,3,7,2,1], "classxpcc_1_1bmp085data_1_1_data_base.html#acd5e6a1ca9d51259723be56133246765a551aa0c911f82dee765b197d92bc4d9f":[2,0,3,7,2,0], "classxpcc_1_1bmp085data_1_1_data_base.html#acd5e6a1ca9d51259723be56133246765a7e21dcfd0416df42c757a69053cfc735":[2,0,3,7,2,2], "classxpcc_1_1bmp085data_1_1_data_base.html#ad9540a0fc7dfb7df515ab029eff4df1c":[2,0,3,7,2,4], "classxpcc_1_1bmp085data_1_1_data_base.html#addc8c4d734f68b5e114d4ea1a4a358d4":[2,0,3,7,2,3], "classxpcc_1_1bmp085data_1_1_data_double.html":[2,0,3,7,3], "classxpcc_1_1bmp085data_1_1_data_double.html#a085cb2026375f882f75fd6bdb282701b":[2,0,3,7,3,6], "classxpcc_1_1bmp085data_1_1_data_double.html#a6890854f79d93f7ebd0d9944ea293035":[2,0,3,7,3,2], "classxpcc_1_1bmp085data_1_1_data_double.html#a873156c807cab8854615da9e421d9271":[2,0,3,7,3,3], "classxpcc_1_1bmp085data_1_1_data_double.html#a8b54cafe5e923301725f9a7a623349d8":[2,0,3,7,3,4], "classxpcc_1_1bmp085data_1_1_data_double.html#ab69ce9e37c906e4ae35f90a346635bd3":[2,0,3,7,3,5], "classxpcc_1_1bmp085data_1_1_data_double.html#ab9ac69cfc15bbaa4e0791819e376a9ad":[2,0,3,7,3,0], "classxpcc_1_1bmp085data_1_1_data_double.html#abca9880a4ad27a080007a8e3a0cc5147":[2,0,3,7,3,1], "classxpcc_1_1color_1_1_hsv_t.html":[2,0,3,9,0], "classxpcc_1_1color_1_1_hsv_t.html#a03dbf4ebbfba0e93e52ce322cdd1825c":[2,0,3,9,0,4], "classxpcc_1_1color_1_1_hsv_t.html#a16cf3ea07992a798088b5f7a840640b5":[2,0,3,9,0,0], "classxpcc_1_1color_1_1_hsv_t.html#a26d6376f20295a7ea3ad93c3038d1fef":[2,0,3,9,0,3], "classxpcc_1_1color_1_1_hsv_t.html#a2da46dbc27e3dda2a45e1ed06dd9b005":[2,0,3,9,0,2], "classxpcc_1_1color_1_1_hsv_t.html#a840e7a63ec0abd8752fa4358a0ac1c41":[2,0,3,9,0,1], "classxpcc_1_1color_1_1_hsv_t.html#aee56e9f76f057f792acf4cf5a83dfb75":[2,0,3,9,0,5], "classxpcc_1_1color_1_1_rgb_t.html":[2,0,3,9,1], "classxpcc_1_1color_1_1_rgb_t.html#a026246b26dc4c9dc4df92bd6359b1312":[2,0,3,9,1,4], "classxpcc_1_1color_1_1_rgb_t.html#a02f9c3f84a97638359a228bfe836acab":[2,0,3,9,1,6], "classxpcc_1_1color_1_1_rgb_t.html#a1144bc610abb6f11e88863017f85b0cc":[2,0,3,9,1,9], "classxpcc_1_1color_1_1_rgb_t.html#a2810ec14b6ba33d9b92cdc08e0806e91":[2,0,3,9,1,3] }; <file_sep>/docs/api/structxpcc_1_1can_1_1_message.js var structxpcc_1_1can_1_1_message = [ [ "Flags", "structxpcc_1_1can_1_1_message_1_1_flags.html", "structxpcc_1_1can_1_1_message_1_1_flags" ], [ "Message", "structxpcc_1_1can_1_1_message.html#a75a5a01c2a6b45774e2c00486a893c5c", null ], [ "getIdentifier", "structxpcc_1_1can_1_1_message.html#af3101e3401cf94f22e1eb4efd3d4a42c", null ], [ "setIdentifier", "structxpcc_1_1can_1_1_message.html#a3daac4445810713ac7eff5e13cfb631d", null ], [ "setExtended", "structxpcc_1_1can_1_1_message.html#a6b00888075748035d59c59c80594d859", null ], [ "isExtended", "structxpcc_1_1can_1_1_message.html#a1f9cd0251ddda4c1c45562c82d05df9b", null ], [ "setRemoteTransmitRequest", "structxpcc_1_1can_1_1_message.html#a6876faba3e9595031ec066e1b08cb97a", null ], [ "isRemoteTransmitRequest", "structxpcc_1_1can_1_1_message.html#ab1ac357abfd1d3f7d148976023cd8b94", null ], [ "getLength", "structxpcc_1_1can_1_1_message.html#a62750d75f0426d191909d049603eb8e4", null ], [ "setLength", "structxpcc_1_1can_1_1_message.html#adab3e99118e1f20703a50088beba7912", null ], [ "xpcc_aligned", "structxpcc_1_1can_1_1_message.html#ab838e4a21e8d7b099e7d520008005c25", null ], [ "operator==", "structxpcc_1_1can_1_1_message.html#a377db763910089dd2edf66a85f77bf27", null ], [ "identifier", "structxpcc_1_1can_1_1_message.html#af80a3417a51f90c70497739317ceb60d", null ], [ "flags", "structxpcc_1_1can_1_1_message.html#aceb0a814c9ce00606ef7aeba2b0ef53a", null ], [ "length", "structxpcc_1_1can_1_1_message.html#ac9f136cdea4466099ae183967a81c899", null ] ];<file_sep>/docs/api/structxpcc_1_1_geometric_traits_3_01int32__t_01_4.js var structxpcc_1_1_geometric_traits_3_01int32__t_01_4 = [ [ "FloatType", "structxpcc_1_1_geometric_traits_3_01int32__t_01_4.html#af9697ce5320b9f531d0d46f43111989b", null ], [ "WideType", "structxpcc_1_1_geometric_traits_3_01int32__t_01_4.html#aede02774c54fae512c65422322cf7d76", null ] ];<file_sep>/docs/api/classxpcc_1_1_tipc_connector.js var classxpcc_1_1_tipc_connector = [ [ "TipcConnector", "classxpcc_1_1_tipc_connector.html#a2357e6c978395dabbc9fd6d1e422f7bb", null ], [ "~TipcConnector", "classxpcc_1_1_tipc_connector.html#aa9e72f7e4a08a991180d7a8742e2feb3", null ], [ "setDomainId", "classxpcc_1_1_tipc_connector.html#a04f0616cbaf86675b52e3406502be329", null ], [ "addEventId", "classxpcc_1_1_tipc_connector.html#a8b9e1719fcb6896c24ff8109f647fe11", null ], [ "addReceiverId", "classxpcc_1_1_tipc_connector.html#a100fc64407abdb52fd6464bfed2bc391", null ], [ "isPacketAvailable", "classxpcc_1_1_tipc_connector.html#ab70b6fdfa247716a4e6e65dd1e952bd4", null ], [ "getPacketHeader", "classxpcc_1_1_tipc_connector.html#a79768273528ef96a379a7382229cbb78", null ], [ "getPacketPayload", "classxpcc_1_1_tipc_connector.html#ab7c3976ffde255125a670f908814324a", null ], [ "dropPacket", "classxpcc_1_1_tipc_connector.html#ab72d717e76c3cfdc4342cd475bd9f81e", null ], [ "update", "classxpcc_1_1_tipc_connector.html#a8de087abddb10352dee3e0b5bbae93e7", null ], [ "sendPacket", "classxpcc_1_1_tipc_connector.html#a76f7e663797f55fef9a43378d902937d", null ] ];<file_sep>/docs/api/classxpcc_1_1_tft_memory_bus8_bit.js var classxpcc_1_1_tft_memory_bus8_bit = [ [ "TftMemoryBus8Bit", "classxpcc_1_1_tft_memory_bus8_bit.html#a53d945e084dfe07faf84a65efe9218b6", null ], [ "writeIndex", "classxpcc_1_1_tft_memory_bus8_bit.html#aa4a7e3d420d2bcc96ca3381389de65e0", null ], [ "writeData", "classxpcc_1_1_tft_memory_bus8_bit.html#a55f20c647a2e56375c7f4acff02ec05d", null ], [ "writeRegister", "classxpcc_1_1_tft_memory_bus8_bit.html#a82ee51bd16bc692deffdb316d5cf9400", null ] ];<file_sep>/docs/api/structxpcc_1_1_i2c.js var structxpcc_1_1_i2c = [ [ "ConfigurationHandler", "structxpcc_1_1_i2c.html#a1e2ee33e8c5cba6b043367ff032c2e59", null ], [ "DetachCause", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fe", [ [ "NormalStop", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fea391c51df2024fa2c540672812faaf879", null ], [ "ErrorCondition", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fea170dca6f1128c602c1ad7423e4e0f672", null ], [ "FailedToAttach", "structxpcc_1_1_i2c.html#a2c8a622eadc65b22eeffc58b1ea1e8fea57871f61ec9b5f775a524aada612d196", null ] ] ], [ "Operation", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8e", [ [ "Stop", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea11a755d598c0c417f9a36758c3da7481", null ], [ "Restart", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea51cfbcff36da74a9fc47f3a5140f99f2", null ], [ "Write", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea1129c0e4d43f2d121652a7302712cff6", null ], [ "Read", "structxpcc_1_1_i2c.html#a54be9f699506dbba632d0eb587c81d8ea7a1a5f3e79fdc91edf2f5ead9d66abb4", null ] ] ], [ "OperationAfterStart", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345", [ [ "Stop", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345a11a755d598c0c417f9a36758c3da7481", null ], [ "Write", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345a1129c0e4d43f2d121652a7302712cff6", null ], [ "Read", "structxpcc_1_1_i2c.html#a0a9188ce55a85c353f46f69e50e75345a7a1a5f3e79fdc91edf2f5ead9d66abb4", null ] ] ], [ "OperationAfterWrite", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9", [ [ "Stop", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9a11a755d598c0c417f9a36758c3da7481", null ], [ "Restart", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9a51cfbcff36da74a9fc47f3a5140f99f2", null ], [ "Write", "structxpcc_1_1_i2c.html#a604510461f5f88aca235e51a24eec8c9a1129c0e4d43f2d121652a7302712cff6", null ] ] ], [ "OperationAfterRead", "structxpcc_1_1_i2c.html#a43522b92da7496888a156e3499df194f", [ [ "Stop", "structxpcc_1_1_i2c.html#a43522b92da7496888a156e3499df194fa11a755d598c0c417f9a36758c3da7481", null ], [ "Restart", "structxpcc_1_1_i2c.html#a43522b92da7496888a156e3499df194fa51cfbcff36da74a9fc47f3a5140f99f2", null ] ] ], [ "TransactionState", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6", [ [ "Idle", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6ae599161956d626eda4cb0a5ffb85271c", null ], [ "Busy", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6ad8a942ef2b04672adfafef0ad817a407", null ], [ "Error", "structxpcc_1_1_i2c.html#abc887dcfb48a32bb32caccc180152ba6a902b0d55fddef6f8d651fe1035b7d4bd", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1attiny_1_1_gpio.js var structxpcc_1_1attiny_1_1_gpio = [ [ "InputType", "structxpcc_1_1attiny_1_1_gpio.html#a8617ed5514f419beec428d56c2abe1a6", [ [ "Floating", "structxpcc_1_1attiny_1_1_gpio.html#a8617ed5514f419beec428d56c2abe1a6ac8df43648942ec3a9aec140f07f47b7c", null ], [ "PullUp", "structxpcc_1_1attiny_1_1_gpio.html#a8617ed5514f419beec428d56c2abe1a6adbe269e26d8282186a4163a2424e3361", null ] ] ], [ "InputTrigger", "structxpcc_1_1attiny_1_1_gpio.html#a02a3404e31abc5d617c2c828db3b8672", [ [ "LowLevel", "structxpcc_1_1attiny_1_1_gpio.html#a02a3404e31abc5d617c2c828db3b8672afc95fd21f661b220b8cce14419f2d352", null ], [ "BothEdges", "structxpcc_1_1attiny_1_1_gpio.html#a02a3404e31abc5d617c2c828db3b8672abc2634359d039750febf9ba58e1643ad", null ], [ "FallingEdge", "structxpcc_1_1attiny_1_1_gpio.html#a02a3404e31abc5d617c2c828db3b8672aa3919f129620bfcb6ba26d6e5dc1aa64", null ], [ "RisingEdge", "structxpcc_1_1attiny_1_1_gpio.html#a02a3404e31abc5d617c2c828db3b8672a5b0a1c3bcd3397b6e692a26fe8427564", null ] ] ], [ "Port", "structxpcc_1_1attiny_1_1_gpio.html#adb94f49abed93cbf3134c1dd0da3ba30", [ [ "B", "structxpcc_1_1attiny_1_1_gpio.html#adb94f49abed93cbf3134c1dd0da3ba30a9d5ed678fe57bcca610140957afab571", null ] ] ] ];<file_sep>/docs/api/group__atmega328p__uart.js var group__atmega328p__uart = [ [ "Uart0", "classxpcc_1_1atmega_1_1_uart0.html", null ] ];<file_sep>/docs/api/classxpcc_1_1_adc.js var classxpcc_1_1_adc = [ [ "Channel", "classxpcc_1_1_adc.html#ab4ad09b0e8dbf2d2f4ede2c985140798", null ] ];<file_sep>/docs/api/classxpcc_1_1_communicatable_task.js var classxpcc_1_1_communicatable_task = [ [ "CommunicatableTask", "classxpcc_1_1_communicatable_task.html#a47a8808eb8901a6b479dda672df3005d", null ], [ "parent", "classxpcc_1_1_communicatable_task.html#a6b8f50b5f1ee52836b8e4b5f8c4fb40a", null ] ];<file_sep>/src/why-use-xpcc.md # Why use xpcc? <center> ![](images/rca_angulatus.jpg) </center> xpcc is tailored for the harsh requirements of the [Eurobot competition][eurobot], where our robots need to run reliably and completely autonomously for the games duration. Furthermore, our robots started off running on AVRs, so xpcc also needs to be very efficient with its resources to be able to support these tiny microcontrollers. All in all, this means we need a really robust and safe foundation to build all our code upon. This foundation is xpcc. It runs very reliably and efficiently on AVR as well as ARM Cortex-M cores. Here are the reasons why. ## Data-driven design The most unique thing about xpcc is how we generate our hardware abstraction layer (HAL) drivers. We have assembled the unique meta data of all of our targets, such as number and type of peripherals, pins, memories and interrupts. This way we know which devices are similar to each other even before opening the datasheet, and we can make informed decisions about what HAL drivers an entire *family* of devices requires, rather than going through this cumbersome process for each device individually. This dramatically reduces duplicated code, required a lot less porting effort and leads to much higher device coverage of our HAL drivers. By combining the specific device meta data with our driver templates, we collect the similarities and differences between device families in one common place, which makes it so much easier to reason about them. This extract from the [STM32F407 device file][stm32f407] shows several types of peripheral drivers as well as additional information like instances and pin alternate functions: ```xml ... <driver type="adc" name="stm32" instances="1,2,3"/> <driver type="clock" name="stm32"/> <driver type="i2c" name="stm32" instances="1,2,3"/> <driver type="uart" name="stm32" instances="1,2,3,4,5,6"/> <driver type="gpio" name="stm32"> <gpio port="A" id="0"> <af id="1" peripheral="Timer2" name="Channel1"/> <af id="8" peripheral="Uart4" name="Tx" type="out"/> <af peripheral="Adc1" name="Channel0" type="analog"/> </gpio> ... ``` This information is then passed to our [HAL drivers][hal_drivers], which use code generation tools, specifically the [Jinja2 template engine][jinja2], to generate the appropriate C++ code structures for the specified target: <markdeep-diagram> . : . : | .------------. | .------. +--->| ADC Template | +--->| GpioB2 | | '------------' | '------' .------. .-----------. | .-------------. | .------. | Target +--->| Device File +-+--->| GPIO Template +-+--->| GpioB3 | '------' '-----------' | '-------------' | '------' | .------------. | .------. +--->| I2C Template + +--->| GpioB4 | | '------------' | '------' ' : ' : </markdeep-diagram> This treasure trove of information is available for [every AVR and STM32 device][device_files] we support and gives us a high confidence in the quality of our HAL ports. ## Usable & fast C++ xpcc's APIs are kept simple and fast by splitting up functionality into separate, small, static functions, which implement the same behavior on all platforms. Furthermore, with our code generation capabilities, we can hide the crazy implementation details of the hardware without compromising on performance. For example, on different AVRs, simple things like enabling the internal PullUp resistor, dealing with external interrupts or even just toggling a pin is done quite dissimilarly. Yet, using static inlined functions we can call GPIO functions at [*ludicrous speed*][ludicrous], all without using even a single byte of static RAM: ```cpp using Led = GpioOutputB1; // Generated by GPIO HAL driver using meta-data. Led::setOutput(); // Sets the pin to output on any platform. Led::set(); // Literally 1 instruction on AVR. Led::toggle(); // PORTA ^= 0x02; or PINA = 0x02; if available. using Button = GpioInputA0; // All pins behave the same way. Button::setInput(Gpio::InputType::PullUp); // PORTA |= 0x01; or PUEA |= 0x01; bool state = Button::read(); // (PINA & 0x01) or Button::setInputTrigger(Gpio::InputTrigger::RisingEdge); // Don't panic! Button::enableExternalInterrupt(); // Something, something, EIMSK. Button::acknowledgeExternalInterruptFlag(); // don't worry, we will do it! ``` You can use these GPIOs as building blocks for more complex drivers and peripherals and still maintain access speed without sacrificing usability: ```cpp // Create a hardware accelerated port of 4 bit width. using Port4 = GpioPort< GpioC0, 4 >; // MSB -> C3, C2, C1, C0 <- LSB using ReadWrite = GpioC4; // "name" your GPIOs. using Reset = GpioOutputC5; using Enable = GpioOutputC6; // Build a super fast character display driver using these inlined GPIOs. xpcc::Hd44780<Port4, ReadWrite, Reset, Enable> display; display.initialize(); // driver knows to initialize for a 4 bit bus! display << "Hello World!" << xpcc::endl; // Yes, ostreams. Deal with it. ``` All other HAL drivers are build using these principles, which makes them easy to configure and use yet very fast without consuming a lot of resources. ## Static allocation Nowhere in our HAL do we allocate memory dynamically – everything is either statically allocated or must explicitly be allocated by the user. This is a strong requirement to be able to run xpcc on AVRs, which have little if any memory to spare for dynamic allocations. We took great care to make sure this constraint remains usable, starting with configurable queue sizes for buffered UART to providing statically extensible I2C state machine for custom IC drivers. When we allocate static memory, we choose an appropriate size for its purpose. After all, just because you *can* use `int` doesn't mean you *should*. We transparently show you how much static memory your application is using, so you get an idea of how much certain functionality costs you in resources. This is the size of the accelerometer example on the STM32F4 discovery board: ```sh cd examples/stm32f4_discovery/accelerometer scons [...] Memory Usage ------------ Device: stm32f407vg Program: 5372 bytes (0.5% used) (.data + .fastdata + .reset + .rodata + .text) Data: 3380 bytes (1.7% used) = 308 bytes static (0.2%) + 3072 bytes stack (1.5%) (.bss + .data + .fastdata + .noinit + .stack) Heap: 197324 bytes (98.3% available) (.heap0 + .heap1 + .heap2 + .heap5) ``` ## Compile-time assertions xpcc stands out for its extensive use of static C++ classes and templates which is unusual in this field, but lends itself well to the static nature of embedded development. By combining modern C++11 features like `constexpr` functions with the meta-data inside our HAL drivers, we can add additional type checks and move certain computations into compile-time, with obvious speed and usability improvements. As an example, consider how xpcc connects GPIOs to peripherals and computes baudrates at compile time[^baud]: ```cpp // The specific UART connect type is unique to this GPIO. GpioA2::connect(Uart0::Tx); GpioA3::connect(Uart0::Rx, Gpio::InputType::PullUp); // Connecting a type to the wrong GPIO will simply _not compile_! GpioA0::connect(Uart0::Tx); ⚡ // PA0 does not have this alternate function! // Enforce the UART baudrate with a 1% tolerance, otherwise compilation error! Uart0::initialize<systemClock, 115200>(); // prescalers computed at compile-time ``` By moving these checks into compile time, xpcc can prevent predictable failures before the code ever makes it to the target, and remove the need for expensive computations at runtime altogether, which pays off especially on AVRs! Another interesting side effect is that your code *is* your documentation, with its correctness transparently enforced at compile-time. [^baud]: [Computing and Asserting Baudrate Settings at Compile Time](http://blog.xpcc.io/2015/06/08/computing-and-asserting-baudrate-settings-at-compile-time/) ## Multitasking xpcc uses stackless cooperative multitasking, for which we have ported [protothreads][] to C++ and extended them with [resumable functions][resumable]. This enables you to split up your application into separate tasks, and use synchronous APIs in all of them, without sacrificing overall responsiveness. This works on even the most resource restricted AVRs, since each task only requires 2 bytes! All our IC drivers are implemented using resumable functions, which can be called from within protothreads or explicitly blocking outside of them. Here is an example of [reading out the accelerometer][accel]: ```cpp class ReaderThread : public xpcc::pt::Protothread { public: bool run() { PT_BEGIN(); // The driver does several I2C transfer here to initialize and configure the // external sensor. The CPU is free to do other things while this happens though. PT_CALL(accelerometer.configure(accelerometer.Scale::G2)); while (true) // this feels quite similar to regular threads { // this resumable function will defer execution back to other protothreads PT_CALL(accelerometer.readAcceleration()); // smooth out the acceleration data a little bit averageX.update(accelerometer.getData().getX()); averageY.update(accelerometer.getData().getY()); // set the boards LEDs depending on the acceleration values LedUp::set( averageX.getValue() < -0.2); LedDown::set( averageX.getValue() > 0.2); LedLeft::set( averageY.getValue() < -0.2); LedRight::set(averageY.getValue() > 0.2); // defer back to other protothreads until the timer fires PT_WAIT_UNTIL(timer.execute()); } PT_END(); } private: // This accelerometer is connected via I2C. xpcc::Lis3dsh< xpcc::Lis3TransportI2c< I2cMaster > > accelerometer; xpcc::PeriodicTimer timer = xpcc::PeriodicTimer(5); // 5ms periodic timer. xpcc::filter::MovingAverage<float, 25> averageX; xpcc::filter::MovingAverage<float, 25> averageY; }; ReaderThread reader; // Protothread is statically allocated! int main() // Execution entry point. { while(true) { // the main loop with implicit round robin cooperative scheduling. reader.run(); otherProtothreads.run(); } } ``` [accel]: https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/accelerometer/main.cpp [resumable]: http://xpcc.io/api/group__resumable.html#details [protothreads]: http://xpcc.io/api/group__protothread.html#details [hal_drivers]: https://github.com/roboterclubaachen/xpcc/tree/develop/src/xpcc/architecture/platform/driver [ludicrous]: https://www.youtube.com/watch?v=ygE01sOhzz0 [device_files]: https://github.com/roboterclubaachen/xpcc/tree/develop/src/xpcc/architecture/platform/devices [jinja2]: http://jinja.pocoo.org [stm32f407]: https://github.com/roboterclubaachen/xpcc/blob/develop/src/xpcc/architecture/platform/devices/stm32/stm32f405_407_415_417-i_o_r_v_z-e_g.xml [eurobot]: http://www.eurobot.org/ <file_sep>/docs/api/group__architecture.js var group__architecture = [ [ "Clock", "classxpcc_1_1_clock.html", [ [ "Type", "classxpcc_1_1_clock.html#ab3aed6148f43a2bfecb5861c2ab10e0e", null ] ] ], [ "Accessor classes", "group__accessor.html", "group__accessor" ], [ "Atomic operations and container", "group__atomic.html", "group__atomic" ], [ "Supported Platforms", "group__platform.html", "group__platform" ], [ "Architecture Interfaces", "group__interface.html", "group__interface" ], [ "delayNanoseconds", "group__architecture.html#ga1c9e5989281ce3741de3d3afad60f656", null ], [ "delayMicroseconds", "group__architecture.html#ga06e11f250517de338c54a041e28181b2", null ], [ "delayMilliseconds", "group__architecture.html#gae49a479a7541f0e2ec1b43d7672f82e1", null ] ];<file_sep>/docs/api/classxpcc_1_1_i2c_write_read_transaction.js var classxpcc_1_1_i2c_write_read_transaction = [ [ "I2cWriteReadTransaction", "classxpcc_1_1_i2c_write_read_transaction.html#ab3f62ee9419532f00030f2982e19acae", null ], [ "configurePing", "classxpcc_1_1_i2c_write_read_transaction.html#a25c93b4478ec79326268b780c3cef69e", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_write_read_transaction.html#af0913945a35675cb51b522ee2e44e480", null ], [ "configureWrite", "classxpcc_1_1_i2c_write_read_transaction.html#a2c22c06916b9744e82b66664d885d8c5", null ], [ "configureRead", "classxpcc_1_1_i2c_write_read_transaction.html#abb0262c229902e7891c1df01beac8fe8", null ], [ "starting", "classxpcc_1_1_i2c_write_read_transaction.html#a3a4f30320a8b692b007b58536fc502d4", null ], [ "writing", "classxpcc_1_1_i2c_write_read_transaction.html#a0d91dcb3e1fffb2353ca5616fb19cccb", null ], [ "reading", "classxpcc_1_1_i2c_write_read_transaction.html#aa94124d2db4cef832330659e0c75ac29", null ], [ "readSize", "classxpcc_1_1_i2c_write_read_transaction.html#af2effa198a9ae077b47dfa4f938b93f3", null ], [ "writeSize", "classxpcc_1_1_i2c_write_read_transaction.html#ae1e4a3c92f1ba7cdc9c397209b527a3c", null ], [ "readBuffer", "classxpcc_1_1_i2c_write_read_transaction.html#a0dfc4fee597b08b2c6981c36e80e898b", null ], [ "writeBuffer", "classxpcc_1_1_i2c_write_read_transaction.html#a7fa738a224df5afe8d8e0bad522e92d6", null ], [ "isReading", "classxpcc_1_1_i2c_write_read_transaction.html#a26f1adaca63c74078b4ea6b3a3b22ec6", null ] ];<file_sep>/docs/api/classxpcc_1_1pc_1_1_terminal.js var classxpcc_1_1pc_1_1_terminal = [ [ "write", "classxpcc_1_1pc_1_1_terminal.html#a9cf19dc76f02153c4ea0b3678557ee3d", null ], [ "write", "classxpcc_1_1pc_1_1_terminal.html#a462c42c73516b8c0d624169ea6a8725a", null ], [ "flush", "classxpcc_1_1pc_1_1_terminal.html#af6269274d76d753849cd2d2c73d831a1", null ], [ "read", "classxpcc_1_1pc_1_1_terminal.html#ae25faaefc5f12b8f4175c31dd865f3e9", null ] ];<file_sep>/docs/api/classxpcc_1_1_st7036.js var classxpcc_1_1_st7036 = [ [ "St7036", "classxpcc_1_1_st7036.html#af62d293b7cbd583ec81bbe93354df14e", null ], [ "initialize", "classxpcc_1_1_st7036.html#abca9ca37b61eaa22a41eb8ffc2b755d0", null ], [ "writeRaw", "classxpcc_1_1_st7036.html#a609cc093936e1f4fa480e38768d3e7e2", null ], [ "execute", "classxpcc_1_1_st7036.html#a87ede776e8ff73b40f4e5405f02afe28", null ], [ "setCursor", "classxpcc_1_1_st7036.html#a0438cd38f50365b34c785df59585000e", null ], [ "writeCommand", "classxpcc_1_1_st7036.html#ae6561c5a5afa1f237a6777d51156faf3", null ] ];<file_sep>/docs/api/navtreeindex19.js var NAVTREEINDEX19 = { "group__platform.html#ga537dead81b8b55f21187e8804d8bb75e":[1,1,3,4], "group__platform.html#ga538e4a576b14d5cc0d04c8a3989c7ab5":[1,1,3,12], "group__platform.html#ga5ca719d180a9b807d4cada4045f88d66":[1,1,3,27], "group__platform.html#ga608575191ac19d142660a11d09bc6710":[1,1,3,45], "group__platform.html#ga64710ff1131fa2e4f82d52cb41c5c5ca":[1,1,3,13], "group__platform.html#ga682434ae1ce205d29465a5dc5aebac64":[1,1,3,39], "group__platform.html#ga70d80a19dae3916bfc040f43dcb9ace1":[1,1,3,8], "group__platform.html#ga762f985b4bb01aad5f6a5af078395e8f":[1,1,3,48], "group__platform.html#ga802ad73dc32342463448faa31a291e6d":[1,1,3,7], "group__platform.html#ga8aaa12fe37c031c7c4749245189c70f3":[1,1,3,9], "group__platform.html#ga8c519bcbffa546525acc426192db9f73":[1,1,3,11], "group__platform.html#ga91e47c41ee0b626c9058443b27fa5ee5":[1,1,3,34], "group__platform.html#ga95b7b044d5377f5c5b049d51930162b4":[1,1,3,20], "group__platform.html#ga994e424bad7577d932194b13d7a23099":[1,1,3,2], "group__platform.html#ga9b50b32673038aaa5e704e0ee8d77cc3":[1,1,3,28], "group__platform.html#ga9d2e7d420e517bf98683960a2eed5047":[1,1,3,43], "group__platform.html#gaa1742550c2d75f1b56487997d8cae801":[1,1,3,26], "group__platform.html#gaa2ff87a1086c0db10b501b41941f3466":[1,1,3,47], "group__platform.html#gab255577ba5fe79efd20163fb4133ece9":[1,1,3,46], "group__platform.html#gab52a1bd815b06033615a759c93c77355":[1,1,3,42], "group__platform.html#gab986d54b786c6c61deb0c67471cd12ce":[1,1,3,16], "group__platform.html#gabbdfb793d1c6e252b30f0f4c5334fa35":[1,1,3,22], "group__platform.html#gac7c355d32f1a8da5c1b39c22a71394b3":[1,1,3,30], "group__platform.html#gad81c41b44edc12481e23da5432861139":[1,1,3,3], "group__platform.html#gadec15f573a2e02d1cac211b0356b842c":[1,1,3,14], "group__platform.html#gae3577266c9f1d40100f173ef22e74fcb":[1,1,3,23], "group__platform.html#gaf989ec80f8919ef767ee2d2bad743094":[1,1,3,38], "group__processing.html":[1,9], "group__protothread.html":[1,9,2], "group__protothread.html#ga0c880659ee8887e4fa796017599bc022":[1,9,2,10], "group__protothread.html#ga146c4bb0e1f9f2020cd12b8dd7ff076e":[1,9,2,3], "group__protothread.html#ga3b5d03ed0a607155806a4f5f7a6570b2":[1,9,2,5], "group__protothread.html#ga62b66f563af59f459841f9cfe42b5496":[1,9,2,7], "group__protothread.html#ga6da3471eb116970eb1dce79bfcc7cd3e":[1,9,2,2], "group__protothread.html#ga742a4c6aa99440473f54651233ebd28b":[1,9,2,6], "group__protothread.html#ga74af1993d763f937b2282d27dc23349a":[1,9,2,8], "group__protothread.html#ga7593fae8873b594580319c407dd81ad6":[1,9,2,4], "group__protothread.html#gaeb2e9a2948001a68950eb6d8b26f0dbd":[1,9,2,9], "group__protothread.html#gaff926c0a76940ee9862be03f69605257":[1,9,2,11], "group__register.html":[1,1,4,7], "group__register.html#ga13f6ff67091cdf706220bb3283342dbf":[1,1,4,7,13], "group__register.html#ga6590d0450d384cae9e9e626fb3efd504":[1,1,4,7,14], "group__register.html#ga6fab1b65449b2ff0ab2dd9bcbc85224b":[1,1,4,7,8], "group__register.html#ga7db670b9768fc70d490ac317fda5e8b2":[1,1,4,7,9], "group__register.html#ga878a50776c1c9e6d27bd82ad4c579efd":[1,1,4,7,15], "group__register.html#ga893a272cf44433787b69b9097b01dc04":[1,1,4,7,11], "group__register.html#ga96c311392d636d6fd607dcb9bdc64b79":[1,1,4,7,6], "group__register.html#gaad8d44188df911c618b5a770e8f3941c":[1,1,4,7,7], "group__register.html#gac82600d3b4d79b80e601b8e03f4d3efb":[1,1,4,7,10], "group__register.html#gaf50110b5b40521dc0dc10cee6f3fe7ea":[1,1,4,7,12], "group__resumable.html":[1,9,3], "group__resumable.html#ga068f9f637000e3da0f8d04d8b4e88f95":[1,9,3,16], "group__resumable.html#ga10fc62ea34c6aa7550012b8a0f8bc9f3":[1,9,3,17], "group__resumable.html#ga2052f0001fb0e336a076e5e2c9ef769e":[1,9,3,6], "group__resumable.html#ga28077ce37251f81f1def791421af551d":[1,9,3,10], "group__resumable.html#ga50fda47255530910b40d0e883b097f68":[1,9,3,8], "group__resumable.html#ga51baeaa00320b4f640c229ff8dbf7ef8":[1,9,3,15], "group__resumable.html#ga6201af643c44f46e0448a2fb612a03b2":[1,9,3,12], "group__resumable.html#gab96493c0cfb6c1da968c8dfb0d39ba3f":[1,9,3,7], "group__resumable.html#gac58b699432d4e11a92a7e10c5bb8b36d":[1,9,3,9], "group__resumable.html#gac8a210fcd55041e209c715e6c2d20046":[1,9,3,3], "group__resumable.html#gadae4d1967a2940541461c43be4e32772":[1,9,3,5], "group__resumable.html#gadb13fb5ba3b91305efb86b131157b7e1":[1,9,3,4], "group__resumable.html#gaefb8c4d6c23c55a9718295ef5810cff2":[1,9,3,14], "group__resumable.html#gaf68766e4a9dae0d7b42b0e82d3d3f7ad":[1,9,3,11], "group__resumable.html#gafd59ed8e97e74cda1c1ef58fcee95988":[1,9,3,13], "group__rpr.html":[1,2,1], "group__rpr.html#gaabe946ffa16eb03670148be5a5d64f59":[1,2,1,4], "group__rpr.html#gabb9219b205aa4dfc65ed2ad45ae3b962":[1,2,1,3], "group__sab.html":[1,2,2], "group__sab.html#ga09e1ac402e543afef644055934ad7511":[1,2,2,7], "group__sab.html#ga1414bbc735f98a4960bf7d5ac6babb6b":[1,2,2,9], "group__sab.html#ga28fceefb11e49e49666e42aa284a9fb2":[1,2,2,6], "group__sab.html#ga7a762fce6beda73f3f1a760db05e76b1":[1,2,2,8], "group__sab.html#gga09e1ac402e543afef644055934ad7511a23a5d9417f9b506bfa2aa6c0fc661ee6":[1,2,2,7,1], "group__sab.html#gga09e1ac402e543afef644055934ad7511a4857601b844d43221fbce544af4affc8":[1,2,2,7,0], "group__sab.html#gga09e1ac402e543afef644055934ad7511abcd4813301d2e869efb6e2330276f93a":[1,2,2,7,3], "group__sab.html#gga09e1ac402e543afef644055934ad7511aed67ee1cb6379baf7e93aa0bd8388479":[1,2,2,7,2], "group__sab.html#structxpcc_1_1sab_1_1_callable":[1,2,2,3], "group__sab2.html":[1,2,3], "group__sab2.html#ga1ab854ba60b4975df7aa3f5254a1203d":[1,2,3,1], "group__sab2.html#gab73228456d3fc333a0431352323f073c":[1,2,3,2], "group__sab2.html#gga1ab854ba60b4975df7aa3f5254a1203da2496deb3e80962a4b5909433f3b444b8":[1,2,3,1,0], "group__sab2.html#gga1<KEY>4a1203da8951856a18d6ab854ff2d57d8f915dfd":[1,2,3,1,1], "group__sab2.html#gga1ab854ba60b4975df7aa3f5254a1203dab215b2d8a4767d9cb35d9d588bbd931d":[1,2,3,1,2], "group__sab2.html#gga1ab854ba60b4975df7aa3f5254a1203dadefab5f560cc3f6bb946907c37e5c237":[1,2,3,1,3], "group__software__timer.html":[1,9,5], "group__software__timer.html#ga32b23d79cca97377f3b1c2a07f004a4f":[1,9,5,5], "group__software__timer.html#ga57388c18fe03b378bdac53245b779ad0":[1,9,5,4], "group__software__timer.html#ga754c92822637441260564830a6759603":[1,9,5,10], "group__software__timer.html#ga9a65468d2c567ff594eccf073146a4cb":[1,9,5,7], "group__software__timer.html#gabb1b13479ca7e79e1eeeaf4a1e05380a":[1,9,5,3], "group__software__timer.html#gabcc9087dd7bf4f67559efacad4f622d8":[1,9,5,9], "group__software__timer.html#gad40633b0e45d38e6d611ad8bc4e7d010":[1,9,5,8], "group__software__timer.html#gaf5ae510ef35cc1cdd0cdfaef4278917e":[1,9,5,6], "group__spi.html":[1,1,4,8], "group__stm32f407vg.html":[1,1,3,0], "group__stm32f407vg__adc.html":[1,1,3,0,0], "group__stm32f407vg__can.html":[1,1,3,0,1], "group__stm32f407vg__clock.html":[1,1,3,0,2], "group__stm32f407vg__dma.html":[1,1,3,0,3], "group__stm32f407vg__fsmc.html":[1,1,3,0,4], "group__stm32f407vg__gpio.html":[1,1,3,0,5], "group__stm32f407vg__i2c.html":[1,1,3,0,6], "group__stm32f407vg__random.html":[1,1,3,0,7], "group__stm32f407vg__spi.html":[1,1,3,0,8], "group__stm32f407vg__timer.html":[1,1,3,0,9], "group__stm32f407vg__uart.html":[1,1,3,0,10], "group__tipc.html":[1,2,4,10,5], "group__tmp.html":[1,11,2], "group__tmp.html#a43565a8ae070a416f4e5376d17baa451":[1,11,2,6,0], "group__tmp.html#a697ed2d3fe127860a9f79226b8d33f54":[1,11,2,1,0], "group__tmp.html#classxpcc_1_1tmp_1_1_null_type":[1,11,2,0], "group__tmp.html#ga5a0c8f5e652d9488d1a8789b3438817e":[1,11,2,9], "group__tmp.html#structxpcc_1_1tmp_1_1_enable_if_condition":[1,11,2,6], "group__tmp.html#structxpcc_1_1tmp_1_1_select":[1,11,2,1], "group__uart.html":[1,1,4,9], "group__ui.html":[1,10], "group__unittest.html":[1,0], "group__unittest.html#ga0224d58e731e6f82506ae6c956f2e1f1":[1,0,10], "group__unittest.html#ga0eb8b7a4af331d5c0692db1882e3e0bf":[1,0,4], "group__unittest.html#ga308fba38f0bf0d01141a69fed6fe4a62":[1,0,9], "group__unittest.html#ga5f57119541f554a210df31de17a9d852":[1,0,7], "group__unittest.html#ga87c42f3aec4e7de608d6cfaf33e8103e":[1,0,8], "group__unittest.html#ga947ab44cc42369eb7cfe33f8a1e38e4b":[1,0,11], "group__unittest.html#gaaee9be886bcc22bf2c068a986e121e8e":[1,0,6], "group__unittest.html#gac5d8360580d9a7e2a372961da107c4f6":[1,0,5], "group__utils.html":[1,11], "group__utils.html#ga75e936312ad441d6ea51fb3468372a1a":[1,11,3], "group__wire.html":[1,1,4,6], "group__wire.html#ga18c5ac90389c6f27d08281c78c227fa2":[1,1,4,6,2], "group__xpcc__comm.html":[1,2,4], "group__xpcc__comm.html#gac82fa14e79906dd2443ec4e3fb49bef6":[1,2,4,11], "hierarchy.html":[2,2], "index.html":[], "index.html":[0], "modules.html":[1], "namespacexpcc.html":[2,0,3], "namespacexpcc_1_1atomic.html":[2,0,3,4], "namespacexpcc_1_1filter.html":[2,0,3,12], "namespacexpcc_1_1log.html":[2,0,3,17], "namespacexpcc_1_1lpc.html":[2,0,3,18], "namespacexpcc_1_1tmp.html":[2,0,3,28], "namespacexpcc_1_1ui.html":[2,0,3,30], "pages.html":[], "struct_board_1_1system_clock.html":[2,0,0,0], "structxpcc_1_1_arithmetic_traits_3_01char_01_4.html":[1,11,1,1], "structxpcc_1_1_arithmetic_traits_3_01double_01_4.html":[1,11,1,11], "structxpcc_1_1_arithmetic_traits_3_01float_01_4.html":[1,11,1,10], "structxpcc_1_1_arithmetic_traits_3_01int16__t_01_4.html":[1,11,1,4], "structxpcc_1_1_arithmetic_traits_3_01int32__t_01_4.html":[1,11,1,6], "structxpcc_1_1_arithmetic_traits_3_01int64__t_01_4.html":[1,11,1,8], "structxpcc_1_1_arithmetic_traits_3_01signed_01char_01_4.html":[1,11,1,2], "structxpcc_1_1_arithmetic_traits_3_01uint16__t_01_4.html":[1,11,1,5], "structxpcc_1_1_arithmetic_traits_3_01uint32__t_01_4.html":[1,11,1,7], "structxpcc_1_1_arithmetic_traits_3_01uint64__t_01_4.html":[1,11,1,9], "structxpcc_1_1_arithmetic_traits_3_01unsigned_01char_01_4.html":[1,11,1,3], "structxpcc_1_1_configuration.html":[1,1,4,7,4], "structxpcc_1_1_configuration.html#a33e82b594c0143d24ac417e2bf63c5bf":[1,1,4,7,4,0], "structxpcc_1_1_configuration.html#a88976ae52646048862d332258ee4880c":[1,1,4,7,4,2], "structxpcc_1_1_configuration.html#a9b6f131ab9f8f605ea1dbba2f827cb25":[1,1,4,7,4,1], "structxpcc_1_1_configuration.html#aab4ab78b84929e91ad02e9089ecba729":[1,1,4,7,4,3], "structxpcc_1_1_flags.html":[1,1,4,7,2], "structxpcc_1_1_flags.html#a045e6f8caf92e1ff3de3aba3e11005f0":[1,1,4,7,2,19], "structxpcc_1_1_flags.html#a0a786034294e5af0ddcd514cd6b40db1":[1,1,4,7,2,13], "structxpcc_1_1_flags.html#a0aad98429dbb24279cff3df04ddfe67b":[1,1,4,7,2,3], "structxpcc_1_1_flags.html#a1731596de3312964152d9010bf900de7":[1,1,4,7,2,9], "structxpcc_1_1_flags.html#a2248c7dfb16af1e6b56c535456a3a711":[1,1,4,7,2,2], "structxpcc_1_1_flags.html#a25d9d111e10a7619fed97b17605340c4":[1,1,4,7,2,8], "structxpcc_1_1_flags.html#a33b6a8df8aff8995b0b413583beeb66a":[1,1,4,7,2,16], "structxpcc_1_1_flags.html#a4dabf8c22c4abdce95e62c749a322963":[1,1,4,7,2,7], "structxpcc_1_1_flags.html#a54c227091cdeb8a8d176df417b6d3b3e":[1,1,4,7,2,22], "structxpcc_1_1_flags.html#a81c85bb7356ffea91e3fd5aac6058148":[1,1,4,7,2,12], "structxpcc_1_1_flags.html#a9238cacb1bac0cb40957c5ae87f59b3c":[1,1,4,7,2,11], "structxpcc_1_1_flags.html#a9696ef8ecda6422cf57cd6e4d35d27e9":[1,1,4,7,2,1], "structxpcc_1_1_flags.html#aa7712d94df88f4592f6c15fad8404b2e":[1,1,4,7,2,10], "structxpcc_1_1_flags.html#aa87018f9fc225bf38ae307d2f6684b9d":[1,1,4,7,2,18], "structxpcc_1_1_flags.html#ac8182708ee2cfd94d7721dd6e766fd99":[1,1,4,7,2,23], "structxpcc_1_1_flags.html#ad268608429ef5dae6e3773c36739e472":[1,1,4,7,2,14], "structxpcc_1_1_flags.html#ad36f975972b7533b6efea7fa35f41c6c":[1,1,4,7,2,0], "structxpcc_1_1_flags.html#ad6e8b6779683dbf033e838525fdcbb34":[1,1,4,7,2,6], "structxpcc_1_1_flags.html#ad8c85c40fba32344dcddc21050276cfe":[1,1,4,7,2,20], "structxpcc_1_1_flags.html#adf887753df75db396de910828bdcd865":[1,1,4,7,2,15], "structxpcc_1_1_flags.html#ae1e50d05da3726c6307f265e0c315e52":[1,1,4,7,2,21], "structxpcc_1_1_flags.html#af2ad5160a2ee32ce8abd7b345ec29d2f":[1,1,4,7,2,17], "structxpcc_1_1_flags.html#afa58f26177327ba2773064650503314c":[1,1,4,7,2,5], "structxpcc_1_1_flags.html#afd51f6f55075bf102f8a5885a2819e0f":[1,1,4,7,2,4], "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html":[1,1,4,7,3], "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a106938991ef31b237ae20a9c894deed2":[1,1,4,7,3,0], "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a49e2aabf030051119cb88c4e7d12bfb9":[1,1,4,7,3,1], "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a4c1dddde91cdb4ecee8a850b1d4de302":[1,1,4,7,3,4], "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a96614d3ba9a626c9b32c68577554bb72":[1,1,4,7,3,3], "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#af804df27a2608832c2a09d36096ba6f7":[1,1,4,7,3,2], "structxpcc_1_1_flags_operators.html":[1,1,4,7,1], "structxpcc_1_1_flags_operators.html#a006af3abf31d4e46ebefe0990b4893ca":[1,1,4,7,1,17], "structxpcc_1_1_flags_operators.html#a07b7034f6e1ed5f91c2d5830271a32c0":[1,1,4,7,1,9], "structxpcc_1_1_flags_operators.html#a0809d3367d5f2ecc41f17ad5e6f4ee54":[1,1,4,7,1,13], "structxpcc_1_1_flags_operators.html#a12d86a9a77241c13b80ef5bbca1f2718":[1,1,4,7,1,27], "structxpcc_1_1_flags_operators.html#a15be9a41d4a07ca63dffb6f1bf318483":[1,1,4,7,1,12], "structxpcc_1_1_flags_operators.html#a1d118c35ab1e55ab45c3e5b5c267c9df":[1,1,4,7,1,10], "structxpcc_1_1_flags_operators.html#a1e58ba739c86048bc890d3376608e5c8":[1,1,4,7,1,8], "structxpcc_1_1_flags_operators.html#a1f56fecec5040f9612550f58a06830a7":[1,1,4,7,1,2], "structxpcc_1_1_flags_operators.html#a2527d68131d87883deb4b76f342ccba9":[1,1,4,7,1,5], "structxpcc_1_1_flags_operators.html#a26e004c57eba88d8201df7be071bf84d":[1,1,4,7,1,23], "structxpcc_1_1_flags_operators.html#a32535bb614c0cac29e2451eddf570540":[1,1,4,7,1,18], "structxpcc_1_1_flags_operators.html#a3a49f7e1c7caf05575bb4f2e4bfec29e":[1,1,4,7,1,21], "structxpcc_1_1_flags_operators.html#a3ca154d188fea587c7589f49cfbb034b":[1,1,4,7,1,24], "structxpcc_1_1_flags_operators.html#a45e47c0db507bf89a29d8ecdd5ce5bd4":[1,1,4,7,1,26], "structxpcc_1_1_flags_operators.html#a4defdead1819f5bf32b63a3e4f05866e":[1,1,4,7,1,30], "structxpcc_1_1_flags_operators.html#a587d5c947e1b1688cc8b8463d8104cfd":[1,1,4,7,1,22], "structxpcc_1_1_flags_operators.html#a756878b7f29d2226ff2c4fd0b0716d42":[1,1,4,7,1,29], "structxpcc_1_1_flags_operators.html#a7bea73f21e1b1a7a41e2104126caee0f":[1,1,4,7,1,31], "structxpcc_1_1_flags_operators.html#a83e736546385634fafc8e5fb06aa53b2":[1,1,4,7,1,16], "structxpcc_1_1_flags_operators.html#a872bd56bf2ee6a03f8647632a64c5173":[1,1,4,7,1,3], "structxpcc_1_1_flags_operators.html#a94848dda5041d305f367abc4c39f327a":[1,1,4,7,1,20], "structxpcc_1_1_flags_operators.html#a9d8c3a729e59ad02477d5cc0e0166cff":[1,1,4,7,1,28], "structxpcc_1_1_flags_operators.html#ab4b8e760e6a8d8e90315acb141eebefe":[1,1,4,7,1,11], "structxpcc_1_1_flags_operators.html#abca028a0deb740b28e7bfdb35d43247c":[1,1,4,7,1,1], "structxpcc_1_1_flags_operators.html#ace5fbcaef6b7d418dd845f809b9d335c":[1,1,4,7,1,4], "structxpcc_1_1_flags_operators.html#acf3e7988c89b5a464e075d20d6334d33":[1,1,4,7,1,0], "structxpcc_1_1_flags_operators.html#ad2f92bd4fb96ddcbabc4f501b052a94a":[1,1,4,7,1,25], "structxpcc_1_1_flags_operators.html#ad420ffeda606d36a01dfd98818b42106":[1,1,4,7,1,7], "structxpcc_1_1_flags_operators.html#ada10bb24b72d2142ca5e23634fac90b1":[1,1,4,7,1,15], "structxpcc_1_1_flags_operators.html#ade43ca762b880f70a93932222fba7ef0":[1,1,4,7,1,14], "structxpcc_1_1_flags_operators.html#ae868f5f3c0f7d737aee4c176498b6c86":[1,1,4,7,1,6], "structxpcc_1_1_flags_operators.html#af242a1c559780336753e58183ca51104":[1,1,4,7,1,19], "structxpcc_1_1_geometric_traits.html":[1,8,3,2], "structxpcc_1_1_geometric_traits_3_01double_01_4.html":[2,0,3,119], "structxpcc_1_1_geometric_traits_3_01double_01_4.html#a30b5d78bd5bc0b7b6078a587aafe8fd1":[2,0,3,119,1], "structxpcc_1_1_geometric_traits_3_01double_01_4.html#ac3f389cbafaad684378234c4ba416961":[2,0,3,119,0], "structxpcc_1_1_geometric_traits_3_01float_01_4.html":[2,0,3,120], "structxpcc_1_1_geometric_traits_3_01float_01_4.html#a9dd7aa5d47c9b7e6927ae3f77fc8a719":[2,0,3,120,1], "structxpcc_1_1_geometric_traits_3_01float_01_4.html#af792f7b9998ccf882564e343f8a38995":[2,0,3,120,0], "structxpcc_1_1_geometric_traits_3_01int16__t_01_4.html":[2,0,3,121], "structxpcc_1_1_geometric_traits_3_01int16__t_01_4.html#ab58c3afe2b9ad38ce2db770a997e4edd":[2,0,3,121,1], "structxpcc_1_1_geometric_traits_3_01int16__t_01_4.html#af23ef62bcc196616c305452b2c7d14cc":[2,0,3,121,0], "structxpcc_1_1_geometric_traits_3_01int32__t_01_4.html":[2,0,3,122], "structxpcc_1_1_geometric_traits_3_01int32__t_01_4.html#aede02774c54fae512c65422322cf7d76":[2,0,3,122,1], "structxpcc_1_1_geometric_traits_3_01int32__t_01_4.html#af9697ce5320b9f531d0d46f43111989b":[2,0,3,122,0], "structxpcc_1_1_geometric_traits_3_01int8__t_01_4.html":[2,0,3,123], "structxpcc_1_1_geometric_traits_3_01int8__t_01_4.html#a938b4fd99921a0f5d9cb3b80d3adab18":[2,0,3,123,1], "structxpcc_1_1_geometric_traits_3_01int8__t_01_4.html#aa8fb6dc43deb02a540215b42060976d4":[2,0,3,123,0], "structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.html":[2,0,3,124], "structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.html#a14ea24e8873b505492d5130238fcd4b5":[2,0,3,124,1], "structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.html#a1c0da8fa399cd721470c71404b04404f":[2,0,3,124,0], "structxpcc_1_1_gpio.html":[2,0,3,125], "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50b":[2,0,3,125,0], "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50ba47a54d9da8952a3980d27488b00a21c1":[2,0,3,125,0,2], "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50ba7c147cda9e49590f6abe83d118b7353b":[2,0,3,125,0,1], "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50bab4c2b550635fe54fd29f2b64dfaca55d":[2,0,3,125,0,3] }; <file_sep>/docs/api/classxpcc_1_1filter_1_1_median.js var classxpcc_1_1filter_1_1_median = [ [ "Median", "classxpcc_1_1filter_1_1_median.html#ab42f104a44d4c403901d9c6111dedefe", null ], [ "append", "classxpcc_1_1filter_1_1_median.html#a26d1edadcb7d074e0955f876e63a8518", null ], [ "udpate", "classxpcc_1_1filter_1_1_median.html#aa64372a5886053228e09388e0887264b", null ], [ "getValue", "classxpcc_1_1filter_1_1_median.html#a5dfc21c1381df88cf3c34ff3a8b30d7d", null ] ];<file_sep>/docs/api/classxpcc_1_1_shift_register_output.js var classxpcc_1_1_shift_register_output = [ [ "operator[]", "classxpcc_1_1_shift_register_output.html#a167ba939709e5da032f798d33a9a533f", null ], [ "operator[]", "classxpcc_1_1_shift_register_output.html#a97ef9511946212e8a80a6cd0c80b6f06", null ] ];<file_sep>/docs/api/classxpcc_1_1_resumable.js var classxpcc_1_1_resumable = [ [ "Resumable", "classxpcc_1_1_resumable.html#ab5407c162cdf0d4f6ec64bd0e7e08a62", null ], [ "stopAllResumables", "classxpcc_1_1_resumable.html#a7d6a7a3dd3e718674009d7c8f9f7ded5", null ], [ "stopResumable", "classxpcc_1_1_resumable.html#a248c8ea10f003e90da6e735bb513953f", null ], [ "isResumableRunning", "classxpcc_1_1_resumable.html#a25da41992bfa7bd129aca048a257d649", null ], [ "areAnyResumablesRunning", "classxpcc_1_1_resumable.html#a359d87fdc7d60de8b99e151566e22383", null ], [ "areAnyResumablesRunning", "classxpcc_1_1_resumable.html#a196fc7b54aa5aa74f09a19024212ad82", null ], [ "areAllResumablesRunning", "classxpcc_1_1_resumable.html#add85af846745935a9ebcbcfcec177c0c", null ], [ "joinResumables", "classxpcc_1_1_resumable.html#aedc20cfcb7b61074d2065e476e23bd9a", null ] ];<file_sep>/docs/api/classxpcc_1_1log_1_1_default_style.js var classxpcc_1_1log_1_1_default_style = [ [ "parseArg", "classxpcc_1_1log_1_1_default_style.html#a664f38c4e1b759d29597a0fa6a9e0412", null ], [ "write", "classxpcc_1_1log_1_1_default_style.html#a0e099c0a6ae764991ce102f1f21e3a9d", null ], [ "write", "classxpcc_1_1log_1_1_default_style.html#a2ab82a484b5baab7773f4aac491d1c95", null ], [ "flush", "classxpcc_1_1log_1_1_default_style.html#a94dd1a64666098a891beefe30b09d7cf", null ] ];<file_sep>/docs/api/group__tmp_structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e_3_01true_01_4.js var group__tmp_structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e_3_01true_01_4 = [ [ "value", "group__tmp.html#a09f892b9f1e0433465f63ed2445d2c97af5e36f8619fd7812a280313a665a3bfa", null ] ];<file_sep>/docs/api/search/groups_8.js var searchData= [ ['led_20indicators',['LED Indicators',['../group__led.html',1,'']]], ['logger',['Logger',['../group__logger.html',1,'']]] ]; <file_sep>/docs/api/structxpcc_1_1hmc5883.js var structxpcc_1_1hmc5883 = [ [ "MeasurementAverage", "structxpcc_1_1hmc5883.html#a6219c2847c723cd05d5b555568c8b7ec", [ [ "Average8", "structxpcc_1_1hmc5883.html#a6219c2847c723cd05d5b555568c8b7eca8a79e972b7999654678d072892416286", null ], [ "Average4", "structxpcc_1_1hmc5883.html#a6219c2847c723cd05d5b555568c8b7ecaeaf2eeffa710fe130285f2526ac161bb", null ], [ "Average2", "structxpcc_1_1hmc5883.html#a6219c2847c723cd05d5b555568c8b7ecae13450a66f103c5d8fa06c3c1b632c38", null ], [ "Average1", "structxpcc_1_1hmc5883.html#a6219c2847c723cd05d5b555568c8b7ecae43b49253fedb684d8bf02a8ef67c6e9", null ] ] ], [ "Gain", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34", [ [ "Ga0_88", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34aca2add645be1f8b7654393a0af0d1e24", null ], [ "Ga1_3", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34aa4160348bb6ac9261a38226150a41856", null ], [ "Ga1_9", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34a144114017564685b5bf2ecd32e1b6680", null ], [ "Ga2_5", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34ab6849c67da05bdc6c4b2a511b176b438", null ], [ "Ga4_0", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34a406cd2180fd73698bdbeb201bc523720", null ], [ "Ga4_7", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34ac9bc5aa4203b21aa54b4bddf6b1030b8", null ], [ "Ga5_6", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34a4c53c55f901d0a8d75b76e7c59fae638", null ], [ "Ga8_1", "structxpcc_1_1hmc5883.html#af8797aae7b1c9374593e9b6ea3ff0a34a7552c612e5e10a67a47a72043f8a66fa", null ] ] ], [ "MeasurementRate", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23", [ [ "Hz0_75", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23a5665b9b8cc8bde17c83a19912edba857", null ], [ "Hz1_5", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23a76d564192eda2260eeba876f6119da99", null ], [ "Hz3", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23ad9a41a5096506d63f257b7626c410d78", null ], [ "Hz7_5", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23ace23e9718beb476224ba7a6b4e4a8cef", null ], [ "Hz15", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23a9c31af56a8cff6312d3a7ef8abe795ce", null ], [ "Hz30", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23a21f29fa3b66a310815b0ff7cfcac5f95", null ], [ "Hz75", "structxpcc_1_1hmc5883.html#a1d3a312a29553062489d50c520191d23ab521aa7137bf5419e4b266098efe62d5", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_generic_timestamp.js var classxpcc_1_1_generic_timestamp = [ [ "Type", "classxpcc_1_1_generic_timestamp.html#aa0bf9311fb0eb10265563bc36e2d9b69", null ], [ "SignedType", "classxpcc_1_1_generic_timestamp.html#a8fdb17d87fce73286557213c34ce82da", null ], [ "GenericTimestamp", "classxpcc_1_1_generic_timestamp.html#a3abebd7b541c932beb74cde10ea570d5", null ], [ "GenericTimestamp", "classxpcc_1_1_generic_timestamp.html#a3f820ca2b13b479eab9dbb12987d3598", null ], [ "getTime", "classxpcc_1_1_generic_timestamp.html#a24ecdcada9b6957fa0de46609f7cd2b9", null ], [ "operator+", "classxpcc_1_1_generic_timestamp.html#a1cff1028572b69b41be90ccc7809dd71", null ], [ "operator-", "classxpcc_1_1_generic_timestamp.html#ae7bdb1e437c97819a750bb45507881ad", null ], [ "operator==", "classxpcc_1_1_generic_timestamp.html#a0bd03c3eaa992bd5350f3b1a23e68a00", null ], [ "operator!=", "classxpcc_1_1_generic_timestamp.html#a000ce5640f38ec731912bfb00becdb7a", null ], [ "operator<", "classxpcc_1_1_generic_timestamp.html#a0990f5ec7a852bf1f6a426a14f15b177", null ], [ "operator>", "classxpcc_1_1_generic_timestamp.html#a9d990ebf2c064a05ba83cb8cb7691862", null ], [ "operator<=", "classxpcc_1_1_generic_timestamp.html#a36e85ba63044c87aadb441a50d7efe77", null ], [ "operator>=", "classxpcc_1_1_generic_timestamp.html#ae54461229066533dc7061e437f2b045c", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_uart_spi_master2.js var classxpcc_1_1stm32_1_1_uart_spi_master2 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24f", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1_pid_1_1_parameter.js var structxpcc_1_1_pid_1_1_parameter = [ [ "Parameter", "structxpcc_1_1_pid_1_1_parameter.html#a39e14e434cd315a3886ecbccd224a010", null ], [ "setKp", "structxpcc_1_1_pid_1_1_parameter.html#a9e110ddb764249fa21c9c2d2be25c4ef", null ], [ "setKi", "structxpcc_1_1_pid_1_1_parameter.html#aea70f62a3844bdcc3d968ab1d4fb5eb1", null ], [ "setKd", "structxpcc_1_1_pid_1_1_parameter.html#a32ca6ab57c56253e06e9e2c46fc585f5", null ], [ "setMaxErrorSum", "structxpcc_1_1_pid_1_1_parameter.html#a147cd1df34e8050fc0e953f2b7a556ff", null ], [ "Pid", "structxpcc_1_1_pid_1_1_parameter.html#aa245417dc2cd8c1415aadfb01d675ce7", null ] ];<file_sep>/docs/api/classxpcc_1_1fat_1_1_file.js var classxpcc_1_1fat_1_1_file = [ [ "open", "classxpcc_1_1fat_1_1_file.html#a8df3531163f9f1535651fa02e9dd13cf", null ], [ "close", "classxpcc_1_1fat_1_1_file.html#acd836144059d474be1024a04d0e23585", null ], [ "read", "classxpcc_1_1fat_1_1_file.html#ae16fb0c40283e797ed31a25ac599886f", null ], [ "lseek", "classxpcc_1_1fat_1_1_file.html#a9e1b55aff2ded1c33778e80920637a96", null ], [ "truncate", "classxpcc_1_1fat_1_1_file.html#af749153a213044a03651923b1d432905", null ], [ "flush", "classxpcc_1_1fat_1_1_file.html#a675938233fedcea654bf8da1c1644426", null ], [ "file", "classxpcc_1_1fat_1_1_file.html#addae885b474a6da8ac4c10ef06ae8932", null ] ];<file_sep>/docs/api/classxpcc_1_1_task.js var classxpcc_1_1_task = [ [ "~Task", "classxpcc_1_1_task.html#a52dab0d6749729fb7220b2ff92558282", null ], [ "start", "classxpcc_1_1_task.html#ad16aba6a103d3120fa432936f7d85940", null ], [ "isFinished", "classxpcc_1_1_task.html#a6084a0f4d6307771136f9b66953f3773", null ], [ "update", "classxpcc_1_1_task.html#a26bf847d086d18efb62a1b1980622e4e", null ] ];<file_sep>/docs/api/classxpcc_1_1_standard_menu.js var classxpcc_1_1_standard_menu = [ [ "EntryList", "classxpcc_1_1_standard_menu.html#a932faca8fa10b2857ebfecb3bfee9205", null ], [ "StandardMenu", "classxpcc_1_1_standard_menu.html#a4a851f9f8ea5163dd72a526f98cbb3c6", null ], [ "~StandardMenu", "classxpcc_1_1_standard_menu.html#a4168d6f028d94a7f749b4977ffbd0029", null ], [ "StandardMenu", "classxpcc_1_1_standard_menu.html#a31ec77137e2813e6c80b454ba36481b5", null ], [ "addEntry", "classxpcc_1_1_standard_menu.html#a3cb73e54a23418aa8becf7ed9b9d8da9", null ], [ "setTitle", "classxpcc_1_1_standard_menu.html#a14eb30309c8c876cb9abdf066962c898", null ], [ "shortButtonPress", "classxpcc_1_1_standard_menu.html#a04f5f737e5acf24c007f69582d9bd428", null ], [ "hasChanged", "classxpcc_1_1_standard_menu.html#aafb415651a31a46a7d514e8b55e76b80", null ], [ "draw", "classxpcc_1_1_standard_menu.html#a58f5bf9a58476b931db61e8531965fc3", null ], [ "selectedEntryFunction", "classxpcc_1_1_standard_menu.html#a1e6bd6f1773e5d99c6096ea853e25435", null ], [ "setUpdateTime", "classxpcc_1_1_standard_menu.html#afb8656ddae8db697c9f15fc96999cb55", null ], [ "entries", "classxpcc_1_1_standard_menu.html#a8eb56d81a256a66b714c5a43c6f4a9df", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_spi_master2.js var classxpcc_1_1stm32_1_1_spi_master2 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446c", [ [ "Mode0", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446ca315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446ca7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446ca04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446cab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1stm32_1_1_spi_master2.html#a2b612e97c24134a984a23412873f3b4f", [ [ "MsbFirst", "classxpcc_1_1stm32_1_1_spi_master2.html#a2b612e97c24134a984a23412873f3b4faee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1stm32_1_1_spi_master2.html#a2b612e97c24134a984a23412873f3b4fabdb340581a62499a27a78804ea99a99a", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_bmp085.js var classxpcc_1_1_bmp085 = [ [ "Bmp085", "classxpcc_1_1_bmp085.html#a789dbde1e51f975e29138a4ef034b81d", null ], [ "initialize", "classxpcc_1_1_bmp085.html#a6a1a2f3be0f78121e562d7373ad11bc9", null ], [ "readout", "classxpcc_1_1_bmp085.html#af28691459bf02cd00eb6f8e06fff9059", null ], [ "setMode", "classxpcc_1_1_bmp085.html#aedb8d4f899aa9c80d9c1fa34f7f5540a", null ], [ "getData", "classxpcc_1_1_bmp085.html#a6f9dc81bfe2987b9aa41e0f4406c2a21", null ] ];<file_sep>/docs/api/group__interface.js var group__interface = [ [ "Analog-to-Digital Converter", "group__adc.html", "group__adc" ], [ "Assertions", "group__assert.html", "group__assert" ], [ "Controller Area Network (CAN)", "group__can.html", "group__can" ], [ "General purpose input and/or output pins (GPIO)", "group__gpio.html", "group__gpio" ], [ "Inter-Integrated Circuit (I2C)", "group__i2c.html", "group__i2c" ], [ "Memory traits", "group__memory__traits.html", "group__memory__traits" ], [ "1-Wire", "group__wire.html", "group__wire" ], [ "General Purpose Register classes", "group__register.html", "group__register" ], [ "Serial Peripheral Interface (SPI)", "group__spi.html", "group__spi" ], [ "Universal Asynchronous Receiver/Transmitter (UART)", "group__uart.html", "group__uart" ] ];<file_sep>/docs/api/classxpcc_1_1_abstract_menu.js var classxpcc_1_1_abstract_menu = [ [ "AbstractMenu", "classxpcc_1_1_abstract_menu.html#a48918191696dfa6e3c6a9bb41ba43895", null ], [ "shortButtonPress", "classxpcc_1_1_abstract_menu.html#a50460345d9d3d6fc731f4fa0868e3b0a", null ] ];<file_sep>/docs/api/classxpcc_1_1hosted_1_1_socket_can.js var classxpcc_1_1hosted_1_1_socket_can = [ [ "SocketCan", "classxpcc_1_1hosted_1_1_socket_can.html#a7985f95a90477576a0f2e2fe1adfaaf3", null ], [ "~SocketCan", "classxpcc_1_1hosted_1_1_socket_can.html#a518ec6ff254144d825af45925bf27539", null ], [ "open", "classxpcc_1_1hosted_1_1_socket_can.html#a53cfe14f60c19cbefcca9ea0cd208f65", null ], [ "close", "classxpcc_1_1hosted_1_1_socket_can.html#aa3114427d68c0ea5f710a77a5cc45f91", null ], [ "isMessageAvailable", "classxpcc_1_1hosted_1_1_socket_can.html#a22d69c93c9806f448cde37ea2ec414c8", null ], [ "getMessage", "classxpcc_1_1hosted_1_1_socket_can.html#a556d9a175cbd09cd4aba5ac753343c59", null ], [ "isReadyToSend", "classxpcc_1_1hosted_1_1_socket_can.html#a2351f37ddac0799f16a6a3e658667447", null ], [ "getBusState", "classxpcc_1_1hosted_1_1_socket_can.html#a8bbb35dc62a8a50410ae9c6c8df8eda4", null ], [ "sendMessage", "classxpcc_1_1hosted_1_1_socket_can.html#a7ea60039ea745ac5b6807ab3acc5a5af", null ] ];<file_sep>/docs/api/classxpcc_1_1_mcp23s08.js var classxpcc_1_1_mcp23s08 = [ [ "RegisterAddress", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdb", [ [ "MCP_IODIR", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba36986d495d85b1af840228e334e5d245", null ], [ "MCP_IPOL", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba4ae271df65ed5cd4f7112535e0a044eb", null ], [ "MCP_GPINTEN", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba91db699975c9b60951726da6bb8f3f90", null ], [ "MCP_DEFVAL", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbafd6ed4d66203b40267636ebbd1725aa9", null ], [ "MCP_INTCON", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba61f4bda0ca985ab68c1c1fe0f2251088", null ], [ "MCP_IOCON", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba42343001afbb02de43274df05718b52d", null ], [ "MCP_GPPU", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba14af5bce9670d4c3f0fd70dc1b79657d", null ], [ "MCP_INTF", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba2f6ff26b3af8d2f501d82ecf84191513", null ], [ "MCP_INTCAP", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbadf2a4d99939f4c795e73233d916e9b16", null ], [ "MCP_GPIO", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba0271ca1d54b33be651c4e0faa8587c93", null ], [ "MCP_OLAT", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbac9313c76784ffb6d96748d5e5fcecbdb", null ] ] ], [ "RW", "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304a", [ [ "WRITE", "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304aa336c2dfd66cf1330e508bf3d17eeec83", null ], [ "READ", "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304aacf0fafbe6ee82b6adc4d6de724a40cf9", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_string_rocker.js var classxpcc_1_1gui_1_1_string_rocker = [ [ "StringRocker", "classxpcc_1_1gui_1_1_string_rocker.html#a8898c75d51a70aa8541db3fced5a6dbf", null ], [ "next", "classxpcc_1_1gui_1_1_string_rocker.html#afb31532f0540415a3d6975b84a976c6e", null ], [ "previous", "classxpcc_1_1gui_1_1_string_rocker.html#a5463513f7b3d820ed75e2f687eea56a7", null ], [ "activate", "classxpcc_1_1gui_1_1_string_rocker.html#a8e9a327526fa82959bbaf49fd2374f56", null ], [ "deactivate", "classxpcc_1_1gui_1_1_string_rocker.html#a79ec9e2a87c6d049fe97cea5f9c853fb", null ], [ "getValue", "classxpcc_1_1gui_1_1_string_rocker.html#a7e6b72827653133e010aacd2c481877e", null ], [ "getId", "classxpcc_1_1gui_1_1_string_rocker.html#affdceef8d50fe71fe72ae0c0415613d0", null ] ];<file_sep>/docs/api/namespacexpcc_1_1lpc.js var namespacexpcc_1_1lpc = [ [ "TypeId", null, [ [ "ClockOutput", "structxpcc_1_1lpc_1_1_type_id_1_1_clock_output.html", null ], [ "ExternalClock", "structxpcc_1_1lpc_1_1_type_id_1_1_external_clock.html", null ], [ "ExternalCrystal", "structxpcc_1_1lpc_1_1_type_id_1_1_external_crystal.html", null ], [ "InternalClock", "structxpcc_1_1lpc_1_1_type_id_1_1_internal_clock.html", null ], [ "Pll", "structxpcc_1_1lpc_1_1_type_id_1_1_pll.html", null ], [ "SystemClock", "structxpcc_1_1lpc_1_1_type_id_1_1_system_clock.html", null ], [ "Uart1Rx", "structxpcc_1_1lpc_1_1_type_id_1_1_uart1_rx.html", null ], [ "Uart1Tx", "structxpcc_1_1lpc_1_1_type_id_1_1_uart1_tx.html", null ] ] ], [ "Adc", "classxpcc_1_1lpc_1_1_adc.html", "classxpcc_1_1lpc_1_1_adc" ], [ "AdcAutomaticBurst", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html", "classxpcc_1_1lpc_1_1_adc_automatic_burst" ], [ "AdcManualSingle", "classxpcc_1_1lpc_1_1_adc_manual_single.html", "classxpcc_1_1lpc_1_1_adc_manual_single" ], [ "Can", "classxpcc_1_1lpc_1_1_can.html", null ], [ "CanFilter", "classxpcc_1_1lpc_1_1_can_filter.html", "classxpcc_1_1lpc_1_1_can_filter" ], [ "Lpc11PllSettings", "classxpcc_1_1lpc_1_1_lpc11_pll_settings.html", null ], [ "SpiMaster0", "classxpcc_1_1lpc_1_1_spi_master0.html", "classxpcc_1_1lpc_1_1_spi_master0" ], [ "SpiMaster1", "classxpcc_1_1lpc_1_1_spi_master1.html", "classxpcc_1_1lpc_1_1_spi_master1" ] ];<file_sep>/docs/api/structxpcc_1_1_register.js var structxpcc_1_1_register = [ [ "UnderlyingType", "structxpcc_1_1_register.html#a4c2c4eb34f0c968c96d2c002ed12a088", null ], [ "Register", "structxpcc_1_1_register.html#a92ec8cc1f33614e59aa0bd7987c215a7", null ], [ "Register", "structxpcc_1_1_register.html#ad8e4239f936b80e01a5ec96a161694e9", null ], [ "operator bool", "structxpcc_1_1_register.html#a986d04d3cf3712b17b2b51a7e57d6458", null ], [ "operator!", "structxpcc_1_1_register.html#a196ef010a3c4a4ad88a72a6c8333a698", null ], [ "operator<<", "structxpcc_1_1_register.html#a0f260e509aed71042161a12a270d45c8", null ], [ "value", "structxpcc_1_1_register.html#aa4f7e6b17d9cbf6e80bff4014cc829fd", null ] ];<file_sep>/docs/api/hierarchy.js var hierarchy = [ [ "xpcc::AbstractView", "classxpcc_1_1_abstract_view.html", [ [ "xpcc::AbstractMenu", "classxpcc_1_1_abstract_menu.html", [ [ "xpcc::ChoiceMenu", "classxpcc_1_1_choice_menu.html", null ], [ "xpcc::StandardMenu", "classxpcc_1_1_standard_menu.html", null ] ] ], [ "xpcc::gui::View", "classxpcc_1_1gui_1_1_view.html", null ] ] ], [ "xpcc::sab::Action", "structxpcc_1_1sab_1_1_action.html", null ], [ "xpcc::amnb::Action", "structxpcc_1_1amnb_1_1_action.html", null ], [ "xpcc::ActionResult< T >", "classxpcc_1_1_action_result.html", null ], [ "xpcc::ActionResult< void >", "classxpcc_1_1_action_result_3_01void_01_4.html", null ], [ "xpcc::Ad7280a< Spi, Cs, Cnvst, N >", "classxpcc_1_1_ad7280a.html", null ], [ "xpcc::AD840x< Spi, Cs, Rs, Shdn >", "classxpcc_1_1_a_d840x.html", null ], [ "xpcc::lpc::Adc", "classxpcc_1_1lpc_1_1_adc.html", [ [ "xpcc::lpc::AdcAutomaticBurst", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html", null ], [ "xpcc::lpc::AdcManualSingle", "classxpcc_1_1lpc_1_1_adc_manual_single.html", null ] ] ], [ "xpcc::stm32::TypeId::Adc1Channel0", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel0.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel1.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel10", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel10.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel11", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel11.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel12", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel12.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel13", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel13.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel14", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel14.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel15", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel15.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel16", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel16.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel17", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel17.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel18", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel18.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel2.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel3.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel4.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel5", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel5.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel6", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel6.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel7", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel7.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel8", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel8.html", null ], [ "xpcc::stm32::TypeId::Adc1Channel9", "structxpcc_1_1stm32_1_1_type_id_1_1_adc1_channel9.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel0", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel0.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel1.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel10", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel10.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel11", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel11.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel12", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel12.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel13", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel13.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel14", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel14.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel15", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel15.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel16", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel16.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel17", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel17.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel18", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel18.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel2.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel3.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel4.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel5", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel5.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel6", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel6.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel7", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel7.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel8", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel8.html", null ], [ "xpcc::stm32::TypeId::Adc2Channel9", "structxpcc_1_1stm32_1_1_type_id_1_1_adc2_channel9.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel0", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel0.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel1.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel10", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel10.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel11", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel11.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel12", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel12.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel13", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel13.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel14", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel14.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel15", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel15.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel16", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel16.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel17", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel17.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel18", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel18.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel2.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel3.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel4.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel5", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel5.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel6", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel6.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel7", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel7.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel8", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel8.html", null ], [ "xpcc::stm32::TypeId::Adc3Channel9", "structxpcc_1_1stm32_1_1_type_id_1_1_adc3_channel9.html", null ], [ "xpcc::AdcSampler< AdcInterrupt, Channels, Oversamples >", "classxpcc_1_1_adc_sampler.html", null ], [ "xpcc::adns9800", "structxpcc_1_1adns9800.html", [ [ "xpcc::Adns9800< Spi, Cs >", "classxpcc_1_1_adns9800.html", null ] ] ], [ "xpcc::Ads7843< Spi, Cs, Int >", "classxpcc_1_1_ads7843.html", null ], [ "xpcc::allocator::AllocatorBase< T >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Block< T, BLOCKSIZE >", "classxpcc_1_1allocator_1_1_block.html", null ], [ "xpcc::allocator::Dynamic< T >", "classxpcc_1_1allocator_1_1_dynamic.html", null ], [ "xpcc::allocator::Static< T, N >", "classxpcc_1_1allocator_1_1_static.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< ChoiceMenuEntry >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< ChoiceMenuEntry >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< Entry >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< Entry >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< MenuEntry >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< MenuEntry >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< ReceiveListItem >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< ReceiveListItem >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< SendListItem >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< SendListItem >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< uint8_t >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< uint8_t >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< Widget * >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< Widget * >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< xpcc::AbstractView * >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< xpcc::AbstractView * >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< xpcc::gui::View * >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< xpcc::gui::View * >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::allocator::AllocatorBase< xpcc::Vector< T, 2 > >", "classxpcc_1_1allocator_1_1_allocator_base.html", [ [ "xpcc::allocator::Dynamic< xpcc::Vector< T, 2 > >", "classxpcc_1_1allocator_1_1_dynamic.html", null ] ] ], [ "xpcc::Angle", "classxpcc_1_1_angle.html", null ], [ "xpcc::ui::Animation< T >", "classxpcc_1_1ui_1_1_animation.html", null ], [ "xpcc::ui::Animation< uint8_t >", "classxpcc_1_1ui_1_1_animation.html", null ], [ "xpcc::ArithmeticTraits< T >", "group__arithmetic__trais.html#structxpcc_1_1_arithmetic_traits", null ], [ "xpcc::ArithmeticTraits< char >", "structxpcc_1_1_arithmetic_traits_3_01char_01_4.html", null ], [ "xpcc::ArithmeticTraits< double >", "structxpcc_1_1_arithmetic_traits_3_01double_01_4.html", null ], [ "xpcc::ArithmeticTraits< float >", "structxpcc_1_1_arithmetic_traits_3_01float_01_4.html", null ], [ "xpcc::ArithmeticTraits< int16_t >", "structxpcc_1_1_arithmetic_traits_3_01int16__t_01_4.html", null ], [ "xpcc::ArithmeticTraits< int32_t >", "structxpcc_1_1_arithmetic_traits_3_01int32__t_01_4.html", null ], [ "xpcc::ArithmeticTraits< int64_t >", "structxpcc_1_1_arithmetic_traits_3_01int64__t_01_4.html", null ], [ "xpcc::ArithmeticTraits< signed char >", "structxpcc_1_1_arithmetic_traits_3_01signed_01char_01_4.html", null ], [ "xpcc::ArithmeticTraits< uint16_t >", "structxpcc_1_1_arithmetic_traits_3_01uint16__t_01_4.html", null ], [ "xpcc::ArithmeticTraits< uint32_t >", "structxpcc_1_1_arithmetic_traits_3_01uint32__t_01_4.html", null ], [ "xpcc::ArithmeticTraits< uint64_t >", "structxpcc_1_1_arithmetic_traits_3_01uint64__t_01_4.html", null ], [ "xpcc::ArithmeticTraits< unsigned char >", "structxpcc_1_1_arithmetic_traits_3_01unsigned_01char_01_4.html", null ], [ "xpcc::gui::AsyncEvent", "classxpcc_1_1gui_1_1_async_event.html", null ], [ "xpcc::stm32::fsmc::NorSram::AsynchronousTiming", "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#structxpcc_1_1stm32_1_1fsmc_1_1_nor_sram_1_1_asynchronous_timing", null ], [ "xpcc::At45db0x1d< Spi, Cs >", "classxpcc_1_1_at45db0x1d.html", null ], [ "xpcc::BackendInterface", "classxpcc_1_1_backend_interface.html", [ [ "xpcc::CanConnector< Driver >", "classxpcc_1_1_can_connector.html", null ], [ "xpcc::TipcConnector", "classxpcc_1_1_tipc_connector.html", null ], [ "xpcc::ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html", null ] ] ], [ "xpcc::stm32::BasicTimer", "classxpcc_1_1stm32_1_1_basic_timer.html", [ [ "xpcc::stm32::GeneralPurposeTimer", "classxpcc_1_1stm32_1_1_general_purpose_timer.html", [ [ "xpcc::stm32::AdvancedControlTimer", "classxpcc_1_1stm32_1_1_advanced_control_timer.html", [ [ "xpcc::stm32::Timer1", "classxpcc_1_1stm32_1_1_timer1.html", null ], [ "xpcc::stm32::Timer8", "classxpcc_1_1stm32_1_1_timer8.html", null ] ] ], [ "xpcc::stm32::Timer10", "classxpcc_1_1stm32_1_1_timer10.html", null ], [ "xpcc::stm32::Timer11", "classxpcc_1_1stm32_1_1_timer11.html", null ], [ "xpcc::stm32::Timer12", "classxpcc_1_1stm32_1_1_timer12.html", null ], [ "xpcc::stm32::Timer13", "classxpcc_1_1stm32_1_1_timer13.html", null ], [ "xpcc::stm32::Timer14", "classxpcc_1_1stm32_1_1_timer14.html", null ], [ "xpcc::stm32::Timer2", "classxpcc_1_1stm32_1_1_timer2.html", null ], [ "xpcc::stm32::Timer3", "classxpcc_1_1stm32_1_1_timer3.html", null ], [ "xpcc::stm32::Timer4", "classxpcc_1_1stm32_1_1_timer4.html", null ], [ "xpcc::stm32::Timer5", "classxpcc_1_1stm32_1_1_timer5.html", null ], [ "xpcc::stm32::Timer9", "classxpcc_1_1stm32_1_1_timer9.html", null ] ] ], [ "xpcc::stm32::Timer6", "classxpcc_1_1stm32_1_1_timer6.html", null ], [ "xpcc::stm32::Timer7", "classxpcc_1_1stm32_1_1_timer7.html", null ] ] ], [ "xpcc::BitbangMemoryInterface< PORT, CS, CD, WR >", "classxpcc_1_1_bitbang_memory_interface.html", null ], [ "xpcc::BlockAllocator< T, BLOCK_SIZE >", "classxpcc_1_1_block_allocator.html", null ], [ "xpcc::bme280", "structxpcc_1_1bme280.html", [ [ "xpcc::Bme280< I2cMaster >", "classxpcc_1_1_bme280.html", null ] ] ], [ "xpcc::bmp085", "structxpcc_1_1bmp085.html", [ [ "xpcc::Bmp085< I2cMaster >", "classxpcc_1_1_bmp085.html", null ] ] ], [ "xpcc::BoundedDeque< T, N >", "classxpcc_1_1_bounded_deque.html", null ], [ "xpcc::Button< PIN >", "classxpcc_1_1_button.html", null ], [ "xpcc::ButtonGroup< T >", "classxpcc_1_1_button_group.html", null ], [ "xpcc::bme280data::Calibration", "structxpcc_1_1bme280data_1_1_calibration.html", null ], [ "xpcc::bmp085data::Calibration", "structxpcc_1_1bmp085data_1_1_calibration.html", null ], [ "xpcc::amnb::Callable", "group__amnb.html#structxpcc_1_1amnb_1_1_callable", null ], [ "xpcc::rpr::Callable", "structxpcc_1_1rpr_1_1_callable.html", null ], [ "xpcc::sab::Callable", "group__sab.html#structxpcc_1_1sab_1_1_callable", null ], [ "xpcc::stm32::TypeId::Can1Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_can1_rx.html", null ], [ "xpcc::stm32::TypeId::Can1Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_can1_tx.html", null ], [ "xpcc::stm32::TypeId::Can2Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_can2_rx.html", null ], [ "xpcc::stm32::TypeId::Can2Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_can2_tx.html", null ], [ "xpcc::stm32::TypeId::Can3Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_can3_rx.html", null ], [ "xpcc::stm32::TypeId::Can3Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_can3_tx.html", null ], [ "xpcc::CanBitTiming< Clk, Bitrate >", "classxpcc_1_1_can_bit_timing.html", null ], [ "xpcc::CanConnectorBase", "classxpcc_1_1_can_connector_base.html", [ [ "xpcc::CanConnector< Driver >", "classxpcc_1_1_can_connector.html", null ] ] ], [ "xpcc::stm32::CanFilter", "classxpcc_1_1stm32_1_1_can_filter.html", null ], [ "xpcc::lpc::CanFilter", "classxpcc_1_1lpc_1_1_can_filter.html", null ], [ "xpcc::CanLawicelFormatter", "classxpcc_1_1_can_lawicel_formatter.html", null ], [ "xpcc::stm32::TypeId::CanRx", "structxpcc_1_1stm32_1_1_type_id_1_1_can_rx.html", null ], [ "xpcc::stm32::TypeId::CanTx", "structxpcc_1_1stm32_1_1_type_id_1_1_can_tx.html", null ], [ "xpcc::ChoiceMenuEntry", "classxpcc_1_1_choice_menu_entry.html", null ], [ "xpcc::Circle2D< T >", "classxpcc_1_1_circle2_d.html", null ], [ "xpcc::amnb::Clock", "classxpcc_1_1amnb_1_1_clock.html", null ], [ "xpcc::Clock", "classxpcc_1_1_clock.html", null ], [ "xpcc::stm32::ClockControl", "classxpcc_1_1stm32_1_1_clock_control.html", null ], [ "xpcc::ClockDummy", "classxpcc_1_1_clock_dummy.html", null ], [ "xpcc::lpc::TypeId::ClockOutput", "structxpcc_1_1lpc_1_1_type_id_1_1_clock_output.html", null ], [ "xpcc::stm32::TypeId::ClockOutput", "structxpcc_1_1stm32_1_1_type_id_1_1_clock_output.html", null ], [ "xpcc::stm32::ClockOutput1", "classxpcc_1_1stm32_1_1_clock_output1.html", null ], [ "xpcc::stm32::TypeId::ClockOutput1", "structxpcc_1_1stm32_1_1_type_id_1_1_clock_output1.html", null ], [ "xpcc::stm32::ClockOutput2", "classxpcc_1_1stm32_1_1_clock_output2.html", null ], [ "xpcc::stm32::TypeId::ClockOutput2", "structxpcc_1_1stm32_1_1_type_id_1_1_clock_output2.html", null ], [ "xpcc::glcd::Color", "classxpcc_1_1glcd_1_1_color.html", null ], [ "xpcc::gui::ColorPalette", "classxpcc_1_1gui_1_1_color_palette.html", null ], [ "xpcc::Communicatable", "classxpcc_1_1_communicatable.html", [ [ "xpcc::AbstractComponent", "classxpcc_1_1_abstract_component.html", null ], [ "xpcc::CommunicatableTask", "classxpcc_1_1_communicatable_task.html", null ], [ "xpcc::CommunicatingView", "classxpcc_1_1_communicating_view.html", null ], [ "xpcc::Communicator", "classxpcc_1_1_communicator.html", null ] ] ], [ "xpcc::ds1302::Config", "namespacexpcc.html#structxpcc_1_1ds1302_1_1_config", null ], [ "xpcc::BoundedDeque< T, N >::const_iterator", "classxpcc_1_1_bounded_deque_1_1const__iterator.html", null ], [ "xpcc::DoublyLinkedList< T, Allocator >::const_iterator", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html", null ], [ "xpcc::DynamicArray< T, Allocator >::const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html", null ], [ "xpcc::LinkedList< T, Allocator >::const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html", null ], [ "xpcc::atomic::Container< T >", "classxpcc_1_1atomic_1_1_container.html", null ], [ "unittest::Controller", "classunittest_1_1_controller.html", null ], [ "xpcc::tmp::Conversion< T, U >", "classxpcc_1_1tmp_1_1_conversion.html", null ], [ "xpcc::tmp::Conversion< T, T >", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01_t_01_4.html", null ], [ "xpcc::tmp::Conversion< T, void >", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4.html", null ], [ "xpcc::tmp::Conversion< void, T >", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01_t_01_4.html", null ], [ "xpcc::tmp::Conversion< void, void >", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01void_01_4.html", null ], [ "xpcc::ad7280a::ConversionValue", "structxpcc_1_1ad7280a_1_1_conversion_value.html", null ], [ "xpcc::cortex::Core", "classxpcc_1_1cortex_1_1_core.html", null ], [ "unittest::CountType", "classunittest_1_1_count_type.html", null ], [ "xpcc::cortex::CycleCounter", "classxpcc_1_1cortex_1_1_cycle_counter.html", null ], [ "xpcc::tmp102::Data", "structxpcc_1_1tmp102_1_1_data.html", null ], [ "xpcc::lm75::Data", "structxpcc_1_1lm75_1_1_data.html", null ], [ "xpcc::ft6x06::Data", "structxpcc_1_1ft6x06_1_1_data.html", null ], [ "xpcc::hmc58x3::Data", "structxpcc_1_1hmc58x3_1_1_data.html", null ], [ "xpcc::hmc6343::Data", "structxpcc_1_1hmc6343_1_1_data.html", null ], [ "xpcc::itg3200::Data", "structxpcc_1_1itg3200_1_1_data.html", null ], [ "xpcc::l3gd20::Data", "structxpcc_1_1l3gd20_1_1_data.html", null ], [ "xpcc::lis302dl::Data", "structxpcc_1_1lis302dl_1_1_data.html", null ], [ "xpcc::lis3dsh::Data", "structxpcc_1_1lis3dsh_1_1_data.html", null ], [ "xpcc::lsm303a::Data", "structxpcc_1_1lsm303a_1_1_data.html", null ], [ "xpcc::vl53l0::Data", "structxpcc_1_1vl53l0_1_1_data.html", null ], [ "xpcc::vl6180::Data", "structxpcc_1_1vl6180_1_1_data.html", null ], [ "xpcc::hclax::Data", "structxpcc_1_1hclax_1_1_data.html", null ], [ "xpcc::ds1302::Data", "structxpcc_1_1ds1302_1_1_data.html", null ], [ "xpcc::Tcs3472< I2cMaster >::Data.__unnamed__", "classxpcc_1_1_tcs3472.html#structxpcc_1_1_tcs3472_1_1_data_8____unnamed____", null ], [ "xpcc::Tcs3414< I2cMaster >::Data.__unnamed__", "classxpcc_1_1_tcs3414.html#structxpcc_1_1_tcs3414_1_1_data_8____unnamed____", null ], [ "xpcc::bme280data::DataBase", "structxpcc_1_1bme280data_1_1_data_base.html", [ [ "xpcc::bme280data::Data", "classxpcc_1_1bme280data_1_1_data.html", null ], [ "xpcc::bme280data::DataDouble", "classxpcc_1_1bme280data_1_1_data_double.html", null ] ] ], [ "xpcc::bmp085data::DataBase", "classxpcc_1_1bmp085data_1_1_data_base.html", [ [ "xpcc::bmp085data::Data", "classxpcc_1_1bmp085data_1_1_data.html", null ], [ "xpcc::bmp085data::DataDouble", "classxpcc_1_1bmp085data_1_1_data_double.html", null ] ] ], [ "xpcc::Date", "classxpcc_1_1_date.html", null ], [ "xpcc::filter::Debounce< T >", "classxpcc_1_1filter_1_1_debounce.html", null ], [ "xpcc::log::DefaultStyle", "classxpcc_1_1log_1_1_default_style.html", null ], [ "xpcc::gui::Dimension", "structxpcc_1_1gui_1_1_dimension.html", null ], [ "xpcc::fat::Directory", "classxpcc_1_1fat_1_1_directory.html", null ], [ "xpcc::Dispatcher", "classxpcc_1_1_dispatcher.html", null ], [ "xpcc::stm32::Dma1", "classxpcc_1_1stm32_1_1_dma1.html", null ], [ "xpcc::stm32::Dma2", "classxpcc_1_1stm32_1_1_dma2.html", null ], [ "xpcc::stm32::DmaBase", "classxpcc_1_1stm32_1_1_dma_base.html", [ [ "xpcc::stm32::Dma1::Stream0", "classxpcc_1_1stm32_1_1_dma1_1_1_stream0.html", null ], [ "xpcc::stm32::Dma1::Stream1", "classxpcc_1_1stm32_1_1_dma1_1_1_stream1.html", null ], [ "xpcc::stm32::Dma1::Stream2", "classxpcc_1_1stm32_1_1_dma1_1_1_stream2.html", null ], [ "xpcc::stm32::Dma1::Stream3", "classxpcc_1_1stm32_1_1_dma1_1_1_stream3.html", null ], [ "xpcc::stm32::Dma1::Stream4", "classxpcc_1_1stm32_1_1_dma1_1_1_stream4.html", null ], [ "xpcc::stm32::Dma1::Stream5", "classxpcc_1_1stm32_1_1_dma1_1_1_stream5.html", null ], [ "xpcc::stm32::Dma1::Stream6", "classxpcc_1_1stm32_1_1_dma1_1_1_stream6.html", null ], [ "xpcc::stm32::Dma1::Stream7", "classxpcc_1_1stm32_1_1_dma1_1_1_stream7.html", null ], [ "xpcc::stm32::Dma2::Stream0", "classxpcc_1_1stm32_1_1_dma2_1_1_stream0.html", null ], [ "xpcc::stm32::Dma2::Stream1", "classxpcc_1_1stm32_1_1_dma2_1_1_stream1.html", null ], [ "xpcc::stm32::Dma2::Stream2", "classxpcc_1_1stm32_1_1_dma2_1_1_stream2.html", null ], [ "xpcc::stm32::Dma2::Stream3", "classxpcc_1_1stm32_1_1_dma2_1_1_stream3.html", null ], [ "xpcc::stm32::Dma2::Stream4", "classxpcc_1_1stm32_1_1_dma2_1_1_stream4.html", null ], [ "xpcc::stm32::Dma2::Stream5", "classxpcc_1_1stm32_1_1_dma2_1_1_stream5.html", null ], [ "xpcc::stm32::Dma2::Stream6", "classxpcc_1_1stm32_1_1_dma2_1_1_stream6.html", null ], [ "xpcc::stm32::Dma2::Stream7", "classxpcc_1_1stm32_1_1_dma2_1_1_stream7.html", null ] ] ], [ "xpcc::DoublyLinkedList< T, Allocator >", "classxpcc_1_1_doubly_linked_list.html", null ], [ "xpcc::DoublyLinkedList< ChoiceMenuEntry >", "classxpcc_1_1_doubly_linked_list.html", null ], [ "xpcc::DoublyLinkedList< MenuEntry >", "classxpcc_1_1_doubly_linked_list.html", null ], [ "xpcc::ds1302", "namespacexpcc.html#structxpcc_1_1ds1302", null ], [ "xpcc::Ds1302< PinSet >", "classxpcc_1_1_ds1302.html", null ], [ "xpcc::ds1631", "structxpcc_1_1ds1631.html", [ [ "xpcc::Ds1631< I2cMaster >", "classxpcc_1_1_ds1631.html", null ] ] ], [ "xpcc::Ds18b20< OneWire >", "classxpcc_1_1_ds18b20.html", null ], [ "xpcc::DynamicArray< T, Allocator >", "classxpcc_1_1_dynamic_array.html", null ], [ "xpcc::DynamicArray< Widget * >", "classxpcc_1_1_dynamic_array.html", null ], [ "xpcc::DynamicArray< xpcc::Vector< T, 2 > >", "classxpcc_1_1_dynamic_array.html", null ], [ "xpcc::tmp::EnableIfCondition< B, T >", "group__tmp.html#structxpcc_1_1tmp_1_1_enable_if_condition", null ], [ "xpcc::tmp::EnableIfCondition< Conditional::value, T >", "group__tmp.html", [ [ "xpcc::tmp::EnableIf< Conditional, T >", "structxpcc_1_1tmp_1_1_enable_if.html", null ] ] ], [ "xpcc::tmp::EnableIfCondition< false, T >", "namespacexpcc_1_1tmp.html#structxpcc_1_1tmp_1_1_enable_if_condition_3_01false_00_01_t_01_4", null ], [ "xpcc::rpr::Error", "structxpcc_1_1rpr_1_1_error.html", null ], [ "xpcc::amnb::ErrorHandler", "structxpcc_1_1amnb_1_1_error_handler.html", null ], [ "xpcc::rpr::ErrorMessage", "structxpcc_1_1rpr_1_1_error_message.html", null ], [ "xpcc::ErrorReport", "classxpcc_1_1_error_report.html", null ], [ "xpcc::stm32::CanFilter::ExtendedFilterMask", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask.html", null ], [ "xpcc::lpc::CanFilter::ExtendedFilterMask", "structxpcc_1_1lpc_1_1_can_filter_1_1_extended_filter_mask.html", null ], [ "xpcc::stm32::CanFilter::ExtendedFilterMaskShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask_short.html", null ], [ "xpcc::stm32::CanFilter::ExtendedIdentifier", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_identifier.html", null ], [ "xpcc::lpc::CanFilter::ExtendedIdentifier", "structxpcc_1_1lpc_1_1_can_filter_1_1_extended_identifier.html", null ], [ "xpcc::stm32::CanFilter::ExtendedIdentifierShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_identifier_short.html", null ], [ "xpcc::stm32::ExternalClock< InputFrequency >", "classxpcc_1_1stm32_1_1_external_clock.html", null ], [ "xpcc::lpc::TypeId::ExternalClock", "structxpcc_1_1lpc_1_1_type_id_1_1_external_clock.html", null ], [ "xpcc::stm32::TypeId::ExternalClock", "structxpcc_1_1stm32_1_1_type_id_1_1_external_clock.html", null ], [ "xpcc::stm32::ExternalCrystal< InputFrequency >", "classxpcc_1_1stm32_1_1_external_crystal.html", null ], [ "xpcc::lpc::TypeId::ExternalCrystal", "structxpcc_1_1lpc_1_1_type_id_1_1_external_crystal.html", null ], [ "xpcc::stm32::TypeId::ExternalCrystal", "structxpcc_1_1stm32_1_1_type_id_1_1_external_crystal.html", null ], [ "xpcc::ui::FastRamp< T >", "classxpcc_1_1ui_1_1_fast_ramp.html", null ], [ "xpcc::ui::FastRamp< uint8_t >", "classxpcc_1_1ui_1_1_fast_ramp.html", null ], [ "xpcc::fat::File", "classxpcc_1_1fat_1_1_file.html", null ], [ "xpcc::fat::FileInfo", "classxpcc_1_1fat_1_1_file_info.html", null ], [ "xpcc::fat::FileSystem", "classxpcc_1_1fat_1_1_file_system.html", null ], [ "xpcc::filter::Fir< T, N, BLOCK_SIZE, ScaleFactor >", "classxpcc_1_1filter_1_1_fir.html", null ], [ "xpcc::atomic::Flag", "classxpcc_1_1atomic_1_1_flag.html", null ], [ "xpcc::can::Message::Flags", "structxpcc_1_1can_1_1_message_1_1_flags.html", null ], [ "xpcc::accessor::Flash< T >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< char >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< uint8_t >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< xpcc::amnb::Action >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< xpcc::amnb::ErrorHandler >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< xpcc::amnb::Listener >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< xpcc::rpr::Error >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< xpcc::rpr::Listener >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::accessor::Flash< xpcc::sab::Action >", "classxpcc_1_1accessor_1_1_flash.html", null ], [ "xpcc::Nrf24Data< Nrf24Phy >::Frame", "classxpcc_1_1_nrf24_data.html#structxpcc_1_1_nrf24_data_1_1_frame", null ], [ "xpcc::stm32::Fsmc", "classxpcc_1_1stm32_1_1_fsmc.html", null ], [ "xpcc::stm32::TypeId::FsmcA0", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a0.html", null ], [ "xpcc::stm32::TypeId::FsmcA1", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a1.html", null ], [ "xpcc::stm32::TypeId::FsmcA10", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a10.html", null ], [ "xpcc::stm32::TypeId::FsmcA11", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a11.html", null ], [ "xpcc::stm32::TypeId::FsmcA12", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a12.html", null ], [ "xpcc::stm32::TypeId::FsmcA13", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a13.html", null ], [ "xpcc::stm32::TypeId::FsmcA14", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a14.html", null ], [ "xpcc::stm32::TypeId::FsmcA15", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a15.html", null ], [ "xpcc::stm32::TypeId::FsmcA16", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a16.html", null ], [ "xpcc::stm32::TypeId::FsmcA17", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a17.html", null ], [ "xpcc::stm32::TypeId::FsmcA18", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a18.html", null ], [ "xpcc::stm32::TypeId::FsmcA19", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a19.html", null ], [ "xpcc::stm32::TypeId::FsmcA2", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a2.html", null ], [ "xpcc::stm32::TypeId::FsmcA20", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a20.html", null ], [ "xpcc::stm32::TypeId::FsmcA21", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a21.html", null ], [ "xpcc::stm32::TypeId::FsmcA22", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a22.html", null ], [ "xpcc::stm32::TypeId::FsmcA23", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a23.html", null ], [ "xpcc::stm32::TypeId::FsmcA24", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a24.html", null ], [ "xpcc::stm32::TypeId::FsmcA25", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a25.html", null ], [ "xpcc::stm32::TypeId::FsmcA3", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a3.html", null ], [ "xpcc::stm32::TypeId::FsmcA4", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a4.html", null ], [ "xpcc::stm32::TypeId::FsmcA5", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a5.html", null ], [ "xpcc::stm32::TypeId::FsmcA6", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a6.html", null ], [ "xpcc::stm32::TypeId::FsmcA7", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a7.html", null ], [ "xpcc::stm32::TypeId::FsmcA8", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a8.html", null ], [ "xpcc::stm32::TypeId::FsmcA9", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_a9.html", null ], [ "xpcc::stm32::TypeId::FsmcAle", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_ale.html", null ], [ "xpcc::stm32::TypeId::FsmcCd", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_cd.html", null ], [ "xpcc::stm32::TypeId::FsmcCle", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_cle.html", null ], [ "xpcc::stm32::TypeId::FsmcClk", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_clk.html", null ], [ "xpcc::stm32::TypeId::FsmcD0", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d0.html", null ], [ "xpcc::stm32::TypeId::FsmcD1", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d1.html", null ], [ "xpcc::stm32::TypeId::FsmcD10", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d10.html", null ], [ "xpcc::stm32::TypeId::FsmcD11", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d11.html", null ], [ "xpcc::stm32::TypeId::FsmcD12", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d12.html", null ], [ "xpcc::stm32::TypeId::FsmcD13", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d13.html", null ], [ "xpcc::stm32::TypeId::FsmcD14", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d14.html", null ], [ "xpcc::stm32::TypeId::FsmcD15", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d15.html", null ], [ "xpcc::stm32::TypeId::FsmcD16", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d16.html", null ], [ "xpcc::stm32::TypeId::FsmcD17", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d17.html", null ], [ "xpcc::stm32::TypeId::FsmcD18", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d18.html", null ], [ "xpcc::stm32::TypeId::FsmcD19", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d19.html", null ], [ "xpcc::stm32::TypeId::FsmcD2", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d2.html", null ], [ "xpcc::stm32::TypeId::FsmcD20", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d20.html", null ], [ "xpcc::stm32::TypeId::FsmcD21", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d21.html", null ], [ "xpcc::stm32::TypeId::FsmcD22", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d22.html", null ], [ "xpcc::stm32::TypeId::FsmcD23", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d23.html", null ], [ "xpcc::stm32::TypeId::FsmcD24", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d24.html", null ], [ "xpcc::stm32::TypeId::FsmcD25", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d25.html", null ], [ "xpcc::stm32::TypeId::FsmcD26", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d26.html", null ], [ "xpcc::stm32::TypeId::FsmcD27", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d27.html", null ], [ "xpcc::stm32::TypeId::FsmcD28", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d28.html", null ], [ "xpcc::stm32::TypeId::FsmcD29", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d29.html", null ], [ "xpcc::stm32::TypeId::FsmcD3", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d3.html", null ], [ "xpcc::stm32::TypeId::FsmcD30", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d30.html", null ], [ "xpcc::stm32::TypeId::FsmcD31", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d31.html", null ], [ "xpcc::stm32::TypeId::FsmcD4", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d4.html", null ], [ "xpcc::stm32::TypeId::FsmcD5", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d5.html", null ], [ "xpcc::stm32::TypeId::FsmcD6", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d6.html", null ], [ "xpcc::stm32::TypeId::FsmcD7", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d7.html", null ], [ "xpcc::stm32::TypeId::FsmcD8", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d8.html", null ], [ "xpcc::stm32::TypeId::FsmcD9", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_d9.html", null ], [ "xpcc::stm32::TypeId::FsmcInt", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_int.html", null ], [ "xpcc::stm32::TypeId::FsmcInt2", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_int2.html", null ], [ "xpcc::stm32::TypeId::FsmcInt3", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_int3.html", null ], [ "xpcc::stm32::TypeId::FsmcIntr", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_intr.html", null ], [ "xpcc::stm32::fsmc::FsmcNand", "classxpcc_1_1stm32_1_1fsmc_1_1_fsmc_nand.html", null ], [ "xpcc::stm32::TypeId::FsmcNbl0", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nbl0.html", null ], [ "xpcc::stm32::TypeId::FsmcNbl1", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nbl1.html", null ], [ "xpcc::stm32::TypeId::FsmcNce", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nce.html", null ], [ "xpcc::stm32::TypeId::FsmcNce2", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nce2.html", null ], [ "xpcc::stm32::TypeId::FsmcNce3", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nce3.html", null ], [ "xpcc::stm32::TypeId::FsmcNce4", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nce4.html", null ], [ "xpcc::stm32::TypeId::FsmcNe1", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_ne1.html", null ], [ "xpcc::stm32::TypeId::FsmcNe2", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_ne2.html", null ], [ "xpcc::stm32::TypeId::FsmcNe3", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_ne3.html", null ], [ "xpcc::stm32::TypeId::FsmcNe4", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_ne4.html", null ], [ "xpcc::stm32::TypeId::FsmcNiord", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_niord.html", null ], [ "xpcc::stm32::TypeId::FsmcNios16", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nios16.html", null ], [ "xpcc::stm32::TypeId::FsmcNiowr", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_niowr.html", null ], [ "xpcc::stm32::TypeId::FsmcNl", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nl.html", null ], [ "xpcc::stm32::TypeId::FsmcNoe", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_noe.html", null ], [ "xpcc::stm32::TypeId::FsmcNreg", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nreg.html", null ], [ "xpcc::stm32::TypeId::FsmcNwait", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nwait.html", null ], [ "xpcc::stm32::TypeId::FsmcNwe", "structxpcc_1_1stm32_1_1_type_id_1_1_fsmc_nwe.html", null ], [ "xpcc::stm32::fsmc::FsmcPcCard", "classxpcc_1_1stm32_1_1fsmc_1_1_fsmc_pc_card.html", null ], [ "xpcc::Ft245< PORT, RD, WR, RXF, TXE >", "classxpcc_1_1_ft245.html", null ], [ "xpcc::ft6x06", "structxpcc_1_1ft6x06.html", [ [ "xpcc::Ft6x06< I2cMaster >", "classxpcc_1_1_ft6x06.html", null ] ] ], [ "xpcc::GenericPeriodicTimer< Clock, TimestampType >", "classxpcc_1_1_generic_periodic_timer.html", null ], [ "xpcc::GenericPeriodicTimer< ::xpcc::Clock, ShortTimestamp >", "classxpcc_1_1_generic_periodic_timer.html", null ], [ "xpcc::GenericTimeout< Clock, TimestampType >", "classxpcc_1_1_generic_timeout.html", null ], [ "xpcc::GenericTimeout< ::xpcc::Clock, ShortTimestamp >", "classxpcc_1_1_generic_timeout.html", null ], [ "xpcc::GenericTimeout< xpcc::amnb::Clock >", "classxpcc_1_1_generic_timeout.html", null ], [ "xpcc::GenericTimeout< xpcc::Clock, TimestampType >", "classxpcc_1_1_generic_timeout.html", null ], [ "xpcc::GenericTimestamp< T >", "classxpcc_1_1_generic_timestamp.html", null ], [ "xpcc::GenericTimestamp< uint16_t >", "classxpcc_1_1_generic_timestamp.html", null ], [ "xpcc::GeometricTraits< T >", "structxpcc_1_1_geometric_traits.html", null ], [ "xpcc::GeometricTraits< double >", "structxpcc_1_1_geometric_traits_3_01double_01_4.html", null ], [ "xpcc::GeometricTraits< float >", "structxpcc_1_1_geometric_traits_3_01float_01_4.html", null ], [ "xpcc::GeometricTraits< int16_t >", "structxpcc_1_1_geometric_traits_3_01int16__t_01_4.html", null ], [ "xpcc::GeometricTraits< int32_t >", "structxpcc_1_1_geometric_traits_3_01int32__t_01_4.html", null ], [ "xpcc::GeometricTraits< int8_t >", "structxpcc_1_1_geometric_traits_3_01int8__t_01_4.html", null ], [ "xpcc::GeometricTraits< uint8_t >", "structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.html", null ], [ "xpcc::Gpio", "structxpcc_1_1_gpio.html", [ [ "xpcc::GpioInput", "classxpcc_1_1_gpio_input.html", [ [ "xpcc::GpioIO", "classxpcc_1_1_gpio_i_o.html", [ [ "xpcc::GpioExpanderPin< GpioExpander, expander, pin >", "classxpcc_1_1_gpio_expander_pin.html", null ], [ "xpcc::GpioUnused", "classxpcc_1_1_gpio_unused.html", null ], [ "xpcc::GpioUnused", "classxpcc_1_1_gpio_unused.html", null ], [ "xpcc::stm32::GpioA0", "structxpcc_1_1stm32_1_1_gpio_a0.html", null ], [ "xpcc::stm32::GpioA1", "structxpcc_1_1stm32_1_1_gpio_a1.html", null ], [ "xpcc::stm32::GpioA10", "structxpcc_1_1stm32_1_1_gpio_a10.html", null ], [ "xpcc::stm32::GpioA11", "structxpcc_1_1stm32_1_1_gpio_a11.html", null ], [ "xpcc::stm32::GpioA12", "structxpcc_1_1stm32_1_1_gpio_a12.html", null ], [ "xpcc::stm32::GpioA13", "structxpcc_1_1stm32_1_1_gpio_a13.html", null ], [ "xpcc::stm32::GpioA14", "structxpcc_1_1stm32_1_1_gpio_a14.html", null ], [ "xpcc::stm32::GpioA15", "structxpcc_1_1stm32_1_1_gpio_a15.html", null ], [ "xpcc::stm32::GpioA2", "structxpcc_1_1stm32_1_1_gpio_a2.html", null ], [ "xpcc::stm32::GpioA3", "structxpcc_1_1stm32_1_1_gpio_a3.html", null ], [ "xpcc::stm32::GpioA4", "structxpcc_1_1stm32_1_1_gpio_a4.html", null ], [ "xpcc::stm32::GpioA5", "structxpcc_1_1stm32_1_1_gpio_a5.html", null ], [ "xpcc::stm32::GpioA6", "structxpcc_1_1stm32_1_1_gpio_a6.html", null ], [ "xpcc::stm32::GpioA7", "structxpcc_1_1stm32_1_1_gpio_a7.html", null ], [ "xpcc::stm32::GpioA8", "structxpcc_1_1stm32_1_1_gpio_a8.html", null ], [ "xpcc::stm32::GpioA9", "structxpcc_1_1stm32_1_1_gpio_a9.html", null ], [ "xpcc::stm32::GpioB0", "structxpcc_1_1stm32_1_1_gpio_b0.html", null ], [ "xpcc::stm32::GpioB1", "structxpcc_1_1stm32_1_1_gpio_b1.html", null ], [ "xpcc::stm32::GpioB10", "structxpcc_1_1stm32_1_1_gpio_b10.html", null ], [ "xpcc::stm32::GpioB11", "structxpcc_1_1stm32_1_1_gpio_b11.html", null ], [ "xpcc::stm32::GpioB12", "structxpcc_1_1stm32_1_1_gpio_b12.html", null ], [ "xpcc::stm32::GpioB13", "structxpcc_1_1stm32_1_1_gpio_b13.html", null ], [ "xpcc::stm32::GpioB14", "structxpcc_1_1stm32_1_1_gpio_b14.html", null ], [ "xpcc::stm32::GpioB15", "structxpcc_1_1stm32_1_1_gpio_b15.html", null ], [ "xpcc::stm32::GpioB2", "structxpcc_1_1stm32_1_1_gpio_b2.html", null ], [ "xpcc::stm32::GpioB3", "structxpcc_1_1stm32_1_1_gpio_b3.html", null ], [ "xpcc::stm32::GpioB4", "structxpcc_1_1stm32_1_1_gpio_b4.html", null ], [ "xpcc::stm32::GpioB5", "structxpcc_1_1stm32_1_1_gpio_b5.html", null ], [ "xpcc::stm32::GpioB6", "structxpcc_1_1stm32_1_1_gpio_b6.html", null ], [ "xpcc::stm32::GpioB7", "structxpcc_1_1stm32_1_1_gpio_b7.html", null ], [ "xpcc::stm32::GpioB8", "structxpcc_1_1stm32_1_1_gpio_b8.html", null ], [ "xpcc::stm32::GpioB9", "structxpcc_1_1stm32_1_1_gpio_b9.html", null ], [ "xpcc::stm32::GpioC0", "structxpcc_1_1stm32_1_1_gpio_c0.html", null ], [ "xpcc::stm32::GpioC1", "structxpcc_1_1stm32_1_1_gpio_c1.html", null ], [ "xpcc::stm32::GpioC10", "structxpcc_1_1stm32_1_1_gpio_c10.html", null ], [ "xpcc::stm32::GpioC11", "structxpcc_1_1stm32_1_1_gpio_c11.html", null ], [ "xpcc::stm32::GpioC12", "structxpcc_1_1stm32_1_1_gpio_c12.html", null ], [ "xpcc::stm32::GpioC13", "structxpcc_1_1stm32_1_1_gpio_c13.html", null ], [ "xpcc::stm32::GpioC14", "structxpcc_1_1stm32_1_1_gpio_c14.html", null ], [ "xpcc::stm32::GpioC15", "structxpcc_1_1stm32_1_1_gpio_c15.html", null ], [ "xpcc::stm32::GpioC2", "structxpcc_1_1stm32_1_1_gpio_c2.html", null ], [ "xpcc::stm32::GpioC3", "structxpcc_1_1stm32_1_1_gpio_c3.html", null ], [ "xpcc::stm32::GpioC4", "structxpcc_1_1stm32_1_1_gpio_c4.html", null ], [ "xpcc::stm32::GpioC5", "structxpcc_1_1stm32_1_1_gpio_c5.html", null ], [ "xpcc::stm32::GpioC6", "structxpcc_1_1stm32_1_1_gpio_c6.html", null ], [ "xpcc::stm32::GpioC7", "structxpcc_1_1stm32_1_1_gpio_c7.html", null ], [ "xpcc::stm32::GpioC8", "structxpcc_1_1stm32_1_1_gpio_c8.html", null ], [ "xpcc::stm32::GpioC9", "structxpcc_1_1stm32_1_1_gpio_c9.html", null ], [ "xpcc::stm32::GpioD0", "structxpcc_1_1stm32_1_1_gpio_d0.html", null ], [ "xpcc::stm32::GpioD1", "structxpcc_1_1stm32_1_1_gpio_d1.html", null ], [ "xpcc::stm32::GpioD10", "structxpcc_1_1stm32_1_1_gpio_d10.html", null ], [ "xpcc::stm32::GpioD11", "structxpcc_1_1stm32_1_1_gpio_d11.html", null ], [ "xpcc::stm32::GpioD12", "structxpcc_1_1stm32_1_1_gpio_d12.html", null ], [ "xpcc::stm32::GpioD13", "structxpcc_1_1stm32_1_1_gpio_d13.html", null ], [ "xpcc::stm32::GpioD14", "structxpcc_1_1stm32_1_1_gpio_d14.html", null ], [ "xpcc::stm32::GpioD15", "structxpcc_1_1stm32_1_1_gpio_d15.html", null ], [ "xpcc::stm32::GpioD2", "structxpcc_1_1stm32_1_1_gpio_d2.html", null ], [ "xpcc::stm32::GpioD3", "structxpcc_1_1stm32_1_1_gpio_d3.html", null ], [ "xpcc::stm32::GpioD4", "structxpcc_1_1stm32_1_1_gpio_d4.html", null ], [ "xpcc::stm32::GpioD5", "structxpcc_1_1stm32_1_1_gpio_d5.html", null ], [ "xpcc::stm32::GpioD6", "structxpcc_1_1stm32_1_1_gpio_d6.html", null ], [ "xpcc::stm32::GpioD7", "structxpcc_1_1stm32_1_1_gpio_d7.html", null ], [ "xpcc::stm32::GpioD8", "structxpcc_1_1stm32_1_1_gpio_d8.html", null ], [ "xpcc::stm32::GpioD9", "structxpcc_1_1stm32_1_1_gpio_d9.html", null ], [ "xpcc::stm32::GpioE0", "structxpcc_1_1stm32_1_1_gpio_e0.html", null ], [ "xpcc::stm32::GpioE1", "structxpcc_1_1stm32_1_1_gpio_e1.html", null ], [ "xpcc::stm32::GpioE10", "structxpcc_1_1stm32_1_1_gpio_e10.html", null ], [ "xpcc::stm32::GpioE11", "structxpcc_1_1stm32_1_1_gpio_e11.html", null ], [ "xpcc::stm32::GpioE12", "structxpcc_1_1stm32_1_1_gpio_e12.html", null ], [ "xpcc::stm32::GpioE13", "structxpcc_1_1stm32_1_1_gpio_e13.html", null ], [ "xpcc::stm32::GpioE14", "structxpcc_1_1stm32_1_1_gpio_e14.html", null ], [ "xpcc::stm32::GpioE15", "structxpcc_1_1stm32_1_1_gpio_e15.html", null ], [ "xpcc::stm32::GpioE2", "structxpcc_1_1stm32_1_1_gpio_e2.html", null ], [ "xpcc::stm32::GpioE3", "structxpcc_1_1stm32_1_1_gpio_e3.html", null ], [ "xpcc::stm32::GpioE4", "structxpcc_1_1stm32_1_1_gpio_e4.html", null ], [ "xpcc::stm32::GpioE5", "structxpcc_1_1stm32_1_1_gpio_e5.html", null ], [ "xpcc::stm32::GpioE6", "structxpcc_1_1stm32_1_1_gpio_e6.html", null ], [ "xpcc::stm32::GpioE7", "structxpcc_1_1stm32_1_1_gpio_e7.html", null ], [ "xpcc::stm32::GpioE8", "structxpcc_1_1stm32_1_1_gpio_e8.html", null ], [ "xpcc::stm32::GpioE9", "structxpcc_1_1stm32_1_1_gpio_e9.html", null ], [ "xpcc::stm32::GpioH0", "structxpcc_1_1stm32_1_1_gpio_h0.html", null ], [ "xpcc::stm32::GpioH1", "structxpcc_1_1stm32_1_1_gpio_h1.html", null ] ] ], [ "xpcc::stm32::GpioInputA0", "structxpcc_1_1stm32_1_1_gpio_input_a0.html", null ], [ "xpcc::stm32::GpioInputA1", "structxpcc_1_1stm32_1_1_gpio_input_a1.html", null ], [ "xpcc::stm32::GpioInputA10", "structxpcc_1_1stm32_1_1_gpio_input_a10.html", null ], [ "xpcc::stm32::GpioInputA11", "structxpcc_1_1stm32_1_1_gpio_input_a11.html", null ], [ "xpcc::stm32::GpioInputA12", "structxpcc_1_1stm32_1_1_gpio_input_a12.html", null ], [ "xpcc::stm32::GpioInputA13", "structxpcc_1_1stm32_1_1_gpio_input_a13.html", null ], [ "xpcc::stm32::GpioInputA14", "structxpcc_1_1stm32_1_1_gpio_input_a14.html", null ], [ "xpcc::stm32::GpioInputA15", "structxpcc_1_1stm32_1_1_gpio_input_a15.html", null ], [ "xpcc::stm32::GpioInputA2", "structxpcc_1_1stm32_1_1_gpio_input_a2.html", null ], [ "xpcc::stm32::GpioInputA3", "structxpcc_1_1stm32_1_1_gpio_input_a3.html", null ], [ "xpcc::stm32::GpioInputA4", "structxpcc_1_1stm32_1_1_gpio_input_a4.html", null ], [ "xpcc::stm32::GpioInputA5", "structxpcc_1_1stm32_1_1_gpio_input_a5.html", null ], [ "xpcc::stm32::GpioInputA6", "structxpcc_1_1stm32_1_1_gpio_input_a6.html", null ], [ "xpcc::stm32::GpioInputA7", "structxpcc_1_1stm32_1_1_gpio_input_a7.html", null ], [ "xpcc::stm32::GpioInputA8", "structxpcc_1_1stm32_1_1_gpio_input_a8.html", null ], [ "xpcc::stm32::GpioInputA9", "structxpcc_1_1stm32_1_1_gpio_input_a9.html", null ], [ "xpcc::stm32::GpioInputB0", "structxpcc_1_1stm32_1_1_gpio_input_b0.html", null ], [ "xpcc::stm32::GpioInputB1", "structxpcc_1_1stm32_1_1_gpio_input_b1.html", null ], [ "xpcc::stm32::GpioInputB10", "structxpcc_1_1stm32_1_1_gpio_input_b10.html", null ], [ "xpcc::stm32::GpioInputB11", "structxpcc_1_1stm32_1_1_gpio_input_b11.html", null ], [ "xpcc::stm32::GpioInputB12", "structxpcc_1_1stm32_1_1_gpio_input_b12.html", null ], [ "xpcc::stm32::GpioInputB13", "structxpcc_1_1stm32_1_1_gpio_input_b13.html", null ], [ "xpcc::stm32::GpioInputB14", "structxpcc_1_1stm32_1_1_gpio_input_b14.html", null ], [ "xpcc::stm32::GpioInputB15", "structxpcc_1_1stm32_1_1_gpio_input_b15.html", null ], [ "xpcc::stm32::GpioInputB2", "structxpcc_1_1stm32_1_1_gpio_input_b2.html", null ], [ "xpcc::stm32::GpioInputB3", "structxpcc_1_1stm32_1_1_gpio_input_b3.html", null ], [ "xpcc::stm32::GpioInputB4", "structxpcc_1_1stm32_1_1_gpio_input_b4.html", null ], [ "xpcc::stm32::GpioInputB5", "structxpcc_1_1stm32_1_1_gpio_input_b5.html", null ], [ "xpcc::stm32::GpioInputB6", "structxpcc_1_1stm32_1_1_gpio_input_b6.html", null ], [ "xpcc::stm32::GpioInputB7", "structxpcc_1_1stm32_1_1_gpio_input_b7.html", null ], [ "xpcc::stm32::GpioInputB8", "structxpcc_1_1stm32_1_1_gpio_input_b8.html", null ], [ "xpcc::stm32::GpioInputB9", "structxpcc_1_1stm32_1_1_gpio_input_b9.html", null ], [ "xpcc::stm32::GpioInputC0", "structxpcc_1_1stm32_1_1_gpio_input_c0.html", null ], [ "xpcc::stm32::GpioInputC1", "structxpcc_1_1stm32_1_1_gpio_input_c1.html", null ], [ "xpcc::stm32::GpioInputC10", "structxpcc_1_1stm32_1_1_gpio_input_c10.html", null ], [ "xpcc::stm32::GpioInputC11", "structxpcc_1_1stm32_1_1_gpio_input_c11.html", null ], [ "xpcc::stm32::GpioInputC12", "structxpcc_1_1stm32_1_1_gpio_input_c12.html", null ], [ "xpcc::stm32::GpioInputC13", "structxpcc_1_1stm32_1_1_gpio_input_c13.html", null ], [ "xpcc::stm32::GpioInputC14", "structxpcc_1_1stm32_1_1_gpio_input_c14.html", null ], [ "xpcc::stm32::GpioInputC15", "structxpcc_1_1stm32_1_1_gpio_input_c15.html", null ], [ "xpcc::stm32::GpioInputC2", "structxpcc_1_1stm32_1_1_gpio_input_c2.html", null ], [ "xpcc::stm32::GpioInputC3", "structxpcc_1_1stm32_1_1_gpio_input_c3.html", null ], [ "xpcc::stm32::GpioInputC4", "structxpcc_1_1stm32_1_1_gpio_input_c4.html", null ], [ "xpcc::stm32::GpioInputC5", "structxpcc_1_1stm32_1_1_gpio_input_c5.html", null ], [ "xpcc::stm32::GpioInputC6", "structxpcc_1_1stm32_1_1_gpio_input_c6.html", null ], [ "xpcc::stm32::GpioInputC7", "structxpcc_1_1stm32_1_1_gpio_input_c7.html", null ], [ "xpcc::stm32::GpioInputC8", "structxpcc_1_1stm32_1_1_gpio_input_c8.html", null ], [ "xpcc::stm32::GpioInputC9", "structxpcc_1_1stm32_1_1_gpio_input_c9.html", null ], [ "xpcc::stm32::GpioInputD0", "structxpcc_1_1stm32_1_1_gpio_input_d0.html", null ], [ "xpcc::stm32::GpioInputD1", "structxpcc_1_1stm32_1_1_gpio_input_d1.html", null ], [ "xpcc::stm32::GpioInputD10", "structxpcc_1_1stm32_1_1_gpio_input_d10.html", null ], [ "xpcc::stm32::GpioInputD11", "structxpcc_1_1stm32_1_1_gpio_input_d11.html", null ], [ "xpcc::stm32::GpioInputD12", "structxpcc_1_1stm32_1_1_gpio_input_d12.html", null ], [ "xpcc::stm32::GpioInputD13", "structxpcc_1_1stm32_1_1_gpio_input_d13.html", null ], [ "xpcc::stm32::GpioInputD14", "structxpcc_1_1stm32_1_1_gpio_input_d14.html", null ], [ "xpcc::stm32::GpioInputD15", "structxpcc_1_1stm32_1_1_gpio_input_d15.html", null ], [ "xpcc::stm32::GpioInputD2", "structxpcc_1_1stm32_1_1_gpio_input_d2.html", null ], [ "xpcc::stm32::GpioInputD3", "structxpcc_1_1stm32_1_1_gpio_input_d3.html", null ], [ "xpcc::stm32::GpioInputD4", "structxpcc_1_1stm32_1_1_gpio_input_d4.html", null ], [ "xpcc::stm32::GpioInputD5", "structxpcc_1_1stm32_1_1_gpio_input_d5.html", null ], [ "xpcc::stm32::GpioInputD6", "structxpcc_1_1stm32_1_1_gpio_input_d6.html", null ], [ "xpcc::stm32::GpioInputD7", "structxpcc_1_1stm32_1_1_gpio_input_d7.html", null ], [ "xpcc::stm32::GpioInputD8", "structxpcc_1_1stm32_1_1_gpio_input_d8.html", null ], [ "xpcc::stm32::GpioInputD9", "structxpcc_1_1stm32_1_1_gpio_input_d9.html", null ], [ "xpcc::stm32::GpioInputE0", "structxpcc_1_1stm32_1_1_gpio_input_e0.html", null ], [ "xpcc::stm32::GpioInputE1", "structxpcc_1_1stm32_1_1_gpio_input_e1.html", null ], [ "xpcc::stm32::GpioInputE10", "structxpcc_1_1stm32_1_1_gpio_input_e10.html", null ], [ "xpcc::stm32::GpioInputE11", "structxpcc_1_1stm32_1_1_gpio_input_e11.html", null ], [ "xpcc::stm32::GpioInputE12", "structxpcc_1_1stm32_1_1_gpio_input_e12.html", null ], [ "xpcc::stm32::GpioInputE13", "structxpcc_1_1stm32_1_1_gpio_input_e13.html", null ], [ "xpcc::stm32::GpioInputE14", "structxpcc_1_1stm32_1_1_gpio_input_e14.html", null ], [ "xpcc::stm32::GpioInputE15", "structxpcc_1_1stm32_1_1_gpio_input_e15.html", null ], [ "xpcc::stm32::GpioInputE2", "structxpcc_1_1stm32_1_1_gpio_input_e2.html", null ], [ "xpcc::stm32::GpioInputE3", "structxpcc_1_1stm32_1_1_gpio_input_e3.html", null ], [ "xpcc::stm32::GpioInputE4", "structxpcc_1_1stm32_1_1_gpio_input_e4.html", null ], [ "xpcc::stm32::GpioInputE5", "structxpcc_1_1stm32_1_1_gpio_input_e5.html", null ], [ "xpcc::stm32::GpioInputE6", "structxpcc_1_1stm32_1_1_gpio_input_e6.html", null ], [ "xpcc::stm32::GpioInputE7", "structxpcc_1_1stm32_1_1_gpio_input_e7.html", null ], [ "xpcc::stm32::GpioInputE8", "structxpcc_1_1stm32_1_1_gpio_input_e8.html", null ], [ "xpcc::stm32::GpioInputE9", "structxpcc_1_1stm32_1_1_gpio_input_e9.html", null ], [ "xpcc::stm32::GpioInputH0", "structxpcc_1_1stm32_1_1_gpio_input_h0.html", null ], [ "xpcc::stm32::GpioInputH1", "structxpcc_1_1stm32_1_1_gpio_input_h1.html", null ] ] ], [ "xpcc::GpioOutput", "classxpcc_1_1_gpio_output.html", [ [ "xpcc::GpioIO", "classxpcc_1_1_gpio_i_o.html", null ], [ "xpcc::stm32::GpioOutputA0", "structxpcc_1_1stm32_1_1_gpio_output_a0.html", null ], [ "xpcc::stm32::GpioOutputA1", "structxpcc_1_1stm32_1_1_gpio_output_a1.html", null ], [ "xpcc::stm32::GpioOutputA10", "structxpcc_1_1stm32_1_1_gpio_output_a10.html", null ], [ "xpcc::stm32::GpioOutputA11", "structxpcc_1_1stm32_1_1_gpio_output_a11.html", null ], [ "xpcc::stm32::GpioOutputA12", "structxpcc_1_1stm32_1_1_gpio_output_a12.html", null ], [ "xpcc::stm32::GpioOutputA13", "structxpcc_1_1stm32_1_1_gpio_output_a13.html", null ], [ "xpcc::stm32::GpioOutputA14", "structxpcc_1_1stm32_1_1_gpio_output_a14.html", null ], [ "xpcc::stm32::GpioOutputA15", "structxpcc_1_1stm32_1_1_gpio_output_a15.html", null ], [ "xpcc::stm32::GpioOutputA2", "structxpcc_1_1stm32_1_1_gpio_output_a2.html", null ], [ "xpcc::stm32::GpioOutputA3", "structxpcc_1_1stm32_1_1_gpio_output_a3.html", null ], [ "xpcc::stm32::GpioOutputA4", "structxpcc_1_1stm32_1_1_gpio_output_a4.html", null ], [ "xpcc::stm32::GpioOutputA5", "structxpcc_1_1stm32_1_1_gpio_output_a5.html", null ], [ "xpcc::stm32::GpioOutputA6", "structxpcc_1_1stm32_1_1_gpio_output_a6.html", null ], [ "xpcc::stm32::GpioOutputA7", "structxpcc_1_1stm32_1_1_gpio_output_a7.html", null ], [ "xpcc::stm32::GpioOutputA8", "structxpcc_1_1stm32_1_1_gpio_output_a8.html", null ], [ "xpcc::stm32::GpioOutputA9", "structxpcc_1_1stm32_1_1_gpio_output_a9.html", null ], [ "xpcc::stm32::GpioOutputB0", "structxpcc_1_1stm32_1_1_gpio_output_b0.html", null ], [ "xpcc::stm32::GpioOutputB1", "structxpcc_1_1stm32_1_1_gpio_output_b1.html", null ], [ "xpcc::stm32::GpioOutputB10", "structxpcc_1_1stm32_1_1_gpio_output_b10.html", null ], [ "xpcc::stm32::GpioOutputB11", "structxpcc_1_1stm32_1_1_gpio_output_b11.html", null ], [ "xpcc::stm32::GpioOutputB12", "structxpcc_1_1stm32_1_1_gpio_output_b12.html", null ], [ "xpcc::stm32::GpioOutputB13", "structxpcc_1_1stm32_1_1_gpio_output_b13.html", null ], [ "xpcc::stm32::GpioOutputB14", "structxpcc_1_1stm32_1_1_gpio_output_b14.html", null ], [ "xpcc::stm32::GpioOutputB15", "structxpcc_1_1stm32_1_1_gpio_output_b15.html", null ], [ "xpcc::stm32::GpioOutputB2", "structxpcc_1_1stm32_1_1_gpio_output_b2.html", null ], [ "xpcc::stm32::GpioOutputB3", "structxpcc_1_1stm32_1_1_gpio_output_b3.html", null ], [ "xpcc::stm32::GpioOutputB4", "structxpcc_1_1stm32_1_1_gpio_output_b4.html", null ], [ "xpcc::stm32::GpioOutputB5", "structxpcc_1_1stm32_1_1_gpio_output_b5.html", null ], [ "xpcc::stm32::GpioOutputB6", "structxpcc_1_1stm32_1_1_gpio_output_b6.html", null ], [ "xpcc::stm32::GpioOutputB7", "structxpcc_1_1stm32_1_1_gpio_output_b7.html", null ], [ "xpcc::stm32::GpioOutputB8", "structxpcc_1_1stm32_1_1_gpio_output_b8.html", null ], [ "xpcc::stm32::GpioOutputB9", "structxpcc_1_1stm32_1_1_gpio_output_b9.html", null ], [ "xpcc::stm32::GpioOutputC0", "structxpcc_1_1stm32_1_1_gpio_output_c0.html", null ], [ "xpcc::stm32::GpioOutputC1", "structxpcc_1_1stm32_1_1_gpio_output_c1.html", null ], [ "xpcc::stm32::GpioOutputC10", "structxpcc_1_1stm32_1_1_gpio_output_c10.html", null ], [ "xpcc::stm32::GpioOutputC11", "structxpcc_1_1stm32_1_1_gpio_output_c11.html", null ], [ "xpcc::stm32::GpioOutputC12", "structxpcc_1_1stm32_1_1_gpio_output_c12.html", null ], [ "xpcc::stm32::GpioOutputC13", "structxpcc_1_1stm32_1_1_gpio_output_c13.html", null ], [ "xpcc::stm32::GpioOutputC14", "structxpcc_1_1stm32_1_1_gpio_output_c14.html", null ], [ "xpcc::stm32::GpioOutputC15", "structxpcc_1_1stm32_1_1_gpio_output_c15.html", null ], [ "xpcc::stm32::GpioOutputC2", "structxpcc_1_1stm32_1_1_gpio_output_c2.html", null ], [ "xpcc::stm32::GpioOutputC3", "structxpcc_1_1stm32_1_1_gpio_output_c3.html", null ], [ "xpcc::stm32::GpioOutputC4", "structxpcc_1_1stm32_1_1_gpio_output_c4.html", null ], [ "xpcc::stm32::GpioOutputC5", "structxpcc_1_1stm32_1_1_gpio_output_c5.html", null ], [ "xpcc::stm32::GpioOutputC6", "structxpcc_1_1stm32_1_1_gpio_output_c6.html", null ], [ "xpcc::stm32::GpioOutputC7", "structxpcc_1_1stm32_1_1_gpio_output_c7.html", null ], [ "xpcc::stm32::GpioOutputC8", "structxpcc_1_1stm32_1_1_gpio_output_c8.html", null ], [ "xpcc::stm32::GpioOutputC9", "structxpcc_1_1stm32_1_1_gpio_output_c9.html", null ], [ "xpcc::stm32::GpioOutputD0", "structxpcc_1_1stm32_1_1_gpio_output_d0.html", null ], [ "xpcc::stm32::GpioOutputD1", "structxpcc_1_1stm32_1_1_gpio_output_d1.html", null ], [ "xpcc::stm32::GpioOutputD10", "structxpcc_1_1stm32_1_1_gpio_output_d10.html", null ], [ "xpcc::stm32::GpioOutputD11", "structxpcc_1_1stm32_1_1_gpio_output_d11.html", null ], [ "xpcc::stm32::GpioOutputD12", "structxpcc_1_1stm32_1_1_gpio_output_d12.html", null ], [ "xpcc::stm32::GpioOutputD13", "structxpcc_1_1stm32_1_1_gpio_output_d13.html", null ], [ "xpcc::stm32::GpioOutputD14", "structxpcc_1_1stm32_1_1_gpio_output_d14.html", null ], [ "xpcc::stm32::GpioOutputD15", "structxpcc_1_1stm32_1_1_gpio_output_d15.html", null ], [ "xpcc::stm32::GpioOutputD2", "structxpcc_1_1stm32_1_1_gpio_output_d2.html", null ], [ "xpcc::stm32::GpioOutputD3", "structxpcc_1_1stm32_1_1_gpio_output_d3.html", null ], [ "xpcc::stm32::GpioOutputD4", "structxpcc_1_1stm32_1_1_gpio_output_d4.html", null ], [ "xpcc::stm32::GpioOutputD5", "structxpcc_1_1stm32_1_1_gpio_output_d5.html", null ], [ "xpcc::stm32::GpioOutputD6", "structxpcc_1_1stm32_1_1_gpio_output_d6.html", null ], [ "xpcc::stm32::GpioOutputD7", "structxpcc_1_1stm32_1_1_gpio_output_d7.html", null ], [ "xpcc::stm32::GpioOutputD8", "structxpcc_1_1stm32_1_1_gpio_output_d8.html", null ], [ "xpcc::stm32::GpioOutputD9", "structxpcc_1_1stm32_1_1_gpio_output_d9.html", null ], [ "xpcc::stm32::GpioOutputE0", "structxpcc_1_1stm32_1_1_gpio_output_e0.html", null ], [ "xpcc::stm32::GpioOutputE1", "structxpcc_1_1stm32_1_1_gpio_output_e1.html", null ], [ "xpcc::stm32::GpioOutputE10", "structxpcc_1_1stm32_1_1_gpio_output_e10.html", null ], [ "xpcc::stm32::GpioOutputE11", "structxpcc_1_1stm32_1_1_gpio_output_e11.html", null ], [ "xpcc::stm32::GpioOutputE12", "structxpcc_1_1stm32_1_1_gpio_output_e12.html", null ], [ "xpcc::stm32::GpioOutputE13", "structxpcc_1_1stm32_1_1_gpio_output_e13.html", null ], [ "xpcc::stm32::GpioOutputE14", "structxpcc_1_1stm32_1_1_gpio_output_e14.html", null ], [ "xpcc::stm32::GpioOutputE15", "structxpcc_1_1stm32_1_1_gpio_output_e15.html", null ], [ "xpcc::stm32::GpioOutputE2", "structxpcc_1_1stm32_1_1_gpio_output_e2.html", null ], [ "xpcc::stm32::GpioOutputE3", "structxpcc_1_1stm32_1_1_gpio_output_e3.html", null ], [ "xpcc::stm32::GpioOutputE4", "structxpcc_1_1stm32_1_1_gpio_output_e4.html", null ], [ "xpcc::stm32::GpioOutputE5", "structxpcc_1_1stm32_1_1_gpio_output_e5.html", null ], [ "xpcc::stm32::GpioOutputE6", "structxpcc_1_1stm32_1_1_gpio_output_e6.html", null ], [ "xpcc::stm32::GpioOutputE7", "structxpcc_1_1stm32_1_1_gpio_output_e7.html", null ], [ "xpcc::stm32::GpioOutputE8", "structxpcc_1_1stm32_1_1_gpio_output_e8.html", null ], [ "xpcc::stm32::GpioOutputE9", "structxpcc_1_1stm32_1_1_gpio_output_e9.html", null ], [ "xpcc::stm32::GpioOutputH0", "structxpcc_1_1stm32_1_1_gpio_output_h0.html", null ], [ "xpcc::stm32::GpioOutputH1", "structxpcc_1_1stm32_1_1_gpio_output_h1.html", null ] ] ] ] ], [ "xpcc::stm32::Gpio", "structxpcc_1_1stm32_1_1_gpio.html", [ [ "xpcc::stm32::GpioA0", "structxpcc_1_1stm32_1_1_gpio_a0.html", null ], [ "xpcc::stm32::GpioA1", "structxpcc_1_1stm32_1_1_gpio_a1.html", null ], [ "xpcc::stm32::GpioA10", "structxpcc_1_1stm32_1_1_gpio_a10.html", null ], [ "xpcc::stm32::GpioA11", "structxpcc_1_1stm32_1_1_gpio_a11.html", null ], [ "xpcc::stm32::GpioA12", "structxpcc_1_1stm32_1_1_gpio_a12.html", null ], [ "xpcc::stm32::GpioA13", "structxpcc_1_1stm32_1_1_gpio_a13.html", null ], [ "xpcc::stm32::GpioA14", "structxpcc_1_1stm32_1_1_gpio_a14.html", null ], [ "xpcc::stm32::GpioA15", "structxpcc_1_1stm32_1_1_gpio_a15.html", null ], [ "xpcc::stm32::GpioA2", "structxpcc_1_1stm32_1_1_gpio_a2.html", null ], [ "xpcc::stm32::GpioA3", "structxpcc_1_1stm32_1_1_gpio_a3.html", null ], [ "xpcc::stm32::GpioA4", "structxpcc_1_1stm32_1_1_gpio_a4.html", null ], [ "xpcc::stm32::GpioA5", "structxpcc_1_1stm32_1_1_gpio_a5.html", null ], [ "xpcc::stm32::GpioA6", "structxpcc_1_1stm32_1_1_gpio_a6.html", null ], [ "xpcc::stm32::GpioA7", "structxpcc_1_1stm32_1_1_gpio_a7.html", null ], [ "xpcc::stm32::GpioA8", "structxpcc_1_1stm32_1_1_gpio_a8.html", null ], [ "xpcc::stm32::GpioA9", "structxpcc_1_1stm32_1_1_gpio_a9.html", null ], [ "xpcc::stm32::GpioB0", "structxpcc_1_1stm32_1_1_gpio_b0.html", null ], [ "xpcc::stm32::GpioB1", "structxpcc_1_1stm32_1_1_gpio_b1.html", null ], [ "xpcc::stm32::GpioB10", "structxpcc_1_1stm32_1_1_gpio_b10.html", null ], [ "xpcc::stm32::GpioB11", "structxpcc_1_1stm32_1_1_gpio_b11.html", null ], [ "xpcc::stm32::GpioB12", "structxpcc_1_1stm32_1_1_gpio_b12.html", null ], [ "xpcc::stm32::GpioB13", "structxpcc_1_1stm32_1_1_gpio_b13.html", null ], [ "xpcc::stm32::GpioB14", "structxpcc_1_1stm32_1_1_gpio_b14.html", null ], [ "xpcc::stm32::GpioB15", "structxpcc_1_1stm32_1_1_gpio_b15.html", null ], [ "xpcc::stm32::GpioB2", "structxpcc_1_1stm32_1_1_gpio_b2.html", null ], [ "xpcc::stm32::GpioB3", "structxpcc_1_1stm32_1_1_gpio_b3.html", null ], [ "xpcc::stm32::GpioB4", "structxpcc_1_1stm32_1_1_gpio_b4.html", null ], [ "xpcc::stm32::GpioB5", "structxpcc_1_1stm32_1_1_gpio_b5.html", null ], [ "xpcc::stm32::GpioB6", "structxpcc_1_1stm32_1_1_gpio_b6.html", null ], [ "xpcc::stm32::GpioB7", "structxpcc_1_1stm32_1_1_gpio_b7.html", null ], [ "xpcc::stm32::GpioB8", "structxpcc_1_1stm32_1_1_gpio_b8.html", null ], [ "xpcc::stm32::GpioB9", "structxpcc_1_1stm32_1_1_gpio_b9.html", null ], [ "xpcc::stm32::GpioC0", "structxpcc_1_1stm32_1_1_gpio_c0.html", null ], [ "xpcc::stm32::GpioC1", "structxpcc_1_1stm32_1_1_gpio_c1.html", null ], [ "xpcc::stm32::GpioC10", "structxpcc_1_1stm32_1_1_gpio_c10.html", null ], [ "xpcc::stm32::GpioC11", "structxpcc_1_1stm32_1_1_gpio_c11.html", null ], [ "xpcc::stm32::GpioC12", "structxpcc_1_1stm32_1_1_gpio_c12.html", null ], [ "xpcc::stm32::GpioC13", "structxpcc_1_1stm32_1_1_gpio_c13.html", null ], [ "xpcc::stm32::GpioC14", "structxpcc_1_1stm32_1_1_gpio_c14.html", null ], [ "xpcc::stm32::GpioC15", "structxpcc_1_1stm32_1_1_gpio_c15.html", null ], [ "xpcc::stm32::GpioC2", "structxpcc_1_1stm32_1_1_gpio_c2.html", null ], [ "xpcc::stm32::GpioC3", "structxpcc_1_1stm32_1_1_gpio_c3.html", null ], [ "xpcc::stm32::GpioC4", "structxpcc_1_1stm32_1_1_gpio_c4.html", null ], [ "xpcc::stm32::GpioC5", "structxpcc_1_1stm32_1_1_gpio_c5.html", null ], [ "xpcc::stm32::GpioC6", "structxpcc_1_1stm32_1_1_gpio_c6.html", null ], [ "xpcc::stm32::GpioC7", "structxpcc_1_1stm32_1_1_gpio_c7.html", null ], [ "xpcc::stm32::GpioC8", "structxpcc_1_1stm32_1_1_gpio_c8.html", null ], [ "xpcc::stm32::GpioC9", "structxpcc_1_1stm32_1_1_gpio_c9.html", null ], [ "xpcc::stm32::GpioD0", "structxpcc_1_1stm32_1_1_gpio_d0.html", null ], [ "xpcc::stm32::GpioD1", "structxpcc_1_1stm32_1_1_gpio_d1.html", null ], [ "xpcc::stm32::GpioD10", "structxpcc_1_1stm32_1_1_gpio_d10.html", null ], [ "xpcc::stm32::GpioD11", "structxpcc_1_1stm32_1_1_gpio_d11.html", null ], [ "xpcc::stm32::GpioD12", "structxpcc_1_1stm32_1_1_gpio_d12.html", null ], [ "xpcc::stm32::GpioD13", "structxpcc_1_1stm32_1_1_gpio_d13.html", null ], [ "xpcc::stm32::GpioD14", "structxpcc_1_1stm32_1_1_gpio_d14.html", null ], [ "xpcc::stm32::GpioD15", "structxpcc_1_1stm32_1_1_gpio_d15.html", null ], [ "xpcc::stm32::GpioD2", "structxpcc_1_1stm32_1_1_gpio_d2.html", null ], [ "xpcc::stm32::GpioD3", "structxpcc_1_1stm32_1_1_gpio_d3.html", null ], [ "xpcc::stm32::GpioD4", "structxpcc_1_1stm32_1_1_gpio_d4.html", null ], [ "xpcc::stm32::GpioD5", "structxpcc_1_1stm32_1_1_gpio_d5.html", null ], [ "xpcc::stm32::GpioD6", "structxpcc_1_1stm32_1_1_gpio_d6.html", null ], [ "xpcc::stm32::GpioD7", "structxpcc_1_1stm32_1_1_gpio_d7.html", null ], [ "xpcc::stm32::GpioD8", "structxpcc_1_1stm32_1_1_gpio_d8.html", null ], [ "xpcc::stm32::GpioD9", "structxpcc_1_1stm32_1_1_gpio_d9.html", null ], [ "xpcc::stm32::GpioE0", "structxpcc_1_1stm32_1_1_gpio_e0.html", null ], [ "xpcc::stm32::GpioE1", "structxpcc_1_1stm32_1_1_gpio_e1.html", null ], [ "xpcc::stm32::GpioE10", "structxpcc_1_1stm32_1_1_gpio_e10.html", null ], [ "xpcc::stm32::GpioE11", "structxpcc_1_1stm32_1_1_gpio_e11.html", null ], [ "xpcc::stm32::GpioE12", "structxpcc_1_1stm32_1_1_gpio_e12.html", null ], [ "xpcc::stm32::GpioE13", "structxpcc_1_1stm32_1_1_gpio_e13.html", null ], [ "xpcc::stm32::GpioE14", "structxpcc_1_1stm32_1_1_gpio_e14.html", null ], [ "xpcc::stm32::GpioE15", "structxpcc_1_1stm32_1_1_gpio_e15.html", null ], [ "xpcc::stm32::GpioE2", "structxpcc_1_1stm32_1_1_gpio_e2.html", null ], [ "xpcc::stm32::GpioE3", "structxpcc_1_1stm32_1_1_gpio_e3.html", null ], [ "xpcc::stm32::GpioE4", "structxpcc_1_1stm32_1_1_gpio_e4.html", null ], [ "xpcc::stm32::GpioE5", "structxpcc_1_1stm32_1_1_gpio_e5.html", null ], [ "xpcc::stm32::GpioE6", "structxpcc_1_1stm32_1_1_gpio_e6.html", null ], [ "xpcc::stm32::GpioE7", "structxpcc_1_1stm32_1_1_gpio_e7.html", null ], [ "xpcc::stm32::GpioE8", "structxpcc_1_1stm32_1_1_gpio_e8.html", null ], [ "xpcc::stm32::GpioE9", "structxpcc_1_1stm32_1_1_gpio_e9.html", null ], [ "xpcc::stm32::GpioH0", "structxpcc_1_1stm32_1_1_gpio_h0.html", null ], [ "xpcc::stm32::GpioH1", "structxpcc_1_1stm32_1_1_gpio_h1.html", null ], [ "xpcc::stm32::GpioInputA0", "structxpcc_1_1stm32_1_1_gpio_input_a0.html", null ], [ "xpcc::stm32::GpioInputA1", "structxpcc_1_1stm32_1_1_gpio_input_a1.html", null ], [ "xpcc::stm32::GpioInputA10", "structxpcc_1_1stm32_1_1_gpio_input_a10.html", null ], [ "xpcc::stm32::GpioInputA11", "structxpcc_1_1stm32_1_1_gpio_input_a11.html", null ], [ "xpcc::stm32::GpioInputA12", "structxpcc_1_1stm32_1_1_gpio_input_a12.html", null ], [ "xpcc::stm32::GpioInputA13", "structxpcc_1_1stm32_1_1_gpio_input_a13.html", null ], [ "xpcc::stm32::GpioInputA14", "structxpcc_1_1stm32_1_1_gpio_input_a14.html", null ], [ "xpcc::stm32::GpioInputA15", "structxpcc_1_1stm32_1_1_gpio_input_a15.html", null ], [ "xpcc::stm32::GpioInputA2", "structxpcc_1_1stm32_1_1_gpio_input_a2.html", null ], [ "xpcc::stm32::GpioInputA3", "structxpcc_1_1stm32_1_1_gpio_input_a3.html", null ], [ "xpcc::stm32::GpioInputA4", "structxpcc_1_1stm32_1_1_gpio_input_a4.html", null ], [ "xpcc::stm32::GpioInputA5", "structxpcc_1_1stm32_1_1_gpio_input_a5.html", null ], [ "xpcc::stm32::GpioInputA6", "structxpcc_1_1stm32_1_1_gpio_input_a6.html", null ], [ "xpcc::stm32::GpioInputA7", "structxpcc_1_1stm32_1_1_gpio_input_a7.html", null ], [ "xpcc::stm32::GpioInputA8", "structxpcc_1_1stm32_1_1_gpio_input_a8.html", null ], [ "xpcc::stm32::GpioInputA9", "structxpcc_1_1stm32_1_1_gpio_input_a9.html", null ], [ "xpcc::stm32::GpioInputB0", "structxpcc_1_1stm32_1_1_gpio_input_b0.html", null ], [ "xpcc::stm32::GpioInputB1", "structxpcc_1_1stm32_1_1_gpio_input_b1.html", null ], [ "xpcc::stm32::GpioInputB10", "structxpcc_1_1stm32_1_1_gpio_input_b10.html", null ], [ "xpcc::stm32::GpioInputB11", "structxpcc_1_1stm32_1_1_gpio_input_b11.html", null ], [ "xpcc::stm32::GpioInputB12", "structxpcc_1_1stm32_1_1_gpio_input_b12.html", null ], [ "xpcc::stm32::GpioInputB13", "structxpcc_1_1stm32_1_1_gpio_input_b13.html", null ], [ "xpcc::stm32::GpioInputB14", "structxpcc_1_1stm32_1_1_gpio_input_b14.html", null ], [ "xpcc::stm32::GpioInputB15", "structxpcc_1_1stm32_1_1_gpio_input_b15.html", null ], [ "xpcc::stm32::GpioInputB2", "structxpcc_1_1stm32_1_1_gpio_input_b2.html", null ], [ "xpcc::stm32::GpioInputB3", "structxpcc_1_1stm32_1_1_gpio_input_b3.html", null ], [ "xpcc::stm32::GpioInputB4", "structxpcc_1_1stm32_1_1_gpio_input_b4.html", null ], [ "xpcc::stm32::GpioInputB5", "structxpcc_1_1stm32_1_1_gpio_input_b5.html", null ], [ "xpcc::stm32::GpioInputB6", "structxpcc_1_1stm32_1_1_gpio_input_b6.html", null ], [ "xpcc::stm32::GpioInputB7", "structxpcc_1_1stm32_1_1_gpio_input_b7.html", null ], [ "xpcc::stm32::GpioInputB8", "structxpcc_1_1stm32_1_1_gpio_input_b8.html", null ], [ "xpcc::stm32::GpioInputB9", "structxpcc_1_1stm32_1_1_gpio_input_b9.html", null ], [ "xpcc::stm32::GpioInputC0", "structxpcc_1_1stm32_1_1_gpio_input_c0.html", null ], [ "xpcc::stm32::GpioInputC1", "structxpcc_1_1stm32_1_1_gpio_input_c1.html", null ], [ "xpcc::stm32::GpioInputC10", "structxpcc_1_1stm32_1_1_gpio_input_c10.html", null ], [ "xpcc::stm32::GpioInputC11", "structxpcc_1_1stm32_1_1_gpio_input_c11.html", null ], [ "xpcc::stm32::GpioInputC12", "structxpcc_1_1stm32_1_1_gpio_input_c12.html", null ], [ "xpcc::stm32::GpioInputC13", "structxpcc_1_1stm32_1_1_gpio_input_c13.html", null ], [ "xpcc::stm32::GpioInputC14", "structxpcc_1_1stm32_1_1_gpio_input_c14.html", null ], [ "xpcc::stm32::GpioInputC15", "structxpcc_1_1stm32_1_1_gpio_input_c15.html", null ], [ "xpcc::stm32::GpioInputC2", "structxpcc_1_1stm32_1_1_gpio_input_c2.html", null ], [ "xpcc::stm32::GpioInputC3", "structxpcc_1_1stm32_1_1_gpio_input_c3.html", null ], [ "xpcc::stm32::GpioInputC4", "structxpcc_1_1stm32_1_1_gpio_input_c4.html", null ], [ "xpcc::stm32::GpioInputC5", "structxpcc_1_1stm32_1_1_gpio_input_c5.html", null ], [ "xpcc::stm32::GpioInputC6", "structxpcc_1_1stm32_1_1_gpio_input_c6.html", null ], [ "xpcc::stm32::GpioInputC7", "structxpcc_1_1stm32_1_1_gpio_input_c7.html", null ], [ "xpcc::stm32::GpioInputC8", "structxpcc_1_1stm32_1_1_gpio_input_c8.html", null ], [ "xpcc::stm32::GpioInputC9", "structxpcc_1_1stm32_1_1_gpio_input_c9.html", null ], [ "xpcc::stm32::GpioInputD0", "structxpcc_1_1stm32_1_1_gpio_input_d0.html", null ], [ "xpcc::stm32::GpioInputD1", "structxpcc_1_1stm32_1_1_gpio_input_d1.html", null ], [ "xpcc::stm32::GpioInputD10", "structxpcc_1_1stm32_1_1_gpio_input_d10.html", null ], [ "xpcc::stm32::GpioInputD11", "structxpcc_1_1stm32_1_1_gpio_input_d11.html", null ], [ "xpcc::stm32::GpioInputD12", "structxpcc_1_1stm32_1_1_gpio_input_d12.html", null ], [ "xpcc::stm32::GpioInputD13", "structxpcc_1_1stm32_1_1_gpio_input_d13.html", null ], [ "xpcc::stm32::GpioInputD14", "structxpcc_1_1stm32_1_1_gpio_input_d14.html", null ], [ "xpcc::stm32::GpioInputD15", "structxpcc_1_1stm32_1_1_gpio_input_d15.html", null ], [ "xpcc::stm32::GpioInputD2", "structxpcc_1_1stm32_1_1_gpio_input_d2.html", null ], [ "xpcc::stm32::GpioInputD3", "structxpcc_1_1stm32_1_1_gpio_input_d3.html", null ], [ "xpcc::stm32::GpioInputD4", "structxpcc_1_1stm32_1_1_gpio_input_d4.html", null ], [ "xpcc::stm32::GpioInputD5", "structxpcc_1_1stm32_1_1_gpio_input_d5.html", null ], [ "xpcc::stm32::GpioInputD6", "structxpcc_1_1stm32_1_1_gpio_input_d6.html", null ], [ "xpcc::stm32::GpioInputD7", "structxpcc_1_1stm32_1_1_gpio_input_d7.html", null ], [ "xpcc::stm32::GpioInputD8", "structxpcc_1_1stm32_1_1_gpio_input_d8.html", null ], [ "xpcc::stm32::GpioInputD9", "structxpcc_1_1stm32_1_1_gpio_input_d9.html", null ], [ "xpcc::stm32::GpioInputE0", "structxpcc_1_1stm32_1_1_gpio_input_e0.html", null ], [ "xpcc::stm32::GpioInputE1", "structxpcc_1_1stm32_1_1_gpio_input_e1.html", null ], [ "xpcc::stm32::GpioInputE10", "structxpcc_1_1stm32_1_1_gpio_input_e10.html", null ], [ "xpcc::stm32::GpioInputE11", "structxpcc_1_1stm32_1_1_gpio_input_e11.html", null ], [ "xpcc::stm32::GpioInputE12", "structxpcc_1_1stm32_1_1_gpio_input_e12.html", null ], [ "xpcc::stm32::GpioInputE13", "structxpcc_1_1stm32_1_1_gpio_input_e13.html", null ], [ "xpcc::stm32::GpioInputE14", "structxpcc_1_1stm32_1_1_gpio_input_e14.html", null ], [ "xpcc::stm32::GpioInputE15", "structxpcc_1_1stm32_1_1_gpio_input_e15.html", null ], [ "xpcc::stm32::GpioInputE2", "structxpcc_1_1stm32_1_1_gpio_input_e2.html", null ], [ "xpcc::stm32::GpioInputE3", "structxpcc_1_1stm32_1_1_gpio_input_e3.html", null ], [ "xpcc::stm32::GpioInputE4", "structxpcc_1_1stm32_1_1_gpio_input_e4.html", null ], [ "xpcc::stm32::GpioInputE5", "structxpcc_1_1stm32_1_1_gpio_input_e5.html", null ], [ "xpcc::stm32::GpioInputE6", "structxpcc_1_1stm32_1_1_gpio_input_e6.html", null ], [ "xpcc::stm32::GpioInputE7", "structxpcc_1_1stm32_1_1_gpio_input_e7.html", null ], [ "xpcc::stm32::GpioInputE8", "structxpcc_1_1stm32_1_1_gpio_input_e8.html", null ], [ "xpcc::stm32::GpioInputE9", "structxpcc_1_1stm32_1_1_gpio_input_e9.html", null ], [ "xpcc::stm32::GpioInputH0", "structxpcc_1_1stm32_1_1_gpio_input_h0.html", null ], [ "xpcc::stm32::GpioInputH1", "structxpcc_1_1stm32_1_1_gpio_input_h1.html", null ], [ "xpcc::stm32::GpioOutputA0", "structxpcc_1_1stm32_1_1_gpio_output_a0.html", null ], [ "xpcc::stm32::GpioOutputA1", "structxpcc_1_1stm32_1_1_gpio_output_a1.html", null ], [ "xpcc::stm32::GpioOutputA10", "structxpcc_1_1stm32_1_1_gpio_output_a10.html", null ], [ "xpcc::stm32::GpioOutputA11", "structxpcc_1_1stm32_1_1_gpio_output_a11.html", null ], [ "xpcc::stm32::GpioOutputA12", "structxpcc_1_1stm32_1_1_gpio_output_a12.html", null ], [ "xpcc::stm32::GpioOutputA13", "structxpcc_1_1stm32_1_1_gpio_output_a13.html", null ], [ "xpcc::stm32::GpioOutputA14", "structxpcc_1_1stm32_1_1_gpio_output_a14.html", null ], [ "xpcc::stm32::GpioOutputA15", "structxpcc_1_1stm32_1_1_gpio_output_a15.html", null ], [ "xpcc::stm32::GpioOutputA2", "structxpcc_1_1stm32_1_1_gpio_output_a2.html", null ], [ "xpcc::stm32::GpioOutputA3", "structxpcc_1_1stm32_1_1_gpio_output_a3.html", null ], [ "xpcc::stm32::GpioOutputA4", "structxpcc_1_1stm32_1_1_gpio_output_a4.html", null ], [ "xpcc::stm32::GpioOutputA5", "structxpcc_1_1stm32_1_1_gpio_output_a5.html", null ], [ "xpcc::stm32::GpioOutputA6", "structxpcc_1_1stm32_1_1_gpio_output_a6.html", null ], [ "xpcc::stm32::GpioOutputA7", "structxpcc_1_1stm32_1_1_gpio_output_a7.html", null ], [ "xpcc::stm32::GpioOutputA8", "structxpcc_1_1stm32_1_1_gpio_output_a8.html", null ], [ "xpcc::stm32::GpioOutputA9", "structxpcc_1_1stm32_1_1_gpio_output_a9.html", null ], [ "xpcc::stm32::GpioOutputB0", "structxpcc_1_1stm32_1_1_gpio_output_b0.html", null ], [ "xpcc::stm32::GpioOutputB1", "structxpcc_1_1stm32_1_1_gpio_output_b1.html", null ], [ "xpcc::stm32::GpioOutputB10", "structxpcc_1_1stm32_1_1_gpio_output_b10.html", null ], [ "xpcc::stm32::GpioOutputB11", "structxpcc_1_1stm32_1_1_gpio_output_b11.html", null ], [ "xpcc::stm32::GpioOutputB12", "structxpcc_1_1stm32_1_1_gpio_output_b12.html", null ], [ "xpcc::stm32::GpioOutputB13", "structxpcc_1_1stm32_1_1_gpio_output_b13.html", null ], [ "xpcc::stm32::GpioOutputB14", "structxpcc_1_1stm32_1_1_gpio_output_b14.html", null ], [ "xpcc::stm32::GpioOutputB15", "structxpcc_1_1stm32_1_1_gpio_output_b15.html", null ], [ "xpcc::stm32::GpioOutputB2", "structxpcc_1_1stm32_1_1_gpio_output_b2.html", null ], [ "xpcc::stm32::GpioOutputB3", "structxpcc_1_1stm32_1_1_gpio_output_b3.html", null ], [ "xpcc::stm32::GpioOutputB4", "structxpcc_1_1stm32_1_1_gpio_output_b4.html", null ], [ "xpcc::stm32::GpioOutputB5", "structxpcc_1_1stm32_1_1_gpio_output_b5.html", null ], [ "xpcc::stm32::GpioOutputB6", "structxpcc_1_1stm32_1_1_gpio_output_b6.html", null ], [ "xpcc::stm32::GpioOutputB7", "structxpcc_1_1stm32_1_1_gpio_output_b7.html", null ], [ "xpcc::stm32::GpioOutputB8", "structxpcc_1_1stm32_1_1_gpio_output_b8.html", null ], [ "xpcc::stm32::GpioOutputB9", "structxpcc_1_1stm32_1_1_gpio_output_b9.html", null ], [ "xpcc::stm32::GpioOutputC0", "structxpcc_1_1stm32_1_1_gpio_output_c0.html", null ], [ "xpcc::stm32::GpioOutputC1", "structxpcc_1_1stm32_1_1_gpio_output_c1.html", null ], [ "xpcc::stm32::GpioOutputC10", "structxpcc_1_1stm32_1_1_gpio_output_c10.html", null ], [ "xpcc::stm32::GpioOutputC11", "structxpcc_1_1stm32_1_1_gpio_output_c11.html", null ], [ "xpcc::stm32::GpioOutputC12", "structxpcc_1_1stm32_1_1_gpio_output_c12.html", null ], [ "xpcc::stm32::GpioOutputC13", "structxpcc_1_1stm32_1_1_gpio_output_c13.html", null ], [ "xpcc::stm32::GpioOutputC14", "structxpcc_1_1stm32_1_1_gpio_output_c14.html", null ], [ "xpcc::stm32::GpioOutputC15", "structxpcc_1_1stm32_1_1_gpio_output_c15.html", null ], [ "xpcc::stm32::GpioOutputC2", "structxpcc_1_1stm32_1_1_gpio_output_c2.html", null ], [ "xpcc::stm32::GpioOutputC3", "structxpcc_1_1stm32_1_1_gpio_output_c3.html", null ], [ "xpcc::stm32::GpioOutputC4", "structxpcc_1_1stm32_1_1_gpio_output_c4.html", null ], [ "xpcc::stm32::GpioOutputC5", "structxpcc_1_1stm32_1_1_gpio_output_c5.html", null ], [ "xpcc::stm32::GpioOutputC6", "structxpcc_1_1stm32_1_1_gpio_output_c6.html", null ], [ "xpcc::stm32::GpioOutputC7", "structxpcc_1_1stm32_1_1_gpio_output_c7.html", null ], [ "xpcc::stm32::GpioOutputC8", "structxpcc_1_1stm32_1_1_gpio_output_c8.html", null ], [ "xpcc::stm32::GpioOutputC9", "structxpcc_1_1stm32_1_1_gpio_output_c9.html", null ], [ "xpcc::stm32::GpioOutputD0", "structxpcc_1_1stm32_1_1_gpio_output_d0.html", null ], [ "xpcc::stm32::GpioOutputD1", "structxpcc_1_1stm32_1_1_gpio_output_d1.html", null ], [ "xpcc::stm32::GpioOutputD10", "structxpcc_1_1stm32_1_1_gpio_output_d10.html", null ], [ "xpcc::stm32::GpioOutputD11", "structxpcc_1_1stm32_1_1_gpio_output_d11.html", null ], [ "xpcc::stm32::GpioOutputD12", "structxpcc_1_1stm32_1_1_gpio_output_d12.html", null ], [ "xpcc::stm32::GpioOutputD13", "structxpcc_1_1stm32_1_1_gpio_output_d13.html", null ], [ "xpcc::stm32::GpioOutputD14", "structxpcc_1_1stm32_1_1_gpio_output_d14.html", null ], [ "xpcc::stm32::GpioOutputD15", "structxpcc_1_1stm32_1_1_gpio_output_d15.html", null ], [ "xpcc::stm32::GpioOutputD2", "structxpcc_1_1stm32_1_1_gpio_output_d2.html", null ], [ "xpcc::stm32::GpioOutputD3", "structxpcc_1_1stm32_1_1_gpio_output_d3.html", null ], [ "xpcc::stm32::GpioOutputD4", "structxpcc_1_1stm32_1_1_gpio_output_d4.html", null ], [ "xpcc::stm32::GpioOutputD5", "structxpcc_1_1stm32_1_1_gpio_output_d5.html", null ], [ "xpcc::stm32::GpioOutputD6", "structxpcc_1_1stm32_1_1_gpio_output_d6.html", null ], [ "xpcc::stm32::GpioOutputD7", "structxpcc_1_1stm32_1_1_gpio_output_d7.html", null ], [ "xpcc::stm32::GpioOutputD8", "structxpcc_1_1stm32_1_1_gpio_output_d8.html", null ], [ "xpcc::stm32::GpioOutputD9", "structxpcc_1_1stm32_1_1_gpio_output_d9.html", null ], [ "xpcc::stm32::GpioOutputE0", "structxpcc_1_1stm32_1_1_gpio_output_e0.html", null ], [ "xpcc::stm32::GpioOutputE1", "structxpcc_1_1stm32_1_1_gpio_output_e1.html", null ], [ "xpcc::stm32::GpioOutputE10", "structxpcc_1_1stm32_1_1_gpio_output_e10.html", null ], [ "xpcc::stm32::GpioOutputE11", "structxpcc_1_1stm32_1_1_gpio_output_e11.html", null ], [ "xpcc::stm32::GpioOutputE12", "structxpcc_1_1stm32_1_1_gpio_output_e12.html", null ], [ "xpcc::stm32::GpioOutputE13", "structxpcc_1_1stm32_1_1_gpio_output_e13.html", null ], [ "xpcc::stm32::GpioOutputE14", "structxpcc_1_1stm32_1_1_gpio_output_e14.html", null ], [ "xpcc::stm32::GpioOutputE15", "structxpcc_1_1stm32_1_1_gpio_output_e15.html", null ], [ "xpcc::stm32::GpioOutputE2", "structxpcc_1_1stm32_1_1_gpio_output_e2.html", null ], [ "xpcc::stm32::GpioOutputE3", "structxpcc_1_1stm32_1_1_gpio_output_e3.html", null ], [ "xpcc::stm32::GpioOutputE4", "structxpcc_1_1stm32_1_1_gpio_output_e4.html", null ], [ "xpcc::stm32::GpioOutputE5", "structxpcc_1_1stm32_1_1_gpio_output_e5.html", null ], [ "xpcc::stm32::GpioOutputE6", "structxpcc_1_1stm32_1_1_gpio_output_e6.html", null ], [ "xpcc::stm32::GpioOutputE7", "structxpcc_1_1stm32_1_1_gpio_output_e7.html", null ], [ "xpcc::stm32::GpioOutputE8", "structxpcc_1_1stm32_1_1_gpio_output_e8.html", null ], [ "xpcc::stm32::GpioOutputE9", "structxpcc_1_1stm32_1_1_gpio_output_e9.html", null ], [ "xpcc::stm32::GpioOutputH0", "structxpcc_1_1stm32_1_1_gpio_output_h0.html", null ], [ "xpcc::stm32::GpioOutputH1", "structxpcc_1_1stm32_1_1_gpio_output_h1.html", null ] ] ], [ "xpcc::GpioExpander", "classxpcc_1_1_gpio_expander.html", [ [ "xpcc::Mcp23x17< Transport >", "classxpcc_1_1_mcp23x17.html", null ], [ "xpcc::Pca8574< I2cMaster >", "classxpcc_1_1_pca8574.html", null ], [ "xpcc::Pca9535< I2cMaster >", "classxpcc_1_1_pca9535.html", null ] ] ], [ "xpcc::GpioPort", "classxpcc_1_1_gpio_port.html", [ [ "xpcc::GpioExpanderPort< GpioExpander, expander, StartPin, Width, DataOrder >", "classxpcc_1_1_gpio_expander_port.html", null ], [ "xpcc::SoftwareGpioPort< Gpios >", "classxpcc_1_1_software_gpio_port.html", null ], [ "xpcc::SoftwareGpioPort< Gpios >", "classxpcc_1_1_software_gpio_port.html", null ], [ "xpcc::stm32::GpioPort< StartPin, Width, PortOrder >", "classxpcc_1_1stm32_1_1_gpio_port.html", null ] ] ], [ "xpcc::hclax", "structxpcc_1_1hclax.html", [ [ "xpcc::HclaX< I2cMaster >", "classxpcc_1_1_hcla_x.html", null ] ] ], [ "xpcc::Hd44780Base< DATA, RW, RS, E >", "classxpcc_1_1_hd44780_base.html", null ], [ "xpcc::Header", "structxpcc_1_1_header.html", null ], [ "xpcc::tipc::Header", "structxpcc_1_1tipc_1_1_header.html", null ], [ "xpcc::Nrf24Data< Nrf24Phy >::Header", "classxpcc_1_1_nrf24_data.html#structxpcc_1_1_nrf24_data_1_1_header", null ], [ "xpcc::hmc58x3", "structxpcc_1_1hmc58x3.html", [ [ "xpcc::hmc5843", "structxpcc_1_1hmc5843.html", [ [ "xpcc::Hmc5843< I2cMaster >", "classxpcc_1_1_hmc5843.html", null ] ] ], [ "xpcc::hmc5883", "structxpcc_1_1hmc5883.html", [ [ "xpcc::Hmc5883< I2cMaster >", "classxpcc_1_1_hmc5883.html", null ] ] ], [ "xpcc::Hmc58x3< I2cMaster >", "classxpcc_1_1_hmc58x3.html", [ [ "xpcc::Hmc5843< I2cMaster >", "classxpcc_1_1_hmc5843.html", null ], [ "xpcc::Hmc5883< I2cMaster >", "classxpcc_1_1_hmc5883.html", null ] ] ] ] ], [ "xpcc::hmc6343", "structxpcc_1_1hmc6343.html", [ [ "xpcc::Hmc6343< I2cMaster >", "classxpcc_1_1_hmc6343.html", null ] ] ], [ "xpcc::color::HsvT< UnderlyingType >", "classxpcc_1_1color_1_1_hsv_t.html", null ], [ "xpcc::I2c", "structxpcc_1_1_i2c.html", [ [ "xpcc::I2cMaster", "classxpcc_1_1_i2c_master.html", [ [ "xpcc::SoftwareI2cMaster< SCL, SDA >", "classxpcc_1_1_software_i2c_master.html", null ], [ "xpcc::SoftwareI2cMaster< SCL, SDA >", "classxpcc_1_1_software_i2c_master.html", null ], [ "xpcc::stm32::I2cMaster1", "classxpcc_1_1stm32_1_1_i2c_master1.html", null ], [ "xpcc::stm32::I2cMaster2", "classxpcc_1_1stm32_1_1_i2c_master2.html", null ], [ "xpcc::stm32::I2cMaster3", "classxpcc_1_1stm32_1_1_i2c_master3.html", null ] ] ], [ "xpcc::I2cTransaction", "classxpcc_1_1_i2c_transaction.html", [ [ "xpcc::I2cReadTransaction", "classxpcc_1_1_i2c_read_transaction.html", null ], [ "xpcc::I2cWriteReadTransaction", "classxpcc_1_1_i2c_write_read_transaction.html", [ [ "xpcc::Adxl345< I2cMaster >", "classxpcc_1_1_adxl345.html", null ], [ "xpcc::Bma180< I2cMaster >", "classxpcc_1_1_bma180.html", null ] ] ], [ "xpcc::I2cWriteTransaction", "classxpcc_1_1_i2c_write_transaction.html", null ] ] ] ] ], [ "xpcc::stm32::TypeId::I2cMaster1Scl", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master1_scl.html", null ], [ "xpcc::stm32::TypeId::I2cMaster1Sda", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master1_sda.html", null ], [ "xpcc::stm32::TypeId::I2cMaster2Scl", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master2_scl.html", null ], [ "xpcc::stm32::TypeId::I2cMaster2Sda", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master2_sda.html", null ], [ "xpcc::stm32::TypeId::I2cMaster3Scl", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master3_scl.html", null ], [ "xpcc::stm32::TypeId::I2cMaster3Sda", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master3_sda.html", null ], [ "xpcc::stm32::TypeId::I2cMaster4Scl", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master4_scl.html", null ], [ "xpcc::stm32::TypeId::I2cMaster4Sda", "structxpcc_1_1stm32_1_1_type_id_1_1_i2c_master4_sda.html", null ], [ "xpcc::xmega::TypeId::I2cMasterCScl", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_c_scl.html", null ], [ "xpcc::xmega::TypeId::I2cMasterCSda", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_c_sda.html", null ], [ "xpcc::xmega::TypeId::I2cMasterDScl", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_d_scl.html", null ], [ "xpcc::xmega::TypeId::I2cMasterDSda", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_d_sda.html", null ], [ "xpcc::xmega::TypeId::I2cMasterEScl", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_e_scl.html", null ], [ "xpcc::xmega::TypeId::I2cMasterESda", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_e_sda.html", null ], [ "xpcc::xmega::TypeId::I2cMasterFScl", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_f_scl.html", null ], [ "xpcc::xmega::TypeId::I2cMasterFSda", "structxpcc_1_1xmega_1_1_type_id_1_1_i2c_master_f_sda.html", null ], [ "xpcc::ui::Indicator< T >", "classxpcc_1_1ui_1_1_indicator.html", null ], [ "xpcc::gui::InputEvent", "classxpcc_1_1gui_1_1_input_event.html", null ], [ "xpcc::rpr::Interface< Device, N >", "classxpcc_1_1rpr_1_1_interface.html", null ], [ "xpcc::sab::Interface< Device >", "classxpcc_1_1sab_1_1_interface.html", null ], [ "xpcc::sab2::Interface< Device, N >", "classxpcc_1_1sab2_1_1_interface.html", null ], [ "xpcc::amnb::Interface< Device, PROBABILITY, TIMEOUT >", "classxpcc_1_1amnb_1_1_interface.html", null ], [ "xpcc::stm32::InternalClock< InputFrequency >", "classxpcc_1_1stm32_1_1_internal_clock.html", null ], [ "xpcc::lpc::TypeId::InternalClock", "structxpcc_1_1lpc_1_1_type_id_1_1_internal_clock.html", null ], [ "xpcc::stm32::TypeId::InternalClock", "structxpcc_1_1stm32_1_1_type_id_1_1_internal_clock.html", null ], [ "xpcc::stm32::InternalClock< MHz16 >", "classxpcc_1_1stm32_1_1_internal_clock_3_01_m_hz16_01_4.html", null ], [ "xpcc::IODevice", "classxpcc_1_1_i_o_device.html", [ [ "xpcc::CharacterDisplay::Writer", "classxpcc_1_1_character_display_1_1_writer.html", null ], [ "xpcc::GraphicDisplay::Writer", "classxpcc_1_1_graphic_display_1_1_writer.html", null ], [ "xpcc::hosted::SerialInterface", "classxpcc_1_1hosted_1_1_serial_interface.html", null ], [ "xpcc::hosted::SerialPort", "classxpcc_1_1hosted_1_1_serial_port.html", null ], [ "xpcc::IODeviceWrapper< Device, behavior >", "classxpcc_1_1_i_o_device_wrapper.html", null ], [ "xpcc::log::StyleWrapper< STYLE >", "classxpcc_1_1log_1_1_style_wrapper.html", null ], [ "xpcc::pc::Terminal", "classxpcc_1_1pc_1_1_terminal.html", null ] ] ], [ "xpcc::IOStream", "classxpcc_1_1_i_o_stream.html", [ [ "xpcc::CharacterDisplay", "classxpcc_1_1_character_display.html", [ [ "xpcc::St7036< SPI, CS, RS, 16, 2 >", "classxpcc_1_1_st7036.html", [ [ "xpcc::DogM162< SPI, CS, RS >", "classxpcc_1_1_dog_m162.html", null ] ] ], [ "xpcc::St7036< SPI, CS, RS, 16, 3 >", "classxpcc_1_1_st7036.html", [ [ "xpcc::DogM163< SPI, CS, RS >", "classxpcc_1_1_dog_m163.html", null ] ] ], [ "xpcc::St7036< SPI, CS, RS, 8, 1 >", "classxpcc_1_1_st7036.html", [ [ "xpcc::DogM081< SPI, CS, RS >", "classxpcc_1_1_dog_m081.html", null ] ] ], [ "xpcc::Hd44780< DATA, RW, RS, E >", "classxpcc_1_1_hd44780.html", null ], [ "xpcc::Hd44780Dual< DATA, RW, RS, E1, E2 >", "classxpcc_1_1_hd44780_dual.html", null ], [ "xpcc::St7036< SPI, CS, RS, Width, Heigth >", "classxpcc_1_1_st7036.html", null ] ] ], [ "xpcc::GraphicDisplay", "classxpcc_1_1_graphic_display.html", [ [ "xpcc::BufferedGraphicDisplay< 101, 80 >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::SiemensM55< SPI, CS, RS, Reset >", "classxpcc_1_1_siemens_m55.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 128, 64 >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::Ks0108< E, RW, RS, PIN_CS1, PIN_CS2, PORT >", "classxpcc_1_1_ks0108.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 128, Height >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::Ssd1306< I2cMaster, Height >", "classxpcc_1_1_ssd1306.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 130, 128 >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::Nokia6610< SPI, CS, Reset, GE12 >", "classxpcc_1_1_nokia6610.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 132, 176 >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::SiemensS65Portrait< SPI, CS, RS, Reset >", "classxpcc_1_1_siemens_s65_portrait.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 176, 136 >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::SiemensS65Landscape< SPI, CS, RS, Reset >", "classxpcc_1_1_siemens_s65_landscape.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 8 *COLUMNS, 8 *ROWS >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::Max7219matrix< SPI, CS, COLUMNS, ROWS >", "classxpcc_1_1_max7219matrix.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< 84, 48 >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::Nokia5110< Spi, Ce, Dc, Reset >", "classxpcc_1_1_nokia5110.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< WIDTH, HEIGHT >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::SiemensS75Common< MEMORY, RESET, 136, 176, xpcc::Orientation::Portrait >", "classxpcc_1_1_siemens_s75_common.html", [ [ "xpcc::SiemensS75Portrait< MEMORY, RESET >", "classxpcc_1_1_siemens_s75_portrait.html", null ] ] ], [ "xpcc::SiemensS75Common< MEMORY, RESET, 136, 176, xpcc::Orientation::PortraitUpsideDown >", "classxpcc_1_1_siemens_s75_common.html", [ [ "xpcc::SiemensS75PortraitUpsideDown< MEMORY, RESET >", "classxpcc_1_1_siemens_s75_portrait_upside_down.html", null ] ] ], [ "xpcc::SiemensS75Common< MEMORY, RESET, 176, 136, xpcc::Orientation::LandscapeLeft >", "classxpcc_1_1_siemens_s75_common.html", [ [ "xpcc::SiemensS75LandscapeLeft< MEMORY, RESET >", "classxpcc_1_1_siemens_s75_landscape_left.html", null ] ] ], [ "xpcc::SiemensS75Common< MEMORY, RESET, 176, 136, xpcc::Orientation::LandscapeRight >", "classxpcc_1_1_siemens_s75_common.html", [ [ "xpcc::SiemensS75LandscapeRight< MEMORY, RESET >", "classxpcc_1_1_siemens_s75_landscape_right.html", null ] ] ], [ "xpcc::SiemensS75Common< MEMORY, RESET, WIDTH, HEIGHT, ORIENTATION >", "classxpcc_1_1_siemens_s75_common.html", null ] ] ], [ "xpcc::BufferedGraphicDisplay< Width, Height >", "classxpcc_1_1_buffered_graphic_display.html", [ [ "xpcc::St7565< SPI, CS, A0, Reset, 102, 64, TopView >", "classxpcc_1_1_st7565.html", [ [ "xpcc::DogS102< SPI, CS, A0, Reset, TopView >", "classxpcc_1_1_dog_s102.html", null ] ] ], [ "xpcc::St7565< SPI, CS, A0, Reset, 128, 64, TopView >", "classxpcc_1_1_st7565.html", [ [ "xpcc::DogL128< SPI, CS, A0, Reset, TopView >", "classxpcc_1_1_dog_l128.html", null ], [ "xpcc::DogM128< SPI, CS, A0, Reset, TopView >", "classxpcc_1_1_dog_m128.html", null ] ] ], [ "xpcc::St7565< SPI, CS, A0, Reset, 132, 32, TopView >", "classxpcc_1_1_st7565.html", [ [ "xpcc::DogM132< SPI, CS, A0, Reset, TopView >", "classxpcc_1_1_dog_m132.html", null ] ] ], [ "xpcc::St7565< SPI, CS, A0, Reset, Width, Height, TopView >", "classxpcc_1_1_st7565.html", null ] ] ], [ "xpcc::ParallelTft< INTERFACE >", "classxpcc_1_1_parallel_tft.html", null ], [ "xpcc::SDLDisplay", "classxpcc_1_1_s_d_l_display.html", null ], [ "xpcc::VirtualGraphicDisplay", "classxpcc_1_1_virtual_graphic_display.html", null ] ] ], [ "xpcc::log::Logger", "classxpcc_1_1log_1_1_logger.html", null ] ] ], [ "xpcc::DoublyLinkedList< T, Allocator >::iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html", null ], [ "xpcc::DynamicArray< T, Allocator >::iterator", "classxpcc_1_1_dynamic_array_1_1iterator.html", null ], [ "xpcc::LinkedList< T, Allocator >::iterator", "classxpcc_1_1_linked_list_1_1iterator.html", null ], [ "xpcc::itg3200", "structxpcc_1_1itg3200.html", [ [ "xpcc::Itg3200< I2cMaster >", "classxpcc_1_1_itg3200.html", null ] ] ], [ "xpcc::ui::KeyFrame< T, N >", "structxpcc_1_1ui_1_1_key_frame.html", null ], [ "xpcc::ui::KeyFrame< T >", "structxpcc_1_1ui_1_1_key_frame.html", null ], [ "xpcc::ui::KeyFrameAnimation< T, N >", "classxpcc_1_1ui_1_1_key_frame_animation.html", null ], [ "xpcc::ui::KeyFrameAnimation< T >", "classxpcc_1_1ui_1_1_key_frame_animation.html", null ], [ "xpcc::l3gd20", "structxpcc_1_1l3gd20.html", [ [ "xpcc::L3gd20< Transport >", "classxpcc_1_1_l3gd20.html", null ] ] ], [ "xpcc::interpolation::Lagrange< T, Accessor >", "classxpcc_1_1interpolation_1_1_lagrange.html", null ], [ "xpcc::ui::Led", "classxpcc_1_1ui_1_1_led.html", null ], [ "xpcc::Line2D< T >", "classxpcc_1_1_line2_d.html", null ], [ "xpcc::interpolation::Linear< T, Accessor >", "classxpcc_1_1interpolation_1_1_linear.html", null ], [ "xpcc::LineSegment2D< T >", "classxpcc_1_1_line_segment2_d.html", null ], [ "xpcc::LinkedList< T, Allocator >", "classxpcc_1_1_linked_list.html", null ], [ "xpcc::LinkedList< Entry >", "classxpcc_1_1_linked_list.html", null ], [ "xpcc::LinkedList< ReceiveListItem >", "classxpcc_1_1_linked_list.html", null ], [ "xpcc::LinkedList< SendListItem >", "classxpcc_1_1_linked_list.html", null ], [ "xpcc::LinkedList< xpcc::AbstractView * >", "classxpcc_1_1_linked_list.html", null ], [ "xpcc::LinkedList< xpcc::gui::View * >", "classxpcc_1_1_linked_list.html", null ], [ "xpcc::lis302dl", "structxpcc_1_1lis302dl.html", [ [ "xpcc::Lis302dl< Transport >", "classxpcc_1_1_lis302dl.html", null ] ] ], [ "xpcc::lis3dsh", "structxpcc_1_1lis3dsh.html", [ [ "xpcc::Lis3dsh< Transport >", "classxpcc_1_1_lis3dsh.html", null ] ] ], [ "xpcc::rpr::Listener", "structxpcc_1_1rpr_1_1_listener.html", null ], [ "xpcc::amnb::Listener", "structxpcc_1_1amnb_1_1_listener.html", null ], [ "xpcc::lm75", "structxpcc_1_1lm75.html", [ [ "xpcc::Lm75< I2cMaster >", "classxpcc_1_1_lm75.html", [ [ "xpcc::Tmp102< I2cMaster >", "classxpcc_1_1_tmp102.html", null ], [ "xpcc::Tmp175< I2cMaster >", "classxpcc_1_1_tmp175.html", null ] ] ], [ "xpcc::tmp102", "structxpcc_1_1tmp102.html", [ [ "xpcc::Tmp102< I2cMaster >", "classxpcc_1_1_tmp102.html", null ] ] ], [ "xpcc::tmp175", "structxpcc_1_1tmp175.html", [ [ "xpcc::Tmp175< I2cMaster >", "classxpcc_1_1_tmp175.html", null ] ] ] ] ], [ "xpcc::Location2D< T >", "classxpcc_1_1_location2_d.html", null ], [ "xpcc::rtos::Thread::Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html", null ], [ "xpcc::atomic::Lock", "classxpcc_1_1atomic_1_1_lock.html", null ], [ "lock_guard", null, [ [ "xpcc::rtos::MutexGuard", "classxpcc_1_1rtos_1_1_mutex_guard.html", null ] ] ], [ "xpcc::lpc::Lpc11PllSettings< InputFrequency, SystemFrequency >", "classxpcc_1_1lpc_1_1_lpc11_pll_settings.html", null ], [ "xpcc::lsm303a", "structxpcc_1_1lsm303a.html", [ [ "xpcc::Lsm303a< I2cMaster >", "classxpcc_1_1_lsm303a.html", null ] ] ], [ "xpcc::LUDecomposition", "classxpcc_1_1_l_u_decomposition.html", null ], [ "xpcc::sab::Master< Interface >", "classxpcc_1_1sab_1_1_master.html", null ], [ "xpcc::Matrix< T, ROWS, COLUMNS >", "classxpcc_1_1_matrix.html", null ], [ "xpcc::MAX6966< Spi, Cs, DRIVERS >", "classxpcc_1_1_m_a_x6966.html", null ], [ "xpcc::Max7219< SPI, CS, MODULES >", "classxpcc_1_1_max7219.html", null ], [ "xpcc::Max7219< SPI, CS, COLUMNS *ROWS >", "classxpcc_1_1_max7219.html", null ], [ "xpcc::Mcp23s08< Spi, Cs, Int >", "classxpcc_1_1_mcp23s08.html", null ], [ "xpcc::mcp23x17", "structxpcc_1_1mcp23x17.html", [ [ "xpcc::Mcp23x17< Transport >", "classxpcc_1_1_mcp23x17.html", null ] ] ], [ "xpcc::Mcp4922< Spi, Cs, Ldac >", "classxpcc_1_1_mcp4922.html", null ], [ "xpcc::filter::Median< T, N >", "classxpcc_1_1filter_1_1_median.html", null ], [ "xpcc::MemoryBus< PORT, CS, RD, WR >", "classxpcc_1_1_memory_bus.html", null ], [ "xpcc::MenuEntry", "structxpcc_1_1_menu_entry.html", null ], [ "xpcc::MenuEntryCallback", "classxpcc_1_1_menu_entry_callback.html", null ], [ "xpcc::can::Message", "structxpcc_1_1can_1_1_message.html", null ], [ "xpcc::rpr::Message", "structxpcc_1_1rpr_1_1_message.html", null ], [ "xpcc::filter::MovingAverage< T, N >", "classxpcc_1_1filter_1_1_moving_average.html", null ], [ "xpcc::rtos::Mutex", "classxpcc_1_1rtos_1_1_mutex.html", null ], [ "my_namespace::MyClass", "classmy__namespace_1_1_my_class.html", null ], [ "xpcc::NestedResumable< Levels >", "classxpcc_1_1_nested_resumable.html", null ], [ "xpcc::NestedResumable< 2 >", "classxpcc_1_1_nested_resumable.html", [ [ "xpcc::Lis3TransportSpi< SpiMaster, Cs >", "classxpcc_1_1_lis3_transport_spi.html", null ], [ "xpcc::Mcp23TransportSpi< SpiMaster, Cs >", "classxpcc_1_1_mcp23_transport_spi.html", null ] ] ], [ "xpcc::NestedResumable< NestingLevels+1 >", "classxpcc_1_1_nested_resumable.html", [ [ "xpcc::I2cDevice< I2cMaster, 1 >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::Bme280< I2cMaster >", "classxpcc_1_1_bme280.html", null ], [ "xpcc::Bmp085< I2cMaster >", "classxpcc_1_1_bmp085.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 1, i2cEeprom::DataTransmissionAdapter >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::I2cEeprom< I2cMaster >", "classxpcc_1_1_i2c_eeprom.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 1, I2cReadTransaction >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::HclaX< I2cMaster >", "classxpcc_1_1_hcla_x.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 1, I2cWriteTransaction >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::Pca9685< I2cMaster >", "classxpcc_1_1_pca9685.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 2 >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::Ds1631< I2cMaster >", "classxpcc_1_1_ds1631.html", null ], [ "xpcc::Hmc58x3< I2cMaster >", "classxpcc_1_1_hmc58x3.html", null ], [ "xpcc::Hmc6343< I2cMaster >", "classxpcc_1_1_hmc6343.html", null ], [ "xpcc::Itg3200< I2cMaster >", "classxpcc_1_1_itg3200.html", null ], [ "xpcc::Lis3TransportI2c< I2cMaster >", "classxpcc_1_1_lis3_transport_i2c.html", [ [ "xpcc::Lsm303a< I2cMaster >", "classxpcc_1_1_lsm303a.html", null ] ] ], [ "xpcc::Lm75< I2cMaster >", "classxpcc_1_1_lm75.html", null ], [ "xpcc::Mcp23TransportI2c< I2cMaster >", "classxpcc_1_1_mcp23_transport_i2c.html", null ], [ "xpcc::Pca8574< I2cMaster >", "classxpcc_1_1_pca8574.html", null ], [ "xpcc::Pca9535< I2cMaster >", "classxpcc_1_1_pca9535.html", null ], [ "xpcc::Tcs3414< I2cMaster >", "classxpcc_1_1_tcs3414.html", null ], [ "xpcc::Tcs3472< I2cMaster >", "classxpcc_1_1_tcs3472.html", null ], [ "xpcc::Vl6180< I2cMaster >", "classxpcc_1_1_vl6180.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 2, ssd1306::DataTransmissionAdapter< Height > >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::Ssd1306< I2cMaster, Height >", "classxpcc_1_1_ssd1306.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 3 >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::Ft6x06< I2cMaster >", "classxpcc_1_1_ft6x06.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, 5 >", "classxpcc_1_1_i2c_device.html", [ [ "xpcc::Vl53l0< I2cMaster >", "classxpcc_1_1_vl53l0.html", null ] ] ], [ "xpcc::I2cDevice< I2cMaster, NestingLevels, Transaction >", "classxpcc_1_1_i2c_device.html", null ] ] ], [ "xpcc::DoublyLinkedList< T, Allocator >::Node", "classxpcc_1_1_doubly_linked_list.html#structxpcc_1_1_doubly_linked_list_1_1_node", null ], [ "xpcc::LinkedList< T, Allocator >::Node", "classxpcc_1_1_linked_list.html#structxpcc_1_1_linked_list_1_1_node", null ], [ "xpcc::stm32::fsmc::NorSram", "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html", null ], [ "xpcc::Nrf24Register", "structxpcc_1_1_nrf24_register.html", [ [ "xpcc::Nrf24Config< Nrf24Phy >", "classxpcc_1_1_nrf24_config.html", null ], [ "xpcc::Nrf24Data< Nrf24Phy >", "classxpcc_1_1_nrf24_data.html", null ], [ "xpcc::Nrf24Phy< Spi, Csn, Ce >", "classxpcc_1_1_nrf24_phy.html", null ] ] ], [ "xpcc::tmp::NullType", "group__tmp.html#classxpcc_1_1tmp_1_1_null_type", null ], [ "xpcc::Nrf24Data< Nrf24Phy >::Packet", "structxpcc_1_1_nrf24_data_1_1_packet.html", null ], [ "xpcc::ZeroMQReader::Packet", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html", null ], [ "xpcc::Pair< T1, T2 >", "classxpcc_1_1_pair.html", null ], [ "xpcc::SCurveController< T >::Parameter", "structxpcc_1_1_s_curve_controller_1_1_parameter.html", null ], [ "xpcc::Pid< T, ScaleFactor >::Parameter", "structxpcc_1_1_pid_1_1_parameter.html", null ], [ "xpcc::Nrf24Data< Nrf24Phy >::Packet::Payload", "structxpcc_1_1_nrf24_data_1_1_packet.html#structxpcc_1_1_nrf24_data_1_1_packet_1_1_payload", null ], [ "xpcc::pca8574", "structxpcc_1_1pca8574.html", [ [ "xpcc::Pca8574< I2cMaster >", "classxpcc_1_1_pca8574.html", null ] ] ], [ "xpcc::pca9535", "structxpcc_1_1pca9535.html", [ [ "xpcc::Pca9535< I2cMaster >", "classxpcc_1_1_pca9535.html", null ] ] ], [ "xpcc::pca9685", "structxpcc_1_1pca9685.html", [ [ "xpcc::Pca9685< I2cMaster >", "classxpcc_1_1_pca9685.html", null ] ] ], [ "xpcc::Peripheral", "classxpcc_1_1_peripheral.html", [ [ "xpcc::Adc", "classxpcc_1_1_adc.html", [ [ "xpcc::AdcInterrupt", "classxpcc_1_1_adc_interrupt.html", [ [ "xpcc::stm32::AdcInterrupt1", "classxpcc_1_1stm32_1_1_adc_interrupt1.html", null ], [ "xpcc::stm32::AdcInterrupt2", "classxpcc_1_1stm32_1_1_adc_interrupt2.html", null ], [ "xpcc::stm32::AdcInterrupt3", "classxpcc_1_1stm32_1_1_adc_interrupt3.html", null ] ] ], [ "xpcc::stm32::Adc1", "classxpcc_1_1stm32_1_1_adc1.html", [ [ "xpcc::stm32::AdcInterrupt1", "classxpcc_1_1stm32_1_1_adc_interrupt1.html", null ] ] ], [ "xpcc::stm32::Adc2", "classxpcc_1_1stm32_1_1_adc2.html", [ [ "xpcc::stm32::AdcInterrupt2", "classxpcc_1_1stm32_1_1_adc_interrupt2.html", null ] ] ], [ "xpcc::stm32::Adc3", "classxpcc_1_1stm32_1_1_adc3.html", [ [ "xpcc::stm32::AdcInterrupt3", "classxpcc_1_1stm32_1_1_adc_interrupt3.html", null ] ] ] ] ], [ "xpcc::Can", "classxpcc_1_1_can.html", [ [ "xpcc::hosted::CanUsb< SerialPort >", "classxpcc_1_1hosted_1_1_can_usb.html", null ], [ "xpcc::hosted::SocketCan", "classxpcc_1_1hosted_1_1_socket_can.html", null ], [ "xpcc::lpc::Can", "classxpcc_1_1lpc_1_1_can.html", null ], [ "xpcc::Mcp2515< SPI, CS, INT >", "classxpcc_1_1_mcp2515.html", null ], [ "xpcc::stm32::Can1", "classxpcc_1_1stm32_1_1_can1.html", null ], [ "xpcc::stm32::Can2", "classxpcc_1_1stm32_1_1_can2.html", null ] ] ], [ "xpcc::I2cMaster", "classxpcc_1_1_i2c_master.html", null ], [ "xpcc::SpiMaster", "classxpcc_1_1_spi_master.html", [ [ "xpcc::lpc::SpiMaster0", "classxpcc_1_1lpc_1_1_spi_master0.html", null ], [ "xpcc::lpc::SpiMaster1", "classxpcc_1_1lpc_1_1_spi_master1.html", null ], [ "xpcc::SoftwareSpiMaster< SCK, MOSI, MISO >", "classxpcc_1_1_software_spi_master.html", null ], [ "xpcc::SoftwareSpiMaster< SCK, MOSI, MISO >", "classxpcc_1_1_software_spi_master.html", null ], [ "xpcc::stm32::SpiMaster1", "classxpcc_1_1stm32_1_1_spi_master1.html", null ], [ "xpcc::stm32::SpiMaster2", "classxpcc_1_1stm32_1_1_spi_master2.html", null ], [ "xpcc::stm32::SpiMaster3", "classxpcc_1_1stm32_1_1_spi_master3.html", null ], [ "xpcc::stm32::UartSpiMaster1", "classxpcc_1_1stm32_1_1_uart_spi_master1.html", null ], [ "xpcc::stm32::UartSpiMaster2", "classxpcc_1_1stm32_1_1_uart_spi_master2.html", null ], [ "xpcc::stm32::UartSpiMaster3", "classxpcc_1_1stm32_1_1_uart_spi_master3.html", null ], [ "xpcc::stm32::UartSpiMaster6", "classxpcc_1_1stm32_1_1_uart_spi_master6.html", null ] ] ], [ "xpcc::Uart", "classxpcc_1_1_uart.html", [ [ "xpcc::hosted::StaticSerialInterface< N >", "classxpcc_1_1hosted_1_1_static_serial_interface.html", null ], [ "xpcc::stm32::Uart4", "classxpcc_1_1stm32_1_1_uart4.html", null ], [ "xpcc::stm32::Uart5", "classxpcc_1_1stm32_1_1_uart5.html", null ], [ "xpcc::stm32::Usart1", "classxpcc_1_1stm32_1_1_usart1.html", null ], [ "xpcc::stm32::Usart2", "classxpcc_1_1stm32_1_1_usart2.html", null ], [ "xpcc::stm32::Usart3", "classxpcc_1_1stm32_1_1_usart3.html", null ], [ "xpcc::stm32::Usart6", "classxpcc_1_1stm32_1_1_usart6.html", null ] ] ] ] ], [ "xpcc::fat::PhysicalVolume", "classxpcc_1_1fat_1_1_physical_volume.html", null ], [ "xpcc::Pid< T, ScaleFactor >", "classxpcc_1_1_pid.html", null ], [ "Pin", null, [ [ "xpcc::GpioInverted< Pin >", "classxpcc_1_1_gpio_inverted.html", null ], [ "xpcc::GpioInverted< Pin >", "classxpcc_1_1_gpio_inverted.html", null ] ] ], [ "xpcc::stm32::Pll< Input, OutputFrequency, UsbFrequency >", "classxpcc_1_1stm32_1_1_pll.html", null ], [ "xpcc::lpc::TypeId::Pll", "structxpcc_1_1lpc_1_1_type_id_1_1_pll.html", null ], [ "xpcc::stm32::TypeId::Pll", "structxpcc_1_1stm32_1_1_type_id_1_1_pll.html", null ], [ "xpcc::stm32::Pll< ExternalClock< InputFrequency >, OutputFrequency, UsbFrequency >", "classxpcc_1_1stm32_1_1_pll_3_01_external_clock_3_01_input_frequency_01_4_00_01_output_frequency_00_01_usb_frequency_01_4.html", null ], [ "xpcc::stm32::Pll< ExternalCrystal< InputFrequency >, OutputFrequency, UsbFrequency >", "classxpcc_1_1stm32_1_1_pll_3_01_external_crystal_3_01_input_frequency_01_4_00_01_output_frequency_00_01_usb_frequency_01_4.html", null ], [ "xpcc::stm32::Pll< InternalClock< InputFrequency >, OutputFrequency, UsbFrequency >", "classxpcc_1_1stm32_1_1_pll_3_01_internal_clock_3_01_input_frequency_01_4_00_01_output_frequency_00_01_usb_frequency_01_4.html", null ], [ "xpcc::stm32::PllSetup< InputFrequency, OutputFrequency, UsbFrequency, Source >", "classxpcc_1_1stm32_1_1_pll_setup.html", null ], [ "xpcc::PointSet2D< T >", "classxpcc_1_1_point_set2_d.html", [ [ "xpcc::Polygon2D< T >", "classxpcc_1_1_polygon2_d.html", null ] ] ], [ "xpcc::Postman", "classxpcc_1_1_postman.html", [ [ "xpcc::DynamicPostman", "classxpcc_1_1_dynamic_postman.html", null ] ] ], [ "xpcc::pt::Protothread", "classxpcc_1_1pt_1_1_protothread.html", [ [ "xpcc::Ds1631< I2cMaster >", "classxpcc_1_1_ds1631.html", null ], [ "xpcc::Tmp102< I2cMaster >", "classxpcc_1_1_tmp102.html", null ], [ "xpcc::Tmp175< I2cMaster >", "classxpcc_1_1_tmp175.html", null ] ] ], [ "xpcc::ui::Pulse< T >", "classxpcc_1_1ui_1_1_pulse.html", null ], [ "xpcc::Quaternion< T >", "classxpcc_1_1_quaternion.html", null ], [ "xpcc::atomic::Queue< T, N >", "classxpcc_1_1atomic_1_1_queue.html", null ], [ "xpcc::Queue< T, Container >", "classxpcc_1_1_queue.html", [ [ "xpcc::BoundedQueue< T, N, Container >", "classxpcc_1_1_bounded_queue.html", null ] ] ], [ "xpcc::rtos::QueueBase", "classxpcc_1_1rtos_1_1_queue_base.html", [ [ "xpcc::rtos::Queue< T >", "classxpcc_1_1rtos_1_1_queue.html", null ] ] ], [ "xpcc::accessor::Ram< T >", "classxpcc_1_1accessor_1_1_ram.html", null ], [ "xpcc::filter::Ramp< T >", "classxpcc_1_1filter_1_1_ramp.html", null ], [ "xpcc::stm32::RandomNumberGenerator", "classxpcc_1_1stm32_1_1_random_number_generator.html", null ], [ "xpcc::Ray2D< T >", "classxpcc_1_1_ray2_d.html", null ], [ "xpcc::I2cTransaction::Reading", "structxpcc_1_1_i2c_transaction_1_1_reading.html", null ], [ "xpcc::allocator::Block< T, BLOCKSIZE >::rebind< U >", "classxpcc_1_1allocator_1_1_block.html#structxpcc_1_1allocator_1_1_block_1_1rebind", null ], [ "xpcc::allocator::Dynamic< T >::rebind< U >", "classxpcc_1_1allocator_1_1_dynamic.html#structxpcc_1_1allocator_1_1_dynamic_1_1rebind", null ], [ "xpcc::allocator::Static< T, N >::rebind< U >", "classxpcc_1_1allocator_1_1_static.html#structxpcc_1_1allocator_1_1_static_1_1rebind", null ], [ "xpcc::CanConnector< Driver >::ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html", null ], [ "xpcc::tipc::Receiver", "classxpcc_1_1tipc_1_1_receiver.html", null ], [ "xpcc::tipc::ReceiverSocket", "classxpcc_1_1tipc_1_1_receiver_socket.html", null ], [ "xpcc::Register< T >", "structxpcc_1_1_register.html", [ [ "xpcc::FlagsOperators< Enum, T >", "structxpcc_1_1_flags_operators.html", [ [ "xpcc::Flags< Enum, T >", "structxpcc_1_1_flags.html", null ] ] ] ] ], [ "xpcc::Register< Parent::UnderlyingType >", "structxpcc_1_1_register.html", [ [ "xpcc::FlagsOperators< Parent::EnumType, Parent::UnderlyingType >", "structxpcc_1_1_flags_operators.html", [ [ "xpcc::Configuration< Parent, Enum, Mask, Position >", "structxpcc_1_1_configuration.html", null ], [ "xpcc::Value< Parent, Width, Position >", "structxpcc_1_1_value.html", null ] ] ] ] ], [ "xpcc::Register< T::UnderlyingType >", "structxpcc_1_1_register.html", [ [ "xpcc::FlagsGroup< T... >", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html", null ] ] ], [ "xpcc::ad7280a::RegisterValue", "structxpcc_1_1ad7280a_1_1_register_value.html", null ], [ "unittest::Reporter", "classunittest_1_1_reporter.html", null ], [ "xpcc::sab::Response", "classxpcc_1_1sab_1_1_response.html", null ], [ "xpcc::amnb::Response", "classxpcc_1_1amnb_1_1_response.html", null ], [ "xpcc::ResponseCallback", "classxpcc_1_1_response_callback.html", null ], [ "xpcc::ResponseHandle", "classxpcc_1_1_response_handle.html", null ], [ "xpcc::Resumable< Functions >", "classxpcc_1_1_resumable.html", null ], [ "xpcc::ResumableResult< T >", "structxpcc_1_1_resumable_result.html", null ], [ "xpcc::ui::RgbLed", "classxpcc_1_1ui_1_1_rgb_led.html", null ], [ "xpcc::color::RgbT< UnderlyingType >", "classxpcc_1_1color_1_1_rgb_t.html", null ], [ "xpcc::tmp::SameType< T, U >", "structxpcc_1_1tmp_1_1_same_type.html", null ], [ "xpcc::tmp::SameType< T, T >", "structxpcc_1_1tmp_1_1_same_type_3_01_t_00_01_t_01_4.html", null ], [ "xpcc::Saturated< T >", "classxpcc_1_1_saturated.html", null ], [ "xpcc::rtos::Scheduler", "classxpcc_1_1rtos_1_1_scheduler.html", null ], [ "xpcc::Scheduler", "classxpcc_1_1_scheduler.html", null ], [ "xpcc::Scp1000< Spi, Cs, Int >", "classxpcc_1_1_scp1000.html", null ], [ "xpcc::ScrollableText", "classxpcc_1_1_scrollable_text.html", null ], [ "xpcc::SCurveController< T >", "classxpcc_1_1_s_curve_controller.html", null ], [ "xpcc::SCurveGenerator< T >", "classxpcc_1_1_s_curve_generator.html", null ], [ "xpcc::tmp::Select< flag, T, U >", "group__tmp.html#structxpcc_1_1tmp_1_1_select", null ], [ "xpcc::tmp::Select< false, T, U >", "namespacexpcc_1_1tmp.html#structxpcc_1_1tmp_1_1_select_3_01false_00_01_t_00_01_u_01_4", null ], [ "xpcc::pt::Semaphore", "classxpcc_1_1pt_1_1_semaphore.html", null ], [ "xpcc::rtos::SemaphoreBase", "classxpcc_1_1rtos_1_1_semaphore_base.html", [ [ "xpcc::rtos::BinarySemaphore", "classxpcc_1_1rtos_1_1_binary_semaphore.html", null ], [ "xpcc::rtos::Semaphore", "classxpcc_1_1rtos_1_1_semaphore.html", [ [ "xpcc::rtos::BinarySemaphore", "classxpcc_1_1rtos_1_1_binary_semaphore.html", null ] ] ] ] ], [ "xpcc::CanConnector< Driver >::SendListItem", "classxpcc_1_1_can_connector_1_1_send_list_item.html", null ], [ "xpcc::sevenSegment::SevenSegmentDisplay< Spi, Load, DIGITS >", "classxpcc_1_1seven_segment_1_1_seven_segment_display.html", null ], [ "xpcc::ShiftRegisterInput< Spi, Load, N >", "classxpcc_1_1_shift_register_input.html", null ], [ "xpcc::ShiftRegisterOutput< Spi, Store, N >", "classxpcc_1_1_shift_register_output.html", null ], [ "xpcc::SiemensS65Common< SPI, CS, RS, Reset >", "classxpcc_1_1_siemens_s65_common.html", [ [ "xpcc::SiemensS65Landscape< SPI, CS, RS, Reset >", "classxpcc_1_1_siemens_s65_landscape.html", null ], [ "xpcc::SiemensS65Portrait< SPI, CS, RS, Reset >", "classxpcc_1_1_siemens_s65_portrait.html", null ] ] ], [ "xpcc::SmartPointer", "classxpcc_1_1_smart_pointer.html", null ], [ "xpcc::TypeId::SoftwareI2cMasterScl", "structxpcc_1_1_type_id_1_1_software_i2c_master_scl.html", null ], [ "xpcc::TypeId::SoftwareI2cMasterSda", "structxpcc_1_1_type_id_1_1_software_i2c_master_sda.html", null ], [ "xpcc::SoftwareOneWireMaster< Pin >", "classxpcc_1_1_software_one_wire_master.html", null ], [ "xpcc::TypeId::SoftwareSpiMasterMiso", "structxpcc_1_1_type_id_1_1_software_spi_master_miso.html", null ], [ "xpcc::TypeId::SoftwareSpiMasterMosi", "structxpcc_1_1_type_id_1_1_software_spi_master_mosi.html", null ], [ "xpcc::TypeId::SoftwareSpiMasterSck", "structxpcc_1_1_type_id_1_1_software_spi_master_sck.html", null ], [ "xpcc::Spi", "structxpcc_1_1_spi.html", [ [ "xpcc::SpiMaster", "classxpcc_1_1_spi_master.html", null ] ] ], [ "xpcc::stm32::SpiBase", "classxpcc_1_1stm32_1_1_spi_base.html", [ [ "xpcc::stm32::SpiHal1", "classxpcc_1_1stm32_1_1_spi_hal1.html", null ], [ "xpcc::stm32::SpiHal2", "classxpcc_1_1stm32_1_1_spi_hal2.html", null ], [ "xpcc::stm32::SpiHal3", "classxpcc_1_1stm32_1_1_spi_hal3.html", null ] ] ], [ "xpcc::SpiDevice< SpiMaster >", "classxpcc_1_1_spi_device.html", [ [ "xpcc::Lis3TransportSpi< SpiMaster, Cs >", "classxpcc_1_1_lis3_transport_spi.html", null ], [ "xpcc::Mcp23TransportSpi< SpiMaster, Cs >", "classxpcc_1_1_mcp23_transport_spi.html", null ] ] ], [ "xpcc::stm32::TypeId::SpiMaster1Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master1_miso.html", null ], [ "xpcc::stm32::TypeId::SpiMaster1Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master1_mosi.html", null ], [ "xpcc::stm32::TypeId::SpiMaster1Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master1_nss.html", null ], [ "xpcc::stm32::TypeId::SpiMaster1Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master1_sck.html", null ], [ "xpcc::stm32::TypeId::SpiMaster2Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master2_miso.html", null ], [ "xpcc::stm32::TypeId::SpiMaster2Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master2_mosi.html", null ], [ "xpcc::stm32::TypeId::SpiMaster2Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master2_nss.html", null ], [ "xpcc::stm32::TypeId::SpiMaster2Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master2_sck.html", null ], [ "xpcc::stm32::TypeId::SpiMaster3Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master3_miso.html", null ], [ "xpcc::stm32::TypeId::SpiMaster3Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master3_mosi.html", null ], [ "xpcc::stm32::TypeId::SpiMaster3Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master3_nss.html", null ], [ "xpcc::stm32::TypeId::SpiMaster3Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master3_sck.html", null ], [ "xpcc::stm32::TypeId::SpiMaster4Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master4_miso.html", null ], [ "xpcc::stm32::TypeId::SpiMaster4Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master4_mosi.html", null ], [ "xpcc::stm32::TypeId::SpiMaster4Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master4_nss.html", null ], [ "xpcc::stm32::TypeId::SpiMaster4Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master4_sck.html", null ], [ "xpcc::stm32::TypeId::SpiMaster5Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master5_miso.html", null ], [ "xpcc::stm32::TypeId::SpiMaster5Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master5_mosi.html", null ], [ "xpcc::stm32::TypeId::SpiMaster5Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master5_nss.html", null ], [ "xpcc::stm32::TypeId::SpiMaster5Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master5_sck.html", null ], [ "xpcc::stm32::TypeId::SpiMaster6Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master6_miso.html", null ], [ "xpcc::stm32::TypeId::SpiMaster6Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master6_mosi.html", null ], [ "xpcc::stm32::TypeId::SpiMaster6Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master6_nss.html", null ], [ "xpcc::stm32::TypeId::SpiMaster6Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_master6_sck.html", null ], [ "xpcc::SpiRam< Spi, Cs, Hold >", "classxpcc_1_1_spi_ram.html", null ], [ "xpcc::stm32::TypeId::SpiSlave1Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave1_nss.html", null ], [ "xpcc::stm32::TypeId::SpiSlave1Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave1_sck.html", null ], [ "xpcc::stm32::TypeId::SpiSlave1Simo", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave1_simo.html", null ], [ "xpcc::stm32::TypeId::SpiSlave1Somi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave1_somi.html", null ], [ "xpcc::stm32::TypeId::SpiSlave2Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave2_nss.html", null ], [ "xpcc::stm32::TypeId::SpiSlave2Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave2_sck.html", null ], [ "xpcc::stm32::TypeId::SpiSlave2Simo", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave2_simo.html", null ], [ "xpcc::stm32::TypeId::SpiSlave2Somi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave2_somi.html", null ], [ "xpcc::stm32::TypeId::SpiSlave3Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave3_nss.html", null ], [ "xpcc::stm32::TypeId::SpiSlave3Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave3_sck.html", null ], [ "xpcc::stm32::TypeId::SpiSlave3Simo", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave3_simo.html", null ], [ "xpcc::stm32::TypeId::SpiSlave3Somi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave3_somi.html", null ], [ "xpcc::stm32::TypeId::SpiSlave4Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave4_nss.html", null ], [ "xpcc::stm32::TypeId::SpiSlave4Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave4_sck.html", null ], [ "xpcc::stm32::TypeId::SpiSlave4Simo", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave4_simo.html", null ], [ "xpcc::stm32::TypeId::SpiSlave4Somi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave4_somi.html", null ], [ "xpcc::stm32::TypeId::SpiSlave5Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave5_nss.html", null ], [ "xpcc::stm32::TypeId::SpiSlave5Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave5_sck.html", null ], [ "xpcc::stm32::TypeId::SpiSlave5Simo", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave5_simo.html", null ], [ "xpcc::stm32::TypeId::SpiSlave5Somi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave5_somi.html", null ], [ "xpcc::stm32::TypeId::SpiSlave6Nss", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave6_nss.html", null ], [ "xpcc::stm32::TypeId::SpiSlave6Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave6_sck.html", null ], [ "xpcc::stm32::TypeId::SpiSlave6Simo", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave6_simo.html", null ], [ "xpcc::stm32::TypeId::SpiSlave6Somi", "structxpcc_1_1stm32_1_1_type_id_1_1_spi_slave6_somi.html", null ], [ "xpcc::ssd1306", "structxpcc_1_1ssd1306.html", [ [ "xpcc::Ssd1306< I2cMaster, Height >", "classxpcc_1_1_ssd1306.html", null ] ] ], [ "xpcc::Stack< T, Container >", "classxpcc_1_1_stack.html", [ [ "xpcc::BoundedStack< T, N, Container >", "classxpcc_1_1_bounded_stack.html", null ] ] ], [ "xpcc::Stack< xpcc::AbstractView *, xpcc::LinkedList< xpcc::AbstractView * > >", "classxpcc_1_1_stack.html", null ], [ "xpcc::Stack< xpcc::gui::View *, xpcc::LinkedList< xpcc::gui::View * > >", "classxpcc_1_1_stack.html", null ], [ "xpcc::stm32::CanFilter::StandardFilterMask", "structxpcc_1_1stm32_1_1_can_filter_1_1_standard_filter_mask.html", null ], [ "xpcc::stm32::CanFilter::StandardFilterMaskShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_standard_filter_mask_short.html", null ], [ "xpcc::stm32::CanFilter::StandardIdentifier", "structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier.html", null ], [ "xpcc::stm32::CanFilter::StandardIdentifierShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier_short.html", null ], [ "xpcc::I2cTransaction::Starting", "structxpcc_1_1_i2c_transaction_1_1_starting.html", null ], [ "xpcc::tmp::static_assert_test< x >", "namespacexpcc_1_1tmp.html#structxpcc_1_1tmp_1_1static__assert__test", null ], [ "xpcc::tmp::STATIC_ASSERTION_FAILURE< x >", "namespacexpcc_1_1tmp.html#structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e", null ], [ "xpcc::tmp::STATIC_ASSERTION_FAILURE< true >", "structxpcc_1_1tmp_1_1_s_t_a_t_i_c___a_s_s_e_r_t_i_o_n___f_a_i_l_u_r_e_3_01true_01_4.html", null ], [ "xpcc::stm32::Stm32F100PllSettings< InputFrequency, SystemFrequency, FixedDivideBy2 >", "classxpcc_1_1stm32_1_1_stm32_f100_pll_settings.html", null ], [ "xpcc::stm32::Stm32F2F4PllSettings< VCOOutputMinimum, InputFrequency, SystemFrequency, USBFrequency >", "classxpcc_1_1stm32_1_1_stm32_f2_f4_pll_settings.html", null ], [ "xpcc::stm32::Stm32F3PllSettings< InputFrequency, SystemFrequency, FixedDivideBy2 >", "classxpcc_1_1stm32_1_1_stm32_f3_pll_settings.html", null ], [ "xpcc::ui::Strobe< T >", "classxpcc_1_1ui_1_1_strobe.html", null ], [ "xpcc::log::Style< STYLE >", "classxpcc_1_1log_1_1_style.html", [ [ "xpcc::log::Prefix< T, STYLE >", "classxpcc_1_1log_1_1_prefix.html", null ], [ "xpcc::log::StdColour< TEXT, BACKGROUND, STYLE >", "classxpcc_1_1log_1_1_std_colour.html", null ] ] ], [ "xpcc::tmp::SuperSubclass< T, U >", "structxpcc_1_1tmp_1_1_super_subclass.html", null ], [ "xpcc::tmp::SuperSubclass< T, void >", "structxpcc_1_1tmp_1_1_super_subclass_3_01_t_00_01void_01_4.html", null ], [ "xpcc::tmp::SuperSubclass< void, U >", "structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01_u_01_4.html", null ], [ "xpcc::tmp::SuperSubclass< void, void >", "structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01void_01_4.html", null ], [ "xpcc::tmp::SuperSubclassStrict< T, U >", "structxpcc_1_1tmp_1_1_super_subclass_strict.html", null ], [ "xpcc::stm32::fsmc::NorSram::SynchronousTiming", "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#structxpcc_1_1stm32_1_1fsmc_1_1_nor_sram_1_1_synchronous_timing", null ], [ "xpcc::stm32::TypeId::SystemClock", "structxpcc_1_1stm32_1_1_type_id_1_1_system_clock.html", null ], [ "Board::systemClock", "struct_board_1_1system_clock.html", null ], [ "xpcc::avr::SystemClock", "classxpcc_1_1avr_1_1_system_clock.html", null ], [ "xpcc::lpc::TypeId::SystemClock", "structxpcc_1_1lpc_1_1_type_id_1_1_system_clock.html", null ], [ "xpcc::stm32::SystemClock< Input >", "classxpcc_1_1stm32_1_1_system_clock.html", null ], [ "xpcc::stm32::SystemClock< ExternalClock< OutputFrequency > >", "classxpcc_1_1stm32_1_1_system_clock_3_01_external_clock_3_01_output_frequency_01_4_01_4.html", null ], [ "xpcc::stm32::SystemClock< ExternalCrystal< OutputFrequency > >", "classxpcc_1_1stm32_1_1_system_clock_3_01_external_crystal_3_01_output_frequency_01_4_01_4.html", null ], [ "xpcc::stm32::SystemClock< InternalClock< OutputFrequency > >", "classxpcc_1_1stm32_1_1_system_clock_3_01_internal_clock_3_01_output_frequency_01_4_01_4.html", null ], [ "xpcc::stm32::SystemClock< Pll< Input, OutputFrequency, UsbFrequency > >", "classxpcc_1_1stm32_1_1_system_clock_3_01_pll_3_01_input_00_01_output_frequency_00_01_usb_frequency_01_4_01_4.html", null ], [ "xpcc::cortex::SysTickTimer", "classxpcc_1_1cortex_1_1_sys_tick_timer.html", null ], [ "xpcc::Scheduler::Task", "classxpcc_1_1_scheduler_1_1_task.html", null ], [ "xpcc::Task", "classxpcc_1_1_task.html", [ [ "xpcc::CommunicatableTask", "classxpcc_1_1_communicatable_task.html", null ] ] ], [ "xpcc::tcs3414", "structxpcc_1_1tcs3414.html", [ [ "xpcc::Tcs3414< I2cMaster >", "classxpcc_1_1_tcs3414.html", null ] ] ], [ "xpcc::tcs3472", "structxpcc_1_1tcs3472.html", [ [ "xpcc::Tcs3472< I2cMaster >", "classxpcc_1_1_tcs3472.html", null ] ] ], [ "unittest::TestSuite", "classunittest_1_1_test_suite.html", null ], [ "xpcc::TftMemoryBus16Bit", "classxpcc_1_1_tft_memory_bus16_bit.html", null ], [ "xpcc::TftMemoryBus8Bit", "classxpcc_1_1_tft_memory_bus8_bit.html", null ], [ "xpcc::TftMemoryBus8BitGpio< PORT, CS, RD, WR, CD >", "classxpcc_1_1_tft_memory_bus8_bit_gpio.html", null ], [ "xpcc::rtos::Thread", "classxpcc_1_1rtos_1_1_thread.html", null ], [ "xpcc::vl53l0::TimeOverhead", "structxpcc_1_1vl53l0_1_1_time_overhead.html", null ], [ "xpcc::stm32::TypeId::Timer10Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer10_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer11Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer11_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer12Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer12_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer12Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer12_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer13Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer13_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer14Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer14_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer15BreakIn", "structxpcc_1_1stm32_1_1_type_id_1_1_timer15_break_in.html", null ], [ "xpcc::stm32::TypeId::Timer15Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer15_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer15Channel1N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer15_channel1_n.html", null ], [ "xpcc::stm32::TypeId::Timer15Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer15_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer16_0", "structxpcc_1_1stm32_1_1_type_id_1_1_timer16__0.html", null ], [ "xpcc::stm32::TypeId::Timer16_1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer16__1.html", null ], [ "xpcc::stm32::TypeId::Timer16BreakIn", "structxpcc_1_1stm32_1_1_type_id_1_1_timer16_break_in.html", null ], [ "xpcc::stm32::TypeId::Timer16Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer16_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer16Channel1N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer16_channel1_n.html", null ], [ "xpcc::stm32::TypeId::Timer16Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer16_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer17BreakIn", "structxpcc_1_1stm32_1_1_type_id_1_1_timer17_break_in.html", null ], [ "xpcc::stm32::TypeId::Timer17Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer17_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer17Channel1N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer17_channel1_n.html", null ], [ "xpcc::stm32::TypeId::Timer17Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer17_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer19Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer19_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer19Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer19_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer19Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer19_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer19Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer19_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer19ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer19_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer1BreakIn", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_break_in.html", null ], [ "xpcc::stm32::TypeId::Timer1BreakIn2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_break_in2.html", null ], [ "xpcc::stm32::TypeId::Timer1BreakIn2Comp1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_break_in2_comp1.html", null ], [ "xpcc::stm32::TypeId::Timer1BreakIn2Comp2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_break_in2_comp2.html", null ], [ "xpcc::stm32::TypeId::Timer1BreakInComp1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_break_in_comp1.html", null ], [ "xpcc::stm32::TypeId::Timer1BreakInComp2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_break_in_comp2.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel1N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel1_n.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel2N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel2_n.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel3N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel3_n.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer1Channel4N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_channel4_n.html", null ], [ "xpcc::stm32::TypeId::Timer1ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer1_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer2Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer2_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer2Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer2_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer2Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer2_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer2Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer2_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer2ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer2_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer32_0", "structxpcc_1_1stm32_1_1_type_id_1_1_timer32__0.html", null ], [ "xpcc::stm32::TypeId::Timer32_1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer32__1.html", null ], [ "xpcc::stm32::TypeId::Timer3Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer3_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer3Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer3_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer3Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer3_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer3Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer3_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer3ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer3_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer4Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer4_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer4Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer4_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer4Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer4_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer4Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer4_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer4ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer4_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer5Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer5_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer5Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer5_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer5Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer5_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer5Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer5_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer5ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer5_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer8BreakIn", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_break_in.html", null ], [ "xpcc::stm32::TypeId::Timer8BreakIn2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_break_in2.html", null ], [ "xpcc::stm32::TypeId::Timer8BreakIn2Comp1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_break_in2_comp1.html", null ], [ "xpcc::stm32::TypeId::Timer8BreakIn2Comp2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_break_in2_comp2.html", null ], [ "xpcc::stm32::TypeId::Timer8BreakInComp1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_break_in_comp1.html", null ], [ "xpcc::stm32::TypeId::Timer8BreakInComp2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_break_in_comp2.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel1N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel1_n.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel2.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel2N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel2_n.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel3", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel3.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel3N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel3_n.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel4", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel4.html", null ], [ "xpcc::stm32::TypeId::Timer8Channel4N", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_channel4_n.html", null ], [ "xpcc::stm32::TypeId::Timer8ExternalTrigger", "structxpcc_1_1stm32_1_1_type_id_1_1_timer8_external_trigger.html", null ], [ "xpcc::stm32::TypeId::Timer9Channel1", "structxpcc_1_1stm32_1_1_type_id_1_1_timer9_channel1.html", null ], [ "xpcc::stm32::TypeId::Timer9Channel2", "structxpcc_1_1stm32_1_1_type_id_1_1_timer9_channel2.html", null ], [ "xpcc::TLC594X< CHANNELS, Spi, Xlat, Vprog, Xerr >", "classxpcc_1_1_t_l_c594_x.html", null ], [ "xpcc::Tolerance", "classxpcc_1_1_tolerance.html", null ], [ "xpcc::ft6x06::touch_t", "structxpcc_1_1ft6x06_1_1touch__t.html", null ], [ "xpcc::sab::Transmitter", "classxpcc_1_1sab_1_1_transmitter.html", [ [ "xpcc::sab::Slave< Interface >", "classxpcc_1_1sab_1_1_slave.html", null ] ] ], [ "xpcc::tipc::Transmitter", "classxpcc_1_1tipc_1_1_transmitter.html", null ], [ "xpcc::amnb::Transmitter", "classxpcc_1_1amnb_1_1_transmitter.html", [ [ "xpcc::amnb::Node< Interface >", "classxpcc_1_1amnb_1_1_node.html", null ] ] ], [ "xpcc::rpr::Transmitter", "classxpcc_1_1rpr_1_1_transmitter.html", [ [ "xpcc::rpr::Node< Interface >", "classxpcc_1_1rpr_1_1_node.html", null ] ] ], [ "xpcc::tipc::TransmitterSocket", "classxpcc_1_1tipc_1_1_transmitter_socket.html", null ], [ "Transport", null, [ [ "xpcc::L3gd20< Transport >", "classxpcc_1_1_l3gd20.html", null ], [ "xpcc::Lis302dl< Transport >", "classxpcc_1_1_lis302dl.html", null ], [ "xpcc::Lis3dsh< Transport >", "classxpcc_1_1_lis3dsh.html", null ], [ "xpcc::Mcp23x17< Transport >", "classxpcc_1_1_mcp23x17.html", null ] ] ], [ "xpcc::stm32::TypeId::Uart1Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart1_ck.html", null ], [ "xpcc::stm32::TypeId::Uart1Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart1_cts.html", null ], [ "xpcc::stm32::TypeId::Uart1De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart1_de.html", null ], [ "xpcc::stm32::TypeId::Uart1Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart1_rts.html", null ], [ "xpcc::stm32::TypeId::Uart1Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart1_rx.html", null ], [ "xpcc::lpc::TypeId::Uart1Rx", "structxpcc_1_1lpc_1_1_type_id_1_1_uart1_rx.html", null ], [ "xpcc::stm32::TypeId::Uart1Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart1_tx.html", null ], [ "xpcc::lpc::TypeId::Uart1Tx", "structxpcc_1_1lpc_1_1_type_id_1_1_uart1_tx.html", null ], [ "xpcc::stm32::TypeId::Uart2Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart2_ck.html", null ], [ "xpcc::stm32::TypeId::Uart2Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart2_cts.html", null ], [ "xpcc::stm32::TypeId::Uart2De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart2_de.html", null ], [ "xpcc::stm32::TypeId::Uart2Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart2_rts.html", null ], [ "xpcc::stm32::TypeId::Uart2Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart2_rx.html", null ], [ "xpcc::stm32::TypeId::Uart2Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart2_tx.html", null ], [ "xpcc::stm32::TypeId::Uart3Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart3_ck.html", null ], [ "xpcc::stm32::TypeId::Uart3Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart3_cts.html", null ], [ "xpcc::stm32::TypeId::Uart3De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart3_de.html", null ], [ "xpcc::stm32::TypeId::Uart3Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart3_rts.html", null ], [ "xpcc::stm32::TypeId::Uart3Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart3_rx.html", null ], [ "xpcc::stm32::TypeId::Uart3Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart3_tx.html", null ], [ "xpcc::stm32::TypeId::Uart4Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart4_ck.html", null ], [ "xpcc::stm32::TypeId::Uart4Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart4_cts.html", null ], [ "xpcc::stm32::TypeId::Uart4De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart4_de.html", null ], [ "xpcc::stm32::TypeId::Uart4Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart4_rts.html", null ], [ "xpcc::stm32::TypeId::Uart4Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart4_rx.html", null ], [ "xpcc::stm32::TypeId::Uart4Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart4_tx.html", null ], [ "xpcc::stm32::TypeId::Uart5Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart5_ck.html", null ], [ "xpcc::stm32::TypeId::Uart5Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart5_cts.html", null ], [ "xpcc::stm32::TypeId::Uart5De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart5_de.html", null ], [ "xpcc::stm32::TypeId::Uart5Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart5_rts.html", null ], [ "xpcc::stm32::TypeId::Uart5Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart5_rx.html", null ], [ "xpcc::stm32::TypeId::Uart5Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart5_tx.html", null ], [ "xpcc::stm32::TypeId::Uart6Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart6_ck.html", null ], [ "xpcc::stm32::TypeId::Uart6Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart6_cts.html", null ], [ "xpcc::stm32::TypeId::Uart6De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart6_de.html", null ], [ "xpcc::stm32::TypeId::Uart6Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart6_rts.html", null ], [ "xpcc::stm32::TypeId::Uart6Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart6_rx.html", null ], [ "xpcc::stm32::TypeId::Uart6Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart6_tx.html", null ], [ "xpcc::stm32::TypeId::Uart7Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart7_ck.html", null ], [ "xpcc::stm32::TypeId::Uart7Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart7_cts.html", null ], [ "xpcc::stm32::TypeId::Uart7De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart7_de.html", null ], [ "xpcc::stm32::TypeId::Uart7Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart7_rts.html", null ], [ "xpcc::stm32::TypeId::Uart7Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart7_rx.html", null ], [ "xpcc::stm32::TypeId::Uart7Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart7_tx.html", null ], [ "xpcc::stm32::TypeId::Uart8Ck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart8_ck.html", null ], [ "xpcc::stm32::TypeId::Uart8Cts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart8_cts.html", null ], [ "xpcc::stm32::TypeId::Uart8De", "structxpcc_1_1stm32_1_1_type_id_1_1_uart8_de.html", null ], [ "xpcc::stm32::TypeId::Uart8Rts", "structxpcc_1_1stm32_1_1_type_id_1_1_uart8_rts.html", null ], [ "xpcc::stm32::TypeId::Uart8Rx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart8_rx.html", null ], [ "xpcc::stm32::TypeId::Uart8Tx", "structxpcc_1_1stm32_1_1_type_id_1_1_uart8_tx.html", null ], [ "xpcc::stm32::UartBase", "classxpcc_1_1stm32_1_1_uart_base.html", [ [ "xpcc::stm32::Uart4", "classxpcc_1_1stm32_1_1_uart4.html", null ], [ "xpcc::stm32::Uart5", "classxpcc_1_1stm32_1_1_uart5.html", null ], [ "xpcc::stm32::UartHal4", "classxpcc_1_1stm32_1_1_uart_hal4.html", null ], [ "xpcc::stm32::UartHal5", "classxpcc_1_1stm32_1_1_uart_hal5.html", null ], [ "xpcc::stm32::UartSpiMaster1", "classxpcc_1_1stm32_1_1_uart_spi_master1.html", null ], [ "xpcc::stm32::UartSpiMaster2", "classxpcc_1_1stm32_1_1_uart_spi_master2.html", null ], [ "xpcc::stm32::UartSpiMaster3", "classxpcc_1_1stm32_1_1_uart_spi_master3.html", null ], [ "xpcc::stm32::UartSpiMaster6", "classxpcc_1_1stm32_1_1_uart_spi_master6.html", null ], [ "xpcc::stm32::Usart1", "classxpcc_1_1stm32_1_1_usart1.html", null ], [ "xpcc::stm32::Usart2", "classxpcc_1_1stm32_1_1_usart2.html", null ], [ "xpcc::stm32::Usart3", "classxpcc_1_1stm32_1_1_usart3.html", null ], [ "xpcc::stm32::Usart6", "classxpcc_1_1stm32_1_1_usart6.html", null ], [ "xpcc::stm32::UsartHal1", "classxpcc_1_1stm32_1_1_usart_hal1.html", null ], [ "xpcc::stm32::UsartHal2", "classxpcc_1_1stm32_1_1_usart_hal2.html", null ], [ "xpcc::stm32::UsartHal3", "classxpcc_1_1stm32_1_1_usart_hal3.html", null ], [ "xpcc::stm32::UsartHal6", "classxpcc_1_1stm32_1_1_usart_hal6.html", null ] ] ], [ "xpcc::stm32::UartBaudrate", "classxpcc_1_1stm32_1_1_uart_baudrate.html", null ], [ "xpcc::xmega::UartBaudrate", "classxpcc_1_1xmega_1_1_uart_baudrate.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster1Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master1_miso.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster1Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master1_mosi.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster1Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master1_sck.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster2Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master2_miso.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster2Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master2_mosi.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster2Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master2_sck.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster3Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master3_miso.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster3Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master3_mosi.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster3Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master3_sck.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster4Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master4_miso.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster4Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master4_mosi.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster4Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master4_sck.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster5Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master5_miso.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster5Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master5_mosi.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster5Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master5_sck.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster6Miso", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master6_miso.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster6Mosi", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master6_mosi.html", null ], [ "xpcc::stm32::TypeId::UartSpiMaster6Sck", "structxpcc_1_1stm32_1_1_type_id_1_1_uart_spi_master6_sck.html", null ], [ "xpcc::unaligned_t< T >", "structxpcc_1_1unaligned__t.html", null ], [ "xpcc::UnixTime", "classxpcc_1_1_unix_time.html", null ], [ "xpcc::atomic::Unlock", "classxpcc_1_1atomic_1_1_unlock.html", null ], [ "xpcc::stm32::TypeId::UsbDm", "structxpcc_1_1stm32_1_1_type_id_1_1_usb_dm.html", null ], [ "xpcc::stm32::TypeId::UsbDp", "structxpcc_1_1stm32_1_1_type_id_1_1_usb_dp.html", null ], [ "xpcc::Vector< T, N >", "classxpcc_1_1_vector.html", null ], [ "xpcc::Vector< int16_t, 2 >", "classxpcc_1_1_vector.html", null ], [ "xpcc::Vector< T, 1 >", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html", null ], [ "xpcc::Vector< T, 2 >", "classxpcc_1_1_vector_3_01_t_00_012_01_4.html", null ], [ "xpcc::Vector< T, 3 >", "classxpcc_1_1_vector_3_01_t_00_013_01_4.html", null ], [ "xpcc::Vector< T, 4 >", "classxpcc_1_1_vector_3_01_t_00_014_01_4.html", null ], [ "xpcc::ViewStack", "classxpcc_1_1_view_stack.html", [ [ "xpcc::CommunicatingViewStack", "classxpcc_1_1_communicating_view_stack.html", null ], [ "xpcc::gui::GuiViewStack", "classxpcc_1_1gui_1_1_gui_view_stack.html", null ] ] ], [ "xpcc::vl53l0", "structxpcc_1_1vl53l0.html", [ [ "xpcc::Vl53l0< I2cMaster >", "classxpcc_1_1_vl53l0.html", null ] ] ], [ "xpcc::vl6180", "structxpcc_1_1vl6180.html", [ [ "xpcc::Vl6180< I2cMaster >", "classxpcc_1_1_vl6180.html", null ] ] ], [ "xpcc::gui::Widget", "classxpcc_1_1gui_1_1_widget.html", [ [ "xpcc::gui::NumberField< float >", "classxpcc_1_1gui_1_1_number_field.html", [ [ "xpcc::gui::FloatField", "classxpcc_1_1gui_1_1_float_field.html", null ] ] ], [ "xpcc::gui::ArrowButton", "classxpcc_1_1gui_1_1_arrow_button.html", null ], [ "xpcc::gui::ButtonWidget", "classxpcc_1_1gui_1_1_button_widget.html", null ], [ "xpcc::gui::CheckboxWidget", "classxpcc_1_1gui_1_1_checkbox_widget.html", null ], [ "xpcc::gui::FilledAreaButton", "classxpcc_1_1gui_1_1_filled_area_button.html", null ], [ "xpcc::gui::Label", "classxpcc_1_1gui_1_1_label.html", null ], [ "xpcc::gui::NumberField< T >", "classxpcc_1_1gui_1_1_number_field.html", null ], [ "xpcc::gui::StringField", "classxpcc_1_1gui_1_1_string_field.html", null ], [ "xpcc::gui::WidgetGroup", "classxpcc_1_1gui_1_1_widget_group.html", [ [ "xpcc::gui::NumberRocker< T >", "classxpcc_1_1gui_1_1_number_rocker.html", null ], [ "xpcc::gui::StringRocker", "classxpcc_1_1gui_1_1_string_rocker.html", null ], [ "xpcc::gui::TabPanel", "classxpcc_1_1gui_1_1_tab_panel.html", null ] ] ] ] ], [ "xpcc::XilinxSpartan6Parallel< Cclk, DataLow, DataHigh, ProgB, InitB, Done, DataSource, Led0, Led1 >::WritePageState", "structxpcc_1_1_xilinx_spartan6_parallel_1_1_write_page_state.html", null ], [ "xpcc::I2cTransaction::Writing", "structxpcc_1_1_i2c_transaction_1_1_writing.html", null ], [ "xpcc::Xilinx", "structxpcc_1_1_xilinx.html", [ [ "xpcc::XilinxSpartan3< Cclk, Din, ProgB, InitB, Done, DataSource >", "classxpcc_1_1_xilinx_spartan3.html", null ], [ "xpcc::XilinxSpartan6Parallel< Cclk, DataLow, DataHigh, ProgB, InitB, Done, DataSource, Led0, Led1 >", "classxpcc_1_1_xilinx_spartan6_parallel.html", null ] ] ], [ "xpcc::ZeroMQConnectorBase", "classxpcc_1_1_zero_m_q_connector_base.html", [ [ "xpcc::ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html", null ] ] ], [ "xpcc::ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html", null ] ];<file_sep>/docs/api/classxpcc_1_1_ks0108.js var classxpcc_1_1_ks0108 = [ [ "initialize", "classxpcc_1_1_ks0108.html#a7c39f35d2237ddeb79d5ad29e13155ee", null ], [ "update", "classxpcc_1_1_ks0108.html#a1c9fdf8c23d5691577befa7da07794f1", null ], [ "writeByte", "classxpcc_1_1_ks0108.html#a9b26666bcc33a90c0847a43ed87df2e7", null ], [ "readByte", "classxpcc_1_1_ks0108.html#aac496d7d7ab7a911e535d19f0796c58e", null ], [ "waitBusy", "classxpcc_1_1_ks0108.html#a5799fca0f11bd32a3a5cc574327ff8b8", null ], [ "writeData", "classxpcc_1_1_ks0108.html#ac60272762cf535c03ba1b28e4f2799e0", null ], [ "writeCommand", "classxpcc_1_1_ks0108.html#a9c1763b1717e1b0d798dffd2ba05e2d1", null ], [ "selectLeftChip", "classxpcc_1_1_ks0108.html#a79a715bf6fa7b705a38c4c7134011c8e", null ], [ "selectRightChip", "classxpcc_1_1_ks0108.html#a7bba353a01e8070720279bbab324cbde", null ], [ "e", "classxpcc_1_1_ks0108.html#a5ee98b2ca268c4d53e249114013f0881", null ], [ "rw", "classxpcc_1_1_ks0108.html#a733d3fb42eb9d74b1030fd9a58721acc", null ], [ "rs", "classxpcc_1_1_ks0108.html#a9ae4132fcb6e35e769d9848382a8cf2d", null ], [ "cs1", "classxpcc_1_1_ks0108.html#acdbd58ada96558b4b7e205bbb094ae47", null ], [ "cs2", "classxpcc_1_1_ks0108.html#a7c6746d7815c392fa4c6aed0c3494b03", null ], [ "port", "classxpcc_1_1_ks0108.html#a7ecf3d4c2b45756973790982895238f1", null ] ];<file_sep>/docs/api/group__sab.js var group__sab = [ [ "Interface", "classxpcc_1_1sab_1_1_interface.html", null ], [ "Master", "classxpcc_1_1sab_1_1_master.html", [ [ "QueryStatus", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19e", [ [ "IN_PROGRESS", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19eaa4948cfaa8fdec73d93a76a440ad9bbe", null ], [ "SUCCESS", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19eaff605fbba4deec1238ba1c29b4f94d7b", null ], [ "ERROR_RESPONSE", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19ea6cf7fe3489e39ad3725e8bef16253a7d", null ], [ "ERROR_TIMEOUT", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19eae6b2a73c759746e25365104303388f1a", null ], [ "ERROR_PAYLOAD", "classxpcc_1_1sab_1_1_master.html#ab36ad33c0275c1de893982e1e2bfe19ea4986cfbdbe65d727729ff32f9c5b04ea", null ] ] ] ] ], [ "Response", "classxpcc_1_1sab_1_1_response.html", [ [ "Response", "classxpcc_1_1sab_1_1_response.html#ac0906ee9e84ba9801f6b5948da085164", null ], [ "Response", "classxpcc_1_1sab_1_1_response.html#a04bf851aa8304ec7e6b5e727db8628c9", null ], [ "error", "classxpcc_1_1sab_1_1_response.html#a71dfcd17dd47839457087c23c57402f7", null ], [ "send", "classxpcc_1_1sab_1_1_response.html#ac0f9eb7823909197d1b11159c89f27f1", null ], [ "send", "classxpcc_1_1sab_1_1_response.html#a78ea1e22718be2ad4154f19fe90d30ad", null ], [ "send", "classxpcc_1_1sab_1_1_response.html#ad89dd6c424346233c3518647924cdd87", null ], [ "operator=", "classxpcc_1_1sab_1_1_response.html#a55a90763ba1b50790fbd2b339b6438b2", null ], [ "Slave", "classxpcc_1_1sab_1_1_response.html#a9d17849c1d940c15284815dc87de9c21", null ], [ "transmitter", "classxpcc_1_1sab_1_1_response.html#a77bcc26c619fd1d7a1df08781321693a", null ], [ "triggered", "classxpcc_1_1sab_1_1_response.html#ac7b29734a882064c6517ab6d8207d5e1", null ] ] ], [ "Callable", "group__sab.html#structxpcc_1_1sab_1_1_callable", null ], [ "Action", "structxpcc_1_1sab_1_1_action.html", [ [ "Callback", "structxpcc_1_1sab_1_1_action.html#a4a6ee56b0e471e8541d73cf73b8ba2c7", null ], [ "call", "structxpcc_1_1sab_1_1_action.html#ae8702820db9acadc1ff013af6755263e", null ], [ "object", "structxpcc_1_1sab_1_1_action.html#af3158bb1dfc8ba7d87d6a2260ad90942", null ], [ "function", "structxpcc_1_1sab_1_1_action.html#a29131f7f1cfeb83f1294eeb511c1eac3", null ], [ "payloadLength", "structxpcc_1_1sab_1_1_action.html#a4386a8b3d63630be58718400eb73f24a", null ], [ "command", "structxpcc_1_1sab_1_1_action.html#abe12752f1c7bea7daffc325958003c01", null ] ] ], [ "Slave", "classxpcc_1_1sab_1_1_slave.html", [ [ "Slave", "classxpcc_1_1sab_1_1_slave.html#a625d015025c568888106fe1bc0b92f86", null ], [ "update", "classxpcc_1_1sab_1_1_slave.html#aed2912303d2975f5b46ff4d374379641", null ], [ "send", "classxpcc_1_1sab_1_1_slave.html#a74b2c98278be7110910af99a68a851a3", null ], [ "ownAddress", "classxpcc_1_1sab_1_1_slave.html#a73831ba661fefc43cc1208bc1f1d1d5e", null ], [ "actionList", "classxpcc_1_1sab_1_1_slave.html#aef26c33131cf998fb5ada3c89eeb00b7", null ], [ "actionCount", "classxpcc_1_1sab_1_1_slave.html#a87e7254a7ffafb6b6d8c9d8f59de51a9", null ], [ "currentCommand", "classxpcc_1_1sab_1_1_slave.html#aea81f23f1d87c1e6893bf04c0183e6a5", null ], [ "response", "classxpcc_1_1sab_1_1_slave.html#acedb116baff43266766af6453de9b838", null ] ] ], [ "SAB__ACTION", "group__sab.html#ga28fceefb11e49e49666e42aa284a9fb2", null ], [ "Error", "group__sab.html#ga09e1ac402e543afef644055934ad7511", [ [ "ERROR__GENERAL_ERROR", "group__sab.html#gga09e1ac402e543afef644055934ad7511a4857601b844d43221fbce544af4affc8", null ], [ "ERROR__NO_ACTION", "group__sab.html#gga09e1ac402e543afef644055934ad7511a23a5d9417f9b506bfa2aa6c0fc661ee6", null ], [ "ERROR__WRONG_PAYLOAD_LENGTH", "group__sab.html#gga09e1ac402e543afef644055934ad7511aed67ee1cb6379baf7e93aa0bd8388479", null ], [ "ERROR__NO_RESPONSE", "group__sab.html#gga09e1ac402e543afef644055934ad7511abcd4813301d2e869efb6e2330276f93a", null ] ] ], [ "Flags", "group__sab.html#ga7a762fce6beda73f3f1a760db05e76b1", null ], [ "maxPayloadLength", "group__sab.html#ga1414bbc735f98a4960bf7d5ac6babb6b", null ] ];<file_sep>/docs/api/classxpcc_1_1_siemens_m55.js var classxpcc_1_1_siemens_m55 = [ [ "initialize", "classxpcc_1_1_siemens_m55.html#a2757d111d9ae14d9af0f2633f7dfafe4", null ], [ "update", "classxpcc_1_1_siemens_m55.html#af1ceb621f764a9ab1aee87fa8cabe58e", null ] ];<file_sep>/docs/api/classxpcc_1_1_zero_m_q_connector_base.js var classxpcc_1_1_zero_m_q_connector_base = [ [ "Mode", "classxpcc_1_1_zero_m_q_connector_base.html#ae58a11e9ba6204918bc0312f34723c05", [ [ "SubPush", "classxpcc_1_1_zero_m_q_connector_base.html#ae58a11e9ba6204918bc0312f34723c05aae33bb35eee3fb88873a98d2c645c761", null ], [ "PubPull", "classxpcc_1_1_zero_m_q_connector_base.html#ae58a11e9ba6204918bc0312f34723c05a4c5754922d2133644c9dc2fb14e1164d", null ] ] ] ];<file_sep>/docs/api/functions.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>xpcc: Class Members</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">xpcc </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('functions.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> <div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div> <h3><a id="index_a"></a>- a -</h3><ul> <li>A0 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a61fe458a657e793a4deca98e7911d97c">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A1 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a40045b541aa56f58e6a8a615c8f00b10">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A16 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#a234847d3b1aaad37f1bface5f2f67842">xpcc::stm32::Fsmc</a> </li> <li>A17 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#a9841ba354813e53a925ac0a677628317">xpcc::stm32::Fsmc</a> </li> <li>A18 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#aa4249d86255e3de4f502c97a1f8d3775">xpcc::stm32::Fsmc</a> </li> <li>A19 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#a6ab863d7bc58f817b22eef57d65e7cc3">xpcc::stm32::Fsmc</a> </li> <li>A2 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a278bf672d8684a509527328d2207480e">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A20 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#ad67df24719ed1b00fbc26e1d47477cea">xpcc::stm32::Fsmc</a> </li> <li>A21 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#affc94b841b0b571fdb8c161332f6a39e">xpcc::stm32::Fsmc</a> </li> <li>A22 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#a2def08c65faed6ed63b26a68c08c9c85">xpcc::stm32::Fsmc</a> </li> <li>A23 : <a class="el" href="classxpcc_1_1stm32_1_1_fsmc.html#a564f3b967a78a220f971496eed559b37">xpcc::stm32::Fsmc</a> </li> <li>A3 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a5a07133503ec590dd6013f5683905be0">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A4 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a21626559ca81c7d76caa89e88a03673c">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A5 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a5b178aba539b4b5f9a879858132b62a4">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A6 : <a class="el" href="classxpcc_1_1_mcp23x17.html#aa7d9dda870a54034c256f826b9efd7de">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>A7 : <a class="el" href="classxpcc_1_1_mcp23x17.html#a0abc59a04214818da58b53fb6cafc5b3">xpcc::Mcp23x17&lt; Transport &gt;</a> </li> <li>abs : <a class="el" href="classxpcc_1_1_saturated.html#a29321a0fcf37a4d88292830593460a91">xpcc::Saturated&lt; T &gt;</a> </li> <li>AbstractComponent() : <a class="el" href="classxpcc_1_1_abstract_component.html#a11ee9013bc3f9c4fc47a8945bf25300c">xpcc::AbstractComponent</a> </li> <li>AbstractView() : <a class="el" href="classxpcc_1_1_abstract_view.html#a99357fa5ed844c39beb12e0ae8f76df4">xpcc::AbstractView</a> </li> <li>AccessMode : <a class="el" href="classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a7eef2ee926cc90664bebae8369565935">xpcc::stm32::fsmc::NorSram</a> </li> <li>acknowledgeExternalInterruptFlag() : <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a0.html#a009b1b0385b9c4cd3ee5bdb8e51a9895">xpcc::stm32::GpioA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a10.html#abd050346fed50ddf5afcb45c37637d44">xpcc::stm32::GpioA10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a11.html#a2715d7f21076f7de10d1b48ce58fccef">xpcc::stm32::GpioA11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a12.html#a1830bfb7a7e5b9893b7527f893eb984a">xpcc::stm32::GpioA12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a13.html#aa5a6ee4724d08556055160135bd7c1a5">xpcc::stm32::GpioA13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a14.html#acb8ef9484a7c2b7283a605b6c4a700d8">xpcc::stm32::GpioA14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a15.html#a71033384eb020668e5784cc5a14a6712">xpcc::stm32::GpioA15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a1.html#ad1533b3065ab73c0fcefcb8e8d58f8a7">xpcc::stm32::GpioA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a2.html#a4e68a6d5190f95ee23c6c28e834f960d">xpcc::stm32::GpioA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a3.html#ad64d1432471fda0256c3bfb3a1dbc5fe">xpcc::stm32::GpioA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a4.html#a5014e96ea3f0f2525026735f95701870">xpcc::stm32::GpioA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a5.html#a38d8afd07098c00e628e52041dd05c83">xpcc::stm32::GpioA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a6.html#aa32d91971032f8881fddb4baa572eed8">xpcc::stm32::GpioA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a7.html#a99811f81995f47fd7cba7c6297b1d81e">xpcc::stm32::GpioA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a8.html#aa14bf3d0d2a96e9209366a08eba3542b">xpcc::stm32::GpioA8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a9.html#a4ffd24b6101a02acb14a127b91a23387">xpcc::stm32::GpioA9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b0.html#a0ab2a855430035e6581f1175f2bea9ba">xpcc::stm32::GpioB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b10.html#a5d855754820afde7e8201b89a9f34aac">xpcc::stm32::GpioB10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b11.html#ab4fda06c18e87651cc54000d64fd7d89">xpcc::stm32::GpioB11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b12.html#a105f4882dc98234edcd9a9f648c15ce6">xpcc::stm32::GpioB12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b13.html#a9fabdbb368597f5b7a6a778e68538afb">xpcc::stm32::GpioB13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b14.html#a1f7270d607216b6b9272702069b50a95">xpcc::stm32::GpioB14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b15.html#acabab063f25e9ad9fc2ea3c08b731ac3">xpcc::stm32::GpioB15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b1.html#aab4a30cdbfe9c466e636fb3a330aad0b">xpcc::stm32::GpioB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b2.html#a370d0ce5dc9f609aa1fe2e10d6508cb4">xpcc::stm32::GpioB2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b3.html#a254d7e875912d0db29000cfa881908a1">xpcc::stm32::GpioB3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b4.html#af6c25ca807b790531d230a9d2d645796">xpcc::stm32::GpioB4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b5.html#a28e12eb9864df9353236961ce8c33d92">xpcc::stm32::GpioB5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b6.html#a1f23ff892e53e3ef81f119f3c29b7268">xpcc::stm32::GpioB6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b7.html#a4337ca93d5ba797b1f825b11d89b00ae">xpcc::stm32::GpioB7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b8.html#a28532cefb7b2591e8cdbfeacc7aef9dd">xpcc::stm32::GpioB8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b9.html#a82f31c6adfe54a4ba651ddbb960d5fca">xpcc::stm32::GpioB9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c0.html#a5c593ae2a3ee421ae5bd275faa90ee92">xpcc::stm32::GpioC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c10.html#a5480df452020bb6fe49d3e761f6dae03">xpcc::stm32::GpioC10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c11.html#a7442e8dbd279350ea7e4ffb288a66625">xpcc::stm32::GpioC11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c12.html#a19371174aadb03a3a7460fdf9e80a889">xpcc::stm32::GpioC12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c13.html#aeae9b4bd8ff4d954a5df3d94731333ff">xpcc::stm32::GpioC13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c14.html#a7b5317b10b3f224d1cd16e0153f13418">xpcc::stm32::GpioC14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c15.html#ad0ecd11b3204debfba7142327cb2575e">xpcc::stm32::GpioC15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c1.html#ad448d324d96ee4c659c324319195dd0f">xpcc::stm32::GpioC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c2.html#a42a8b2ae3795dd9438500bc3c80d4856">xpcc::stm32::GpioC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c3.html#a839d37cf618136b04f37a79a8b20a8fc">xpcc::stm32::GpioC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c4.html#aea79bc6f26ef872f29a3bf119763777e">xpcc::stm32::GpioC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c5.html#abf5b52377f31a055669e5a529f1bf7d4">xpcc::stm32::GpioC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c6.html#a0ff5e6a21e18797e0ce5930f36a16511">xpcc::stm32::GpioC6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c7.html#a723f82c1281d648db1dc339631157b2e">xpcc::stm32::GpioC7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c8.html#af1b9810602e012d5237092408d238941">xpcc::stm32::GpioC8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c9.html#a688fe9bdd4ec41db04cffe5ba6c8774a">xpcc::stm32::GpioC9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d0.html#a0b69265b802b2db46b56bae8f668e197">xpcc::stm32::GpioD0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d10.html#a023cde9980ec882bb9c0270ddf843d15">xpcc::stm32::GpioD10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d11.html#ad6883434e85e765844598e07b48a86d4">xpcc::stm32::GpioD11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d12.html#ab507b6f0db06e53550f4d152be723efe">xpcc::stm32::GpioD12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d13.html#a7fd8a6081c33c83405c5cf5af03449e7">xpcc::stm32::GpioD13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d14.html#ad67bd2c5bea452d454ce4e28294192a5">xpcc::stm32::GpioD14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d15.html#ab00df157ebcc58a17d23b5ca3c368edd">xpcc::stm32::GpioD15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d1.html#a330f18f443d5acd992f56baf18ac026e">xpcc::stm32::GpioD1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d2.html#aaa29c1210cbb6d3248429c488b787da1">xpcc::stm32::GpioD2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d3.html#a7d041b209a41620ea596e98313cfbc54">xpcc::stm32::GpioD3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d4.html#a9a72d50258b213529ed8a2185db9db96">xpcc::stm32::GpioD4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d5.html#a7f2f9db1357b5248552663179e51c7fc">xpcc::stm32::GpioD5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d6.html#adb1c80757a539f6dde5f87b3aa63f9f6">xpcc::stm32::GpioD6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d7.html#a736befcb527d7c55a6a51f748fe98909">xpcc::stm32::GpioD7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d8.html#a618af5b19ec9ce3548de5336b9f01aaa">xpcc::stm32::GpioD8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_d9.html#a9d7c77f01517669ba322b1d09c6a6392">xpcc::stm32::GpioD9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e0.html#acbf3fea31c36691f4031b036d455f0de">xpcc::stm32::GpioE0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e10.html#ac05c7261584d10468df768ad70be6503">xpcc::stm32::GpioE10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e11.html#adca9326f209d0683b82560da958d41d7">xpcc::stm32::GpioE11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e12.html#a240684dae3593a80abc2ec5cac00f159">xpcc::stm32::GpioE12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e13.html#ae48bff098bdcc5d653ef4510afa5f311">xpcc::stm32::GpioE13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e14.html#af3d477ee1892d8d083920f1d9f2df194">xpcc::stm32::GpioE14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e15.html#a8f4488b48b9508871d190818f33d8c70">xpcc::stm32::GpioE15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e1.html#a93e1c444309b385ae3a054c0c8d82b2e">xpcc::stm32::GpioE1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e2.html#a926e90a11f88baa6704359af62ba21d8">xpcc::stm32::GpioE2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e3.html#aab6d1459bdf2e997c6b68bb0d62e064e">xpcc::stm32::GpioE3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e4.html#a497ce6c75beb003c7391609894221b29">xpcc::stm32::GpioE4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e5.html#a9b71298e68b51a57e1ad97de9e6c7db6">xpcc::stm32::GpioE5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e6.html#a5cebbc61e1d6ba93535adf8d4dcac0b6">xpcc::stm32::GpioE6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e7.html#af310607f8e0272ca065ff280c5fbf180">xpcc::stm32::GpioE7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e8.html#a937a856b929fc7d64a9371ac2f411187">xpcc::stm32::GpioE8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_e9.html#a082d2b576cc2e353f82cef50b250b966">xpcc::stm32::GpioE9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_h0.html#afb748be1e8bdb9032634af817145227d">xpcc::stm32::GpioH0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_h1.html#aab98f9112ea8b73a0309fc158769c3d1">xpcc::stm32::GpioH1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a0.html#ad00c2dd27cb5ed18e31a9c2f4fb1d3c6">xpcc::stm32::GpioInputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a10.html#a9316b19ca6349bd4029bd570fd49c8cf">xpcc::stm32::GpioInputA10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a11.html#a258cac2e668dddc93a4c3b0241f26777">xpcc::stm32::GpioInputA11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a12.html#a9cce120e22d83c473d571acd1e774700">xpcc::stm32::GpioInputA12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a13.html#a9a34b9fce25dda3ccb011e8cc0f6ca57">xpcc::stm32::GpioInputA13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a14.html#aa66ecb0cf21b8fa2a7e95042af361fb3">xpcc::stm32::GpioInputA14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a15.html#a74d38119aaf217752824912158e718f3">xpcc::stm32::GpioInputA15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a1.html#acf4334f7db63f0710de188d960adc3bb">xpcc::stm32::GpioInputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a2.html#aa0f6707da8ee08f20c0d47ffa5c3385e">xpcc::stm32::GpioInputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a3.html#aa666c40d1ff0e99373129c5e54c031a3">xpcc::stm32::GpioInputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a4.html#a3e0636a1d980a605d58b2e818e55cb4b">xpcc::stm32::GpioInputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a5.html#a6b5f6a79d0656c8ced5ea2ca0fc204a7">xpcc::stm32::GpioInputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a6.html#af2204fd034e03b2dd5358bda397613c9">xpcc::stm32::GpioInputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a7.html#a052d2e5436783a157ad5dd74e5381bea">xpcc::stm32::GpioInputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a8.html#a899ea86f01b43912c1788fb3c44fe8d8">xpcc::stm32::GpioInputA8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a9.html#a3474013dc32c6ae17dce8079149d8657">xpcc::stm32::GpioInputA9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b0.html#a397db8d172bdccd6051789af35862877">xpcc::stm32::GpioInputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b10.html#af7fcd168b085f00dc8783f3c7afd3a3f">xpcc::stm32::GpioInputB10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b11.html#a4473c192cc4db9c0fc283434ed15c32a">xpcc::stm32::GpioInputB11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b12.html#a51c6304303b0bb1eb8b9a034c7ba11c4">xpcc::stm32::GpioInputB12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b13.html#a6aecc78687babed44b2acb2db4f08753">xpcc::stm32::GpioInputB13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b14.html#a43c85a1e5cdee6bd180f472b8da50ec4">xpcc::stm32::GpioInputB14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b15.html#a43b8dcec78b75f8c15d5d5520f1bc29b">xpcc::stm32::GpioInputB15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b1.html#a63705f634408945ae1449884d862d43b">xpcc::stm32::GpioInputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b2.html#a0a74f190e1ad9f847e5718b1fac6dd60">xpcc::stm32::GpioInputB2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b3.html#a6d571b9f4b383bc5fb4552df56b9d646">xpcc::stm32::GpioInputB3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b4.html#a8bf60da1f6870bb440df3f1a5b51db5a">xpcc::stm32::GpioInputB4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b5.html#a6916252201253ef449a4484697784be4">xpcc::stm32::GpioInputB5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b6.html#abda26cbf492306f78e6da647d3c352f9">xpcc::stm32::GpioInputB6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b7.html#ad55bd8a45f24436592260d47cd932cf6">xpcc::stm32::GpioInputB7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b8.html#ac25d73996d8beb66b8f21a17bb5df99a">xpcc::stm32::GpioInputB8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b9.html#aa9ab99539867d61a8c8aa39273832328">xpcc::stm32::GpioInputB9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c0.html#ae90316554074398cf075b839c1d0cccd">xpcc::stm32::GpioInputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c10.html#a36c4f85a5c9ccc2d67c707fc1cca56fa">xpcc::stm32::GpioInputC10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c11.html#abf3589d9994764058ded61fa4c112df1">xpcc::stm32::GpioInputC11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c12.html#aaa4e5e36fc4d3a9bb91b559e37f0e8ca">xpcc::stm32::GpioInputC12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c13.html#ad875e589d820a0dfdcbae8764ee7fa5e">xpcc::stm32::GpioInputC13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c14.html#a3928be4956f5d7a0130d2df784b60a43">xpcc::stm32::GpioInputC14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c15.html#ac4b882bde8bb5e542bb14d607ac7efee">xpcc::stm32::GpioInputC15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c1.html#ae567e2d27438e2b2eef0ba41d3d72add">xpcc::stm32::GpioInputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c2.html#a9e85b4c4c1c84e4b3bc20c610f3200f9">xpcc::stm32::GpioInputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c3.html#a9eb39dd64232ca902d4247e158101099">xpcc::stm32::GpioInputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c4.html#a74ef21c09c5a80fd9f0a78dd84c69f4d">xpcc::stm32::GpioInputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c5.html#a7813a748275d204d98b09186ee28803d">xpcc::stm32::GpioInputC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c6.html#a37eb4a360dd00ff5b5d154d525203f75">xpcc::stm32::GpioInputC6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c7.html#a46e8a6ab4725de98673aea6f40fe104b">xpcc::stm32::GpioInputC7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c8.html#ab287b417a7b6559e63a80b23fa3780f3">xpcc::stm32::GpioInputC8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c9.html#a3e41bbc573c113b69a86d4e540042958">xpcc::stm32::GpioInputC9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d0.html#af3e898f8e0d1924f984a8f601b0c9c0b">xpcc::stm32::GpioInputD0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d10.html#a4c7b52557a7b9e5e6599e5fd7b68381b">xpcc::stm32::GpioInputD10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d11.html#ad42d5e90afca442c49033bfe96549b44">xpcc::stm32::GpioInputD11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d12.html#acdf7aee48a240e0704ae043a15465329">xpcc::stm32::GpioInputD12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d13.html#a919a5db0a62254bb042ddc7216cd89a6">xpcc::stm32::GpioInputD13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d14.html#afc7f875094a0ae012934f519344c3d41">xpcc::stm32::GpioInputD14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d15.html#a2857f0a5e694218f593e2a076f12232b">xpcc::stm32::GpioInputD15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d1.html#ac0de921aff7a75beae0093f6859f3655">xpcc::stm32::GpioInputD1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d2.html#abd4d11782690b4aa5628d16d2b49f3e8">xpcc::stm32::GpioInputD2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d3.html#a4bf9a27de7491286beefad2efc49e908">xpcc::stm32::GpioInputD3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d4.html#a1d0ae406a46f2f1be4ff1069705986c3">xpcc::stm32::GpioInputD4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d5.html#a27d872f43e0dc9eab67aeebe4540216d">xpcc::stm32::GpioInputD5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d6.html#a11e62aa60be3e5771146eaf8c466972b">xpcc::stm32::GpioInputD6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d7.html#a6f609d7dae869e8b9a61ae65031ef23a">xpcc::stm32::GpioInputD7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d8.html#a47e0aff51fbeafafad48d9c1bbf55369">xpcc::stm32::GpioInputD8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_d9.html#a82c29b599b5548aa2959b01ccf678e6c">xpcc::stm32::GpioInputD9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e0.html#ac97d208503717374465a737caf231dcf">xpcc::stm32::GpioInputE0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e10.html#adf7e62b5611139cce7da3e9a074aa3db">xpcc::stm32::GpioInputE10</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e11.html#ad33bfc35802d969f20e3198852572f2d">xpcc::stm32::GpioInputE11</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e12.html#ad753d94f8083c2d59ecadb039ee920a4">xpcc::stm32::GpioInputE12</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e13.html#aa6333b6917c6df92f8b0a510a5e734a9">xpcc::stm32::GpioInputE13</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e14.html#a6eb1de8cf35b96804ca5360c7d8cfd1c">xpcc::stm32::GpioInputE14</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e15.html#a5d9c2e2197d87857408a2526570ac41d">xpcc::stm32::GpioInputE15</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e1.html#a6587bfe5b25831ddd4ae4084d3b84bb0">xpcc::stm32::GpioInputE1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e2.html#a9e88be9bf701cdad919bf5b92d972d49">xpcc::stm32::GpioInputE2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e3.html#aac64b615522a1eeb91423131246cc08b">xpcc::stm32::GpioInputE3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e4.html#a1181e678fad2f4b722dad89daeadf5bf">xpcc::stm32::GpioInputE4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e5.html#a4206e0765bcd8280800285c45782ad48">xpcc::stm32::GpioInputE5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e6.html#a1b472cd6462949f4dd8ca83bd0ba65dd">xpcc::stm32::GpioInputE6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e7.html#a7d27bbb98b79b0e0348acf1d9f55497d">xpcc::stm32::GpioInputE7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e8.html#aefcb16eed5be6d42aad31996184d9c5c">xpcc::stm32::GpioInputE8</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_e9.html#a76a727988d51cf38efb02338b198b359">xpcc::stm32::GpioInputE9</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_h0.html#adecdeb7385f9b147bc6069453ed21592">xpcc::stm32::GpioInputH0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_h1.html#ad3d3bef11ccb66f7c6eef947c84c54f0">xpcc::stm32::GpioInputH1</a> </li> <li>acknowledgeInterruptFlag() : <a class="el" href="classxpcc_1_1stm32_1_1_spi_hal1.html#a928c0f22769afd7040e0667a1157e604">xpcc::stm32::SpiHal1</a> , <a class="el" href="classxpcc_1_1stm32_1_1_spi_hal2.html#af21b8a20d83cbb6d0c730b70aca88832">xpcc::stm32::SpiHal2</a> , <a class="el" href="classxpcc_1_1stm32_1_1_spi_hal3.html#ad186e65c9bf08f327b43d051661f8aa6">xpcc::stm32::SpiHal3</a> </li> <li>acknowledgeInterruptFlags() : <a class="el" href="classxpcc_1_1stm32_1_1_adc1.html#ab3ecbd0edf0eda341500db7f397ffe60">xpcc::stm32::Adc1</a> , <a class="el" href="classxpcc_1_1stm32_1_1_adc2.html#ab1779813aec1019a5bde1478d6eb8e5d">xpcc::stm32::Adc2</a> , <a class="el" href="classxpcc_1_1stm32_1_1_adc3.html#a68f8d57982449317715e8b5bf58545a1">xpcc::stm32::Adc3</a> , <a class="el" href="classxpcc_1_1stm32_1_1_basic_timer.html#a9f8d900230a18c66fea22a62f6dc614a">xpcc::stm32::BasicTimer</a> , <a class="el" href="classxpcc_1_1stm32_1_1_uart_hal4.html#ad051c3706279594fdf0495fd41c159a2">xpcc::stm32::UartHal4</a> , <a class="el" href="classxpcc_1_1stm32_1_1_uart_hal5.html#adac680838064e5da6fc6f117314c54fc">xpcc::stm32::UartHal5</a> , <a class="el" href="classxpcc_1_1stm32_1_1_usart_hal1.html#a05bbc56deee2146d606d1b0555d416d1">xpcc::stm32::UsartHal1</a> , <a class="el" href="classxpcc_1_1stm32_1_1_usart_hal2.html#af0d0694e0e07f6ca1b3ad8917fff0987">xpcc::stm32::UsartHal2</a> , <a class="el" href="classxpcc_1_1stm32_1_1_usart_hal3.html#acf6ec4a8497dd183880ab574c66680b9">xpcc::stm32::UsartHal3</a> , <a class="el" href="classxpcc_1_1stm32_1_1_usart_hal6.html#aedb44dbbdfd010ee855242d33a7f4fef">xpcc::stm32::UsartHal6</a> </li> <li>acquire() : <a class="el" href="classxpcc_1_1pt_1_1_semaphore.html#a1f6873f28cf4aeac06f642712f62a41d">xpcc::pt::Semaphore</a> , <a class="el" href="classxpcc_1_1rtos_1_1_mutex.html#a6fb6dedd3f3fc9c687d549f986c8e3c5">xpcc::rtos::Mutex</a> , <a class="el" href="classxpcc_1_1rtos_1_1_semaphore.html#a3aea7d7633547be493ff9e5f3a73827d">xpcc::rtos::Semaphore</a> , <a class="el" href="classxpcc_1_1rtos_1_1_semaphore_base.html#a0b7b068974747e2e8841d2c7c2332bc0">xpcc::rtos::SemaphoreBase</a> , <a class="el" href="classxpcc_1_1_spi_master.html#ac41f11a084eed68cf8703fb3edc69a84">xpcc::SpiMaster</a> </li> <li>activate() : <a class="el" href="classxpcc_1_1gui_1_1_number_rocker.html#aa7238f1f5a9da3f8e5ca39a4c5b60492">xpcc::gui::NumberRocker&lt; T &gt;</a> , <a class="el" href="classxpcc_1_1gui_1_1_string_rocker.html#a8e9a327526fa82959bbaf49fd2374f56">xpcc::gui::StringRocker</a> , <a class="el" href="classxpcc_1_1gui_1_1_widget.html#a5adfb9bfb3a81f9574157d515aad974d">xpcc::gui::Widget</a> </li> <li>activated : <a class="el" href="classxpcc_1_1gui_1_1_widget.html#a13779366f738fc0001991b1176319a85">xpcc::gui::Widget</a> </li> <li>Adc1Channel : <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a0.html#aa4d26ebf59d868264353ad7407a58697">xpcc::stm32::GpioA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a1.html#a4e02f85ec5878417d3b4947115be720a">xpcc::stm32::GpioA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a2.html#a0f192c1f3c3762f8fa3912958e50e46d">xpcc::stm32::GpioA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a3.html#aa31e919401796f4671625a1dd96b46fc">xpcc::stm32::GpioA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a4.html#a5503b37b76f051a8d69aed895ab17157">xpcc::stm32::GpioA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a5.html#a49c51af6ed2125ecdbfceec76fd03031">xpcc::stm32::GpioA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a6.html#addbe81d930863b213b8be27cafd5f30e">xpcc::stm32::GpioA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a7.html#adb55ec575d979c9ecb9824306af52356">xpcc::stm32::GpioA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b0.html#a95bb79e1401ad4bdd04e2409fd9df2ee">xpcc::stm32::GpioB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b1.html#a519c78da13df16ba105448a9bb7cb1fa">xpcc::stm32::GpioB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c0.html#ac72e453726abff91eb72989155371ce7">xpcc::stm32::GpioC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c1.html#a8bce7b801878054fe2baaa71f424e708">xpcc::stm32::GpioC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c2.html#acc8ce7e49932a7d971bc5565eab274b7">xpcc::stm32::GpioC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c3.html#a27da826c587cf9ec726fac5bf2334e23">xpcc::stm32::GpioC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c4.html#ac995a8e568f4e5f7acfe71f5f1de8369">xpcc::stm32::GpioC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c5.html#a5a3ce0fb723b1bb53c6cd05c04e8fa10">xpcc::stm32::GpioC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a0.html#ae2fe3811418b7753869734a22f2a241b">xpcc::stm32::GpioInputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a1.html#a1d563cfd126f000e6458cd8e2c00ecc7">xpcc::stm32::GpioInputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a2.html#a8978f7b8fe161c781bfc89810c57ed37">xpcc::stm32::GpioInputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a3.html#ad87010e0111a7e75b53c7dcb3b8591c3">xpcc::stm32::GpioInputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a4.html#a1060ed0ad08dce044fa08a576f4d3ab5">xpcc::stm32::GpioInputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a5.html#a432ee606efaca7c592f585a3d0d917c1">xpcc::stm32::GpioInputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a6.html#a20a188aae5940e1f885129be0eb591b9">xpcc::stm32::GpioInputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a7.html#aa789215ba21ca040d2695106364ec239">xpcc::stm32::GpioInputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b0.html#a38808ea98a1fd362b36597853568c2f6">xpcc::stm32::GpioInputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b1.html#aeefbbe865608c40ccfbacaf282037a67">xpcc::stm32::GpioInputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c0.html#a0d7cef8f7a3c44afb8a03cae18f7fd2e">xpcc::stm32::GpioInputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c1.html#ac4f65e457b4ee886e01ed111597971f5">xpcc::stm32::GpioInputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c2.html#aba7f0a4304980a7311e6ceb480c54887">xpcc::stm32::GpioInputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c3.html#a8c4b084d3aa1d33df37408f100f3a6bf">xpcc::stm32::GpioInputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c4.html#a472955cf346080e7fb0766d3bb50b7ef">xpcc::stm32::GpioInputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c5.html#a7af5fed4abb655ab927237d068c343ae">xpcc::stm32::GpioInputC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a0.html#a8449b67da5f302373177cfabc5b8d7e6">xpcc::stm32::GpioOutputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a1.html#a28196c8ba770695be84ce78e300a5133">xpcc::stm32::GpioOutputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a2.html#a5025c3b538d9a99762321b26005efcca">xpcc::stm32::GpioOutputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a3.html#a295fbdeb68e7235ecc199950a9777033">xpcc::stm32::GpioOutputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a4.html#ad5fa8ec417997b904375de640738b069">xpcc::stm32::GpioOutputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a5.html#aa49afa85aac5e14759cf5f0718c86d9a">xpcc::stm32::GpioOutputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a6.html#a3253c5dfdd8c1205730ea54b2dfa7ff1">xpcc::stm32::GpioOutputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a7.html#a152bf8a1ffc46740adc14c606deef9d0">xpcc::stm32::GpioOutputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b0.html#af89d481aa84c13f74bc9f6383e7ce5f3">xpcc::stm32::GpioOutputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b1.html#a603af2ba2f08a29c7aba6d1528955a40">xpcc::stm32::GpioOutputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c0.html#a9c8a26c79f54b096d10c4c010b72d4a8">xpcc::stm32::GpioOutputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c1.html#a5d71e42c01c82e410619b1be9bbd4028">xpcc::stm32::GpioOutputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c2.html#a5d1d3416c18ec4d6a25cd50c0d0c2d14">xpcc::stm32::GpioOutputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c3.html#a379d12f3a891f6e91420a4cf3cfe2c83">xpcc::stm32::GpioOutputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c4.html#acabd30e7eaef27b8e25861c091017624">xpcc::stm32::GpioOutputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c5.html#aa3973f4c09542d3be65255d8e91d3748">xpcc::stm32::GpioOutputC5</a> </li> <li>Adc2Channel : <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a0.html#a3d6370d8d75453efda061b7fd77502c2">xpcc::stm32::GpioA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a1.html#a06a1889955e1d7c02b97483cb3170462">xpcc::stm32::GpioA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a2.html#a3cc2efecae81d8c70395217fbcfcff4d">xpcc::stm32::GpioA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a3.html#a053f9f95a6784e412530b5ccd6d64f32">xpcc::stm32::GpioA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a4.html#a021870602018a7141b1402e6a54002ea">xpcc::stm32::GpioA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a5.html#a969bc3ae4dad65dfdb579ab32711c3f6">xpcc::stm32::GpioA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a6.html#aff31c3f3eb52e3b1709b3a1c16735225">xpcc::stm32::GpioA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a7.html#abf893c9798fcd978ebb2ee3a773a045a">xpcc::stm32::GpioA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b0.html#a19b5753b5fef6c44785e65a3aae1441a">xpcc::stm32::GpioB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_b1.html#a917cea6fb0e672744d5237647dee4e61">xpcc::stm32::GpioB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c0.html#a10ff5f6720ebf16ba300ab55ca5ec2e3">xpcc::stm32::GpioC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c1.html#aa9192f2b0876c7b4f6bb5343046fd208">xpcc::stm32::GpioC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c2.html#aedb19e1e53204aff121498a88e4ce7e9">xpcc::stm32::GpioC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c3.html#aa84a272f0fd75dd5b6b59242606af34d">xpcc::stm32::GpioC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c4.html#ac1818b13162c3f9084187d9720699bd3">xpcc::stm32::GpioC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c5.html#acf292580800d97e5721124d5c11951ff">xpcc::stm32::GpioC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a0.html#abafab890b455e8517d1f693d37b5997d">xpcc::stm32::GpioInputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a1.html#a3e55b1d36d0dfc325c96f0d72ee4a1bb">xpcc::stm32::GpioInputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a2.html#ad08179cfd90c9caaaea5e237c767c10e">xpcc::stm32::GpioInputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a3.html#a81641535ddc26326b670aa2f94dda55b">xpcc::stm32::GpioInputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a4.html#a8dfe57cba9839a88508598344edfcded">xpcc::stm32::GpioInputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a5.html#aba9ab0183f7d20f18d05d0304c7b8482">xpcc::stm32::GpioInputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a6.html#aeb94ad115f675afb4507bdd189d7aab6">xpcc::stm32::GpioInputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a7.html#a07333cecc22d51236fe569bc1950d2b9">xpcc::stm32::GpioInputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b0.html#a96539d0b05800153bf978682f17e001b">xpcc::stm32::GpioInputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_b1.html#a0524b7f6fc30a7e0f352b58bf8bc55a7">xpcc::stm32::GpioInputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c0.html#af80bef9eda5811cd078b78dfc92f0339">xpcc::stm32::GpioInputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c1.html#a6c03deabb1f4195dd00f0f544064895e">xpcc::stm32::GpioInputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c2.html#ab72647c0e763c0a9bb009a2f3905df7c">xpcc::stm32::GpioInputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c3.html#acff5778f00b737788f4468d4715a5d7d">xpcc::stm32::GpioInputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c4.html#a0629343e3311ac4d86561208a1cc8d74">xpcc::stm32::GpioInputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c5.html#a4f23b79d280e49f7c120afce33aab24c">xpcc::stm32::GpioInputC5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a0.html#a1b62444da0ccf335ab595175ddb711d5">xpcc::stm32::GpioOutputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a1.html#ac76ffbc616991c5b8c43038bd063911a">xpcc::stm32::GpioOutputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a2.html#a95e8e77577af0fd00399ea4464563d8c">xpcc::stm32::GpioOutputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a3.html#a0cc852aa3d6661945d06ab53fb2e2a7e">xpcc::stm32::GpioOutputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a4.html#a69b5d73761aaeaeac93784c09da4c3d3">xpcc::stm32::GpioOutputA4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a5.html#a53f0217468bcfb18de9dfa53f3fb84d2">xpcc::stm32::GpioOutputA5</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a6.html#ab3083a727475fd5c35fa0c1d7a245ce2">xpcc::stm32::GpioOutputA6</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a7.html#a5b25d9c34bece32f4a453f428e218aef">xpcc::stm32::GpioOutputA7</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b0.html#ad44eeee86e92a41d4bd3bdb2869fee64">xpcc::stm32::GpioOutputB0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_b1.html#af7b2ed9c12b725da253405d4c66fb8e8">xpcc::stm32::GpioOutputB1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c0.html#a5ed623e67457da63b00e80be675cdbaf">xpcc::stm32::GpioOutputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c1.html#a1e5fb878b35597e4f6fccbb804e30e25">xpcc::stm32::GpioOutputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c2.html#ad2010a89d5bf4bd20a46b3ce16e7a826">xpcc::stm32::GpioOutputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c3.html#a77c3db9bed4af378f1701ca374d8d30d">xpcc::stm32::GpioOutputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c4.html#adc2c757a0d0cbfdb2465f76b30c6c450">xpcc::stm32::GpioOutputC4</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c5.html#aea32247324978a96e87951d5f6ebebe2">xpcc::stm32::GpioOutputC5</a> </li> <li>Adc3Channel : <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a0.html#a33fd5506f7e39963ba434e37c0d57910">xpcc::stm32::GpioA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a1.html#a58de707dd6bd3b9b2b9aa5b4550ced79">xpcc::stm32::GpioA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a2.html#a7af27661691a13244625eb71dcfe025d">xpcc::stm32::GpioA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_a3.html#a53ad47581dc05e44e967e378fd7af320">xpcc::stm32::GpioA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c0.html#a507de98c6a01de810b3b9cf596441417">xpcc::stm32::GpioC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c1.html#abfb9fa058d08c2a64a1c9e98aefe3de5">xpcc::stm32::GpioC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c2.html#ab1e497bb4f6c475459f970e30d006d19">xpcc::stm32::GpioC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_c3.html#a584b77d9ba240685063a976746c00248">xpcc::stm32::GpioC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a0.html#aed5540edfc41715ee337442e0fefc579">xpcc::stm32::GpioInputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a1.html#aab5418c1fd8754e0967411a2af9db078">xpcc::stm32::GpioInputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a2.html#a8ff5e8a8a2e01c62bd712c9b0bf11241">xpcc::stm32::GpioInputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_a3.html#a29f70cd835a6ca430faa10f2e761698e">xpcc::stm32::GpioInputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c0.html#a338c1cc74df5dbe95940d3ad291ac01e">xpcc::stm32::GpioInputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c1.html#a54bed4cfd49c50a16bd8433e840c0eae">xpcc::stm32::GpioInputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c2.html#acfe9efedb12ce07f16e794a60f0c640c">xpcc::stm32::GpioInputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_input_c3.html#a34d719278a061b696147ae052091e01c">xpcc::stm32::GpioInputC3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a0.html#a924f61cc9ea91892c4237611cda0784b">xpcc::stm32::GpioOutputA0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a1.html#a9fc1218bcee3f0f5ee4f5fe3d5853d5e">xpcc::stm32::GpioOutputA1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a2.html#a1febbbac8488d78bec1cc6248d92292d">xpcc::stm32::GpioOutputA2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_a3.html#a1525eacc32b625bf94fe28977df16042">xpcc::stm32::GpioOutputA3</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c0.html#aa05c70b6edd4b2af770d24727c35d933">xpcc::stm32::GpioOutputC0</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c1.html#a1db716867799880c2ee13d7266aef8b7">xpcc::stm32::GpioOutputC1</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c2.html#af86976870c9e488bd37b82fe085e419c">xpcc::stm32::GpioOutputC2</a> , <a class="el" href="structxpcc_1_1stm32_1_1_gpio_output_c3.html#a28a14534a6110f92f524751699b4cbfd">xpcc::stm32::GpioOutputC3</a> </li> <li>addChannel() : <a class="el" href="classxpcc_1_1stm32_1_1_adc1.html#ad5c3725d781556415aa1ac8f008a11ff">xpcc::stm32::Adc1</a> , <a class="el" href="classxpcc_1_1stm32_1_1_adc2.html#afbab061c120648b6d81af05d999e7e52">xpcc::stm32::Adc2</a> , <a class="el" href="classxpcc_1_1stm32_1_1_adc3.html#acd53ac4674339a9360b7f49043f47cde">xpcc::stm32::Adc3</a> </li> <li>addEntry() : <a class="el" href="classxpcc_1_1_choice_menu.html#a5f342d7dfbd4fe58d94d31877ed69299">xpcc::ChoiceMenu</a> , <a class="el" href="classxpcc_1_1_standard_menu.html#a3cb73e54a23418aa8becf7ed9b9d8da9">xpcc::StandardMenu</a> </li> <li>addEventId() : <a class="el" href="classxpcc_1_1_tipc_connector.html#a8b9e1719fcb6896c24ff8109f647fe11">xpcc::TipcConnector</a> </li> <li>addReceiverId() : <a class="el" href="classxpcc_1_1_tipc_connector.html#a100fc64407abdb52fd6464bfed2bc391">xpcc::TipcConnector</a> </li> <li>address : <a class="el" href="structxpcc_1_1amnb_1_1_error_handler.html#acf7e25e81af3cf6698c162eac4fe08fc">xpcc::amnb::ErrorHandler</a> , <a class="el" href="structxpcc_1_1amnb_1_1_listener.html#abb63d4297ee9d136be90da134f26ba0d">xpcc::amnb::Listener</a> </li> <li>Adxl345() : <a class="el" href="classxpcc_1_1_adxl345.html#a3661252d964c000f925e5ff820e34dd7">xpcc::Adxl345&lt; I2cMaster &gt;</a> </li> <li>all() : <a class="el" href="structxpcc_1_1_flags.html#aa87018f9fc225bf38ae307d2f6684b9d">xpcc::Flags&lt; Enum, T &gt;</a> </li> <li>allocate() : <a class="el" href="classxpcc_1_1_block_allocator.html#a92f348611e265e5272b7d0b39782be94">xpcc::BlockAllocator&lt; T, BLOCK_SIZE &gt;</a> </li> <li>ALS_Status : <a class="el" href="structxpcc_1_1vl6180.html#aed497c42dc42a1e2919cebd2ebd35a38">xpcc::vl6180</a> </li> <li>AlternateFunction : <a class="el" href="structxpcc_1_1stm32_1_1_gpio.html#a558c6d060354d40fd94cae7769469c53">xpcc::stm32::Gpio</a> </li> <li>AnalogGain : <a class="el" href="structxpcc_1_1vl6180.html#a75da4bafec9adf929cf2fe5449015285">xpcc::vl6180</a> </li> <li>animateTo() : <a class="el" href="classxpcc_1_1ui_1_1_animation.html#af63483b4b1f29ac1a09d28767deecc72">xpcc::ui::Animation&lt; T &gt;</a> </li> <li>Animation() : <a class="el" href="classxpcc_1_1ui_1_1_animation.html#a4893b5faff02a683958f133aaf69ef5f">xpcc::ui::Animation&lt; T &gt;</a> </li> <li>any() : <a class="el" href="structxpcc_1_1_flags.html#a045e6f8caf92e1ff3de3aba3e11005f0">xpcc::Flags&lt; Enum, T &gt;</a> </li> <li>append() : <a class="el" href="classxpcc_1_1_doubly_linked_list.html#ad0dfde3a9638f7786eb04a4eb1592afa">xpcc::DoublyLinkedList&lt; T, Allocator &gt;</a> , <a class="el" href="classxpcc_1_1_dynamic_array.html#ae8065ed33b329979c2f97573e28066ae">xpcc::DynamicArray&lt; T, Allocator &gt;</a> , <a class="el" href="classxpcc_1_1filter_1_1_fir.html#ac5dd37beef65b812c0395d10e47e0b5d">xpcc::filter::Fir&lt; T, N, BLOCK_SIZE, ScaleFactor &gt;</a> , <a class="el" href="classxpcc_1_1filter_1_1_median.html#a26d1edadcb7d074e0955f876e63a8518">xpcc::filter::Median&lt; T, N &gt;</a> , <a class="el" href="classxpcc_1_1_linked_list.html#a3f2cf3b2bdd6c3c32176ae6cff3cb584">xpcc::LinkedList&lt; T, Allocator &gt;</a> , <a class="el" href="classxpcc_1_1rtos_1_1_queue_base.html#ae342e298c158bf0fd8ab5279fcfb58b8">xpcc::rtos::QueueBase</a> </li> <li>appendOverwrite() : <a class="el" href="classxpcc_1_1_bounded_deque.html#acec35598f10e247b96012986ac4b23d9">xpcc::BoundedDeque&lt; T, N &gt;</a> </li> <li>applyAndReset() : <a class="el" href="classxpcc_1_1stm32_1_1_basic_timer.html#ac431fac3752a2c0da270dca142d9d2d3">xpcc::stm32::BasicTimer</a> </li> <li>areAllResumablesRunning() : <a class="el" href="classxpcc_1_1_resumable.html#add85af846745935a9ebcbcfcec177c0c">xpcc::Resumable&lt; Functions &gt;</a> </li> <li>areAnyResumablesRunning() : <a class="el" href="classxpcc_1_1_resumable.html#a359d87fdc7d60de8b99e151566e22383">xpcc::Resumable&lt; Functions &gt;</a> </li> <li>ascii() : <a class="el" href="classxpcc_1_1_i_o_stream.html#a609d723cea9b8808037135c6f2decba3">xpcc::IOStream</a> </li> <li>assertBaudrateInTolerance() : <a class="el" href="classxpcc_1_1_peripheral.html#a6333658727bd8ed30333f0b0e3165d56">xpcc::Peripheral</a> </li> <li>attach() : <a class="el" href="classxpcc_1_1_error_report.html#aa880955912776abf5ebc3c9b0f1ad653">xpcc::ErrorReport</a> </li> <li>attachCallback() : <a class="el" href="classxpcc_1_1ui_1_1_animation.html#a138e6e6deee2011dc3a472fb04a80c73">xpcc::ui::Animation&lt; T &gt;</a> </li> <li>attachConfigurationHandler() : <a class="el" href="classxpcc_1_1_i2c_device.html#a809b5250bf81a5830c6a8b4ef39ab888">xpcc::I2cDevice&lt; I2cMaster, NestingLevels, Transaction &gt;</a> </li> <li>attaching() : <a class="el" href="classxpcc_1_1_i2c_transaction.html#a3100e67a72238989387a20ff2958ac8e">xpcc::I2cTransaction</a> </li> <li>attachInterruptHandler() : <a class="el" href="classxpcc_1_1cortex_1_1_sys_tick_timer.html#a04335752f24783943f4e4af74ffb899f">xpcc::cortex::SysTickTimer</a> </li> <li>AxisSign : <a class="el" href="structxpcc_1_1lis3dsh.html#a87e1a166c9b3bad29c81435b37f9a2a8">xpcc::lis3dsh</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Tue Jun 27 2017 20:04:00 for xpcc by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html> <file_sep>/docs/api/search/groups_a.js var searchData= [ ['nrf24',['NRF24',['../group__nrf24.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1_nested_resumable.js var classxpcc_1_1_nested_resumable = [ [ "NestedResumable", "classxpcc_1_1_nested_resumable.html#a484d5699e2e38fa7635911fcbfa27ef8", null ], [ "stopResumable", "classxpcc_1_1_nested_resumable.html#ae55408162e3606d174c9391c9fc82d0c", null ], [ "isResumableRunning", "classxpcc_1_1_nested_resumable.html#a0c3b3d2db6cc352c351b661773ddf228", null ], [ "getResumableDepth", "classxpcc_1_1_nested_resumable.html#a69d709c2fc46674945ef502b068d8cb1", null ] ];<file_sep>/docs/api/search/typedefs_1.js var searchData= [ ['b0',['B0',['../classxpcc_1_1_mcp23x17.html#aae596572bbe4e95b967d43195b9f532b',1,'xpcc::Mcp23x17']]], ['b1',['B1',['../classxpcc_1_1_mcp23x17.html#a97f0bf3710596d7fe90b7805b03cccd9',1,'xpcc::Mcp23x17']]], ['b2',['B2',['../classxpcc_1_1_mcp23x17.html#a495da5416177a88abe5d6d3725d2597a',1,'xpcc::Mcp23x17']]], ['b3',['B3',['../classxpcc_1_1_mcp23x17.html#a4964e4879d7671ef130658dbc66b2186',1,'xpcc::Mcp23x17']]], ['b4',['B4',['../classxpcc_1_1_mcp23x17.html#adf307aa29e3fcabba7c494d4216afa99',1,'xpcc::Mcp23x17']]], ['b5',['B5',['../classxpcc_1_1_mcp23x17.html#ab1d01bc3b697fafa4de60a605133948e',1,'xpcc::Mcp23x17']]], ['b6',['B6',['../classxpcc_1_1_mcp23x17.html#abff94e16fa79d8d115e1ea6134555f55',1,'xpcc::Mcp23x17']]], ['b7',['B7',['../classxpcc_1_1_mcp23x17.html#a769350efb948a997f93ac817863beaec',1,'xpcc::Mcp23x17']]] ]; <file_sep>/docs/api/classxpcc_1_1bmp085data_1_1_data_double.js var classxpcc_1_1bmp085data_1_1_data_double = [ [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data_double.html#ab9ac69cfc15bbaa4e0791819e376a9ad", null ], [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data_double.html#abca9880a4ad27a080007a8e3a0cc5147", null ], [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data_double.html#a6890854f79d93f7ebd0d9944ea293035", null ], [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data_double.html#a873156c807cab8854615da9e421d9271", null ], [ "getPressure", "classxpcc_1_1bmp085data_1_1_data_double.html#a8b54cafe5e923301725f9a7a623349d8", null ], [ "calculateCalibratedTemperature", "classxpcc_1_1bmp085data_1_1_data_double.html#ab69ce9e37c906e4ae35f90a346635bd3", null ], [ "calculateCalibratedPressure", "classxpcc_1_1bmp085data_1_1_data_double.html#a085cb2026375f882f75fd6bdb282701b", null ] ];<file_sep>/docs/api/classxpcc_1_1lpc_1_1_adc_automatic_burst.js var classxpcc_1_1lpc_1_1_adc_automatic_burst = [ [ "Resolution", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901", [ [ "BITS_10", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901a8812e84b2a81192ab533a506709b0890", null ], [ "BITS_9", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901a9ab6572ed9c11c2b6bd8e9876730ea8c", null ], [ "BITS_8", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901a506328a07de044eef05ac29ed6b48a7e", null ], [ "BITS_7", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901ad67f7c6a5580a30453b9340bfa4f8065", null ], [ "BITS_6", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901abb2cdb0e9c1b017b6061a4d4c4c63725", null ], [ "BITS_5", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901a030510a1caf934d84181135834bf2509", null ], [ "BITS_4", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901ae5692a4697cba5753db569f838c5b47d", null ], [ "BITS_3", "classxpcc_1_1lpc_1_1_adc_automatic_burst.html#a5bdb5d058e157e58999b80135aafe901a5c8d979b4040479f425d8450585796b1", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1pt_1_1_semaphore.js var classxpcc_1_1pt_1_1_semaphore = [ [ "Semaphore", "classxpcc_1_1pt_1_1_semaphore.html#a01dedd3b63f46875643e2009767f0a7b", null ], [ "acquire", "classxpcc_1_1pt_1_1_semaphore.html#a1f6873f28cf4aeac06f642712f62a41d", null ], [ "release", "classxpcc_1_1pt_1_1_semaphore.html#ac936a6f743c9ef7f98701818e852193f", null ], [ "count", "classxpcc_1_1pt_1_1_semaphore.html#adb40e55514c147cf4c13761c3cce6288", null ] ];<file_sep>/docs/api/classxpcc_1_1sab_1_1_response.js var classxpcc_1_1sab_1_1_response = [ [ "Response", "classxpcc_1_1sab_1_1_response.html#ac0906ee9e84ba9801f6b5948da085164", null ], [ "Response", "classxpcc_1_1sab_1_1_response.html#a04bf851aa8304ec7e6b5e727db8628c9", null ], [ "error", "classxpcc_1_1sab_1_1_response.html#a71dfcd17dd47839457087c23c57402f7", null ], [ "send", "classxpcc_1_1sab_1_1_response.html#ac0f9eb7823909197d1b11159c89f27f1", null ], [ "send", "classxpcc_1_1sab_1_1_response.html#a78ea1e22718be2ad4154f19fe90d30ad", null ], [ "send", "classxpcc_1_1sab_1_1_response.html#ad89dd6c424346233c3518647924cdd87", null ], [ "operator=", "classxpcc_1_1sab_1_1_response.html#a55a90763ba1b50790fbd2b339b6438b2", null ], [ "Slave", "classxpcc_1_1sab_1_1_response.html#a9d17849c1d940c15284815dc87de9c21", null ], [ "transmitter", "classxpcc_1_1sab_1_1_response.html#a77bcc26c619fd1d7a1df08781321693a", null ], [ "triggered", "classxpcc_1_1sab_1_1_response.html#ac7b29734a882064c6517ab6d8207d5e1", null ] ];<file_sep>/docs/api/classxpcc_1_1_nrf24_data.js var classxpcc_1_1_nrf24_data = [ [ "Frame", "classxpcc_1_1_nrf24_data.html#structxpcc_1_1_nrf24_data_1_1_frame", [ [ "header", "classxpcc_1_1_nrf24_data.html#a34d85febacb9bcea5f936c55e3b72295", null ], [ "data", "classxpcc_1_1_nrf24_data.html#a8ea760892284becfbab92751adc233bf", null ] ] ], [ "Header", "classxpcc_1_1_nrf24_data.html#structxpcc_1_1_nrf24_data_1_1_header", [ [ "src", "classxpcc_1_1_nrf24_data.html#a5bdd78cb1214f25bb5b33580b61d420f", null ], [ "dest", "classxpcc_1_1_nrf24_data.html#afae268b88862e5f5f09c0b7b32bed5b0", null ] ] ], [ "BaseAddress", "group__nrf24.html#ga6cf2e8a3efed4df83ba0d53f5f8790b5", null ], [ "Address", "group__nrf24.html#ga7ccdd6badc5e133a47ad2b5231d60bb2", null ], [ "Config", "classxpcc_1_1_nrf24_data.html#aaa45d822886be1edec9789785e82069c", null ], [ "Phy", "classxpcc_1_1_nrf24_data.html#a818f43163684241b2bde7b43d965023d", null ], [ "SendingState", "group__nrf24.html#gac466c7ce11b5b6eaead992f21cc2e6a2", [ [ "Busy", "group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2ad8a942ef2b04672adfafef0ad817a407", null ], [ "FinishedAck", "group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2a40fff80ffbc0c2f176caa6f03f93faaa", null ], [ "FinishedNack", "group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2a7e65cb7886cc82a7b10a510125d14059", null ], [ "DontKnow", "group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2a0376265f1d915c2504844d6ed96becd3", null ], [ "Failed", "group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2ad7c8c85bf79bbe1b7188497c32c3b0ca", null ], [ "Undefined", "group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2aec0fc0100c4fc1ce4eea230c3dc10360", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_scheduler_1_1_task.js var classxpcc_1_1_scheduler_1_1_task = [ [ "run", "classxpcc_1_1_scheduler_1_1_task.html#ae7b1822261e1eb25baa06045d7de55cc", null ] ];<file_sep>/docs/api/classxpcc_1_1_block_allocator.js var classxpcc_1_1_block_allocator = [ [ "initialize", "classxpcc_1_1_block_allocator.html#ad36ee3b1b0d755c0cc3407ff397b2c48", null ], [ "allocate", "classxpcc_1_1_block_allocator.html#a92f348611e265e5272b7d0b39782be94", null ], [ "free", "classxpcc_1_1_block_allocator.html#ac6fd58f9a7d817b121aed7be84e16abb", null ], [ "getAvailableSize", "classxpcc_1_1_block_allocator.html#a9b2f9ed33b54a45b8e64f1ec483038e9", null ] ];<file_sep>/docs/api/group__rpr.js var group__rpr = [ [ "Listener", "structxpcc_1_1rpr_1_1_listener.html", [ [ "Callback", "structxpcc_1_1rpr_1_1_listener.html#ade0f44a3a69a8c87598f76417f69558e", null ], [ "call", "structxpcc_1_1rpr_1_1_listener.html#a68d78dec173ded1e064a8cb7e95f2fe7", null ], [ "type", "structxpcc_1_1rpr_1_1_listener.html#a9dce32a2dbb49139cb349d7675661d12", null ], [ "source", "structxpcc_1_1rpr_1_1_listener.html#ac211bf9ee7e2e542c485eeb7235b076c", null ], [ "command", "structxpcc_1_1rpr_1_1_listener.html#a3e2d1d65f7498b3036bb0a9d0195a658", null ], [ "object", "structxpcc_1_1rpr_1_1_listener.html#aca52bf2a9260f244d84f98dd99dfd27a", null ], [ "function", "structxpcc_1_1rpr_1_1_listener.html#a08f322f790783b2c9c71b68b3cc782fb", null ] ] ], [ "Error", "structxpcc_1_1rpr_1_1_error.html", [ [ "Callback", "structxpcc_1_1rpr_1_1_error.html#a17a2c9ba54f35d05abbd34cd8c4b15e0", null ], [ "call", "structxpcc_1_1rpr_1_1_error.html#a96d999836b8296f86c4c029167a1627f", null ], [ "command", "structxpcc_1_1rpr_1_1_error.html#ab83b62e5d975ee200885881fe888e4c9", null ], [ "object", "structxpcc_1_1rpr_1_1_error.html#abcd79e9b45ce6d3520c8cd57df081dc1", null ], [ "function", "structxpcc_1_1rpr_1_1_error.html#aec685a142518ae2313060df454829af8", null ] ] ], [ "Node", "classxpcc_1_1rpr_1_1_node.html", [ [ "Node", "classxpcc_1_1rpr_1_1_node.html#abd0fee1ba0c83ba382935fc31e50f7c1", null ], [ "Node", "classxpcc_1_1rpr_1_1_node.html#a274b5ea00cd5c7c69a25d3705eab097d", null ], [ "setAddress", "classxpcc_1_1rpr_1_1_node.html#ac42f4f927f404ea9b63593bdbc8de45e", null ], [ "unicastMessage", "classxpcc_1_1rpr_1_1_node.html#a8b8e1b5ef4aba42b0e5344f0fa1e749f", null ], [ "multicastMessage", "classxpcc_1_1rpr_1_1_node.html#a0a573b8dfdafb455c603101b945b0cbd", null ], [ "broadcastMessage", "classxpcc_1_1rpr_1_1_node.html#acf70e4842972c9efe7e3366ec9c3f159", null ], [ "update", "classxpcc_1_1rpr_1_1_node.html#a047730f7746b4fa970a229eb18f3b9ca", null ], [ "checkErrorCallbacks", "classxpcc_1_1rpr_1_1_node.html#a6fd6268fcdc64773297814edfd5f837b", null ], [ "checkListenerCallbacks", "classxpcc_1_1rpr_1_1_node.html#ac4cfabd08dc34ad3d34e8c8eb66f08fe", null ], [ "listenerCallbackList", "classxpcc_1_1rpr_1_1_node.html#ade97d1f0946315fef48d0a2decffeedc", null ], [ "listenerCallbackCount", "classxpcc_1_1rpr_1_1_node.html#a9527452fbddb004747568c3afa425c30", null ], [ "errorCallbackList", "classxpcc_1_1rpr_1_1_node.html#a3c1ef0a1bf9361b72aa68a0be16c6681", null ], [ "errorCallbackCount", "classxpcc_1_1rpr_1_1_node.html#a40fc28c2f060426712fa9213584e7d85", null ] ] ], [ "RPR__LISTEN", "group__rpr.html#gabb9219b205aa4dfc65ed2ad45ae3b962", null ], [ "RPR__ERROR", "group__rpr.html#gaabe946ffa16eb03670148be5a5d64f59", null ] ];<file_sep>/docs/api/structxpcc_1_1tmp_1_1_conversion_3_01void_00_01void_01_4.js var structxpcc_1_1tmp_1_1_conversion_3_01void_00_01void_01_4 = [ [ "exists", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01void_01_4.html#a46e282ca1fb53e1410c22848eb9bd1c4a5998815c8c4ceb5501cbb8054e1f485b", null ], [ "existsBothWays", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01void_01_4.html#a46e282ca1fb53e1410c22848eb9bd1c4ac8d158a9806ac487eb30975e50d82bc3", null ], [ "isSameType", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01void_01_4.html#a46e282ca1fb53e1410c22848eb9bd1c4ab6d4c0ced3ea03801c2cc3e2348776dc", null ] ];<file_sep>/docs/api/classxpcc_1_1atomic_1_1_unlock.js var classxpcc_1_1atomic_1_1_unlock = [ [ "Unlock", "classxpcc_1_1atomic_1_1_unlock.html#a8f00e4906c137838243e6bcb37cd88e1", null ], [ "~Unlock", "classxpcc_1_1atomic_1_1_unlock.html#a21351db379a83d2ac5ca17cce8dfecdf", null ] ];<file_sep>/docs/api/classxpcc_1_1_mcp23_transport_spi.js var classxpcc_1_1_mcp23_transport_spi = [ [ "Mcp23TransportSpi", "classxpcc_1_1_mcp23_transport_spi.html#ac9ed324cfab357018ef3b5cfa9cf17a2", null ], [ "ping", "classxpcc_1_1_mcp23_transport_spi.html#ac1e1cf4e9800c74e86647d5d31f5d202", null ], [ "write", "classxpcc_1_1_mcp23_transport_spi.html#ac3dd06d4470ea8bc9366326325f12e07", null ], [ "write16", "classxpcc_1_1_mcp23_transport_spi.html#a8b430686235a430b5ee83f536d635053", null ], [ "read", "classxpcc_1_1_mcp23_transport_spi.html#a2560837419436394568991edb2e882f9", null ], [ "read", "classxpcc_1_1_mcp23_transport_spi.html#a99eb010a5b06d3d4a9c264e7f41a06f9", null ] ];<file_sep>/docs/api/classxpcc_1_1sab2_1_1_interface.js var classxpcc_1_1sab2_1_1_interface = [ [ "Index", "classxpcc_1_1sab2_1_1_interface.html#afb4d6f77bad44482fb57a851ff3b0d23", null ], [ "Size", "classxpcc_1_1sab2_1_1_interface.html#afd03a41761856b580af1511b4b2f13dd", null ] ];<file_sep>/docs/api/classxpcc_1_1_dynamic_postman.js var classxpcc_1_1_dynamic_postman = [ [ "DynamicPostman", "classxpcc_1_1_dynamic_postman.html#a797d1df8d092d2d06c2b779878294e2a", null ], [ "deliverPacket", "classxpcc_1_1_dynamic_postman.html#a10861441211803af0bf8c66824d4665f", null ], [ "isComponentAvailable", "classxpcc_1_1_dynamic_postman.html#a58b1b59250a7d5d574351e7b1f88455b", null ], [ "registerEventListener", "classxpcc_1_1_dynamic_postman.html#af5d2d5564fc31d317bc29d66bfcf09a3", null ], [ "registerEventListener", "classxpcc_1_1_dynamic_postman.html#ad97dbcc8b05e9bc436fc481bfeeed848", null ], [ "registerActionHandler", "classxpcc_1_1_dynamic_postman.html#a3fef2469a9066e3b06bfd9fdb7fc7779", null ], [ "registerActionHandler", "classxpcc_1_1_dynamic_postman.html#ab51a346cf08a856a18b28cf237abd4bc", null ] ];<file_sep>/docs/api/structxpcc_1_1_s_curve_controller_1_1_parameter.js var structxpcc_1_1_s_curve_controller_1_1_parameter = [ [ "Parameter", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#aa6e173bc0ce09bb7d38761cd6d3aacec", null ], [ "targetArea", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a5105511f258c85b762d6cb6e9793e698", null ], [ "increment", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a41e2188f64530a24d71b9f8d6cf1dacb", null ], [ "decreaseFactor", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a11039c3c5c8dfd8f3693652c2513d665", null ], [ "kp", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a2acd0a1796e2cc1b4190b15db5ed4caa", null ], [ "speedMaximum", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a11b63e7ba555f3d4eac334cac5348293", null ], [ "speedMinimum", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a2de16b5d2e5079ac5394257f96741228", null ], [ "speedTarget", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a607e08f09dfab169f214061bdb0dc022", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_clock_output1.js var classxpcc_1_1stm32_1_1_clock_output1 = [ [ "Division", "classxpcc_1_1stm32_1_1_clock_output1.html#a088fca50ee6353fe63e48cfbbcfc7a37", [ [ "By1", "classxpcc_1_1stm32_1_1_clock_output1.html#a088fca50ee6353fe63e48cfbbcfc7a37a43550529c3cefc46dab550c7498f9b48", null ], [ "By2", "classxpcc_1_1stm32_1_1_clock_output1.html#a088fca50ee6353fe63e48cfbbcfc7a37a0f4a5b48f4ebe1f735c7183de5cf83d0", null ], [ "By3", "classxpcc_1_1stm32_1_1_clock_output1.html#a088fca50ee6353fe63e48cfbbcfc7a37a587251a235be5a67fae81e5cdf85f138", null ], [ "By4", "classxpcc_1_1stm32_1_1_clock_output1.html#a088fca50ee6353fe63e48cfbbcfc7a37a57d7b0fdf567e26ff1b2a5af0ea7d04e", null ], [ "By5", "classxpcc_1_1stm32_1_1_clock_output1.html#a088fca50ee6353fe63e48cfbbcfc7a37a9e727e1b38b45e3c756cd9268f2ff967", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_zero_m_q_reader.js var classxpcc_1_1_zero_m_q_reader = [ [ "Packet", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html", "structxpcc_1_1_zero_m_q_reader_1_1_packet" ], [ "ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html#ac911c0df669ad316d5689e1804eb5f08", null ], [ "~ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html#a492cfe28c37b6b55f5e1fa6df78afd16", null ], [ "ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html#a7567d275133cb0b39dd016988bc160b5", null ], [ "operator=", "classxpcc_1_1_zero_m_q_reader.html#a91f5a0d223bf5fd79a0e0eff27bf645d", null ], [ "start", "classxpcc_1_1_zero_m_q_reader.html#a76f99d7fd74eb28828ec1484a174243e", null ], [ "stop", "classxpcc_1_1_zero_m_q_reader.html#af37c7fb70ad6609dc88532e906e4d2ae", null ], [ "isPacketAvailable", "classxpcc_1_1_zero_m_q_reader.html#a0208ced3d7d6e0832b87280116001824", null ], [ "getPacket", "classxpcc_1_1_zero_m_q_reader.html#acd64f824345c7ce22dc69d3b9f130627", null ], [ "dropPacket", "classxpcc_1_1_zero_m_q_reader.html#a7ea837cc9c87d1d4fb02435f9fd09d01", null ] ];<file_sep>/docs/api/classxpcc_1_1tipc_1_1_transmitter_socket.js var classxpcc_1_1tipc_1_1_transmitter_socket = [ [ "TransmitterSocket", "classxpcc_1_1tipc_1_1_transmitter_socket.html#a432ca5758d442f9b3358615e28597d82", null ], [ "~TransmitterSocket", "classxpcc_1_1tipc_1_1_transmitter_socket.html#ab03da7008277a944d8e82032f2274971", null ], [ "transmitPayload", "classxpcc_1_1tipc_1_1_transmitter_socket.html#a86d9d7d62bffd0ce2bd24e5136626f45", null ], [ "getPortId", "classxpcc_1_1tipc_1_1_transmitter_socket.html#ae545daeb42ff10f2b86a21fc08a0c43f", null ] ];<file_sep>/docs/api/structxpcc_1_1itg3200_1_1_data.js var structxpcc_1_1itg3200_1_1_data = [ [ "getX", "structxpcc_1_1itg3200_1_1_data.html#ad26a006227cad23a54aa3fc135f8b67d", null ], [ "getY", "structxpcc_1_1itg3200_1_1_data.html#a0f82befa36e817146d3a1e4f20f61f39", null ], [ "getZ", "structxpcc_1_1itg3200_1_1_data.html#adc2c438d7d1b802e80c2a723eb4b6ed0", null ], [ "getTemperature", "structxpcc_1_1itg3200_1_1_data.html#a214734052c41dca217d3ab2a6da42875", null ], [ "operator[]", "structxpcc_1_1itg3200_1_1_data.html#a0155b72a4c39f92ec06147f82960cc16", null ], [ "Itg3200", "structxpcc_1_1itg3200_1_1_data.html#ae1959c0437ca0801f3f0e42aca94bec9", null ] ];<file_sep>/docs/api/structxpcc_1_1rpr_1_1_message.js var structxpcc_1_1rpr_1_1_message = [ [ "type", "structxpcc_1_1rpr_1_1_message.html#adf34bb4ea3d4fcb49175a759215c04ec", null ], [ "destination", "structxpcc_1_1rpr_1_1_message.html#afd50cb48fb6f8b6db19367a6d088fe58", null ], [ "source", "structxpcc_1_1rpr_1_1_message.html#a78b7e9ad2faae0d076a203ad291d1654", null ], [ "command", "structxpcc_1_1rpr_1_1_message.html#a063127259265a8334d325c6af58a771a", null ], [ "payload", "structxpcc_1_1rpr_1_1_message.html#ae8b548b85104df78ce314b138ddbf4df", null ], [ "length", "structxpcc_1_1rpr_1_1_message.html#a7e9e56e348b876678364c83fa14f48da", null ] ];<file_sep>/docs/api/group__tmp_structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4.js var group__tmp_structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4 = [ [ "exists", "group__tmp.html#ac203c45f01830eb1818e471a436fb562a661b3b1fa4f23e978ed7b4550683a30c", null ], [ "existsBothWays", "group__tmp.html#ac203c45f01830eb1818e471a436fb562ab935a062cf15b4a11c0731fdafb91b0d", null ], [ "isSameType", "group__tmp.html#ac203c45f01830eb1818e471a436fb562ad0366f21bc8444f1649638394a5b7342", null ] ];<file_sep>/docs/api/structxpcc_1_1bme280data_1_1_data_base.js var structxpcc_1_1bme280data_1_1_data_base = [ [ "HUMIDITY_CALCULATED", "structxpcc_1_1bme280data_1_1_data_base.html#a5497a921cd460c8a4156a46b75f4a98eadd2955312dc7c74919541d5ae940bce9", null ], [ "TEMPERATURE_CALCULATED", "structxpcc_1_1bme280data_1_1_data_base.html#a5497a921cd460c8a4156a46b75f4a98ea1f9f731ffe416aab52490a04333002e9", null ], [ "PRESSURE_CALCULATED", "structxpcc_1_1bme280data_1_1_data_base.html#a5497a921cd460c8a4156a46b75f4a98eaa046af6111380ac432031100c762e91d", null ], [ "getCalibration", "structxpcc_1_1bme280data_1_1_data_base.html#a24d98c342d06f002797bb57db4aaedf8", null ], [ "rawTemperatureTouched", "structxpcc_1_1bme280data_1_1_data_base.html#a47f4556e340fc4d7d8ac0aaaab247e86", null ], [ "rawPressureTouched", "structxpcc_1_1bme280data_1_1_data_base.html#a2c8cf4c206aecf217f7c6966fbc12490", null ], [ "rawHumidityTouched", "structxpcc_1_1bme280data_1_1_data_base.html#a1759f83fed4478b78ed4d7c1d0fb5977", null ], [ "::xpcc::Bme280", "structxpcc_1_1bme280data_1_1_data_base.html#a791e0f36afc5c6b6485468af808322b6", null ], [ "::Bme280Test", "structxpcc_1_1bme280data_1_1_data_base.html#af3e5f8c225368114e652b8594b16a58d", null ], [ "calibration", "structxpcc_1_1bme280data_1_1_data_base.html#af01b6feb69fd1bbbcc300bcbf20885fc", null ], [ "raw", "structxpcc_1_1bme280data_1_1_data_base.html#a5e8d20400078d007f1188251f00a6e32", null ], [ "meta", "structxpcc_1_1bme280data_1_1_data_base.html#a760a386d765d063e21b0d79b381292bf", null ] ];<file_sep>/docs/api/structxpcc_1_1hmc58x3.js var structxpcc_1_1hmc58x3 = [ [ "Data", "structxpcc_1_1hmc58x3_1_1_data.html", "structxpcc_1_1hmc58x3_1_1_data" ], [ "ConfigA_t", "structxpcc_1_1hmc58x3.html#ac0cb281c9fcbe0f2bb76e1541369cf51", null ], [ "ConfigB_t", "structxpcc_1_1hmc58x3.html#a6cdd0dc8fcec99a3b84434bc44ea1518", null ], [ "Mode_t", "structxpcc_1_1hmc58x3.html#a287190aba1c37e525ead6456816f610b", null ], [ "Status_t", "structxpcc_1_1hmc58x3.html#a483208e822c07b1334b640b3ef096c62", null ], [ "ConfigA", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eb", [ [ "MA1", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba54579bc7bf6db27a13957401b5a8af91", null ], [ "MA0", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba7cad47b062febf7ab3ba4a69577b6976", null ], [ "MA_Mask", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265ebad2e46f217f966c2876de4e5445563f88", null ], [ "DO2", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba2db3d349653b23d315944644cc36e37e", null ], [ "DO1", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba073911f3132e3999d8124e8b904476f0", null ], [ "DO0", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265ebaaaf4be8a965b6583eca48ba8b5db1123", null ], [ "DO_Mask", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba6774d413e7429857c8864be29d6d43b5", null ], [ "MS1", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba3c4708a2cdd3c4bfd03ad04e36b87544", null ], [ "MS0", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba2f395137e3466672963ad6e27b8f4b29", null ], [ "MS_Mask", "structxpcc_1_1hmc58x3.html#a7cf8681d97ec8f500bb594d42ba265eba695e3736b4c2af62b7069b57e6d6a9a9", null ] ] ], [ "ConfigB", "structxpcc_1_1hmc58x3.html#ab1a980ddae9121d32bca5abe9d31fe63", [ [ "GN2", "structxpcc_1_1hmc58x3.html#ab1a980ddae9121d32bca5abe9d31fe63afd20e12e10692111498234c0e94e5b75", null ], [ "GN1", "structxpcc_1_1hmc58x3.html#ab1a980ddae9121d32bca5abe9d31fe63a2ac0920af26db5dab1eda6f6bdc72b57", null ], [ "GN0", "structxpcc_1_1hmc58x3.html#ab1a980ddae9121d32bca5abe9d31fe63a7324f220d58a624dd5e68585ae8e29ca", null ], [ "GN_Mask", "structxpcc_1_1hmc58x3.html#ab1a980ddae9121d32bca5abe9d31fe63a260ae0f6340fde81804d7d336801a9b0", null ] ] ], [ "Mode", "structxpcc_1_1hmc58x3.html#acab2f965ba3758fd02d4d526098fe5cd", [ [ "MD1", "structxpcc_1_1hmc58x3.html#acab2f965ba3758fd02d4d526098fe5cda2b9cc083eab2aa5464b2ceee1f3f1239", null ], [ "MD0", "structxpcc_1_1hmc58x3.html#acab2f965ba3758fd02d4d526098fe5cda2a5f1ec8604863e04d237de66d7372f8", null ], [ "MD_Mask", "structxpcc_1_1hmc58x3.html#acab2f965ba3758fd02d4d526098fe5cda4554ac47fc2c71c15e48d29185bb9432", null ] ] ], [ "Status", "structxpcc_1_1hmc58x3.html#a5e93f71b475c31f8cfa6b26243386afa", [ [ "REN", "structxpcc_1_1hmc58x3.html#a5e93f71b475c31f8cfa6b26243386afaa752e4d6a7e4e334e4771d6255b069462", null ], [ "LOCK", "structxpcc_1_1hmc58x3.html#a5e93f71b475c31f8cfa6b26243386afaaf510b97de4ace11844b85f23d0fc012f", null ], [ "RDY", "structxpcc_1_1hmc58x3.html#a5e93f71b475c31f8cfa6b26243386afaaa668ed2e5c2094adede3bb5a070e8068", null ] ] ], [ "OperationMode", "structxpcc_1_1hmc58x3.html#afcc337f49913b0afbc81a4226094227f", [ [ "ContinousConversion", "structxpcc_1_1hmc58x3.html#afcc337f49913b0afbc81a4226094227faaf8e2a1e91ad030419c9c1f0359d6b44", null ], [ "SingleConversion", "structxpcc_1_1hmc58x3.html#afcc337f49913b0afbc81a4226094227fa6e3e7c571fc4eb77b573a285c53c0e45", null ], [ "Idle", "structxpcc_1_1hmc58x3.html#afcc337f49913b0afbc81a4226094227fae599161956d626eda4cb0a5ffb85271c", null ], [ "Sleep", "structxpcc_1_1hmc58x3.html#afcc337f49913b0afbc81a4226094227fa243924bfd56a682be235638b53961e09", null ] ] ] ];<file_sep>/docs/api/group__driver__other.js var group__driver__other = [ [ "tcs3414", "structxpcc_1_1tcs3414.html", [ [ "UnderlyingType", "structxpcc_1_1tcs3414.html#aaf960407c8ca742f0955e209079d4f08", null ], [ "Rgb", "structxpcc_1_1tcs3414.html#a714a090e5bf8e8e57c6b5205bc46e3ce", null ], [ "Gain", "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005", [ [ "X1", "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005abb7f5ae6220c9828e5ec91faf054197c", null ], [ "X4", "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005a7d71ed2af4cc5c6a8380324d9bc4a45f", null ], [ "X16", "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005a8566d518618cc93194d9e7688e2dafa2", null ], [ "X64", "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005af0851da0e02bf22830828822f578dc8f", null ], [ "DEFAULT", "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005a5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "Prescaler", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85", [ [ "D1", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a4a4079e06eb2f7ba7a12821c7c58a3f6", null ], [ "D2", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85ac4d62b6dcca08e5caf06c01889282859", null ], [ "D4", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a2521dc256a4368da87585c936b451dd7", null ], [ "D8", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85ab1522194d726a396729c3148c2b3a0bd", null ], [ "D16", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a6fd9ec81643ee5a57f85a71951bfe13d", null ], [ "D32", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85aa6b2eecc4252564f599b9a979e4e0602", null ], [ "D64", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a653c7a3d42099ef42f611a18fde2a80b", null ], [ "DEFAULT", "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "IntegrationMode", "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2", [ [ "INTERNAL", "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a182fa1c42a2468f8488e6dcf75a81b81", null ], [ "ADC_CTR", "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a12c5c8d0d9196c9a05f1e52fc2d5cf6e", null ], [ "SYNC_NOM", "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2ab8c22647c2fa5df7a09c45e609f71ada", null ], [ "SYNC_COUNT", "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a8b16d3fc8545695df507da6749992983", null ], [ "DEFAULT", "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "NominalIntegrationTime", "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11", [ [ "MSEC_12", "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a552357ae9765301bec1db798b6a2a6eb", null ], [ "MSEC_100", "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a21198118aa88764b53032b1ab9c7f95a", null ], [ "MSEC_400", "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a57144bdb3e5d0cb7d8d43313c2d45716", null ], [ "DEFAULT", "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "SyncPulseCount", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111", [ [ "PULSES_1", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a7ad167dc44c6b7d2716dc4d69fa8a8fd", null ], [ "PULSES_2", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a4f6c5d2d6d8865cf7075e43494a5809e", null ], [ "PULSES_4", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a61739233ce7ed2ae88aac5eecbc2d5b1", null ], [ "PULSES_8", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111af83fec35b13141c2f12fecc3db7af573", null ], [ "PULSES_16", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111ae8db95cd8d14b21f4f58943656ff229f", null ], [ "PULSES_32", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111af60ffd10c8e88b9cf4b20eb4cffd1460", null ], [ "PULSES_64", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111aafb2027632bbc38860fa69ab1ff0fa2f", null ], [ "PULSES_128", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a8cbc034aa44c987df3c22b4f260dd706", null ], [ "PULSES_256", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111aa85024b0df85b28772a2575b1dc4b217", null ], [ "DEFAULT", "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "RegisterAddress", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324", [ [ "CONTROL", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324ac861cd34025f9002df5912d623326130", null ], [ "TIMING", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a8f9e1889c89e42901ab7c0a033a3347c", null ], [ "INTERRUPT", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a81b7fe15c43052525db74111aa314cc9", null ], [ "INT_SOURCE", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a34609c1662bdc31bd7e2aaf91aa6d6cd", null ], [ "ID", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324ab718adec73e04ce3ec720dd11a06a308", null ], [ "GAIN", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a0803331e7c3fe03c1938ac408faaa0cc", null ], [ "LOW_THRESH_LOW_BYTE", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324ae4c103ee6b29010def4ee2ceca338904", null ], [ "LOW_THRESH_HIGH_BYTE", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a9743494d7655f857f8d2bec66ff0187d", null ], [ "HIGH_THRESH_LOW_BYTE", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a7786bf76ad6671b960d374f257c4bdc3", null ], [ "HIGH_THRESH_HIGH_BYTE", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a94fb9053331bc4a94579dd5a0236b39e", null ], [ "DATA1LOW", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a04bab40d95e7d166d56a751e96111a51", null ], [ "DATA1HIGH", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324aebec0053703eceb0060fa9aa228f05b6", null ], [ "DATA2LOW", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a4078ba16c48786ddbcc49794c309b7fb", null ], [ "DATA2HIGH", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a91d64ab3e8ec250e7154fee7e9ccce35", null ], [ "DATA3LOW", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a7504c8d03e468e63fcc94d85f86c928d", null ], [ "DATA3HIGH", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a1184f5f10c2e4ec45dd302bb31bc336d", null ], [ "DATA4LOW", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a4e7db454ac264600213ccbdc92d36547", null ], [ "DATA5HIGH", "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a3d85a3115aaeffcb978de2ded55b4f22", null ] ] ] ] ], [ "Tcs3414", "classxpcc_1_1_tcs3414.html", [ [ "Data.__unnamed__", "classxpcc_1_1_tcs3414.html#structxpcc_1_1_tcs3414_1_1_data_8____unnamed____", [ [ "green", "classxpcc_1_1_tcs3414.html#a9f27410725ab8cc8854a2769c7a516b8", null ], [ "red", "classxpcc_1_1_tcs3414.html#abda9643ac6601722a28f238714274da4", null ], [ "blue", "classxpcc_1_1_tcs3414.html#a48d6215903dff56238e52e8891380c8f", null ], [ "clear", "classxpcc_1_1_tcs3414.html#a01bc6f8efa4202821e95f4fdf6298b30", null ] ] ], [ "Tcs3414", "classxpcc_1_1_tcs3414.html#a31b935c618868af3a916675e78d0dd50", null ], [ "initializeBlocking", "classxpcc_1_1_tcs3414.html#a216b0daf6dff793d53212fd9f1517492", null ], [ "setGain", "classxpcc_1_1_tcs3414.html#af2b88e4cf351696e712897df8bb85ab6", null ], [ "setIntegrationTime", "classxpcc_1_1_tcs3414.html#a199c6ee805ef86a55e56ff8cb3bc3e58", null ], [ "setIntegrationTime", "classxpcc_1_1_tcs3414.html#ab3160a1d6d2cf6d51a261893e32fb469", null ], [ "refreshAllColors", "classxpcc_1_1_tcs3414.html#a5b2a2ba10cd66cdd49f2c864ea15fb51", null ], [ "initialize", "classxpcc_1_1_tcs3414.html#a66902f64da3e21b6b54c858a86449fdd", null ], [ "configure", "classxpcc_1_1_tcs3414.html#a8f25825dda1b9af63c2f448c282ae50f", null ] ] ], [ "tcs3472", "structxpcc_1_1tcs3472.html", [ [ "UnderlyingType", "structxpcc_1_1tcs3472.html#a3ef7e794003e0c8970465b6540e7f33b", null ], [ "Rgb", "structxpcc_1_1tcs3472.html#ac2852064dea9f76fbf4fee9d03a20865", null ], [ "Gain", "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7", [ [ "X1", "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7abb7f5ae6220c9828e5ec91faf054197c", null ], [ "X4", "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7a7d71ed2af4cc5c6a8380324d9bc4a45f", null ], [ "X16", "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7a8566d518618cc93194d9e7688e2dafa2", null ], [ "X64", "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7af0851da0e02bf22830828822f578dc8f", null ], [ "DEFAULT", "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7a5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "IntegrationTime", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3e", [ [ "MSEC_2", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ead27b4dff93acabd01f2b0cdb48e7cf20", null ], [ "MSEC_24", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea2f791a36d82b0102afcdf952a7560836", null ], [ "MSEC_101", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea01ed152f1ec68064f14f5b79eb45edd7", null ], [ "MSEC_154", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea117c36310b50816b734bf5f73c3e057d", null ], [ "MSEC_700", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea0bd422886bb873a43bbfe61ff07510bd", null ], [ "DEFAULT", "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea5b39c8b553c821e7cddc6da64b5bd2ee", null ] ] ], [ "RegisterAddress", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eb", [ [ "ENABLE", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebab332708e4304e13c9b424e7465254954", null ], [ "TIMING", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba8f9e1889c89e42901ab7c0a033a3347c", null ], [ "ID", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebab718adec73e04ce3ec720dd11a06a308", null ], [ "GAIN", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba0803331e7c3fe03c1938ac408faaa0cc", null ], [ "LOW_THRESH_LOW_BYTE", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebae4c103ee6b29010def4ee2ceca338904", null ], [ "LOW_THRESH_HIGH_BYTE", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba9743494d7655f857f8d2bec66ff0187d", null ], [ "HIGH_THRESH_LOW_BYTE", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba7786bf76ad6671b960d374f257c4bdc3", null ], [ "HIGH_THRESH_HIGH_BYTE", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba94fb9053331bc4a94579dd5a0236b39e", null ], [ "CDATALOW", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebaabd49eeed6b719203801cf9241e2c053", null ], [ "CDATAHIGH", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba705463a299a6ec2bbefee59d6cde771e", null ], [ "RDATALOW", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba8c0980c5e57b2bca92a048d36fc66c9b", null ], [ "RDATAHIGH", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba3edaf457d6740121350cd2e2fcf371ca", null ], [ "GDATALOW", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebab3285c5cc2526fada89f34dff4decf5a", null ], [ "GDATAHIGH", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba341a4d90fbbe4a83e6dd737abb2845cb", null ], [ "BDATALOW", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba0a9736bb1a7123ed218cf8a41ae628cf", null ], [ "BDATAHIGH", "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba63e734e38dbcd61e7587c3f264fad159", null ] ] ] ] ], [ "Tcs3472", "classxpcc_1_1_tcs3472.html", [ [ "Data.__unnamed__", "classxpcc_1_1_tcs3472.html#structxpcc_1_1_tcs3472_1_1_data_8____unnamed____", [ [ "clear", "classxpcc_1_1_tcs3472.html#a01bc6f8efa4202821e95f4fdf6298b30", null ], [ "red", "classxpcc_1_1_tcs3472.html#abda9643ac6601722a28f238714274da4", null ], [ "green", "classxpcc_1_1_tcs3472.html#a9f27410725ab8cc8854a2769c7a516b8", null ], [ "blue", "classxpcc_1_1_tcs3472.html#a48d6215903dff56238e52e8891380c8f", null ] ] ], [ "Tcs3472", "classxpcc_1_1_tcs3472.html#a37e21d9b5224a97a7da1eb0c93ec72ac", null ], [ "initializeBlocking", "classxpcc_1_1_tcs3472.html#aef91f1dd880f40fd265261935f870fe9", null ], [ "setGain", "classxpcc_1_1_tcs3472.html#af1b4f021b9da99d086dd801a528d5e14", null ], [ "refreshAllColors", "classxpcc_1_1_tcs3472.html#a2b7b3aa6664066b3ce6a2646c5868623", null ], [ "initialize", "classxpcc_1_1_tcs3472.html#a09472f58f3c6e9c6e22ac9fcc249cdeb", null ], [ "configure", "classxpcc_1_1_tcs3472.html#ab985686724d5be72ba2abdc10248b2d0", null ] ] ], [ "XilinxSpartan3", "classxpcc_1_1_xilinx_spartan3.html", null ], [ "XilinxSpartan6Parallel", "classxpcc_1_1_xilinx_spartan6_parallel.html", [ [ "WritePageState", "structxpcc_1_1_xilinx_spartan6_parallel_1_1_write_page_state.html", [ [ "CONFIG_ONGOING", "structxpcc_1_1_xilinx_spartan6_parallel_1_1_write_page_state.html#a042aff763c56b1a72c1ee4564b6a6e22a5697a716582a3da502cb1fc9942b7b3b", null ], [ "CONFIG_DONE", "structxpcc_1_1_xilinx_spartan6_parallel_1_1_write_page_state.html#a042aff763c56b1a72c1ee4564b6a6e22a9f46c569e88a40d6aec55861cbe1141a", null ], [ "CONFIG_CRC_ERROR", "structxpcc_1_1_xilinx_spartan6_parallel_1_1_write_page_state.html#a042aff763c56b1a72c1ee4564b6a6e22ad11d512c2780bfa9c16f1be05ac1e8a0", null ], [ "state", "structxpcc_1_1_xilinx_spartan6_parallel_1_1_write_page_state.html#a2b28a83c992864300e7649042565110d", null ] ] ] ] ], [ "AD840x", "classxpcc_1_1_a_d840x.html", null ], [ "Ft245", "classxpcc_1_1_ft245.html", null ], [ "Channel", "group__driver__other.html#ga4c936afae0f4c1ab27a131d65711d4ae", [ [ "CHANNEL2", "group__driver__other.html#gga4c936afae0f4c1ab27a131d65711d4aea8e5e9105a4d97549df83a387131999e6", null ], [ "CHANNEL3", "group__driver__other.html#gga4c936afae0f4c1ab27a131d65711d4aea75cc65f9021fb81a9a17c3312f7b1e7a", null ], [ "CHANNEL4", "group__driver__other.html#gga4c936afae0f4c1ab27a131d65711d4aeaa344273f54f50d427a1c2fb168591876", null ] ] ] ];<file_sep>/docs/api/group__backend.js var group__backend = [ [ "CanConnector", "classxpcc_1_1_can_connector.html", [ [ "ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html", [ [ "ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a22c699216fe80273836d32e9faac1925", null ], [ "ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#ab5a8fa3970541a2120db18a8ec5ab993", null ], [ "header", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a7525dfac072127535afa2cfe65189b8c", null ], [ "payload", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a01e4a3ffc0f3b6daf9c122ed7ef629d3", null ], [ "receivedFragments", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a0db7a8077fabae052c924f74d62a47e1", null ], [ "counter", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#ab8ff05e1950351cbc562aaababe89f28", null ] ] ], [ "SendListItem", "classxpcc_1_1_can_connector_1_1_send_list_item.html", [ [ "SendListItem", "classxpcc_1_1_can_connector_1_1_send_list_item.html#a8c882891a3b9c996c12a368074f82a92", null ], [ "SendListItem", "classxpcc_1_1_can_connector_1_1_send_list_item.html#a9b22499ffbe4c7d1363d192117af1126", null ], [ "identifier", "classxpcc_1_1_can_connector_1_1_send_list_item.html#a3cd3c5d3b6fbcbc4ef2cb06029a33f00", null ], [ "payload", "classxpcc_1_1_can_connector_1_1_send_list_item.html#aa7062797edd1e15fc85f07c2738faebc", null ], [ "fragmentIndex", "classxpcc_1_1_can_connector_1_1_send_list_item.html#ac4e46b0500c622eece086b5bd2e5a33f", null ] ] ], [ "SendList", "classxpcc_1_1_can_connector.html#a98dc3c73bb7cb6910eb3dae53719aabb", null ], [ "ReceiveList", "classxpcc_1_1_can_connector.html#aed553a76f0c265cf448d350b6b1cd94c", null ], [ "CanConnector", "classxpcc_1_1_can_connector.html#adabb35a09557972dc56557b5e925e176", null ], [ "~CanConnector", "classxpcc_1_1_can_connector.html#a7bf080715613f06a2ad171e39ba3d526", null ], [ "CanConnector", "classxpcc_1_1_can_connector.html#a78cf5e581214b6eedb09707f49da17f9", null ], [ "sendPacket", "classxpcc_1_1_can_connector.html#a51e51cf95a071972c83dc2dd233503a8", null ], [ "isPacketAvailable", "classxpcc_1_1_can_connector.html#aaac9b5ee9d72377067d13870a329f582", null ], [ "getPacketHeader", "classxpcc_1_1_can_connector.html#a16230c052c033b65a0853b4548d295e0", null ], [ "getPacketPayload", "classxpcc_1_1_can_connector.html#a371f1cc4792ad4fe7c5b1208aa2b12a2", null ], [ "dropPacket", "classxpcc_1_1_can_connector.html#a466b6962a240b03f6dad9b11e14bdcd5", null ], [ "update", "classxpcc_1_1_can_connector.html#afdf56a3c9b08ebd0b1a71ab483b64c45", null ], [ "operator=", "classxpcc_1_1_can_connector.html#a453226e9ddc1ada57007afcfc7bac175", null ], [ "sendMessage", "classxpcc_1_1_can_connector.html#a83db3f5d921e1a45dcd0395e97519b46", null ], [ "sendWaitingMessages", "classxpcc_1_1_can_connector.html#a7d50b34462e7aae4a6f4f83d9c94285c", null ], [ "retrieveMessage", "classxpcc_1_1_can_connector.html#ad1775869231f13e62e05d1966e854299", null ], [ "sendList", "classxpcc_1_1_can_connector.html#aa11aeaa0cc2c0a0e521ffb93dbed1cf8", null ], [ "pendingMessages", "classxpcc_1_1_can_connector.html#aad89382cacf6e57f2eb940574838c32e", null ], [ "receivedMessages", "classxpcc_1_1_can_connector.html#a2b3a59b2b096060dc50009c071288d3c", null ], [ "canDriver", "classxpcc_1_1_can_connector.html#afc0d4f1b928abc38760639834a7e46b0", null ] ] ], [ "Header", "structxpcc_1_1_header.html", [ [ "Type", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9", [ [ "REQUEST", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9aad6c35880c58d97c03d60a6ad0f23737", null ], [ "RESPONSE", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9a4fa1a4d2e48aa765093ca6aae57a5150", null ], [ "NEGATIVE_RESPONSE", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9a8f4a406e65653144e8c083c45f3c25ec", null ] ] ], [ "Header", "structxpcc_1_1_header.html#ab744f647d54f5900d47fdaceccabdbfd", null ], [ "Header", "structxpcc_1_1_header.html#a60bd6093f70ae67b1128b057a17a2a37", null ], [ "operator==", "structxpcc_1_1_header.html#ae75563fb75eda59cc6c899fb32a5497a", null ], [ "type", "structxpcc_1_1_header.html#a8a2312708d15b7c9953ae54560b809b3", null ], [ "isAcknowledge", "structxpcc_1_1_header.html#aaba58c049c18e2f904184e8391cd9b8c", null ], [ "destination", "structxpcc_1_1_header.html#aeba74cb42e5f1142bb59a170605f08f6", null ], [ "source", "structxpcc_1_1_header.html#a1622cdcf0f8af24a1b1abd2171137971", null ], [ "packetIdentifier", "structxpcc_1_1_header.html#a76addf60d72c9fe67aa5bb263030854b", null ] ] ], [ "TipcConnector", "classxpcc_1_1_tipc_connector.html", [ [ "TipcConnector", "classxpcc_1_1_tipc_connector.html#a2357e6c978395dabbc9fd6d1e422f7bb", null ], [ "~TipcConnector", "classxpcc_1_1_tipc_connector.html#aa9e72f7e4a08a991180d7a8742e2feb3", null ], [ "setDomainId", "classxpcc_1_1_tipc_connector.html#a04f0616cbaf86675b52e3406502be329", null ], [ "addEventId", "classxpcc_1_1_tipc_connector.html#a8b9e1719fcb6896c24ff8109f647fe11", null ], [ "addReceiverId", "classxpcc_1_1_tipc_connector.html#a100fc64407abdb52fd6464bfed2bc391", null ], [ "isPacketAvailable", "classxpcc_1_1_tipc_connector.html#ab70b6fdfa247716a4e6e65dd1e952bd4", null ], [ "getPacketHeader", "classxpcc_1_1_tipc_connector.html#a79768273528ef96a379a7382229cbb78", null ], [ "getPacketPayload", "classxpcc_1_1_tipc_connector.html#ab7c3976ffde255125a670f908814324a", null ], [ "dropPacket", "classxpcc_1_1_tipc_connector.html#ab72d717e76c3cfdc4342cd475bd9f81e", null ], [ "update", "classxpcc_1_1_tipc_connector.html#a8de087abddb10352dee3e0b5bbae93e7", null ], [ "sendPacket", "classxpcc_1_1_tipc_connector.html#a76f7e663797f55fef9a43378d902937d", null ] ] ], [ "ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html", [ [ "ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html#ad5234fe1fee59e5fb75e3f1e611b327d", null ], [ "~ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html#ad8342473c74376c8df9deb65c6f26ee8", null ], [ "sendPacket", "classxpcc_1_1_zero_m_q_connector.html#a9dd08bd8a48e537bea471862fc1c811f", null ], [ "isPacketAvailable", "classxpcc_1_1_zero_m_q_connector.html#a7353598b7a2ec64beae5125cfaa4e122", null ], [ "getPacketHeader", "classxpcc_1_1_zero_m_q_connector.html#a69b6998df64c439730439e90eb6e373f", null ], [ "getPacketPayload", "classxpcc_1_1_zero_m_q_connector.html#ab5c0cf01d64e35ed3f0d8cf4e08a01c6", null ], [ "dropPacket", "classxpcc_1_1_zero_m_q_connector.html#aa5731d201c5611e1333e8aa289dd3793", null ], [ "update", "classxpcc_1_1_zero_m_q_connector.html#a4956a3c202012af87365cf028abf9fde", null ], [ "context", "classxpcc_1_1_zero_m_q_connector.html#a93f7e85aef9340361f3c9cda8fd3977d", null ], [ "socketIn", "classxpcc_1_1_zero_m_q_connector.html#a937b3218e2a8ffa8e6c748d2b84d131c", null ], [ "socketOut", "classxpcc_1_1_zero_m_q_connector.html#a8677e124ff8fbeeeb74d995b226527d4", null ], [ "reader", "classxpcc_1_1_zero_m_q_connector.html#a967551aa0f8d845f111cb42473563c62", null ] ] ], [ "ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html", [ [ "Packet", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html", [ [ "Packet", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html#a2a30a26df9906e6f22f1772790f3976b", null ], [ "header", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html#ad5d7b693f84c7b5f052e73221ba0048c", null ], [ "payload", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html#a3cb2f0cff68d27709b93a40c52ba27e6", null ] ] ], [ "ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html#ac911c0df669ad316d5689e1804eb5f08", null ], [ "~ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html#a492cfe28c37b6b55f5e1fa6df78afd16", null ], [ "ZeroMQReader", "classxpcc_1_1_zero_m_q_reader.html#a7567d275133cb0b39dd016988bc160b5", null ], [ "operator=", "classxpcc_1_1_zero_m_q_reader.html#a91f5a0d223bf5fd79a0e0eff27bf645d", null ], [ "start", "classxpcc_1_1_zero_m_q_reader.html#a76f99d7fd74eb28828ec1484a174243e", null ], [ "stop", "classxpcc_1_1_zero_m_q_reader.html#af37c7fb70ad6609dc88532e906e4d2ae", null ], [ "isPacketAvailable", "classxpcc_1_1_zero_m_q_reader.html#a0208ced3d7d6e0832b87280116001824", null ], [ "getPacket", "classxpcc_1_1_zero_m_q_reader.html#acd64f824345c7ce22dc69d3b9f130627", null ], [ "dropPacket", "classxpcc_1_1_zero_m_q_reader.html#a7ea837cc9c87d1d4fb02435f9fd09d01", null ] ] ], [ "(TIPC) Transparent Inter-Process Communication", "group__tipc.html", "group__tipc" ], [ "operator<<", "group__backend.html#gae607c84f8e96aae062e3c12b86ce316f", null ] ];<file_sep>/docs/api/structxpcc_1_1l3gd20_1_1_data.js var structxpcc_1_1l3gd20_1_1_data = [ [ "Data", "structxpcc_1_1l3gd20_1_1_data.html#a943cef13950c62601b362e1ac7bda383", null ], [ "getX", "structxpcc_1_1l3gd20_1_1_data.html#a3705f0298e815a3cd6da5ddde46e84bf", null ], [ "getY", "structxpcc_1_1l3gd20_1_1_data.html#a03a10cc862ef0bb6873e08e5b9ba4c33", null ], [ "getZ", "structxpcc_1_1l3gd20_1_1_data.html#a5f7a87507a0a90776820e911027965f1", null ], [ "getTemperature", "structxpcc_1_1l3gd20_1_1_data.html#a91888ad4ef3c3474ff4ffb75a33d98a8", null ], [ "operator[]", "structxpcc_1_1l3gd20_1_1_data.html#a0ecc29d4153ccc3fc40453d55b94f3b5", null ], [ "getPointer", "structxpcc_1_1l3gd20_1_1_data.html#aa4e278e8b304e4ea3a26279a86bffe68", null ], [ "L3gd20", "structxpcc_1_1l3gd20_1_1_data.html#a4c0b3d851c9363e321e381f7ccbd9ab4", null ] ];<file_sep>/docs/api/classxpcc_1_1_lis3_transport_spi.js var classxpcc_1_1_lis3_transport_spi = [ [ "Lis3TransportSpi", "classxpcc_1_1_lis3_transport_spi.html#a1cf8d82493669ac8d84312faa69b364c", null ], [ "ping", "classxpcc_1_1_lis3_transport_spi.html#ae2787a7638b06eca853fc835895c7b00", null ], [ "write", "classxpcc_1_1_lis3_transport_spi.html#aa90826c6ded26dc9be725113ef963403", null ], [ "read", "classxpcc_1_1_lis3_transport_spi.html#afb6779efbc0dd180618908c2dfc03ed8", null ], [ "read", "classxpcc_1_1_lis3_transport_spi.html#a50ee1c2bd788e3aebbccbb178ec509f7", null ] ];<file_sep>/docs/api/classxpcc_1_1_can.js var classxpcc_1_1_can = [ [ "Mode", "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709", [ [ "Normal", "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a960b44c579bc2f6818d2daaf9e4c16f0", null ], [ "ListenOnly", "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a3db5be2c0f1a2c52d4efc1d475551ba9", null ], [ "LoopBack", "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a2bedeeb051e4212e3c53f13f85845fde", null ], [ "ListenOnlyLoopBack", "classxpcc_1_1_can.html#a70d6bfc57a9d0f5ec505afa247e43709a45987c21827015f2000fff5769b231a2", null ] ] ], [ "Bitrate", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720", [ [ "kBps10", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a0ce272ee0320cb7aa1e28afd17936a18", null ], [ "kBps20", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a4b81755cfe03fc72a30846c917723a1b", null ], [ "kBps50", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a53db17dcb6f1e88fcc120560305c1984", null ], [ "kBps100", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720ab2f64d661215c80110a9836abb473302", null ], [ "kBps125", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a21b1eb7094856ae8fcc15cef6ca4b97d", null ], [ "kBps250", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a67edaa773e5936d4c85dc0437f809c60", null ], [ "kBps500", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720abb2693a7cd71b19a9bb56efdee7e3ceb", null ], [ "MBps1", "classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720a0ae5bab196b9c076bdece0b35e411a8a", null ] ] ], [ "BusState", "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50f", [ [ "Connected", "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50fa2ec0d16e4ca169baedb9b2d50ec5c6d7", null ], [ "ErrorWarning", "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50faf6838fe3c9b719640b817473e714ac47", null ], [ "ErrorPassive", "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50faf2dddaa52fc350a733bae4d166aed1fe", null ], [ "Off", "classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50fad15305d7a4e34e02489c74a5ef542f36", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1ui_1_1_indicator.js var classxpcc_1_1ui_1_1_indicator = [ [ "Indicator", "classxpcc_1_1ui_1_1_indicator.html#a1b1f1a9d33304697b7eec0dbf4de2a3d", null ], [ "setPeriod", "classxpcc_1_1ui_1_1_indicator.html#ac8006aff290c20ff11d825b9e730204a", null ], [ "setFadeTimes", "classxpcc_1_1ui_1_1_indicator.html#aad830ba89b0c1ba7c177fb65d048d9cd", null ], [ "setRange", "classxpcc_1_1ui_1_1_indicator.html#a0a0f4636141055abfb779f921eaecadf", null ], [ "start", "classxpcc_1_1ui_1_1_indicator.html#a7ff7d3863080150c9943913504f9d5f3", null ], [ "stop", "classxpcc_1_1ui_1_1_indicator.html#ad0fda9553dc7469a8cd43aef35028240", null ], [ "isAnimating", "classxpcc_1_1ui_1_1_indicator.html#a4f7830e0cc60bc8755c8ee675ad584fa", null ], [ "update", "classxpcc_1_1ui_1_1_indicator.html#a12a04196d7b6acf8bd814c9e3cb1e4e3", null ] ];<file_sep>/docs/api/group__driver__radio.js var group__driver__radio = [ [ "NRF24", "group__nrf24.html", "group__nrf24" ] ];<file_sep>/docs/api/classxpcc_1_1_scheduler.js var classxpcc_1_1_scheduler = [ [ "Task", "classxpcc_1_1_scheduler_1_1_task.html", "classxpcc_1_1_scheduler_1_1_task" ], [ "Priority", "classxpcc_1_1_scheduler.html#ad87181bd99f0b09ff3a3e3fe29f4f35b", null ], [ "Scheduler", "classxpcc_1_1_scheduler.html#ab0d844b0ec238ebf83875d450a772d8f", null ], [ "scheduleTask", "classxpcc_1_1_scheduler.html#ab7f41ccb1d219cc4cfeb7c417e057873", null ], [ "schedule", "classxpcc_1_1_scheduler.html#a7f068894aec0ac632ee58a9551d175ce", null ], [ "scheduleInterupt", "classxpcc_1_1_scheduler.html#a8e57f2e7be649cd78da0003b1411b70d", null ] ];<file_sep>/docs/api/navtreeindex17.js var NAVTREEINDEX17 = { "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a33944f2e4dc97619d11dc72cedc98ce3a478463ef48b17565d0fc5512488b428d":[1,1,3,0,4,0,4,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a33944f2e4dc97619d11dc72cedc98ce3a4de2888cac9d25eba6322e146871e22b":[1,1,3,0,4,0,4,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a33944f2e4dc97619d11dc72cedc98ce3a9bde31cdcae5a207d9a97c5431975344":[1,1,3,0,4,0,4,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a35e09f22311a741d419a5e01cb706943":[1,1,3,0,4,0,0,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a3c8b3a267020be0300543ad34cb75a2d":[1,1,3,0,4,0,0,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a43d90a12e89f677bac105b44314d1eba":[1,1,3,0,4,0,1,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a639f0a286904d9f662852a3bc3b1e698":[1,1,3,0,4,0,0,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a6debb6088504b937692c2ff4f7ea8a3b":[1,1,3,0,4,0,0,5], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a78e13fe041d11be72bb4675a2ac9da5f":[1,1,3,0,4,0,0,3], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a78f06aac9dd83d70d6444ce2d39b76b9":[1,1,3,0,4,0,0,6], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a7eef2ee926cc90664bebae8369565935":[1,1,3,0,4,0,6], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a7eef2ee926cc90664bebae8369565935a704ce9bb55755236e8da1f1183466807":[1,1,3,0,4,0,6,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a7eef2ee926cc90664bebae8369565935a78cbe2576651cdd2ae49ce4a98ac9a02":[1,1,3,0,4,0,6,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a7eef2ee926cc90664bebae8369565935abc8042ee1d6259c0b44251c0ec4e09ac":[1,1,3,0,4,0,6,3], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#a7eef2ee926cc90664bebae8369565935ad0184541679a6f3ddaa78bc82e454c5e":[1,1,3,0,4,0,6,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ac0d7500750c118fa3e9850a178c950d0":[1,1,3,0,4,0,0,4], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ac1b00bb3dc0159a8d86e398e0bc6f7c4":[1,1,3,0,4,0,1,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ad4bf67b6f2167ea973a2f5f5742da169":[1,1,3,0,4,0,1,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ad54f20cf64c8871b8bfb007b73225e04":[1,1,3,0,4,0,5], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ad54f20cf64c8871b8bfb007b73225e04a0fa14811e397ded69a1c9968dd93aa03":[1,1,3,0,4,0,5,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ad54f20cf64c8871b8bfb007b73225e04a776abe4d6fce6dda6ffee5fb31fb949f":[1,1,3,0,4,0,5,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ad54f20cf64c8871b8bfb007b73225e04ad6bbf2a30d2362c741ee18ae195cb54d":[1,1,3,0,4,0,5,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#adb1f719b6f10c8cd4b9189ee0d02b49f":[1,1,3,0,4,0,7], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#<KEY>":[1,1,3,0,4,0,7,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#adb1f719b6f10c8cd4b9189ee0d02b49fabcfaccebf745acfd5e75351095a5394a":[1,1,3,0,4,0,7,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ae2abb7e5ceeaa024431a4db124a8f46a":[1,1,3,0,4,0,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ae2abb7e5ceeaa024431a4db124a8f46aa17a403802601c8c772166a89aa2d6eee":[1,1,3,0,4,0,2,1], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ae2abb7e5ceeaa024431a4db124a8f46aa4d6df795e0f36f486e06608ce092e95c":[1,1,3,0,4,0,2,2], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ae2abb7e5ceeaa024431a4db124a8f46aa60f9fdd3e0cfff45195e8052b532e3af":[1,1,3,0,4,0,2,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#ae2abb7e5ceeaa024431a4db124a8f46aa6748381fd439074869c406bdeb611e97":[1,1,3,0,4,0,2,3], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#structxpcc_1_1stm32_1_1fsmc_1_1_nor_sram_1_1_asynchronous_timing":[1,1,3,0,4,0,0], "classxpcc_1_1stm32_1_1fsmc_1_1_nor_sram.html#structxpcc_1_1stm32_1_1fsmc_1_1_nor_sram_1_1_synchronous_timing":[1,1,3,0,4,0,1], "classxpcc_1_1tipc_1_1_receiver.html":[1,2,4,10,5,1], "classxpcc_1_1tipc_1_1_receiver.html#a378574fc4e1f35d85c0d86eedcee02d3":[1,2,4,10,5,1,5], "classxpcc_1_1tipc_1_1_receiver.html#a4ea1be08232bac7972619a4206812111":[1,2,4,10,5,1,4], "classxpcc_1_1tipc_1_1_receiver.html#a610acd0800840ba0021ebeb5f0466611":[1,2,4,10,5,1,0], "classxpcc_1_1tipc_1_1_receiver.html#a87fe3ccd9e130a1b3a18c624bc06cee8":[1,2,4,10,5,1,3], "classxpcc_1_1tipc_1_1_receiver.html#ab539491564e9c6120038c20d3c382056":[1,2,4,10,5,1,7], "classxpcc_1_1tipc_1_1_receiver.html#ab994ff33c41b350e1d1f366880bab009":[1,2,4,10,5,1,1], "classxpcc_1_1tipc_1_1_receiver.html#abd44e25c29645092a730ece57fc44b0d":[1,2,4,10,5,1,2], "classxpcc_1_1tipc_1_1_receiver.html#adef36b0dc21b1cc0e98b870dc3f7e0d1":[1,2,4,10,5,1,6], "classxpcc_1_1tipc_1_1_receiver_socket.html":[1,2,4,10,5,2], "classxpcc_1_1tipc_1_1_receiver_socket.html#a08ba5d3303e98e2e758ca57304ead9a5":[1,2,4,10,5,2,4], "classxpcc_1_1tipc_1_1_receiver_socket.html#a4772d037c792153062acf31506301904":[1,2,4,10,5,2,5], "classxpcc_1_1tipc_1_1_receiver_socket.html#a4afc8545b41c495c0151df9cf2b72a8a":[1,2,4,10,5,2,1], "classxpcc_1_1tipc_1_1_receiver_socket.html#a4d9a09c17d2b5827e8a08e71034fdd52":[1,2,4,10,5,2,0], "classxpcc_1_1tipc_1_1_receiver_socket.html#aa9faa4c5d44798f79137f7159c92f1ea":[1,2,4,10,5,2,3], "classxpcc_1_1tipc_1_1_receiver_socket.html#ab1f38d97e985cf8ed8c8ee9204eab43f":[1,2,4,10,5,2,2], "classxpcc_1_1tipc_1_1_transmitter.html":[1,2,4,10,5,3], "classxpcc_1_1tipc_1_1_transmitter.html#a0f773279851eedb93f493d1bb47b49fc":[1,2,4,10,5,3,0], "classxpcc_1_1tipc_1_1_transmitter.html#a1a242ec94aa81067bc1f27c2294138e6":[1,2,4,10,5,3,5], "classxpcc_1_1tipc_1_1_transmitter.html#a29d36cc61eec15f7af77a394d61bd5b8":[1,2,4,10,5,3,2], "classxpcc_1_1tipc_1_1_transmitter.html#a2ec06b83f7f996d761ca18d9f577a8b4":[1,2,4,10,5,3,4], "classxpcc_1_1tipc_1_1_transmitter.html#aa76bd4ccef9badd6bfc2ce0750f6ecef":[1,2,4,10,5,3,1], "classxpcc_1_1tipc_1_1_transmitter.html#ab7f2938dd5aa9625df6c1a8879f2298e":[1,2,4,10,5,3,3], "classxpcc_1_1tipc_1_1_transmitter_socket.html":[1,2,4,10,5,4], "classxpcc_1_1tipc_1_1_transmitter_socket.html#a432ca5758d442f9b3358615e28597d82":[1,2,4,10,5,4,0], "classxpcc_1_1tipc_1_1_transmitter_socket.html#a86d9d7d62bffd0ce2bd24e5136626f45":[1,2,4,10,5,4,2], "classxpcc_1_1tipc_1_1_transmitter_socket.html#ab03da7008277a944d8e82032f2274971":[1,2,4,10,5,4,1], "classxpcc_1_1tipc_1_1_transmitter_socket.html#ae545daeb42ff10f2b86a21fc08a0c43f":[1,2,4,10,5,4,3], "classxpcc_1_1tmp_1_1_conversion.html":[1,11,2,3], "classxpcc_1_1tmp_1_1_conversion.html#ac38cf5b3cd44824ebc6fca0df965d0a3a161df622500b1bbb8536d50e6f8fbfbb":[1,11,2,3,1], "classxpcc_1_1tmp_1_1_conversion.html#ac38cf5b3cd44824ebc6fca0df965d0a3adbe1485d1bf8da88be27937665aeded9":[1,11,2,3,0], "classxpcc_1_1tmp_1_1_conversion.html#ac38cf5b3cd44824ebc6fca0df965d0a3af375a24b327c462c7e6ad2bd8389b916":[1,11,2,3,2], "classxpcc_1_1ui_1_1_animation.html":[1,10,4,0], "classxpcc_1_1ui_1_1_animation.html#a138e6e6deee2011dc3a472fb04a80c73":[1,10,4,0,4], "classxpcc_1_1ui_1_1_animation.html#a323d847a6a94220d13e0c4e9fbd5e0bc":[1,10,4,0,5], "classxpcc_1_1ui_1_1_animation.html#a4542a86e15651126b39f7d3f0893d54f":[1,10,4,0,8], "classxpcc_1_1ui_1_1_animation.html#a4893b5faff02a683958f133aaf69ef5f":[1,10,4,0,3], "classxpcc_1_1ui_1_1_animation.html#a72922b4a5a7ecffe0c7320ee99451fde":[1,10,4,0,10], "classxpcc_1_1ui_1_1_animation.html#a76a0b6375b6b7a5e8a196eeb99a23dce":[1,10,4,0,6], "classxpcc_1_1ui_1_1_animation.html#aa9fa91fa7a4277b059ae637dd704ae74":[1,10,4,0,2], "classxpcc_1_1ui_1_1_animation.html#ac146698468bc439c4a55b837ddf6f026":[1,10,4,0,1], "classxpcc_1_1ui_1_1_animation.html#ac1bb999902268cb8596da38a7e7f2623":[1,10,4,0,7], "classxpcc_1_1ui_1_1_animation.html#ae893a916f5d5c03f2884c0a809ac2d5c":[1,10,4,0,0], "classxpcc_1_1ui_1_1_animation.html#af63483b4b1f29ac1a09d28767deecc72":[1,10,4,0,9], "classxpcc_1_1ui_1_1_fast_ramp.html":[1,10,4,2], "classxpcc_1_1ui_1_1_fast_ramp.html#a0a47d0f19f11a39f2cf5e76b823f1392":[1,10,4,2,1], "classxpcc_1_1ui_1_1_fast_ramp.html#a3e767f57c34508f08abd4d3c4eac86bc":[1,10,4,2,2], "classxpcc_1_1ui_1_1_fast_ramp.html#a429e656a6cc5aa0e480c5a2eea384e9c":[1,10,4,2,3], "classxpcc_1_1ui_1_1_fast_ramp.html#a9ce363a691a8ff4952a9e2faf457d7d2":[1,10,4,2,0], "classxpcc_1_1ui_1_1_fast_ramp.html#aac339f751634738d6a1b09340223bccb":[1,10,4,2,5], "classxpcc_1_1ui_1_1_fast_ramp.html#af413a68d8321e2be4da414e9ae557b42":[1,10,4,2,4], "classxpcc_1_1ui_1_1_indicator.html":[1,10,4,1], "classxpcc_1_1ui_1_1_indicator.html#a0a0f4636141055abfb779f921eaecadf":[1,10,4,1,3], "classxpcc_1_1ui_1_1_indicator.html#a12a04196d7b6acf8bd814c9e3cb1e4e3":[1,10,4,1,7], "classxpcc_1_1ui_1_1_indicator.html#a1b1f1a9d33304697b7eec0dbf4de2a3d":[1,10,4,1,0], "classxpcc_1_1ui_1_1_indicator.html#a4f7830e0cc60bc8755c8ee675ad584fa":[1,10,4,1,6], "classxpcc_1_1ui_1_1_indicator.html#a7ff7d3863080150c9943913504f9d5f3":[1,10,4,1,4], "classxpcc_1_1ui_1_1_indicator.html#aad830ba89b0c1ba7c177fb65d048d9cd":[1,10,4,1,2], "classxpcc_1_1ui_1_1_indicator.html#ac8006aff290c20ff11d825b9e730204a":[1,10,4,1,1], "classxpcc_1_1ui_1_1_indicator.html#ad0fda9553dc7469a8cd43aef35028240":[1,10,4,1,5], "classxpcc_1_1ui_1_1_key_frame_animation.html":[1,10,4,4], "classxpcc_1_1ui_1_1_key_frame_animation.html#a16258890ec088e983265aebb96383b4d":[1,10,4,4,7], "classxpcc_1_1ui_1_1_key_frame_animation.html#a1da874de029d944b151c0990651486bb":[1,10,4,4,4], "classxpcc_1_1ui_1_1_key_frame_animation.html#a23fca4571b131f42e6efceaa9eb6655f":[1,10,4,4,0], "classxpcc_1_1ui_1_1_key_frame_animation.html#a2d91a3f0a455aa315ffcf7c2ab586c15":[1,10,4,4,8], "classxpcc_1_1ui_1_1_key_frame_animation.html#a4ae0a95e2159e4307c9e527cb97fdd90":[1,10,4,4,2], "classxpcc_1_1ui_1_1_key_frame_animation.html#a780a8f7a7109424de6782b6e26e6c9e7":[1,10,4,4,6], "classxpcc_1_1ui_1_1_key_frame_animation.html#a896070e0d043f4dd3b518fb8b813aa5c":[1,10,4,4,9], "classxpcc_1_1ui_1_1_key_frame_animation.html#a925bcb3d2f9e948b76636b4a9f7f09b0":[1,10,4,4,5], "classxpcc_1_1ui_1_1_key_frame_animation.html#aa0ebf17ddb4730cd10bb1110ed8b4f4a":[1,10,4,4,1], "classxpcc_1_1ui_1_1_key_frame_animation.html#abc56cd10049d889a0f5b671830e06e9e":[1,10,4,4,11], "classxpcc_1_1ui_1_1_key_frame_animation.html#aef824ff7ce0aace7ced1354adeea30c3":[1,10,4,4,3], "classxpcc_1_1ui_1_1_key_frame_animation.html#afefa834bcdfe9e2a269d5baca599cb68":[1,10,4,4,10], "classxpcc_1_1ui_1_1_led.html":[1,10,7,0], "classxpcc_1_1ui_1_1_led.html#a2b603934aec4cc2af7e0e3e59ca207f6":[1,10,7,0,1], "classxpcc_1_1ui_1_1_led.html#a467878d059b4fe59d9e858340bdb6ea1":[1,10,7,0,2], "classxpcc_1_1ui_1_1_led.html#a51b40a433c78d4579e6af84fb96be203":[1,10,7,0,3], "classxpcc_1_1ui_1_1_led.html#a79eb74bfa88a2df14628e1c2c495ceec":[1,10,7,0,4], "classxpcc_1_1ui_1_1_led.html#a7e1fc42f26e70671e7fbc0aa9595e6df":[1,10,7,0,7], "classxpcc_1_1ui_1_1_led.html#a950afd5bdbd20a194788840afe3cc9bc":[1,10,7,0,5], "classxpcc_1_1ui_1_1_led.html#aa7b066c49cf6784f185230be3245ae12":[1,10,7,0,8], "classxpcc_1_1ui_1_1_led.html#acbabf82037b7aed550b64aa439f31905":[1,10,7,0,6], "classxpcc_1_1ui_1_1_led.html#ace1b8ca4de248f2187565cd1045b2e50":[1,10,7,0,9], "classxpcc_1_1ui_1_1_led.html#adc48a7f4d4b1f721fc37b9bd166b5975":[1,10,7,0,0], "classxpcc_1_1ui_1_1_pulse.html":[1,10,4,5], "classxpcc_1_1ui_1_1_pulse.html#a35fbe25618366412f384cf58632fd6a9":[1,10,4,5,2], "classxpcc_1_1ui_1_1_pulse.html#a413e8306a2948352857e2fe832460a00":[1,10,4,5,1], "classxpcc_1_1ui_1_1_pulse.html#a46e4b55489c1a8b4ef2d2ecd23dc9e30":[1,10,4,5,0], "classxpcc_1_1ui_1_1_pulse.html#a5c457be9dea7f525cd1015000ced69fa":[1,10,4,5,4], "classxpcc_1_1ui_1_1_pulse.html#a74920290306a0b4bc1e82aea7ddf0f07":[1,10,4,5,6], "classxpcc_1_1ui_1_1_pulse.html#aafe0b6f988d9c40a64d7bc1f5b57526e":[1,10,4,5,5], "classxpcc_1_1ui_1_1_pulse.html#af4ce679a840f0730055fd1cac876cf0e":[1,10,4,5,3], "classxpcc_1_1ui_1_1_rgb_led.html":[1,10,7,1], "classxpcc_1_1ui_1_1_rgb_led.html#a11ece94f08d7e09e7fb4d11e93d354d3":[1,10,7,1,6], "classxpcc_1_1ui_1_1_rgb_led.html#a337c4a5ea8ff304a5a6fac28806835a5":[1,10,7,1,5], "classxpcc_1_1ui_1_1_rgb_led.html#a58280d9288ad57337ff01c2db0b8e439":[1,10,7,1,4], "classxpcc_1_1ui_1_1_rgb_led.html#a8ba4248988fb84f69a2be4d41857a11e":[1,10,7,1,7], "classxpcc_1_1ui_1_1_rgb_led.html#a8ef6c74856eaec7b8bf73d1a8be6d0fd":[1,10,7,1,0], "classxpcc_1_1ui_1_1_rgb_led.html#a9b7180e7ec5d172c72edf298ac952aef":[1,10,7,1,2], "classxpcc_1_1ui_1_1_rgb_led.html#ac0aef89794c81608605a8efa0a8d6096":[1,10,7,1,3], "classxpcc_1_1ui_1_1_rgb_led.html#aceac2130a83c8c3bca3c8b5b8bd227cb":[1,10,7,1,1], "classxpcc_1_1ui_1_1_strobe.html":[1,10,4,6], "classxpcc_1_1ui_1_1_strobe.html#a279eeee64a37a79b242cb4430d9b2ee3":[1,10,4,6,7], "classxpcc_1_1ui_1_1_strobe.html#a2ba5dd0a7f0b9a7135db10b06961366b":[1,10,4,6,5], "classxpcc_1_1ui_1_1_strobe.html#a3b18cfd5d9d1acf1469e6c1e44c22937":[1,10,4,6,8], "classxpcc_1_1ui_1_1_strobe.html#a64c893e3d196f9fcac25dce8af8b4bbd":[1,10,4,6,4], "classxpcc_1_1ui_1_1_strobe.html#a71199fd8dddc51ea61687d1bbf832681":[1,10,4,6,2], "classxpcc_1_1ui_1_1_strobe.html#a89ef6bd21825838cefdd352cffa3b1f8":[1,10,4,6,6], "classxpcc_1_1ui_1_1_strobe.html#abcef9a5edec5c867adb83d6a79ff125c":[1,10,4,6,3], "classxpcc_1_1ui_1_1_strobe.html#ac75750b36f6e48eba8abc781b064bc23":[1,10,4,6,1], "classxpcc_1_1ui_1_1_strobe.html#adacce6f3d88612e0928e3fa7be68d5fc":[1,10,4,6,0], "classxpcc_1_1xmega_1_1_uart_baudrate.html":[2,0,3,31,1], "functions.html":[2,3,0,0], "functions.html":[2,3,0], "functions_0x7e.html":[2,3,0,25], "functions_b.html":[2,3,0,1], "functions_c.html":[2,3,0,2], "functions_d.html":[2,3,0,3], "functions_e.html":[2,3,0,4], "functions_enum.html":[2,3,4], "functions_eval.html":[2,3,5], "functions_f.html":[2,3,0,5], "functions_func.html":[2,3,1,0], "functions_func.html":[2,3,1], "functions_func_0x7e.html":[2,3,1,25], "functions_func_b.html":[2,3,1,1], "functions_func_c.html":[2,3,1,2], "functions_func_d.html":[2,3,1,3], "functions_func_e.html":[2,3,1,4], "functions_func_f.html":[2,3,1,5], "functions_func_g.html":[2,3,1,6], "functions_func_h.html":[2,3,1,7], "functions_func_i.html":[2,3,1,8], "functions_func_j.html":[2,3,1,9], "functions_func_k.html":[2,3,1,10], "functions_func_l.html":[2,3,1,11], "functions_func_m.html":[2,3,1,12], "functions_func_n.html":[2,3,1,13], "functions_func_o.html":[2,3,1,14], "functions_func_p.html":[2,3,1,15], "functions_func_q.html":[2,3,1,16], "functions_func_r.html":[2,3,1,17], "functions_func_s.html":[2,3,1,18], "functions_func_t.html":[2,3,1,19], "functions_func_u.html":[2,3,1,20], "functions_func_v.html":[2,3,1,21], "functions_func_w.html":[2,3,1,22], "functions_func_y.html":[2,3,1,23], "functions_func_z.html":[2,3,1,24], "functions_g.html":[2,3,0,6], "functions_h.html":[2,3,0,7], "functions_i.html":[2,3,0,8], "functions_j.html":[2,3,0,9], "functions_k.html":[2,3,0,10], "functions_l.html":[2,3,0,11], "functions_m.html":[2,3,0,12], "functions_n.html":[2,3,0,13], "functions_o.html":[2,3,0,14], "functions_p.html":[2,3,0,15], "functions_q.html":[2,3,0,16], "functions_r.html":[2,3,0,17], "functions_rela.html":[2,3,6], "functions_s.html":[2,3,0,18], "functions_t.html":[2,3,0,19], "functions_type.html":[2,3,3], "functions_u.html":[2,3,0,20], "functions_v.html":[2,3,0,21], "functions_vars.html":[2,3,2], "functions_vars.html":[2,3,2,0], "functions_vars_b.html":[2,3,2,1], "functions_vars_c.html":[2,3,2,2], "functions_vars_d.html":[2,3,2,3], "functions_vars_e.html":[2,3,2,4], "functions_vars_f.html":[2,3,2,5], "functions_vars_h.html":[2,3,2,6], "functions_vars_i.html":[2,3,2,7], "functions_vars_l.html":[2,3,2,8], "functions_vars_m.html":[2,3,2,9], "functions_vars_n.html":[2,3,2,10], "functions_vars_o.html":[2,3,2,11], "functions_vars_p.html":[2,3,2,12], "functions_vars_r.html":[2,3,2,13], "functions_vars_s.html":[2,3,2,14], "functions_vars_t.html":[2,3,2,15], "functions_vars_u.html":[2,3,2,16], "functions_vars_v.html":[2,3,2,17], "functions_vars_w.html":[2,3,2,18], "functions_vars_y.html":[2,3,2,19], "functions_vars_z.html":[2,3,2,20], "functions_w.html":[2,3,0,22], "functions_y.html":[2,3,0,23], "functions_z.html":[2,3,0,24], "group__accessor.html":[1,1,1], "group__accessor.html#ga05c6b6d2b982ea0fc3403431892ad3ec":[1,1,1,9], "group__accessor.html#ga3f6d6eba4f884c8fd6824b7382c41b56":[1,1,1,7], "group__accessor.html#ga4a73026e5059235b8a9157c455392e4b":[1,1,1,5], "group__accessor.html#ga4b2a48bfd556ea5005ecff1f4eec15a0":[1,1,1,4], "group__accessor.html#ga71c8fdec33b7ac78b2f56e4ca3ccfc9f":[1,1,1,3], "group__accessor.html#gaca5a949ad233f699688a2cfdd2c57efd":[1,1,1,10], "group__accessor.html#gad4b896ad2edf50c8dd824031f1894a66":[1,1,1,6], "group__accessor.html#gaef6d3eee945154e5b984f0ca59f9857a":[1,1,1,8], "group__adc.html":[1,1,4,0], "group__allocator.html":[1,11,0], "group__amnb.html":[1,2,0], "group__amnb.html#ga3373b80bb1a758b8821487802750735d":[1,2,0,12], "group__amnb.html#ga5ba1d96e88ef2e3189fc07af8f758a94":[1,2,0,7], "group__amnb.html#ga9d51acabbd29c61b9931e2ebae600686":[1,2,0,11], "group__amnb.html#gac3b87049713c290d3ae496621d7536b4":[1,2,0,10], "group__amnb.html#gac462596130c1e5f05fffe34773311e1c":[1,2,0,9], "group__amnb.html#gac9e174dbfa0dff218a593e63321d0cce":[1,2,0,8], "group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686a0854ac17d8dcb980a1218b1fccad5269":[1,2,0,11,3], "group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686a1ad0dc82868c547f4ceb989b4b104f8c":[1,2,0,11,0], "group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686a3d15367875437d4704134aa896c09547":[1,2,0,11,2], "group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686abc0cc523493221a5252ba5158ad1eb49":[1,2,0,11,1], "group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a16a7c6c7b1e5302990dfb5b3ae529c6f":[1,2,0,10,9], "group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a1824225512dd1f2e8a9eee28c5cb5d43":[1,2,0,10,2], "group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a1edbc2c629ffee54b54e3912008e11b8":[1,2,0,10,0], "group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a2e2f363220d35e24db2d5088b9d6162b":[1,2,0,10,6] }; <file_sep>/docs/api/classxpcc_1_1_point_set2_d.js var classxpcc_1_1_point_set2_d = [ [ "SizeType", "classxpcc_1_1_point_set2_d.html#ae99572be13e76b0b6d69cc10e70bfe4a", null ], [ "PointType", "classxpcc_1_1_point_set2_d.html#a36caf124029455670f524fd3965a57d6", null ], [ "iterator", "classxpcc_1_1_point_set2_d.html#a400c31a86173662ba0a02be106445831", null ], [ "const_iterator", "classxpcc_1_1_point_set2_d.html#ae268eedfdd0a88c5b187797b9e5d5103", null ], [ "PointSet2D", "classxpcc_1_1_point_set2_d.html#ae0e62e776fdb965c88bbc0b3a6152fba", null ], [ "PointSet2D", "classxpcc_1_1_point_set2_d.html#a5abe27d53207ce362b535ddc3a0295a4", null ], [ "PointSet2D", "classxpcc_1_1_point_set2_d.html#ad0fb587e3ab1556aba99a395e8e32ed6", null ], [ "operator=", "classxpcc_1_1_point_set2_d.html#a96fbce457527cb12f8ebf0301804e480", null ], [ "getNumberOfPoints", "classxpcc_1_1_point_set2_d.html#ad2a86ed1809df4fc222d055b1fa7b60f", null ], [ "append", "classxpcc_1_1_point_set2_d.html#a70a6942ddad6c2d032a47692bf34caf0", null ], [ "operator[]", "classxpcc_1_1_point_set2_d.html#a6552e37b858c4a4973d18e7e73ecbf46", null ], [ "operator[]", "classxpcc_1_1_point_set2_d.html#a411c3a3804c18110ccfef20a649fe79d", null ], [ "removeAll", "classxpcc_1_1_point_set2_d.html#ae4b935d50a7637153537e7a7484402b1", null ], [ "begin", "classxpcc_1_1_point_set2_d.html#a860a6abc6fdb3490f361f6cfac4677ae", null ], [ "begin", "classxpcc_1_1_point_set2_d.html#abbbfc75ad160f729af2416d424f93d87", null ], [ "end", "classxpcc_1_1_point_set2_d.html#abb72347a26b541bf8e54d243d8233c10", null ], [ "end", "classxpcc_1_1_point_set2_d.html#a6ead7437e9c8fb5aa9b65146e3edab6f", null ], [ "points", "classxpcc_1_1_point_set2_d.html#ae952347a5a33950b3576ce3c31b59ace", null ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_label.js var classxpcc_1_1gui_1_1_label = [ [ "Label", "classxpcc_1_1gui_1_1_label.html#ad4f918d295c9bad7a9e0ded768b462f2", null ], [ "render", "classxpcc_1_1gui_1_1_label.html#ad39642c4baeabaed90010c589749354f", null ], [ "setColor", "classxpcc_1_1gui_1_1_label.html#acfd943b89c55971ca26e9d1e770ac2d8", null ], [ "setLabel", "classxpcc_1_1gui_1_1_label.html#ae6bea01a30e5572d7c39ec48adf1c50c", null ], [ "setFont", "classxpcc_1_1gui_1_1_label.html#a79722253b48819e23f7c64270e462eb8", null ], [ "setFont", "classxpcc_1_1gui_1_1_label.html#a0e49edb236dba43a87d014def5581380", null ] ];<file_sep>/docs/api/group__driver__pwm.js var group__driver__pwm = [ [ "MAX6966", "classxpcc_1_1_m_a_x6966.html", null ], [ "Pca9685", "classxpcc_1_1_pca9685.html", [ [ "Pca9685", "classxpcc_1_1_pca9685.html#a723212c0f1a461c47a918901624ceeb3", null ], [ "initialize", "classxpcc_1_1_pca9685.html#a13a240f38991c4f88aa3d7c722c9c597", null ], [ "setChannel", "classxpcc_1_1_pca9685.html#a2b0a4787639276888dbd628eaf0105d2", null ], [ "setAllChannels", "classxpcc_1_1_pca9685.html#aa275555c38a1d2224993793d33b7f035", null ] ] ], [ "TLC594X", "classxpcc_1_1_t_l_c594_x.html", null ] ];<file_sep>/docs/api/search/functions_18.js var searchData= [ ['yellow',['yellow',['../group__io.html#gac4a73dbc4b1d6a7609c845636ec62104',1,'xpcc']]], ['yield',['yield',['../classxpcc_1_1rtos_1_1_thread.html#a0c245ecde851c7ea67e5f61231d0a192',1,'xpcc::rtos::Thread::yield()'],['../classxpcc_1_1rtos_1_1_thread.html#a0c245ecde851c7ea67e5f61231d0a192',1,'xpcc::rtos::Thread::yield()']]] ]; <file_sep>/docs/api/classxpcc_1_1_communicating_view_stack.js var classxpcc_1_1_communicating_view_stack = [ [ "CommunicatingViewStack", "classxpcc_1_1_communicating_view_stack.html#a4aaba862fbc63f3c80687bba6f465993", null ], [ "getCommunicator", "classxpcc_1_1_communicating_view_stack.html#ad8321f19b4b230091e650bace67e9655", null ], [ "communicator", "classxpcc_1_1_communicating_view_stack.html#a64d50b2cb2be1703449f9984490bcf6c", null ] ];<file_sep>/docs/api/classxpcc_1_1_polygon2_d.js var classxpcc_1_1_polygon2_d = [ [ "Polygon2D", "classxpcc_1_1_polygon2_d.html#abe922fd771cc46cb58f353b0045d44fa", null ], [ "Polygon2D", "classxpcc_1_1_polygon2_d.html#a7cabdb1760a86970525146e6e1c5fb4a", null ], [ "Polygon2D", "classxpcc_1_1_polygon2_d.html#a6fea158a1b02abf05e144a305f4db274", null ], [ "operator=", "classxpcc_1_1_polygon2_d.html#a5added8cdb935cdcb31c356aefb14f0f", null ], [ "operator<<", "classxpcc_1_1_polygon2_d.html#ad8752987722d40ff6cab256630478a27", null ], [ "intersects", "classxpcc_1_1_polygon2_d.html#ad8e1327ed890798baba1d8575708bd59", null ], [ "intersects", "classxpcc_1_1_polygon2_d.html#a06bdec0f12807ba62a09decbc7a4cc74", null ], [ "intersects", "classxpcc_1_1_polygon2_d.html#a7a6e26ddc343e6ee62e3a5b52f43c2b7", null ], [ "intersects", "classxpcc_1_1_polygon2_d.html#a80f7c52e1656b4b5210477b640082efc", null ], [ "getIntersections", "classxpcc_1_1_polygon2_d.html#ad17e8589d50d5e6432ca191eb7d05cbb", null ], [ "isInside", "classxpcc_1_1_polygon2_d.html#a95b16514f58b68ac90fc7ba11cb68095", null ] ];<file_sep>/docs/api/navtreeindex10.js var NAVTREEINDEX10 = { "classxpcc_1_1color_1_1_rgb_t.html#a32d7bf9d5b0357ea9871fcecdbdeb9af":[2,0,3,9,1,8], "classxpcc_1_1color_1_1_rgb_t.html#a32f8ee4bd1e228c239188dcfff5970e0":[2,0,3,9,1,10], "classxpcc_1_1color_1_1_rgb_t.html#a4395b9f051fecc0f6c9d8028ff0bde5c":[2,0,3,9,1,1], "classxpcc_1_1color_1_1_rgb_t.html#a4559519abb23993606512deba1dbaed6":[2,0,3,9,1,11], "classxpcc_1_1color_1_1_rgb_t.html#a4ada77108b50278d42c15d18e329b49f":[2,0,3,9,1,5], "classxpcc_1_1color_1_1_rgb_t.html#a552843fa5abdc9466058155f790dc726":[2,0,3,9,1,2], "classxpcc_1_1color_1_1_rgb_t.html#a7b2f71a19c01dce910d34bb7e1b765b8":[2,0,3,9,1,0], "classxpcc_1_1color_1_1_rgb_t.html#af1dc0a4a85e04e53c7db3f854e23ef2a":[2,0,3,9,1,7], "classxpcc_1_1cortex_1_1_core.html":[2,0,3,10,0], "classxpcc_1_1cortex_1_1_core.html#a6a2ea1094bb50f163fd908492cabd9cd":[2,0,3,10,0,0], "classxpcc_1_1cortex_1_1_cycle_counter.html":[2,0,3,10,1], "classxpcc_1_1cortex_1_1_sys_tick_timer.html":[2,0,3,10,2], "classxpcc_1_1fat_1_1_directory.html":[2,0,3,11,0], "classxpcc_1_1fat_1_1_directory.html#a6a2805c1593066ebf57910c461da8193":[2,0,3,11,0,0], "classxpcc_1_1fat_1_1_file.html":[2,0,3,11,1], "classxpcc_1_1fat_1_1_file.html#a675938233fedcea654bf8da1c1644426":[2,0,3,11,1,5], "classxpcc_1_1fat_1_1_file.html#a8df3531163f9f1535651fa02e9dd13cf":[2,0,3,11,1,0], "classxpcc_1_1fat_1_1_file.html#a9e1b55aff2ded1c33778e80920637a96":[2,0,3,11,1,3], "classxpcc_1_1fat_1_1_file.html#acd836144059d474be1024a04d0e23585":[2,0,3,11,1,1], "classxpcc_1_1fat_1_1_file.html#addae885b474a6da8ac4c10ef06ae8932":[2,0,3,11,1,6], "classxpcc_1_1fat_1_1_file.html#ae16fb0c40283e797ed31a25ac599886f":[2,0,3,11,1,2], "classxpcc_1_1fat_1_1_file.html#af749153a213044a03651923b1d432905":[2,0,3,11,1,4], "classxpcc_1_1fat_1_1_file_info.html":[2,0,3,11,2], "classxpcc_1_1fat_1_1_file_info.html#a2304a8092b45ff74e0f57174672aaf03":[2,0,3,11,2,5], "classxpcc_1_1fat_1_1_file_info.html#a238078068ae9226ecb2b42f74adf70d4":[2,0,3,11,2,2], "classxpcc_1_1fat_1_1_file_info.html#a3fdf21d63fa0a6d6f4830bec79c05c1e":[2,0,3,11,2,4], "classxpcc_1_1fat_1_1_file_info.html#a715596df020def1a0274d62828ceaeb4":[2,0,3,11,2,1], "classxpcc_1_1fat_1_1_file_info.html#a839a8b4b7777d2440501d5f5a68d46a6":[2,0,3,11,2,3], "classxpcc_1_1fat_1_1_file_info.html#aa7cf2b558f0e3259f72995c69f111326":[2,0,3,11,2,0], "classxpcc_1_1fat_1_1_file_info.html#ad2600d3df4a00a700732936e70332b2f":[2,0,3,11,2,6], "classxpcc_1_1fat_1_1_file_system.html":[2,0,3,11,3], "classxpcc_1_1fat_1_1_file_system.html#a23962960d58b97c7c65e85b57a30ddec":[2,0,3,11,3,2], "classxpcc_1_1fat_1_1_file_system.html#a6d923662c6b9b7610303d3e2700a6c9d":[2,0,3,11,3,1], "classxpcc_1_1fat_1_1_file_system.html#ac56e2d7af8b35da74c229db9250cd1b3":[2,0,3,11,3,0], "classxpcc_1_1fat_1_1_physical_volume.html":[2,0,3,11,4], "classxpcc_1_1fat_1_1_physical_volume.html#a2e42d95d9d5eefc6e3510c0d508534a5":[2,0,3,11,4,3], "classxpcc_1_1fat_1_1_physical_volume.html#a2ecab1e5420532bbfdf6d7a139514771":[2,0,3,11,4,4], "classxpcc_1_1fat_1_1_physical_volume.html#a5e0a50c5ef37a8d177f131b73eb6d0e0":[2,0,3,11,4,5], "classxpcc_1_1fat_1_1_physical_volume.html#ab0ed892f8b0faee4a75d6c4c29d7fdeb":[2,0,3,11,4,2], "classxpcc_1_1fat_1_1_physical_volume.html#abb9b3b43722b0c0a6b9e6a0ae3cbdb37":[2,0,3,11,4,1], "classxpcc_1_1fat_1_1_physical_volume.html#ac3e04ebf817e73a063fa0a375a181a52":[2,0,3,11,4,0], "classxpcc_1_1filter_1_1_debounce.html":[1,8,2,0], "classxpcc_1_1filter_1_1_debounce.html#a2d189eb7711e48fbc9aab3c8efc64a90":[1,8,2,0,0], "classxpcc_1_1filter_1_1_debounce.html#a636af4c40daff593e51b0d8112c6514c":[1,8,2,0,3], "classxpcc_1_1filter_1_1_debounce.html#a908ae23d3060e4cc0282f349123ec3e2":[1,8,2,0,2], "classxpcc_1_1filter_1_1_debounce.html#ae38dce0e417ef273c27d083ece126a51":[1,8,2,0,1], "classxpcc_1_1filter_1_1_fir.html":[2,0,3,12,1], "classxpcc_1_1filter_1_1_fir.html#a1bbb156b8cd0f5b94031df25585cc516":[2,0,3,12,1,0], "classxpcc_1_1filter_1_1_fir.html#a7390a48280d55427d6d4f37caa28fb90":[2,0,3,12,1,1], "classxpcc_1_1filter_1_1_fir.html#a9d8ebbb272eb8e2fa1899a809398f607":[2,0,3,12,1,2], "classxpcc_1_1filter_1_1_fir.html#ac35fc64d077ef304d810d57d9e007b78":[2,0,3,12,1,5], "classxpcc_1_1filter_1_1_fir.html#ac5dd37beef65b812c0395d10e47e0b5d":[2,0,3,12,1,3], "classxpcc_1_1filter_1_1_fir.html#ac8bc6a31b504a217a6556175f3515e82":[2,0,3,12,1,4], "classxpcc_1_1filter_1_1_median.html":[1,8,2,1], "classxpcc_1_1filter_1_1_median.html#a26d1edadcb7d074e0955f876e63a8518":[1,8,2,1,1], "classxpcc_1_1filter_1_1_median.html#a5dfc21c1381df88cf3c34ff3a8b30d7d":[1,8,2,1,3], "classxpcc_1_1filter_1_1_median.html#aa64372a5886053228e09388e0887264b":[1,8,2,1,2], "classxpcc_1_1filter_1_1_median.html#ab42f104a44d4c403901d9c6111dedefe":[1,8,2,1,0], "classxpcc_1_1filter_1_1_moving_average.html":[1,8,2,2], "classxpcc_1_1filter_1_1_moving_average.html#a4931f63f22344ad1514c59d2e5fe8ac7":[1,8,2,2,0], "classxpcc_1_1filter_1_1_moving_average.html#aa3a842ffeca80dadb8dbd36b2c683d86":[1,8,2,2,1], "classxpcc_1_1filter_1_1_moving_average.html#ab327ea8a0504a5c3fbe2f55dab5cfcba":[1,8,2,2,2], "classxpcc_1_1filter_1_1_ramp.html":[1,8,2,4], "classxpcc_1_1filter_1_1_ramp.html#a111aa1a01b95f9acd2e63e2fa8e1862c":[1,8,2,4,0], "classxpcc_1_1filter_1_1_ramp.html#a179a9a5139a4fd2da5cf316f211c8de9":[1,8,2,4,4], "classxpcc_1_1filter_1_1_ramp.html#a30a56acec2079eb1b5c4719a88ad20af":[1,8,2,4,1], "classxpcc_1_1filter_1_1_ramp.html#a545a89e052e6a53919d7c28e884ced90":[1,8,2,4,3], "classxpcc_1_1filter_1_1_ramp.html#ab02a5289479478c89e91d92891f5bd93":[1,8,2,4,2], "classxpcc_1_1filter_1_1_ramp.html#ada39680ff385e6babdf622d0d0a4e489":[1,8,2,4,5], "classxpcc_1_1glcd_1_1_color.html":[2,0,3,13,0], "classxpcc_1_1glcd_1_1_color.html#a17dc2e5f2efe0adaa5e8dc3fbb0a50c1":[2,0,3,13,0,2], "classxpcc_1_1glcd_1_1_color.html#a69236bea908ca158bebc491501deda3c":[2,0,3,13,0,1], "classxpcc_1_1glcd_1_1_color.html#a83870452b1e0641c03bcae9d1fbf9c14":[2,0,3,13,0,4], "classxpcc_1_1glcd_1_1_color.html#aba774fd781371a572142122ae40a08be":[2,0,3,13,0,3], "classxpcc_1_1glcd_1_1_color.html#ac63d0c695f344cd3a8ae06308e88ddf1":[2,0,3,13,0,0], "classxpcc_1_1gui_1_1_arrow_button.html":[1,10,6,6], "classxpcc_1_1gui_1_1_arrow_button.html#a308f33377313f8d2dd5cafcbb06b71a5":[1,10,6,6,0], "classxpcc_1_1gui_1_1_arrow_button.html#ada2b4a24af7abeb23abb42392971735b":[1,10,6,6,1], "classxpcc_1_1gui_1_1_async_event.html":[1,10,6,2], "classxpcc_1_1gui_1_1_async_event.html#a74b0749f38767f8760790c3a91b62c3d":[1,10,6,2,0], "classxpcc_1_1gui_1_1_async_event.html#aa228c2163d0e55f4d8f9b64fdfb9a4b8":[1,10,6,2,1], "classxpcc_1_1gui_1_1_button_widget.html":[1,10,6,5], "classxpcc_1_1gui_1_1_button_widget.html#a0e4808021a92795cabee22597e14832a":[1,10,6,5,1], "classxpcc_1_1gui_1_1_button_widget.html#a7ae244b10f45671866e9851417aff001":[1,10,6,5,2], "classxpcc_1_1gui_1_1_button_widget.html#ae6c6fd0b0d9d62061312e989abec6bd5":[1,10,6,5,0], "classxpcc_1_1gui_1_1_checkbox_widget.html":[1,10,6,8], "classxpcc_1_1gui_1_1_checkbox_widget.html#a0518963d892dbd8f0b9d37ea791bb0ea":[1,10,6,8,2], "classxpcc_1_1gui_1_1_checkbox_widget.html#a0899e18a243d557b3e1e32ca584ecfbb":[1,10,6,8,3], "classxpcc_1_1gui_1_1_checkbox_widget.html#a94da4fec9a09eeaf6ea94be5789c9653":[1,10,6,8,1], "classxpcc_1_1gui_1_1_checkbox_widget.html#ae76d3ee68616815649ce3b11e8dcaf8f":[1,10,6,8,0], "classxpcc_1_1gui_1_1_color_palette.html":[1,10,6,0], "classxpcc_1_1gui_1_1_color_palette.html#a10fa39f4c9ab62f6e8d81e4e28a1a724":[1,10,6,0,4], "classxpcc_1_1gui_1_1_color_palette.html#a2040705fca95a1ad5bc5e8015377777f":[1,10,6,0,2], "classxpcc_1_1gui_1_1_color_palette.html#a28f50f85219073034376e8946bb49823":[1,10,6,0,6], "classxpcc_1_1gui_1_1_color_palette.html#a75c053273c6ba763091955230108cb93":[1,10,6,0,0], "classxpcc_1_1gui_1_1_color_palette.html#aa8737a86b88d32683c304e9806f3ab75":[1,10,6,0,1], "classxpcc_1_1gui_1_1_color_palette.html#acfc6267f399f7804380fd871b8f82ba3":[1,10,6,0,3], "classxpcc_1_1gui_1_1_color_palette.html#af089b95aad81fdc34ece194f864746cc":[1,10,6,0,5], "classxpcc_1_1gui_1_1_filled_area_button.html":[1,10,6,7], "classxpcc_1_1gui_1_1_filled_area_button.html#a290fb12f8712a61f6edc539393f19678":[1,10,6,7,2], "classxpcc_1_1gui_1_1_filled_area_button.html#aaba824beb7290eb26fdd5b92ebccf15d":[1,10,6,7,1], "classxpcc_1_1gui_1_1_filled_area_button.html#aabc9db2b214d3df4ab92372993d158e2":[1,10,6,7,0], "classxpcc_1_1gui_1_1_float_field.html":[2,0,3,14,7], "classxpcc_1_1gui_1_1_float_field.html#a023a8d319f7e2ac9619232520bba970f":[2,0,3,14,7,1], "classxpcc_1_1gui_1_1_float_field.html#ab8ef6f8dc79210c47a528ad89a9a4488":[2,0,3,14,7,0], "classxpcc_1_1gui_1_1_gui_view_stack.html":[1,10,6,4], "classxpcc_1_1gui_1_1_gui_view_stack.html#a01bdd4c66ff8deea95c4c102e1a16e70":[1,10,6,4,2], "classxpcc_1_1gui_1_1_gui_view_stack.html#a281d801babbe1cb0cd1f274886e2202e":[1,10,6,4,1], "classxpcc_1_1gui_1_1_gui_view_stack.html#a49a63d1bb25ff5361d385d079f813fba":[1,10,6,4,5], "classxpcc_1_1gui_1_1_gui_view_stack.html#a5438c3373e641377e42071227aedd44a":[1,10,6,4,3], "classxpcc_1_1gui_1_1_gui_view_stack.html#ab3bbf381820d03e9508b4f705df52baf":[1,10,6,4,6], "classxpcc_1_1gui_1_1_gui_view_stack.html#ab8a594cd6085d9238fdaa6a49da12b40":[1,10,6,4,0], "classxpcc_1_1gui_1_1_gui_view_stack.html#ac7e70da7a577163fa0fd6feecf7bc58e":[1,10,6,4,4], "classxpcc_1_1gui_1_1_input_event.html":[1,10,6,1], "classxpcc_1_1gui_1_1_input_event.html#a384f80bb27b9e291539987573d37d016":[1,10,6,1,5], "classxpcc_1_1gui_1_1_input_event.html#a38792b20fbc3c2163447585cccdc5ed0":[1,10,6,1,2], "classxpcc_1_1gui_1_1_input_event.html#a4268fc803ca81baac3cd83376bf0cb84":[1,10,6,1,4], "classxpcc_1_1gui_1_1_input_event.html#a55eb1d415b13663f1c7c4fab693c077e":[1,10,6,1,1], "classxpcc_1_1gui_1_1_input_event.html#a55eb1d415b13663f1c7c4fab693c077eac4e0e4e3118472beeb2ae75827450f1f":[1,10,6,1,1,1], "classxpcc_1_1gui_1_1_input_event.html#a55eb1d415b13663f1c7c4fab693c077eafbaedde498cdead4f2780217646e9ba1":[1,10,6,1,1,0], "classxpcc_1_1gui_1_1_input_event.html#aac9aa39d0d42b1de7580c75aae39f878":[1,10,6,1,0], "classxpcc_1_1gui_1_1_input_event.html#aac9aa39d0d42b1de7580c75aae39f878a2b40a1ea27beb450618885ec87f0ee15":[1,10,6,1,0,1], "classxpcc_1_1gui_1_1_input_event.html#aac9aa39d0d42b1de7580c75aae39f878a57b35198356d373bcd2a6e08abcb3795":[1,10,6,1,0,0], "classxpcc_1_1gui_1_1_input_event.html#ab45213e8ce1c4c3081518aafc443554d":[1,10,6,1,6], "classxpcc_1_1gui_1_1_input_event.html#ad1727b520ab2ec809fecb9371e2eed4e":[1,10,6,1,3], "classxpcc_1_1gui_1_1_label.html":[1,10,6,11], "classxpcc_1_1gui_1_1_label.html#a0e49edb236dba43a87d014def5581380":[1,10,6,11,5], "classxpcc_1_1gui_1_1_label.html#a79722253b48819e23f7c64270e462eb8":[1,10,6,11,4], "classxpcc_1_1gui_1_1_label.html#acfd943b89c55971ca26e9d1e770ac2d8":[1,10,6,11,2], "classxpcc_1_1gui_1_1_label.html#ad39642c4baeabaed90010c589749354f":[1,10,6,11,1], "classxpcc_1_1gui_1_1_label.html#ad4f918d295c9bad7a9e0ded768b462f2":[1,10,6,11,0], "classxpcc_1_1gui_1_1_label.html#ae6bea01a30e5572d7c39ec48adf1c50c":[1,10,6,11,3], "classxpcc_1_1gui_1_1_number_field.html":[1,10,6,12], "classxpcc_1_1gui_1_1_number_field.html#a1fd760d8a12757cb8816c0369d4bdc30":[1,10,6,12,0], "classxpcc_1_1gui_1_1_number_field.html#a7ca574dcf19a6dcbe46c4f3b15857826":[1,10,6,12,3], "classxpcc_1_1gui_1_1_number_field.html#ab5c7bc9d45248d2804cd634b4b7f8e85":[1,10,6,12,2], "classxpcc_1_1gui_1_1_number_field.html#aca1f3a5365d51278fdb2e60579b22845":[1,10,6,12,1], "classxpcc_1_1gui_1_1_number_rocker.html":[1,10,6,13], "classxpcc_1_1gui_1_1_number_rocker.html#a8b37da0a79fb259f29e1a31ed11bcfa7":[1,10,6,13,0], "classxpcc_1_1gui_1_1_number_rocker.html#a8e9bf6d4742657d1db31ac1c34678eaf":[1,10,6,13,2], "classxpcc_1_1gui_1_1_number_rocker.html#a90d95d25d078d1dbea10381434527052":[1,10,6,13,5], "classxpcc_1_1gui_1_1_number_rocker.html#aa1fe0bff8b3ba2f1df9cd529d3d5ee61":[1,10,6,13,4], "classxpcc_1_1gui_1_1_number_rocker.html#aa7238f1f5a9da3f8e5ca39a4c5b60492":[1,10,6,13,3], "classxpcc_1_1gui_1_1_number_rocker.html#ac25bd518b1b9b405e5784efe4ce1a62b":[1,10,6,13,1], "classxpcc_1_1gui_1_1_string_field.html":[1,10,6,14], "classxpcc_1_1gui_1_1_string_field.html#a044407a8748729333a67bea9c64f59d6":[1,10,6,14,0], "classxpcc_1_1gui_1_1_string_field.html#a092128214c35661fd49a88d0bc36899e":[1,10,6,14,1], "classxpcc_1_1gui_1_1_string_field.html#a5918bd44462f4f47762ff0eba10bdc08":[1,10,6,14,2], "classxpcc_1_1gui_1_1_string_field.html#a85afd80baf8c25b19e24fe4ada69f218":[1,10,6,14,3], "classxpcc_1_1gui_1_1_string_rocker.html":[1,10,6,9], "classxpcc_1_1gui_1_1_string_rocker.html#a5463513f7b3d820ed75e2f687eea56a7":[1,10,6,9,2], "classxpcc_1_1gui_1_1_string_rocker.html#a79ec9e2a87c6d049fe97cea5f9c853fb":[1,10,6,9,4], "classxpcc_1_1gui_1_1_string_rocker.html#a7e6b72827653133e010aacd2c481877e":[1,10,6,9,5], "classxpcc_1_1gui_1_1_string_rocker.html#a8898c75d51a70aa8541db3fced5a6dbf":[1,10,6,9,0], "classxpcc_1_1gui_1_1_string_rocker.html#a8e9a327526fa82959bbaf49fd2374f56":[1,10,6,9,3], "classxpcc_1_1gui_1_1_string_rocker.html#afb31532f0540415a3d6975b84a976c6e":[1,10,6,9,1], "classxpcc_1_1gui_1_1_string_rocker.html#affdceef8d50fe71fe72ae0c0415613d0":[1,10,6,9,6], "classxpcc_1_1gui_1_1_tab_panel.html":[1,10,6,10], "classxpcc_1_1gui_1_1_tab_panel.html#a102698510634fdb29cfbb61534bb46d2":[1,10,6,10,4], "classxpcc_1_1gui_1_1_tab_panel.html#a16ca19300293cbec44be1523fd56046e":[1,10,6,10,2], "classxpcc_1_1gui_1_1_tab_panel.html#a2797f30b8c71f5448d4ec014780e2fdd":[1,10,6,10,5], "classxpcc_1_1gui_1_1_tab_panel.html#a56be49421fb9cf1af108b1b9b1d2dc92":[1,10,6,10,0], "classxpcc_1_1gui_1_1_tab_panel.html#a9b241030a4e19dc4c8b0018a8415fb6f":[1,10,6,10,3], "classxpcc_1_1gui_1_1_tab_panel.html#aaecb53e1cc864ad93bb694745e7d52a7":[1,10,6,10,6], "classxpcc_1_1gui_1_1_tab_panel.html#ab896b4727dc15b3368167ee2e13e0d89":[1,10,6,10,1], "classxpcc_1_1gui_1_1_view.html":[1,10,6,3], "classxpcc_1_1gui_1_1_view.html#a01b1c9305312823e336ab357ec989f02":[1,10,6,3,7], "classxpcc_1_1gui_1_1_view.html#a12b527dbdb10d44044b50cc4c225193d":[1,10,6,3,12], "classxpcc_1_1gui_1_1_view.html#a25dd176d79c26556f88786541e5e9d62":[1,10,6,3,5], "classxpcc_1_1gui_1_1_view.html#a4925e2849a38214826413494bcfb0a0f":[1,10,6,3,11], "classxpcc_1_1gui_1_1_view.html#a5b5d3597a028b3b0c003e9b8ece5958c":[1,10,6,3,0], "classxpcc_1_1gui_1_1_view.html#a61afc0535c3a761b1bc333feb481c474":[1,10,6,3,6], "classxpcc_1_1gui_1_1_view.html#a7084cef7f3274f5436531341ab5c7e4c":[1,10,6,3,8], "classxpcc_1_1gui_1_1_view.html#a7435ef3f5ee83e60d5d7e8593be946c1":[1,10,6,3,3], "classxpcc_1_1gui_1_1_view.html#a7ca018425dfe8f9251df5e7bcd8b7b02":[1,10,6,3,2], "classxpcc_1_1gui_1_1_view.html#ac4ec8e9313e9c04249a2c87b8613674e":[1,10,6,3,15], "classxpcc_1_1gui_1_1_view.html#accf8f8a32887c5d3baf3ca6c5603b22d":[1,10,6,3,16], "classxpcc_1_1gui_1_1_view.html#ace27185cfc711c1e8e3a244b2c966941":[1,10,6,3,1], "classxpcc_1_1gui_1_1_view.html#ad228821c88e5e448b4b126e8e87d1f1a":[1,10,6,3,14], "classxpcc_1_1gui_1_1_view.html#adb448c19f6b4ff930dcd05d100a3beb8":[1,10,6,3,13], "classxpcc_1_1gui_1_1_view.html#ae1f1b096dfdddf045235129ea80179c6":[1,10,6,3,9], "classxpcc_1_1gui_1_1_view.html#ae24cd6ed3bd3a091c232e001e9b36a74":[1,10,6,3,4], "classxpcc_1_1gui_1_1_view.html#ae6fb680f4c1ebece841fbac687aeb613":[1,10,6,3,17], "classxpcc_1_1gui_1_1_view.html#afb90d50b647a2f0c2378e91f8108e530":[1,10,6,3,10], "classxpcc_1_1gui_1_1_widget.html":[1,10,6,15], "classxpcc_1_1gui_1_1_widget.html#a032d6c86e0aa90bf488073b267e25988":[1,10,6,15,15], "classxpcc_1_1gui_1_1_widget.html#a0e221ddc141c40987096dfddc35e7a6b":[1,10,6,15,6], "classxpcc_1_1gui_1_1_widget.html#a0f087a0978264f2b8af31b31baa99cfb":[1,10,6,15,18], "classxpcc_1_1gui_1_1_widget.html#a13779366f738fc0001991b1176319a85":[1,10,6,15,32], "classxpcc_1_1gui_1_1_widget.html#a18ac3213557917f6c195522a67e24dac":[1,10,6,15,40], "classxpcc_1_1gui_1_1_widget.html#a1e000ea80722515ae29abcbc3d92b6b6":[1,10,6,15,30], "classxpcc_1_1gui_1_1_widget.html#a232298c502ae04fd9e9432507c417e9c":[1,10,6,15,31], "classxpcc_1_1gui_1_1_widget.html#a23fdbdaadd4d1fd61350e8eb1ba67fbe":[1,10,6,15,9], "classxpcc_1_1gui_1_1_widget.html#a2741e1b671b0ae3582f500494491baf5":[1,10,6,15,25], "classxpcc_1_1gui_1_1_widget.html#a2829cd46af2301c39a6dce9481dc4fce":[1,10,6,15,39], "classxpcc_1_1gui_1_1_widget.html#a29e4696e1fb6a7ba9e2fd9ea0dd0d8b3":[1,10,6,15,28], "classxpcc_1_1gui_1_1_widget.html#a2cb0386592de58f60b7e3b4ca05f1003":[1,10,6,15,22], "classxpcc_1_1gui_1_1_widget.html#a36484c269c46816ecf6a88bbb9bb3ff2":[1,10,6,15,21], "classxpcc_1_1gui_1_1_widget.html#a3a1b4c731a48f46051299a7a6d53d840":[1,10,6,15,10], "classxpcc_1_1gui_1_1_widget.html#a3b9c80950a8901c199ad7111b1614029":[1,10,6,15,19], "classxpcc_1_1gui_1_1_widget.html#a3cc34e7f67d202fa504f2985e07f8946":[1,10,6,15,36], "classxpcc_1_1gui_1_1_widget.html#a46ec42402680bb29e26a78621c742ee6":[1,10,6,15,13], "classxpcc_1_1gui_1_1_widget.html#a4883e359a50905dbf99c489391525e24":[1,10,6,15,27], "classxpcc_1_1gui_1_1_widget.html#a4d8c036f47cbcc9b8b6ff77c43fbf5c5":[1,10,6,15,2], "classxpcc_1_1gui_1_1_widget.html#a58b855eafeb0b53ad388b69d41b34cd2":[1,10,6,15,5], "classxpcc_1_1gui_1_1_widget.html#a5adfb9bfb3a81f9574157d515aad974d":[1,10,6,15,8], "classxpcc_1_1gui_1_1_widget.html#a61006e8a4ac1b39a14f0a6df4acd9d19":[1,10,6,15,7], "classxpcc_1_1gui_1_1_widget.html#a62060516514c6035e26c6b4582ca28d2":[1,10,6,15,37], "classxpcc_1_1gui_1_1_widget.html#a65c47954c7cc1ccfcadcc8d952833940":[1,10,6,15,35], "classxpcc_1_1gui_1_1_widget.html#a66786e7b77808c6fdee3ff9382b88a27":[1,10,6,15,4], "classxpcc_1_1gui_1_1_widget.html#a67f528cca5d902013408ca3cb43bbdac":[1,10,6,15,16], "classxpcc_1_1gui_1_1_widget.html#a6c0ca8904fa3d807457bd1d54ba4336b":[1,10,6,15,34], "classxpcc_1_1gui_1_1_widget.html#a782955e6770efb7c748aa9c800ebd72e":[1,10,6,15,20], "classxpcc_1_1gui_1_1_widget.html#a7cc182f0f8f953516dbd80353358441e":[1,10,6,15,11], "classxpcc_1_1gui_1_1_widget.html#a878a95192ad0a49a33a0e5f5562188fe":[1,10,6,15,29], "classxpcc_1_1gui_1_1_widget.html#a8cdd702a7701faee67cc5af6c6af30d2":[1,10,6,15,3], "classxpcc_1_1gui_1_1_widget.html#a9d5504e96336306f0ea4e87c4e925567":[1,10,6,15,41], "classxpcc_1_1gui_1_1_widget.html#ab70f1b2fa363c2901760ba82eef8d895":[1,10,6,15,38], "classxpcc_1_1gui_1_1_widget.html#abb0805a55619d3000f7b4d65faec3073":[1,10,6,15,17], "classxpcc_1_1gui_1_1_widget.html#ac9db7a138b6ee81d8568e869f729fcc0":[1,10,6,15,26], "classxpcc_1_1gui_1_1_widget.html#ace2f205be35ab0dac9f8ac0b5e2945ac":[1,10,6,15,1], "classxpcc_1_1gui_1_1_widget.html#ad3b991fb561195ea43aeea3eec514b2a":[1,10,6,15,42], "classxpcc_1_1gui_1_1_widget.html#ad44c053ca34813fc8e7c2e558ab9bf52":[1,10,6,15,14], "classxpcc_1_1gui_1_1_widget.html#ad6346a00199546a0452f413d581ec981":[1,10,6,15,33], "classxpcc_1_1gui_1_1_widget.html#ae46a2e28470276fa49ce2aee942f5282":[1,10,6,15,12], "classxpcc_1_1gui_1_1_widget.html#aea04e574b694fc85ce9f3135c81a7029":[1,10,6,15,0], "classxpcc_1_1gui_1_1_widget.html#af09981c7208c1ce4463e79dd725518fe":[1,10,6,15,24], "classxpcc_1_1gui_1_1_widget.html#affc3ee28e93366dd7145ec589c2b2290":[1,10,6,15,23], "classxpcc_1_1gui_1_1_widget_group.html":[1,10,6,16], "classxpcc_1_1gui_1_1_widget_group.html#a02f824f714eebefc400530b8576f66c1":[1,10,6,16,3], "classxpcc_1_1gui_1_1_widget_group.html#a618f899960804aed8909d73f0b1724c0":[1,10,6,16,1], "classxpcc_1_1gui_1_1_widget_group.html#a7b94127917fc5f3bdaa2b30d7ae1a022":[1,10,6,16,4], "classxpcc_1_1gui_1_1_widget_group.html#a90da84e42d950440588e4f0f0c662f12":[1,10,6,16,8], "classxpcc_1_1gui_1_1_widget_group.html#aa72455d1c4b251ab66bed8b181bfe875":[1,10,6,16,0], "classxpcc_1_1gui_1_1_widget_group.html#aabb4f89a1417d6c9d50f6e7377f45de0":[1,10,6,16,5], "classxpcc_1_1gui_1_1_widget_group.html#ab32ccf1f3eea87d0cb5713c5d3afb96e":[1,10,6,16,2], "classxpcc_1_1gui_1_1_widget_group.html#ac96d16fc10675201c7c5036dbcaffd53":[1,10,6,16,6], "classxpcc_1_1gui_1_1_widget_group.html#adaf4ded5c1d93796d56270ace5876b9c":[1,10,6,16,9], "classxpcc_1_1gui_1_1_widget_group.html#adc884d4378254822ebec385d06a815fc":[1,10,6,16,7], "classxpcc_1_1gui_1_1_widget_group.html#aea5325755400bd268c5921fdc928f33f":[1,10,6,16,10], "classxpcc_1_1hosted_1_1_can_usb.html":[2,0,3,15,0], "classxpcc_1_1hosted_1_1_can_usb.html#a1f51899e513513ff0644ccdabb977fe6":[2,0,3,15,0,5], "classxpcc_1_1hosted_1_1_can_usb.html#a3d435265d610cc1e408116f71045af3b":[2,0,3,15,0,0], "classxpcc_1_1hosted_1_1_can_usb.html#a3e7a971cedf1dbef5f006701a87fd577":[2,0,3,15,0,9], "classxpcc_1_1hosted_1_1_can_usb.html#a3f0f82ee2cf3d44244fd6c94aa9ff847":[2,0,3,15,0,4], "classxpcc_1_1hosted_1_1_can_usb.html#a548a69427c1db258bebb13ab3e9066ca":[2,0,3,15,0,8], "classxpcc_1_1hosted_1_1_can_usb.html#a54b96fa69a132efdf6e1c0ffd443dcda":[2,0,3,15,0,2], "classxpcc_1_1hosted_1_1_can_usb.html#a8c42a6f9967bb14d034461e9fe73b428":[2,0,3,15,0,3], "classxpcc_1_1hosted_1_1_can_usb.html#a9dc9f4d5731af73a77882deb135ffc75":[2,0,3,15,0,1], "classxpcc_1_1hosted_1_1_can_usb.html#ae80d4f0ae1d73ddeee46f419b3148e0b":[2,0,3,15,0,7] }; <file_sep>/docs/api/structxpcc_1_1amnb_1_1_error_handler.js var structxpcc_1_1amnb_1_1_error_handler = [ [ "Callback", "structxpcc_1_1amnb_1_1_error_handler.html#ab0b5c1e073692b8a3342beb84241144d", null ], [ "call", "structxpcc_1_1amnb_1_1_error_handler.html#a308615986faebba727c486c3e315837f", null ], [ "address", "structxpcc_1_1amnb_1_1_error_handler.html#acf7e25e81af3cf6698c162eac4fe08fc", null ], [ "command", "structxpcc_1_1amnb_1_1_error_handler.html#ad5d75ae4c95c05e92e76e02ef630efe9", null ], [ "object", "structxpcc_1_1amnb_1_1_error_handler.html#ac014b7ee31667cd7db15e88c783f8739", null ], [ "function", "structxpcc_1_1amnb_1_1_error_handler.html#ab13e9da59c509191d97756b2432489d9", null ] ];<file_sep>/src/reference/api.md # API reference xpcc is a relatively large framework with many APIs and advanced concepts. We are annotating our APIs using Doxygen and are trying to provide conceptual design documentation on [our project blog](http://blog.xpcc.io). However, this is a slow and difficult process, and the results are not perfect. The most complete and most up-to-date API documentation is definitely the - [Doxygen API reference][doxygen]. Unfortunately the generated HAL for our many devices confuses Doxygen. We therefore chose to only include the HAL API for `ATtiny85`, the `ATmega328p` and the `STM32F407vg` online. The rest of the xpcc API is documented without limitations. <!-- ## Your device We recommend that you generate the documentation for your own project locally. To do so, simply execute our documentation command `scons doc` inside your project folder. This will build the xpcc documentation with your specific project configuration in `build/doc/`. --> If you are stuck, don't hesitate to [send us an email with your questions][mailing_list]. [doxygen]: http://xpcc.io/api/modules.html [examples]: https://github.com/roboterclubaachen/xpcc/tree/develop/examples [mailing_list]: https://mailman.rwth-aachen.de/mailman/listinfo/xpcc-dev <file_sep>/docs/api/classxpcc_1_1_ad7280a.js var classxpcc_1_1_ad7280a = [ [ "::Ad7280aTest", "classxpcc_1_1_ad7280a.html#affc1d452737be22efb8c02a599e64dfc", null ] ];<file_sep>/docs/api/classxpcc_1_1bmp085data_1_1_data_base.js var classxpcc_1_1bmp085data_1_1_data_base = [ [ "CALIBRATION_CALCULATED", "classxpcc_1_1bmp085data_1_1_data_base.html#acd5e6a1ca9d51259723be56133246765a551aa0c911f82dee765b197d92bc4d9f", null ], [ "TEMPERATURE_CALCULATED", "classxpcc_1_1bmp085data_1_1_data_base.html#acd5e6a1ca9d51259723be56133246765a4cf35690c3ba632b15292cceeeb82547", null ], [ "PRESSURE_CALCULATED", "classxpcc_1_1bmp085data_1_1_data_base.html#acd5e6a1ca9d51259723be56133246765a7e21dcfd0416df42c757a69053cfc735", null ], [ "getCalibration", "classxpcc_1_1bmp085data_1_1_data_base.html#addc8c4d734f68b5e114d4ea1a4a358d4", null ], [ "rawTemperatureTouched", "classxpcc_1_1bmp085data_1_1_data_base.html#ad9540a0fc7dfb7df515ab029eff4df1c", null ], [ "rawPressureTouched", "classxpcc_1_1bmp085data_1_1_data_base.html#a5dbffb06c849b468012f82ebc9d437ea", null ], [ "::xpcc::Bmp085", "classxpcc_1_1bmp085data_1_1_data_base.html#a8e035012cafbaac7e33a7a50d19e1d5b", null ], [ "::Bmp085Test", "classxpcc_1_1bmp085data_1_1_data_base.html#a4d9e4ddb2f12344a8132fc8809ebe594", null ], [ "calibration", "classxpcc_1_1bmp085data_1_1_data_base.html#a56f14c59484db0a9257ccfb396423fea", null ], [ "raw", "classxpcc_1_1bmp085data_1_1_data_base.html#ac18c8b94117aa8e9433406586462f660", null ], [ "meta", "classxpcc_1_1bmp085data_1_1_data_base.html#a618c640d7e0083c656d1ccc5ba28a0c5", null ] ];<file_sep>/docs/api/classxpcc_1_1_at45db0x1d.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>xpcc: xpcc::At45db0x1d&lt; Spi, Cs &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">xpcc </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classxpcc_1_1_at45db0x1d.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="classxpcc_1_1_at45db0x1d-members.html">List of all members</a> &#124; <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="#pro-types">Protected Types</a> &#124; <a href="#pro-static-methods">Static Protected Member Functions</a> </div> <div class="headertitle"> <div class="title">xpcc::At45db0x1d&lt; Spi, Cs &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__driver.html">Device drivers</a> &raquo; <a class="el" href="group__driver__storage.html">Storage</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Atmel DataFlash. <a href="classxpcc_1_1_at45db0x1d.html#details">More...</a></p> <p><code>#include &lt;xpcc/driver/storage/at45db0x1d.hpp&gt;</code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:a215826d42d97911028aa0065a5836aae"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a215826d42d97911028aa0065a5836aae">initialize</a> ()</td></tr> <tr class="memdesc:a215826d42d97911028aa0065a5836aae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize. <a href="#a215826d42d97911028aa0065a5836aae">More...</a><br /></td></tr> <tr class="separator:a215826d42d97911028aa0065a5836aae"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f3f2983edd52e854bbfe7fa48412758"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a9f3f2983edd52e854bbfe7fa48412758">copyPageToBuffer</a> (uint16_t pageAddress, at45db::Buffer buffer)</td></tr> <tr class="memdesc:a9f3f2983edd52e854bbfe7fa48412758"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy memory page to a buffer. <a href="#a9f3f2983edd52e854bbfe7fa48412758">More...</a><br /></td></tr> <tr class="separator:a9f3f2983edd52e854bbfe7fa48412758"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8f27be4a3cd86663c6f78bb3720557ab"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a8f27be4a3cd86663c6f78bb3720557ab">comparePageToBuffer</a> (uint16_t pageAddress, at45db::Buffer buffer)</td></tr> <tr class="memdesc:a8f27be4a3cd86663c6f78bb3720557ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the content of a buffer matches the content of a memory page. <a href="#a8f27be4a3cd86663c6f78bb3720557ab">More...</a><br /></td></tr> <tr class="separator:a8f27be4a3cd86663c6f78bb3720557ab"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4fcd1b3155a14e5bd9a61fae657becd7"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a4fcd1b3155a14e5bd9a61fae657becd7">isCompareEqual</a> ()</td></tr> <tr class="memdesc:a4fcd1b3155a14e5bd9a61fae657becd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check the result of a compare operation. <a href="#a4fcd1b3155a14e5bd9a61fae657becd7">More...</a><br /></td></tr> <tr class="separator:a4fcd1b3155a14e5bd9a61fae657becd7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a86e1772ec815d07f40e62c5f5ceb94f0"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a86e1772ec815d07f40e62c5f5ceb94f0">copyBufferToPage</a> (at45db::Buffer buffer, uint16_t pageAddress)</td></tr> <tr class="memdesc:a86e1772ec815d07f40e62c5f5ceb94f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write to buffer to a memory page. <a href="#a86e1772ec815d07f40e62c5f5ceb94f0">More...</a><br /></td></tr> <tr class="separator:a86e1772ec815d07f40e62c5f5ceb94f0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad38503382ad8a17ff098bb7cf4aebdb5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#ad38503382ad8a17ff098bb7cf4aebdb5">copyBufferToPageWithoutErase</a> (at45db::Buffer buffer, uint16_t pageAddress)</td></tr> <tr class="memdesc:ad38503382ad8a17ff098bb7cf4aebdb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write to buffer to a memory page without erasing the page. <a href="#ad38503382ad8a17ff098bb7cf4aebdb5">More...</a><br /></td></tr> <tr class="separator:ad38503382ad8a17ff098bb7cf4aebdb5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7f86fb1f7f87af33b00d34b73bddbdd1"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a7f86fb1f7f87af33b00d34b73bddbdd1">readFromBuffer</a> (at45db::Buffer buffer, uint8_t address, uint8_t *data, std::size_t size)</td></tr> <tr class="memdesc:a7f86fb1f7f87af33b00d34b73bddbdd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data from a buffer. <a href="#a7f86fb1f7f87af33b00d34b73bddbdd1">More...</a><br /></td></tr> <tr class="separator:a7f86fb1f7f87af33b00d34b73bddbdd1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0bc3271009ca71b0cfc43a69a01a3907"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a0bc3271009ca71b0cfc43a69a01a3907">writeToBuffer</a> (at45db::Buffer buffer, uint8_t address, const uint8_t *data, std::size_t size)</td></tr> <tr class="memdesc:a0bc3271009ca71b0cfc43a69a01a3907"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data to a buffer. <a href="#a0bc3271009ca71b0cfc43a69a01a3907">More...</a><br /></td></tr> <tr class="separator:a0bc3271009ca71b0cfc43a69a01a3907"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9fe249bb60d5b8fc6366fb66b2aa4475"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a9fe249bb60d5b8fc6366fb66b2aa4475">readFromMemory</a> (uint32_t address, uint8_t *data, std::size_t size)</td></tr> <tr class="memdesc:a9fe249bb60d5b8fc6366fb66b2aa4475"><td class="mdescLeft">&#160;</td><td class="mdescRight">Continuous read from the memory. <a href="#a9fe249bb60d5b8fc6366fb66b2aa4475">More...</a><br /></td></tr> <tr class="separator:a9fe249bb60d5b8fc6366fb66b2aa4475"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a419710cf8aeacc35499bb5466c57103c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a419710cf8aeacc35499bb5466c57103c">readPageFromMemory</a> (uint32_t address, uint8_t *data, std::size_t size)</td></tr> <tr class="memdesc:a419710cf8aeacc35499bb5466c57103c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a page from the memory (bypassing the buffers) <a href="#a419710cf8aeacc35499bb5466c57103c">More...</a><br /></td></tr> <tr class="separator:a419710cf8aeacc35499bb5466c57103c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad3493e1c0a3eb13a620bba17b645d413"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#ad3493e1c0a3eb13a620bba17b645d413">pageErase</a> (uint16_t pageAddress)</td></tr> <tr class="memdesc:ad3493e1c0a3eb13a620bba17b645d413"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase page. <a href="#ad3493e1c0a3eb13a620bba17b645d413">More...</a><br /></td></tr> <tr class="separator:ad3493e1c0a3eb13a620bba17b645d413"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ade9aeec62512bef546c33a851ca952f5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#ade9aeec62512bef546c33a851ca952f5">pageRewrite</a> (uint16_t pageAddress, at45db::Buffer buffer)</td></tr> <tr class="memdesc:ade9aeec62512bef546c33a851ca952f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rewrite page. <a href="#ade9aeec62512bef546c33a851ca952f5">More...</a><br /></td></tr> <tr class="separator:ade9aeec62512bef546c33a851ca952f5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a03c7cfadd8a9c67434e92ceb075ce744"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a03c7cfadd8a9c67434e92ceb075ce744">blockErase</a> (uint16_t blockAddress)</td></tr> <tr class="memdesc:a03c7cfadd8a9c67434e92ceb075ce744"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase a block of eight pages. <a href="#a03c7cfadd8a9c67434e92ceb075ce744">More...</a><br /></td></tr> <tr class="separator:a03c7cfadd8a9c67434e92ceb075ce744"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5d200bbe89d078f46924dc1b759356ad"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a5d200bbe89d078f46924dc1b759356ad">chipErase</a> ()</td></tr> <tr class="memdesc:a5d200bbe89d078f46924dc1b759356ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase entire chip. <a href="#a5d200bbe89d078f46924dc1b759356ad">More...</a><br /></td></tr> <tr class="separator:a5d200bbe89d078f46924dc1b759356ad"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3d1a242ed966e9393290f3ccd69defc7"><td class="memItemLeft" align="right" valign="top"><a id="a3d1a242ed966e9393290f3ccd69defc7"></a> static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7">isReady</a> ()</td></tr> <tr class="memdesc:a3d1a242ed966e9393290f3ccd69defc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the device is ready for the next operation. <br /></td></tr> <tr class="separator:a3d1a242ed966e9393290f3ccd69defc7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab292c1dc868f326948abd77ba0d92e04"><td class="memItemLeft" align="right" valign="top"><a id="ab292c1dc868f326948abd77ba0d92e04"></a> static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#ab292c1dc868f326948abd77ba0d92e04">waitUntilReady</a> ()</td></tr> <tr class="memdesc:ab292c1dc868f326948abd77ba0d92e04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait until <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>. <br /></td></tr> <tr class="separator:ab292c1dc868f326948abd77ba0d92e04"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a> Protected Types</h2></td></tr> <tr class="memitem:a86b0a35c694e9b591a9a27b9c052ced3"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3">Opcode</a> { <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a8eca70668fac3a5c941fa3d53384cf07">CONTINOUS_ARRAY_READ_HIGH_FREQ</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a3570cdc9458c8ef9a12ce7c09e141005">CONTINOUS_ARRAY_READ</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a76458da63f362503516f982516166bb5">MAIN_MEMORY_PAGE_READ</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a6b17f336512f2f82bcccdceb8a42248d">BUFFER_1_READ</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3ab10bd60d5a81ef64b8e96de9dd94974e">BUFFER_2_READ</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a81131d2f3394e2d9e9cf7ac6e014ba64">BUFFER_1_WRITE</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a68a42fcb6bdaf38c0a15cd89c2354961">BUFFER_2_WRITE</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3afc0a49eeb4bed5da4f02714c88b3617c">MAIN_MEMORY_PAGE_TO_BUFFER_1_TRANSFER</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a577135bcf7a07a939ab1fdfc06edfeec">MAIN_MEMORY_PAGE_TO_BUFFER_2_TRANSFER</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a2bf434242419c6d1b6164c7ad6ea57de">MAIN_MEMORY_PAGE_TO_BUFFER_1_COMPARE</a>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3aae20869990688e0b47c3ee0384b9a593">MAIN_MEMORY_PAGE_TO_BUFFER_2_COMPARE</a>, <br /> &#160;&#160;<b>BUFFER_1_TO_MAIN_MEMORY_PAGE_PROGRAM_WITH_ERASE</b>, <br /> &#160;&#160;<b>BUFFER_2_TO_MAIN_MEMORY_PAGE_PROGRAM_WITH_ERASE</b>, <br /> &#160;&#160;<b>BUFFER_1_TO_MAIN_MEMORY_PAGE_PROGRAM_WITHOUT_ERASE</b>, <br /> &#160;&#160;<b>BUFFER_2_TO_MAIN_MEMORY_PAGE_PROGRAM_WITHOUT_ERASE</b>, <br /> &#160;&#160;<b>BUFFER_1_PAGE_REWRITE</b>, <br /> &#160;&#160;<b>BUFFER_2_PAGE_REWRITE</b>, <br /> &#160;&#160;<b>MAIN_MEMORY_PAGE_PROGRAM_THROUGH_BUFFER_1</b>, <br /> &#160;&#160;<b>MAIN_MEMORY_PAGE_PROGRAM_THROUGH_BUFFER_2</b>, <br /> &#160;&#160;<b>PAGE_ERASE</b>, <br /> &#160;&#160;<a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a7bd0890af9b6b70cc5f870c141bfaf51">BLOCK_ERASE</a>, <br /> &#160;&#160;<b>SECTOR_ERASE</b>, <br /> &#160;&#160;<b>READ_STATUS_REGISTER</b>, <br /> &#160;&#160;<b>DEEP_POWER_DOWN</b>, <br /> &#160;&#160;<b>RESUME_FROM_POWER_DOWN</b> <br /> }</td></tr> <tr class="separator:a86b0a35c694e9b591a9a27b9c052ced3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a09f3e9af74076729a14d9769d1b62e4f"><td class="memItemLeft" align="right" valign="top"><a id="a09f3e9af74076729a14d9769d1b62e4f"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>StatusRegister</b> { <br /> &#160;&#160;<b>READY</b>, <br /> &#160;&#160;<b>COMP</b>, <br /> &#160;&#160;<b>PROTECT</b>, <br /> &#160;&#160;<b>PAGE_SIZE</b> <br /> }</td></tr> <tr class="separator:a09f3e9af74076729a14d9769d1b62e4f"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-methods"></a> Static Protected Member Functions</h2></td></tr> <tr class="memitem:ad803155faa07608a53ce2a9ad49ae655"><td class="memItemLeft" align="right" valign="top"><a id="ad803155faa07608a53ce2a9ad49ae655"></a> static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>readStatus</b> (void)</td></tr> <tr class="separator:ad803155faa07608a53ce2a9ad49ae655"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;typename Spi, typename Cs&gt;<br /> class xpcc::At45db0x1d&lt; Spi, Cs &gt;</h3> <p>Works with: AT45DB011D (128kB), AT45DB021D (256kB), AT45DB041D (512kB) and AT45DB081D (1MB)</p> <p>Features:</p><ul> <li>2.7 to 3.6V Supply Voltage</li> <li>66Mhz SPI interface</li> <li>256 byte page size</li> </ul> <div class="fragment"><div class="line">Operation | Time</div><div class="line">---------------------------+--------</div><div class="line">Page to buffer | 200µs</div><div class="line">Page to buffer compare | 200µs</div><div class="line">Page erase and programming | 14-35ms</div><div class="line">Page programming time | 2-4ms</div><div class="line">Page erase time | 13-32ms</div><div class="line">Block erase time | 30-75ms</div><div class="line">Sector erase time | 1.6-5s</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="namespacexpcc_1_1at45db.html">at45db</a> </dd> <dd> <a href="http://www.atmel.com/dyn/resources/prod_documents/doc3595.pdf">Datasheet</a></dd></dl> <dl class="section author"><dt>Author</dt><dd><NAME> </dd></dl> </div><h2 class="groupheader">Member Enumeration Documentation</h2> <a id="a86b0a35c694e9b591a9a27b9c052ced3"></a> <h2 class="memtitle"><span class="permalink"><a href="#a86b0a35c694e9b591a9a27b9c052ced3">&#9670;&nbsp;</a></span>Opcode</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3">xpcc::At45db0x1d::Opcode</a></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a8eca70668fac3a5c941fa3d53384cf07"></a>CONTINOUS_ARRAY_READ_HIGH_FREQ&#160;</td><td class="fielddoc"><p>high frequency (up to 66 Mhz) </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a3570cdc9458c8ef9a12ce7c09e141005"></a>CONTINOUS_ARRAY_READ&#160;</td><td class="fielddoc"><p>low frequency (up to 33 MHz) </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a76458da63f362503516f982516166bb5"></a>MAIN_MEMORY_PAGE_READ&#160;</td><td class="fielddoc"><p>read directly, bypassing the buffers </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a6b17f336512f2f82bcccdceb8a42248d"></a>BUFFER_1_READ&#160;</td><td class="fielddoc"><p>read from buffer 1 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3ab10bd60d5a81ef64b8e96de9dd94974e"></a>BUFFER_2_READ&#160;</td><td class="fielddoc"><p>read from buffer 2 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a81131d2f3394e2d9e9cf7ac6e014ba64"></a>BUFFER_1_WRITE&#160;</td><td class="fielddoc"><p>write to buffer 1 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a68a42fcb6bdaf38c0a15cd89c2354961"></a>BUFFER_2_WRITE&#160;</td><td class="fielddoc"><p>write to buffer 2 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3afc0a49eeb4bed5da4f02714c88b3617c"></a>MAIN_MEMORY_PAGE_TO_BUFFER_1_TRANSFER&#160;</td><td class="fielddoc"><p>transfer data from the main memory to buffer 1 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a577135bcf7a07a939ab1fdfc06edfeec"></a>MAIN_MEMORY_PAGE_TO_BUFFER_2_TRANSFER&#160;</td><td class="fielddoc"><p>transfer data from the main memory to buffer 2 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a2bf434242419c6d1b6164c7ad6ea57de"></a>MAIN_MEMORY_PAGE_TO_BUFFER_1_COMPARE&#160;</td><td class="fielddoc"><p>compare content of the main memory with the content of buffer 1 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3aae20869990688e0b47c3ee0384b9a593"></a>MAIN_MEMORY_PAGE_TO_BUFFER_2_COMPARE&#160;</td><td class="fielddoc"><p>compare content of the main memory with the content of buffer 2 </p> </td></tr> <tr><td class="fieldname"><a id="a86b0a35c694e9b591a9a27b9c052ced3a7bd0890af9b6b70cc5f870c141bfaf51"></a>BLOCK_ERASE&#160;</td><td class="fielddoc"><p>erase a block of eight pages </p> </td></tr> </table> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a215826d42d97911028aa0065a5836aae"></a> <h2 class="memtitle"><span class="permalink"><a href="#a215826d42d97911028aa0065a5836aae">&#9670;&nbsp;</a></span>initialize()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static bool <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::initialize </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Sets used pins as outputs and switches to binary page size mode (if not already active).</p> <dl class="section return"><dt>Returns</dt><dd><code>true</code> if the device is present, <code>false</code> if no device was found </dd></dl> </div> </div> <a id="a9f3f2983edd52e854bbfe7fa48412758"></a> <h2 class="memtitle"><span class="permalink"><a href="#a9f3f2983edd52e854bbfe7fa48412758">&#9670;&nbsp;</a></span>copyPageToBuffer()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::copyPageToBuffer </td> <td>(</td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>pageAddress</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Takes ~200µs. Operation is finished when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pageAddress</td><td>Page address (upper 11-bits of the 19-bit address) </td></tr> <tr><td class="paramname">buffer</td><td>Buffer index (0..1)</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd></dl> </div> </div> <a id="a8f27be4a3cd86663c6f78bb3720557ab"></a> <h2 class="memtitle"><span class="permalink"><a href="#a8f27be4a3cd86663c6f78bb3720557ab">&#9670;&nbsp;</a></span>comparePageToBuffer()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::comparePageToBuffer </td> <td>(</td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>pageAddress</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Use isEqual() to check the result.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pageAddress</td><td>Page address (upper 11-bits of the 19-bit address) </td></tr> <tr><td class="paramname">buffer</td><td>Buffer index (0..1)</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd> <dd> isEqual() </dd></dl> </div> </div> <a id="a4fcd1b3155a14e5bd9a61fae657becd7"></a> <h2 class="memtitle"><span class="permalink"><a href="#a4fcd1b3155a14e5bd9a61fae657becd7">&#9670;&nbsp;</a></span>isCompareEqual()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static bool <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::isCompareEqual </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Output is only valid after a <a class="el" href="classxpcc_1_1_at45db0x1d.html#a8f27be4a3cd86663c6f78bb3720557ab" title="Check if the content of a buffer matches the content of a memory page. ">comparePageToBuffer()</a> operation and when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true!</code> Any other time the result is undefined.</p> <dl class="section return"><dt>Returns</dt><dd><code>true</code> if the content during the last compare operation matches, <code>false</code> on any difference. </dd></dl> </div> </div> <a id="a86e1772ec815d07f40e62c5f5ceb94f0"></a> <h2 class="memtitle"><span class="permalink"><a href="#a86e1772ec815d07f40e62c5f5ceb94f0">&#9670;&nbsp;</a></span>copyBufferToPage()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::copyBufferToPage </td> <td>(</td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>pageAddress</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Takes 14-35ms. Operation is finished when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">buffer</td><td>Buffer index (0..1) </td></tr> <tr><td class="paramname">pageAddress</td><td>Page address (upper 11-bits of the 19-bit address)</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd></dl> </div> </div> <a id="ad38503382ad8a17ff098bb7cf4aebdb5"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad38503382ad8a17ff098bb7cf4aebdb5">&#9670;&nbsp;</a></span>copyBufferToPageWithoutErase()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::copyBufferToPageWithoutErase </td> <td>(</td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>pageAddress</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This operation is 2-3ms faster than <a class="el" href="classxpcc_1_1_at45db0x1d.html#a86e1772ec815d07f40e62c5f5ceb94f0" title="Write to buffer to a memory page. ">copyBufferToPage()</a> and requires the content of the page to be empty (all 0xff). Despite that it is equal to <a class="el" href="classxpcc_1_1_at45db0x1d.html#a86e1772ec815d07f40e62c5f5ceb94f0" title="Write to buffer to a memory page. ">copyBufferToPage()</a>.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a86e1772ec815d07f40e62c5f5ceb94f0" title="Write to buffer to a memory page. ">copyBufferToPage()</a> </dd></dl> </div> </div> <a id="a7f86fb1f7f87af33b00d34b73bddbdd1"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7f86fb1f7f87af33b00d34b73bddbdd1">&#9670;&nbsp;</a></span>readFromBuffer()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::readFromBuffer </td> <td>(</td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t&#160;</td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t *&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::size_t&#160;</td> <td class="paramname"><em>size</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>When the end of the buffer is reached the address pointer wraps around to the beginning of the buffer.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir"></td><td class="paramname">buffer</td><td>Buffer index (0..1) </td></tr> <tr><td class="paramdir"></td><td class="paramname">address</td><td>Address within the buffer </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Target buffer </td></tr> <tr><td class="paramdir"></td><td class="paramname">size</td><td>Number of bytes to read </td></tr> </table> </dd> </dl> </div> </div> <a id="a0bc3271009ca71b0cfc<KEY>7"></a> <h2 class="memtitle"><span class="permalink"><a href="#a0bc3271009ca71b0cfc43a69a01a3907">&#9670;&nbsp;</a></span>writeToBuffer()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::writeToBuffer </td> <td>(</td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t&#160;</td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const uint8_t *&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::size_t&#160;</td> <td class="paramname"><em>size</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>When the end of the buffer is reached the address pointer wraps around to the beginning of the buffer.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir"></td><td class="paramname">buffer</td><td>Buffer index (0..1) </td></tr> <tr><td class="paramdir"></td><td class="paramname">address</td><td>Address within the buffer </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Target buffer </td></tr> <tr><td class="paramdir"></td><td class="paramname">size</td><td>Number of bytes to write </td></tr> </table> </dd> </dl> </div> </div> <a id="a9fe249bb60d5b8fc6366fb66b2aa4475"></a> <h2 class="memtitle"><span class="permalink"><a href="#a9fe249bb60d5b8fc6366fb66b2aa4475">&#9670;&nbsp;</a></span>readFromMemory()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::readFromMemory </td> <td>(</td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t *&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::size_t&#160;</td> <td class="paramname"><em>size</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir"></td><td class="paramname">address</td><td>19-bit address </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Target buffer </td></tr> <tr><td class="paramdir"></td><td class="paramname">size</td><td>Number of bytes to read </td></tr> </table> </dd> </dl> </div> </div> <a id="a419710cf8aeacc35499bb5466c57103c"></a> <h2 class="memtitle"><span class="permalink"><a href="#a419710cf8aeacc35499bb5466c57103c">&#9670;&nbsp;</a></span>readPageFromMemory()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::readPageFromMemory </td> <td>(</td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint8_t *&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::size_t&#160;</td> <td class="paramname"><em>size</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>When the end of the page is reached the address pointer wraps around to the beginning of the page.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir"></td><td class="paramname">address</td><td>19-bit address (upper 11-bit specify the page, lower 8-bit specify the position inside the page) </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Target buffer </td></tr> <tr><td class="paramdir"></td><td class="paramname">size</td><td>Number of bytes to read </td></tr> </table> </dd> </dl> </div> </div> <a id="ad3493e1c0a3eb13a620bba17b645d413"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad3493e1c0a3eb13a620bba17b645d413">&#9670;&nbsp;</a></span>pageErase()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::pageErase </td> <td>(</td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>pageAddress</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Takes 13-32ms. Operation is finished when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pageAddress</td><td>Page address (upper 11-bits of the 19-bit address) </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd></dl> </div> </div> <a id="ade9aeec62512bef546c33a851ca952f5"></a> <h2 class="memtitle"><span class="permalink"><a href="#ade9aeec62512bef546c33a851ca952f5">&#9670;&nbsp;</a></span>pageRewrite()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::pageRewrite </td> <td>(</td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>pageAddress</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">at45db::Buffer&#160;</td> <td class="paramname"><em>buffer</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Takes 14-35ms. Operation is finished when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>.</p> <p>This operation is a combination of two operations: Main Memory Page to Buffer Transfer and Buffer to Main Memory Page Program with Built-in Erase. A page of data is first transferred from the main memory to buffer 0 or 1, and then the same data (from buffer 0 or 1) is programmed back into its original page of main memory.</p> <p>Each page within a sector must be updated/rewritten at least once within every 10,000 cumulative page erase/program operations in that sector.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pageAddress</td><td>Page address (upper 11-bits of the 19-bit address) </td></tr> <tr><td class="paramname">buffer</td><td>Buffer index (0..1)</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd></dl> </div> </div> <a id="a03c7cfadd8a9c67434e92ceb075ce744"></a> <h2 class="memtitle"><span class="permalink"><a href="#a03c7cfadd8a9c67434e92ceb075ce744">&#9670;&nbsp;</a></span>blockErase()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::blockErase </td> <td>(</td> <td class="paramtype">uint16_t&#160;</td> <td class="paramname"><em>blockAddress</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Takes 30-75ms. Operation is finished when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">blockAddress</td><td>Block address (upper 11-bits of the 19-bit address, from these 11-bits the three lower bits are don't care). </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd></dl> </div> </div> <a id="a5d200bbe89d078f46924dc1b759356ad"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5d200bbe89d078f46924dc1b759356ad">&#9670;&nbsp;</a></span>chipErase()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename Spi , typename Cs &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void <a class="el" href="classxpcc_1_1_at45db0x1d.html">xpcc::At45db0x1d</a>&lt; <a class="el" href="structxpcc_1_1_spi.html">Spi</a>, Cs &gt;::chipErase </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This will take some seconds. Operation is finished when <a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e<KEY>" title="Check if the device is ready for the next operation. ">isReady()</a> returns <code>true</code>.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_at45db0x1d.html#a3d1a242ed966e9393290f3ccd69defc7" title="Check if the device is ready for the next operation. ">isReady()</a> </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>at45db0x1d.hpp</li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespacexpcc.html">xpcc</a></li><li class="navelem"><a class="el" href="classxpcc_1_1_at45db0x1d.html">At45db0x1d</a></li> <li class="footer">Generated on Tue Jun 27 2017 20:03:52 for xpcc by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html> <file_sep>/docs/api/structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.js var structxpcc_1_1_geometric_traits_3_01uint8__t_01_4 = [ [ "FloatType", "structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.html#a1c0da8fa399cd721470c71404b04404f", null ], [ "WideType", "structxpcc_1_1_geometric_traits_3_01uint8__t_01_4.html#a14ea24e8873b505492d5130238fcd4b5", null ] ];<file_sep>/docs/api/group__ui.js var group__ui = [ [ "Button", "classxpcc_1_1_button.html", null ], [ "ButtonGroup", "classxpcc_1_1_button_group.html", [ [ "Identifier", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443", [ [ "NONE", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a2139cda31544d0b80da8f588d3d0a79c", null ], [ "BUTTON0", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443ad08910ad36221c826164908220c33a48", null ], [ "BUTTON1", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a0dc3a3d66507ed667d89a1d33e533156", null ], [ "BUTTON2", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443afc1b8badc7f2ade3f038c83c0d09be3c", null ], [ "BUTTON3", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a33513b77d3f86bf7635367737f00ad23", null ], [ "BUTTON4", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a479e3e7ce77a1c1c6423881d8eac795a", null ], [ "BUTTON5", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a220077f6136cc38fbf86f82568da5480", null ], [ "BUTTON6", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443ad79aa7626e66943e85f6faa141c75b75", null ], [ "BUTTON7", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443adb42beb7d50000bab9e158cafa46e9d0", null ], [ "ALL", "classxpcc_1_1_button_group.html#a5ab6ab92cc1bbb34ee431ec5e85b4443a413bc4f5e448b2bf02a57e138518dd08", null ] ] ], [ "ButtonGroup", "classxpcc_1_1_button_group.html#ae444915a84bf4d45abaa915450273703", null ], [ "getState", "classxpcc_1_1_button_group.html#aa3cef6ff7d391454d8dfb628a0ef58fa", null ], [ "isReleased", "classxpcc_1_1_button_group.html#a543afb9661099587cbd62104958d5a1d", null ], [ "isPressed", "classxpcc_1_1_button_group.html#a650056c1955240d1785c3581176444e9", null ], [ "isRepeated", "classxpcc_1_1_button_group.html#a43f5b54a271461e2329755a8d2b9aeeb", null ], [ "isPressedShort", "classxpcc_1_1_button_group.html#a47643a4d831e193be47b4bd52280a72e", null ], [ "isPressedLong", "classxpcc_1_1_button_group.html#ac627e9ed0df16256bca2bacff57146ef", null ], [ "update", "classxpcc_1_1_button_group.html#ab5442ca6572d259525ce9f7de31f7ac1", null ], [ "timeout", "classxpcc_1_1_button_group.html#af2d47cca97ecbb0d40b463fa405631f6", null ], [ "interval", "classxpcc_1_1_button_group.html#adafb23682a9fa77ece5adf1200bf8cdf", null ], [ "repeatMask", "classxpcc_1_1_button_group.html#a8e1bbec435f7ccc245382533302255a5", null ], [ "repeatCounter", "classxpcc_1_1_button_group.html#a4df673cfc086c4d149ab57f867e8b52d", null ], [ "state", "classxpcc_1_1_button_group.html#a7d37e81e07826d5b112eb3f1a5cd70e1", null ], [ "pressState", "classxpcc_1_1_button_group.html#aa9b8544d7314ad738386a4772876b48f", null ], [ "releaseState", "classxpcc_1_1_button_group.html#a8522cd5724ac3a84ed3d601c64ae3f57", null ], [ "repeatState", "classxpcc_1_1_button_group.html#a26e6f526b30888d92e8c0584916bae18", null ] ] ], [ "UnixTime", "classxpcc_1_1_unix_time.html", [ [ "UnixTime", "classxpcc_1_1_unix_time.html#aa4fdc5faff748e7c20515fb9ead9f17c", null ], [ "operator uint32_t", "classxpcc_1_1_unix_time.html#ab0b513855a7c3cf02c59e7481eec45fe", null ], [ "toDate", "classxpcc_1_1_unix_time.html#a77b77725d8cf9d86af36f1cfd2933e45", null ] ] ], [ "Date", "classxpcc_1_1_date.html", [ [ "toUnixTimestamp", "classxpcc_1_1_date.html#af7b4cfdc4534fbd9b69843b7d63d193f", null ], [ "second", "classxpcc_1_1_date.html#a7a5cf60c1964ed80db860fb31de0d228", null ], [ "minute", "classxpcc_1_1_date.html#ab7fe455ab93917a403b6ae6b9cbd6804", null ], [ "hour", "classxpcc_1_1_date.html#a4b39cc587f72a772b8aa03a269783d1d", null ], [ "day", "classxpcc_1_1_date.html#aea31871fca3acd678fd9c49ad4a6039f", null ], [ "month", "classxpcc_1_1_date.html#aa8e96e3a7eb20fb3f572fbd1279a5d62", null ], [ "year", "classxpcc_1_1_date.html#a4386667477b13897edae5cb498f3a084", null ], [ "dayOfTheWeek", "classxpcc_1_1_date.html#ad936b70a10c10e94b7444f35acd3f31a", null ], [ "dayOfTheYear", "classxpcc_1_1_date.html#a3e8fd18760f0f34f4dd79b0582477fd0", null ] ] ], [ "Animators", "group__animation.html", "group__animation" ], [ "Graphics", "group__graphics.html", "group__graphics" ], [ "Graphical User Interface", "group__gui.html", "group__gui" ], [ "LED Indicators", "group__led.html", "group__led" ], [ "Display Menu", "group__display__menu.html", "group__display__menu" ] ];<file_sep>/docs/api/classxpcc_1_1_siemens_s65_portrait.js var classxpcc_1_1_siemens_s65_portrait = [ [ "initialize", "classxpcc_1_1_siemens_s65_portrait.html#ad02a1bbc374a884be3f07f5195d0fb0a", null ], [ "update", "classxpcc_1_1_siemens_s65_portrait.html#a97b39c0ca53c5f70f13f580cf30a9680", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_uart_spi_master1.js var classxpcc_1_1stm32_1_1_uart_spi_master1 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1ab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ];<file_sep>/xpcc_doxygen.sh #!/usr/bin/env sh rm -r xpcc/build # build ATtiny85 (cd xpcc/examples/avr/gpio/basic/ && scons) # build ATmega328p (cd xpcc/examples/avr/gpio/blinking/ && scons) # build the STM32F407 (cd xpcc/examples/stm32f4_discovery/blink/ && scons) # build the documenation (cd xpcc && scons doc) # copy the xpcc doc to the right place cp -r xpcc/doc/build/api docs/ <file_sep>/docs/api/classxpcc_1_1_vector_3_01_t_00_011_01_4.js var classxpcc_1_1_vector_3_01_t_00_011_01_4 = [ [ "Vector", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ac04de08e06b877202ed22825e0b374ee", null ], [ "Vector", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a57508c53b09279ad9b59f5fa817333b8", null ], [ "Vector", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a8c6e057ffbf2d0b45765307b9648fc1b", null ], [ "Vector", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a709a5723dde4cc93be40f2047c24e32b", null ], [ "set", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a04ce8f9efe56318642d8dad2007132df", null ], [ "setX", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a33bd6bafb85cd974adb72cdd66c4c861", null ], [ "getX", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#acc0cd9401a72c557ba969d484c811135", null ], [ "operator=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ae968ad1d778a3b16c7dd3489a2c99ebf", null ], [ "operator=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a00a5808620ce82643427788b8d63a7d7", null ], [ "operator==", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a78025bf8463ff5117f6f5a9d11182c5b", null ], [ "operator!=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a9de1ddc37d3f92c7b23248b467fab68b", null ], [ "operator<", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a5f35204115390e86afeb0d9e4807659c", null ], [ "operator<=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a68b8b7242b3ff5b6b8b4bede3e8b9bf5", null ], [ "operator>", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#af633571d74776974a8cb5d3f51081d31", null ], [ "operator>=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#aa4ca81a9dc1463ea5fd126f28d4a0508", null ], [ "operator[]", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a90a4062a0cfec50142020b9cb7e556af", null ], [ "operator[]", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a9f7629896fcc49dc78fccdd8998623da", null ], [ "ptr", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a1e35758918b120913c141cfb67ab92e4", null ], [ "ptr", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ae111732dfb5f45390d399a7d95eabb6c", null ], [ "operator-", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#aa90300c6aa98b6ee9fe594dfca554776", null ], [ "operator+", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#acd83905490d346c374a07caea9eb33ab", null ], [ "operator-", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a7308eafa567442df8e5fe035af797f29", null ], [ "operator*", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a90deb4d66968c800447170802fd2309c", null ], [ "operator*", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a3cc800cbe3b4f6acc59b7ec97b386116", null ], [ "operator/", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a59ddb63b0cd8b7e8a00b95c7fb9ab0fc", null ], [ "operator+=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ac271089824a353d9ca3ae6274f5ef72a", null ], [ "operator-=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a6d43a04e21b8d39ca3861e3155f20bb1", null ], [ "operator*=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#adeb24a3d6097212b35bb9a430f0c490f", null ], [ "operator/=", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a003d4d3ea4d8aadb7c75c0fd9ba900db", null ], [ "getLength", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a36d8c94780411881b2f1d063768840b1", null ], [ "getLengthSquared", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a9b732f6ba6b89f0b083f9f0fb26c7f8e", null ], [ "asMatrix", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#abc092edeafe183cd0e450b8ab6bb45b9", null ], [ "asMatrix", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a90906abf13d08196e8c45fe8c3fcccbd", null ], [ "hasNan", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a76858f6864d707ebefa3bd9395222b06", null ], [ "hasInf", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#aed58afd6e5ed09a9bf122063b09f62ab", null ], [ "x", "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a0d195997c18b32cccd77b442fcf9acbe", null ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_filled_area_button.js var classxpcc_1_1gui_1_1_filled_area_button = [ [ "FilledAreaButton", "classxpcc_1_1gui_1_1_filled_area_button.html#aabc9db2b214d3df4ab92372993d158e2", null ], [ "setBackgroundColor", "classxpcc_1_1gui_1_1_filled_area_button.html#aaba824beb7290eb26fdd5b92ebccf15d", null ], [ "render", "classxpcc_1_1gui_1_1_filled_area_button.html#a290fb12f8712a61f6edc539393f19678", null ] ];<file_sep>/docs/api/classxpcc_1_1_vl6180.js var classxpcc_1_1_vl6180 = [ [ "Vl6180", "classxpcc_1_1_vl6180.html#a50252a5cfdda3f6d5fe703a8b5f3b3d7", null ], [ "ping", "classxpcc_1_1_vl6180.html#a7c8597829fc80232846aa75553c27cf3", null ], [ "initialize", "classxpcc_1_1_vl6180.html#a118c595804903888754f24575c2f8b39", null ], [ "setDeviceAddress", "classxpcc_1_1_vl6180.html#a520a59a2d7d7d4e8332f0afd15309bf3", null ], [ "setGain", "classxpcc_1_1_vl6180.html#a8e1f25d95eefd1583885118fd83f8206", null ], [ "setIntegrationTime", "classxpcc_1_1_vl6180.html#a2b77bcdf2f878325cf7fb4f543f37b6c", null ], [ "readDistance", "classxpcc_1_1_vl6180.html#a6cbaa740d7046de158364d6a3e9575c6", null ], [ "readAmbientLight", "classxpcc_1_1_vl6180.html#a5d7a734a6b7d5c8a4da7857be7e1a052", null ], [ "getRangeError", "classxpcc_1_1_vl6180.html#a71b56e4b8bb3059ef74a4ece8e766d9e", null ], [ "getALS_Error", "classxpcc_1_1_vl6180.html#a7a5daebdce51bd6f2a3e3e27dcc4b960", null ], [ "updateRegister", "classxpcc_1_1_vl6180.html#a3c9a55742fe6b19676397ebb367da379", null ], [ "write", "classxpcc_1_1_vl6180.html#ac377545c8032f1480acf0401e8955927", null ], [ "getData", "classxpcc_1_1_vl6180.html#ac656029ca190e42b844fdaf91b0ab17b", null ], [ "read", "classxpcc_1_1_vl6180.html#a86e8c0d2eec0c00984017e093a092c46", null ] ];<file_sep>/docs/api/classxpcc_1_1cortex_1_1_core.js var classxpcc_1_1cortex_1_1_core = [ [ "getUniqueId", "classxpcc_1_1cortex_1_1_core.html#a6a2ea1094bb50f163fd908492cabd9cd", null ] ];<file_sep>/docs/api/search/variables_e.js var searchData= [ ['scriptonarrow',['ScriptoNarrow',['../group__font.html#ga6b8dfc4d1ff6621fbe286b0139bcdf3f',1,'xpcc::font']]], ['second',['second',['../classxpcc_1_1_date.html#a7a5cf60c1964ed80db860fb31de0d228',1,'xpcc::Date']]], ['skull_5f64x64',['skull_64x64',['../group__image.html#ga4342e056d63af20a8bede6b5dd1698d9',1,'bitmap']]], ['state',['state',['../classxpcc_1_1_button_group.html#a7d37e81e07826d5b112eb3f1a5cd70e1',1,'xpcc::ButtonGroup']]], ['systemclock',['SystemClock',['../classxpcc_1_1stm32_1_1_stm32_f3_pll_settings.html#af203d3ffda2b223bf52ef1ca00e17491',1,'xpcc::stm32::Stm32F3PllSettings::SystemClock()'],['../classxpcc_1_1stm32_1_1_stm32_f100_pll_settings.html#a00059f10eaa5fde8463ed1a7fe117877',1,'xpcc::stm32::Stm32F100PllSettings::SystemClock()']]] ]; <file_sep>/docs/api/group__amnb.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>xpcc: Asynchronous Multi-Node Bus (AMNB)</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">xpcc </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__amnb.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#define-members">Macros</a> &#124; <a href="#enum-members">Enumerations</a> &#124; <a href="#var-members">Variables</a> </div> <div class="headertitle"> <div class="title">Asynchronous Multi-Node Bus (AMNB)<div class="ingroups"><a class="el" href="group__communication.html">Communication</a></div></div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1amnb_1_1_interface.html">xpcc::amnb::Interface&lt; Device, PROBABILITY, TIMEOUT &gt;</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">AMNB interface. <a href="classxpcc_1_1amnb_1_1_interface.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1amnb_1_1_response.html">xpcc::amnb::Response</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classxpcc_1_1amnb_1_1_response.html" title="Response object for an action call. ">Response</a> object for an action call. <a href="classxpcc_1_1amnb_1_1_response.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:structxpcc_1_1amnb_1_1_callable"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#structxpcc_1_1amnb_1_1_callable">xpcc::amnb::Callable</a></td></tr> <tr class="memdesc:structxpcc_1_1amnb_1_1_callable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Base-class for every object which should be used inside a callback. <a href="group__amnb.html#structxpcc_1_1amnb_1_1_callable">More...</a><br /></td></tr> <tr class="separator:structxpcc_1_1amnb_1_1_callable"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structxpcc_1_1amnb_1_1_action.html">xpcc::amnb::Action</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible <a class="el" href="structxpcc_1_1amnb_1_1_action.html" title="Possible Action. ">Action</a>. <a href="structxpcc_1_1amnb_1_1_action.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structxpcc_1_1amnb_1_1_listener.html">xpcc::amnb::Listener</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible <a class="el" href="structxpcc_1_1amnb_1_1_listener.html" title="Possible Listener. ">Listener</a>. <a href="structxpcc_1_1amnb_1_1_listener.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structxpcc_1_1amnb_1_1_error_handler.html">xpcc::amnb::ErrorHandler</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible Error. <a href="structxpcc_1_1amnb_1_1_error_handler.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1amnb_1_1_node.html">xpcc::amnb::Node&lt; Interface &gt;</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">AMNB <a class="el" href="classxpcc_1_1amnb_1_1_node.html" title="AMNB Node. ">Node</a>. <a href="classxpcc_1_1amnb_1_1_node.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga5ba1d96e88ef2e3189fc07af8f758a94"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#ga5ba1d96e88ef2e3189fc07af8f758a94">AMNB__ACTION</a>(command, object, function, length)</td></tr> <tr class="memdesc:ga5ba1d96e88ef2e3189fc07af8f758a94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a amnb::Action. <a href="#ga5ba1d96e88ef2e3189fc07af8f758a94">More...</a><br /></td></tr> <tr class="separator:ga5ba1d96e88ef2e3189fc07af8f758a94"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac9e174dbfa0dff218a593e63321d0cce"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#gac9e174dbfa0dff218a593e63321d0cce">AMNB__LISTEN</a>(address, command, object, function)</td></tr> <tr class="memdesc:gac9e174dbfa0dff218a593e63321d0cce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a amnb::Listener. <a href="#gac9e174dbfa0dff218a593e63321d0cce">More...</a><br /></td></tr> <tr class="separator:gac9e174dbfa0dff218a593e63321d0cce"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac462596130c1e5f05fffe34773311e1c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#gac462596130c1e5f05fffe34773311e1c">AMNB__ERROR</a>(address, command, object, function)</td></tr> <tr class="memdesc:gac462596130c1e5f05fffe34773311e1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a amnb::ErrorHandler. <a href="#gac462596130c1e5f05fffe34773311e1c">More...</a><br /></td></tr> <tr class="separator:gac462596130c1e5f05fffe34773311e1c"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> Enumerations</h2></td></tr> <tr class="memitem:gac3b87049713c290d3ae496621d7536b4"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#gac3b87049713c290d3ae496621d7536b4">xpcc::amnb::Error</a> { <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a1edbc2c629ffee54b54e3912008e11b8">xpcc::amnb::ERROR__GENERAL_ERROR</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a89948133759c53ab5adfdcfe85a6b4e5">xpcc::amnb::ERROR__ACTION_NO_ACTION</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a1824225512dd1f2e8a9eee28c5cb5d43">xpcc::amnb::ERROR__ACTION_WRONG_PAYLOAD_LENGTH</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4abeb9e2bbad9cd0ef4ce44e458ac385b6">xpcc::amnb::ERROR__ACTION_NO_RESPONSE</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a85d1cf4cd479920b731f7dc0910063b0">xpcc::amnb::ERROR__QUERY_ERROR_CODE</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a44e3f625c1b45df1f34a6a7467446ace">xpcc::amnb::ERROR__QUERY_TIMEOUT</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a2e2f363220d35e24db2d5088b9d6162b">xpcc::amnb::ERROR__QUERY_WRONG_PAYLOAD_LENGTH</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a78a185247b3245f0447bbb6827217977">xpcc::amnb::ERROR__QUERY_IN_PROGRESS</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a3dc022d1e4841591305f620e3d100369">xpcc::amnb::ERROR__TRANSMITTER_BUSY</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#ggac3b87049713c290d3ae496621d7536b4a16a7c6c7b1e5302990dfb5b3ae529c6f">xpcc::amnb::ERROR__MESSAGE_OVERWRITTEN</a> <br /> }<tr class="memdesc:gac3b87049713c290d3ae496621d7536b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error code. <a href="group__amnb.html#gac3b87049713c290d3ae496621d7536b4">More...</a><br /></td></tr> </td></tr> <tr class="separator:gac3b87049713c290d3ae496621d7536b4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9d51acabbd29c61b9931e2ebae600686"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#ga9d51acabbd29c61b9931e2ebae600686">xpcc::amnb::Flags</a> { <br /> &#160;&#160;<a class="el" href="group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686a1ad0dc82868c547f4ceb989b4b104f8c">xpcc::amnb::BROADCAST</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686abc0cc523493221a5252ba5158ad1eb49">xpcc::amnb::REQUEST</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686a3d15367875437d4704134aa896c09547">xpcc::amnb::NACK</a>, <br /> &#160;&#160;<a class="el" href="group__amnb.html#gga9d51acabbd29c61b9931e2ebae600686a0854ac17d8dcb980a1218b1fccad5269">xpcc::amnb::ACK</a> <br /> }<tr class="memdesc:ga9d51acabbd29c61b9931e2ebae600686"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags. <a href="group__amnb.html#ga9d51acabbd29c61b9931e2ebae600686">More...</a><br /></td></tr> </td></tr> <tr class="separator:ga9d51acabbd29c61b9931e2ebae600686"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> Variables</h2></td></tr> <tr class="memitem:ga3373b80bb1a758b8821487802750735d"><td class="memItemLeft" align="right" valign="top"><a id="ga3373b80bb1a758b8821487802750735d"></a> const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__amnb.html#ga3373b80bb1a758b8821487802750735d">xpcc::amnb::maxPayloadLength</a></td></tr> <tr class="memdesc:ga3373b80bb1a758b8821487802750735d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum length for the payload. <br /></td></tr> <tr class="separator:ga3373b80bb1a758b8821487802750735d"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <h1><a class="anchor" id="amnb_intro"></a> Introduction</h1> <p>The AMNB (**A**synchronous **M**ulti-**N**ode **B**us) is a multi-master bus system, using p-persitent CSMA to send messages.</p> <p>One bus can be populated with up to 64 nodes. The nodes can be queried for data and they will respond like an SAB Slave, and can query data from other nodes like an SAB Master, or they can just broadcast a message. Each node can listen to all the responses and broadcasts and store that information for its purpose.</p> <p>Action callbacks to query requests can be defined as well as universal callbacks to any transmitted messaged (Listener callbacks). As an optional advanced feature, error handling callbacks can also be defined, which fire if messages have not been able to be sent, or requests timed out or misbehaved in other manners, or other nodes query unavailable information.</p> <h1><a class="anchor" id="amnb_protocol"></a> Protocol</h1> <p>Features:</p><ul> <li>Maximum payload length is 32 byte.</li> <li>CRC8 (1-Wire)</li> </ul> <h2><a class="anchor" id="structure"></a> Structure</h2> <pre class="fragment">+------+--------+--------+---------+--------------+-----+ | SYNC | LENGTH | HEADER | COMMAND | ... DATA ... | CRC | +------+--------+--------+---------+--------------+-----+ </pre><ul> <li><code>SYNC</code> - Synchronization byte (always 0x54)</li> <li><code>LENGTH</code> - Length of the payload (without header, command and CRC byte)</li> <li><code>HEADER</code> - Address of the slave and two flag bits</li> <li><code>COMMAND</code> - Command code</li> <li><code>DATA</code> - Up to 32 byte of payload</li> <li><code>CRC</code> - CRC-8 checksum (iButton)</li> </ul> <h3><a class="anchor" id="header"></a> Header</h3> <pre class="fragment"> 7 6 5 4 3 2 1 0 +---+---+---+---+---+---+---+---+ | Flags | ADDRESS | +---+---+---+---+---+---+---+---+ Flags | Meaning --------+--------- 0 0 | data broadcast by a node 0 1 | data request by a node 1 0 | negative response from the node (NACK) 1 1 | positive response from the node (ACK) </pre><p>When transmitting, the <em>second bit</em> determines, whether or not to expect an answer from the addressed node. To just send information without any need for acknowledgment, use a broadcast. When a node is responding, the <em>second bit</em> has to following meaning:</p> <ul> <li><code>true</code> - Message is an positive response and may contain a payload</li> <li><code>false</code> - Message signals an error condition and carries only one byte of payload. This byte is an error code.</li> </ul> <h1><a class="anchor" id="amnb_electric"></a> Electrical characteristics</h1> <p>Between different boards CAN transceivers are used. Compared to RS485 the CAN transceivers have the advantage to work without a separate direction input. You can just connected the transceiver directly to the UART of your microcontroller. These are identical to the SAB CAN electrical characteristics. You have to use the CAN transceivers, otherwise it cannot be determined, if the bus is busy or available for transmission.</p> <dl class="section author"><dt>Author</dt><dd><NAME> </dd> <dd> <NAME> </dd></dl> <hr/><h2 class="groupheader">Class Documentation</h2> <a name="structxpcc_1_1amnb_1_1_callable" id="structxpcc_1_1amnb_1_1_callable"></a> <h2 class="memtitle"><span class="permalink"><a href="#structxpcc_1_1amnb_1_1_callable">&#9670;&nbsp;</a></span>xpcc::amnb::Callable</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct xpcc::amnb::Callable</td> </tr> </table> </div><div class="memdoc"> <div class="textblock"><p>Example: </p><div class="fragment"><div class="line"><span class="keyword">class </span>Sensor : <span class="keyword">public</span> <a class="code" href="group__amnb.html#structxpcc_1_1amnb_1_1_callable">xpcc::amnb::Callable</a></div><div class="line">{</div><div class="line"><span class="keyword">public</span>:</div><div class="line"> <span class="keywordtype">void</span></div><div class="line"> sendValue(<a class="code" href="classxpcc_1_1amnb_1_1_response.html">xpcc::amnb::Response</a>&amp; response)</div><div class="line"> {</div><div class="line"> response.<a class="code" href="classxpcc_1_1amnb_1_1_response.html#abf40a63a7c5d8c3f853cdc705ddee3de">send</a>(this-&gt;value);</div><div class="line"> }</div><div class="line"> </div><div class="line"> <span class="comment">// ...</span></div><div class="line"> </div><div class="line"><span class="keyword">private</span>:</div><div class="line"> int8_t value;</div><div class="line">};</div></div><!-- fragment --><p>A complete example is available in the <code>example/amnb</code> folder.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1amnb_1_1_node.html" title="AMNB Node. ">xpcc::amnb::Node</a> </dd></dl> </div> </div> </div> <h2 class="groupheader">Macro Definition Documentation</h2> <a id="ga5ba1d96e88ef2e3189fc07af8f758a94"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga5ba1d96e88ef2e3189fc07af8f758a94">&#9670;&nbsp;</a></span>AMNB__ACTION</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define AMNB__ACTION</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">command, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">object, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">function, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">length&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Example: </p><div class="fragment"><div class="line"><span class="keyword">class </span>Sensor : <span class="keyword">public</span> <a class="code" href="group__amnb.html#structxpcc_1_1amnb_1_1_callable">xpcc::amnb::Callable</a></div><div class="line">{</div><div class="line"><span class="keyword">public</span>:</div><div class="line"> <span class="keywordtype">void</span></div><div class="line"> sendValue(<a class="code" href="classxpcc_1_1amnb_1_1_response.html">xpcc::amnb::Response</a>&amp; response)</div><div class="line"> {</div><div class="line"> response.<a class="code" href="classxpcc_1_1amnb_1_1_response.html#abf40a63a7c5d8c3f853cdc705ddee3de">send</a>(this-&gt;value);</div><div class="line"> }</div><div class="line"> </div><div class="line"> <span class="keywordtype">void</span></div><div class="line"> doSomething(<a class="code" href="classxpcc_1_1amnb_1_1_response.html">xpcc::amnb::Response</a>&amp; response, <span class="keyword">const</span> uint32_t* parameter)</div><div class="line"> {</div><div class="line"> <span class="comment">// ... do something useful ...</span></div><div class="line"> </div><div class="line"> response.<a class="code" href="classxpcc_1_1amnb_1_1_response.html#abf40a63a7c5d8c3f853cdc705ddee3de">send</a>();</div><div class="line"> }</div><div class="line"> </div><div class="line"> <span class="comment">// ...</span></div><div class="line"> </div><div class="line"><span class="keyword">private</span>:</div><div class="line"> int8_t value;</div><div class="line">};</div><div class="line"></div><div class="line">Sensor sensor;</div><div class="line"></div><div class="line"><a class="code" href="group__accessor.html#ga71c8fdec33b7ac78b2f56e4ca3ccfc9f">FLASH_STORAGE</a>(<a class="code" href="structxpcc_1_1amnb_1_1_action.html">xpcc::amnb::Action</a> actionList[]) =</div><div class="line">{</div><div class="line"> <a class="code" href="group__amnb.html#ga5ba1d96e88ef2e3189fc07af8f758a94">AMNB__ACTION</a>(0x57, sensor, Sensor::sendValue, 0),</div><div class="line"> <a class="code" href="group__amnb.html#ga5ba1d96e88ef2e3189fc07af8f758a94">AMNB__ACTION</a>(0x03, sensor, Sensor::doSomething, <span class="keyword">sizeof</span>(uint32_t)),</div><div class="line">};</div></div><!-- fragment --><p>A complete example is available in the <code>example/amnb</code> folder.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">command</td><td>Command byte </td></tr> <tr><td class="paramname">object</td><td></td></tr> <tr><td class="paramname">function</td><td>Member function of object </td></tr> <tr><td class="paramname">length</td><td>Parameter size in bytes</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="structxpcc_1_1amnb_1_1_action.html" title="Possible Action. ">xpcc::amnb::Action</a> </dd></dl> </div> </div> <a id="gac9e174dbfa0dff218a593e63321d0cce"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac9e174dbfa0dff218a593e63321d0cce">&#9670;&nbsp;</a></span>AMNB__LISTEN</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define AMNB__LISTEN</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">address, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">command, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">object, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">function&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Example: </p><div class="fragment"><div class="line"><span class="keyword">class </span>ListenToNodes : <span class="keyword">public</span> <a class="code" href="group__amnb.html#structxpcc_1_1amnb_1_1_callable">xpcc::amnb::Callable</a></div><div class="line">{</div><div class="line"><span class="keyword">public</span>:</div><div class="line"> <span class="keywordtype">void</span></div><div class="line"> listenToCommand(uint8_t *payload, <span class="keyword">const</span> uint8_t length, uint8_t sender)</div><div class="line"> {</div><div class="line"> <span class="comment">// ... do something useful ...</span></div><div class="line"> </div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="keywordtype">void</span></div><div class="line"> listenToCommandWithOutCaringForSender(uint8_t *payload, <span class="keyword">const</span> uint8_t length)</div><div class="line"> {</div><div class="line"> <span class="comment">// ... do something useful ...</span></div><div class="line"> </div><div class="line"> }</div><div class="line"> </div><div class="line"> <span class="comment">// ...</span></div><div class="line">};</div><div class="line"></div><div class="line">ListenToNodes listen;</div><div class="line"></div><div class="line"><a class="code" href="group__accessor.html#ga71c8fdec33b7ac78b2f56e4ca3ccfc9f">FLASH_STORAGE</a>(<a class="code" href="structxpcc_1_1amnb_1_1_listener.html">xpcc::amnb::Listener</a> listenList[]) =</div><div class="line">{</div><div class="line"> <a class="code" href="group__amnb.html#gac9e174dbfa0dff218a593e63321d0cce">AMNB__LISTEN</a>(0x46, 0x03, listen, ListenToNodes::listenToCommand),</div><div class="line">};</div></div><!-- fragment --><p>A complete example is available in the <code>example/amnb</code> folder.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">address</td><td>Address of the transmitting node </td></tr> <tr><td class="paramname">command</td><td>Command byte </td></tr> <tr><td class="paramname">object</td><td></td></tr> <tr><td class="paramname">function</td><td>Member function of object</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="structxpcc_1_1amnb_1_1_listener.html" title="Possible Listener. ">xpcc::amnb::Listener</a> </dd></dl> </div> </div> <a id="gac462596130c1e5f05fffe34773311e1c"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac462596130c1e5f05fffe34773311e1c">&#9670;&nbsp;</a></span>AMNB__ERROR</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define AMNB__ERROR</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">address, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">command, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">object, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">function&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Example: </p><div class="fragment"><div class="line"><span class="keyword">class </span>handleErrors : <span class="keyword">public</span> <a class="code" href="group__amnb.html#structxpcc_1_1amnb_1_1_callable">xpcc::amnb::Callable</a></div><div class="line">{</div><div class="line"><span class="keyword">public</span>:</div><div class="line"> <span class="keywordtype">void</span></div><div class="line"> errorForCommand(<a class="code" href="group__amnb.html#ga9d51acabbd29c61b9931e2ebae600686">xpcc::amnb::Flags</a> type, <span class="keyword">const</span> uint8_t errorCode)</div><div class="line"> {</div><div class="line"> <span class="comment">// ... do something useful with that information ...</span></div><div class="line"> </div><div class="line"> }</div><div class="line"> </div><div class="line"> <span class="comment">// ...</span></div><div class="line">};</div><div class="line"></div><div class="line">handleErrors errorhandler;</div><div class="line"></div><div class="line"><a class="code" href="group__accessor.html#ga71c8fdec33b7ac78b2f56e4ca3ccfc9f">FLASH_STORAGE</a>(<a class="code" href="structxpcc_1_1amnb_1_1_listener.html">xpcc::amnb::Listener</a> listenList[]) =</div><div class="line">{</div><div class="line"> <a class="code" href="group__amnb.html#gac9e174dbfa0dff218a593e63321d0cce">AMNB__LISTEN</a>(0x37, 0x57, errorhandler, handleErrors::errorForCommand),</div><div class="line">};</div></div><!-- fragment --><p>A complete example is available in the <code>example/amnb</code> folder.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">address</td><td>Node address of message </td></tr> <tr><td class="paramname">command</td><td>Command of message </td></tr> <tr><td class="paramname">object</td><td></td></tr> <tr><td class="paramname">function</td><td>Member function of object</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="structxpcc_1_1amnb_1_1_error_handler.html" title="Possible Error. ">xpcc::amnb::ErrorHandler</a> </dd></dl> </div> </div> <h2 class="groupheader">Enumeration Type Documentation</h2> <a id="gac3b87049713c290d3ae496621d7536b4"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac3b87049713c290d3ae496621d7536b4">&#9670;&nbsp;</a></span>Error</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__amnb.html#gac3b87049713c290d3ae496621d7536b4">xpcc::amnb::Error</a></td> </tr> </table> </div><div class="memdoc"> <p>Error codes below 0x20 are reserved for the system. Every other code may be used by user. </p> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a1edbc2c629ffee54b54e3912008e11b8"></a>ERROR__GENERAL_ERROR&#160;</td><td class="fielddoc"><p>Universal error code. </p> <p>Use this code if you're not sure what error to signal. If the user should react to the error code, create a specific one for the given problem. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a89948133759c53ab5adfdcfe85a6b4e5"></a>ERROR__ACTION_NO_ACTION&#160;</td><td class="fielddoc"><p>No corresponding action found for this command. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a1824225512dd1f2e8a9eee28c5cb5d43"></a>ERROR__ACTION_WRONG_PAYLOAD_LENGTH&#160;</td><td class="fielddoc"><p>Unexpected payload length. </p> <p>The payload length of the received message differs from the expected length for the given command. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4abeb9e2bbad9cd0ef4ce44e458ac385b6"></a>ERROR__ACTION_NO_RESPONSE&#160;</td><td class="fielddoc"><p>No response given by the user. </p> <p>This error code is generated when no response method is called by the user during an action callback. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a85d1cf4cd479920b731f7dc0910063b0"></a>ERROR__QUERY_ERROR_CODE&#160;</td><td class="fielddoc"><p>Query answer contains an more detailed error code. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a44e3f625c1b45df1f34a6a7467446ace"></a>ERROR__QUERY_TIMEOUT&#160;</td><td class="fielddoc"><p>Query timed out. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a2e2f363220d35e24db2d5088b9d6162b"></a>ERROR__QUERY_WRONG_PAYLOAD_LENGTH&#160;</td><td class="fielddoc"><p>Query answer has wrong payload length. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a78a185247b3245f0447bbb6827217977"></a>ERROR__QUERY_IN_PROGRESS&#160;</td><td class="fielddoc"><p>Query is already in progress. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a3dc022d1e4841591305f620e3d100369"></a>ERROR__TRANSMITTER_BUSY&#160;</td><td class="fielddoc"><p><a class="el" href="classxpcc_1_1amnb_1_1_interface.html" title="AMNB interface. ">Interface</a> is currently transmitting. </p> </td></tr> <tr><td class="fieldname"><a id="ggac3b87049713c290d3ae496621d7536b4a16a7c6c7b1e5302990dfb5b3ae529c6f"></a>ERROR__MESSAGE_OVERWRITTEN&#160;</td><td class="fielddoc"><p>Another message will be transmitted before this one. </p> </td></tr> </table> </div> </div> <a id="ga9d51acabbd29c61b9931e2ebae600686"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga9d51acabbd29c61b9931e2ebae600686">&#9670;&nbsp;</a></span>Flags</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__amnb.html#ga9d51acabbd29c61b9931e2ebae600686">xpcc::amnb::Flags</a></td> </tr> </table> </div><div class="memdoc"> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga9d51acabbd29c61b9931e2ebae600686a1ad0dc82868c547f4ceb989b4b104f8c"></a>BROADCAST&#160;</td><td class="fielddoc"><p>send a message without getting a response </p> </td></tr> <tr><td class="fieldname"><a id="gga9d51acabbd29c61b9931e2ebae600686abc0cc523493221a5252ba5158ad1eb49"></a>REQUEST&#160;</td><td class="fielddoc"><p>request data from a node </p> </td></tr> <tr><td class="fieldname"><a id="gga9d51acabbd29c61b9931e2ebae600686a3d15367875437d4704134aa896c09547"></a>NACK&#160;</td><td class="fielddoc"><p>data request Negative ACKnowledge </p> </td></tr> <tr><td class="fieldname"><a id="gga9d51acabbd29c61b9931e2ebae600686a0854ac17d8dcb980a1218b1fccad5269"></a>ACK&#160;</td><td class="fielddoc"><p>data request positive ACKnowledge </p> </td></tr> </table> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Tue Jun 27 2017 20:03:52 for xpcc by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html> <file_sep>/docs/api/classxpcc_1_1_ssd1306.js var classxpcc_1_1_ssd1306 = [ [ "Ssd1306", "classxpcc_1_1_ssd1306.html#a5113e400aa2ef0596b753aa7c27b106d", null ], [ "pingBlocking", "classxpcc_1_1_ssd1306.html#aac4a43f45c9f3b46ab23faa6e02b461c", null ], [ "initializeBlocking", "classxpcc_1_1_ssd1306.html#aad88a6a7a16c90877336d937abbe36e3", null ], [ "update", "classxpcc_1_1_ssd1306.html#a8269dd957a47c4074e7cc269482bc05b", null ], [ "isWritable", "classxpcc_1_1_ssd1306.html#a511493c4b9034faee348f7b0668f7305", null ], [ "initialize", "classxpcc_1_1_ssd1306.html#aedd344c38942fa6196543877510cf6e9", null ], [ "writeDisplay", "classxpcc_1_1_ssd1306.html#aad724b286946e4c2aca609c97e6bb072", null ], [ "setDisplayMode", "classxpcc_1_1_ssd1306.html#ad169e6b81a4f50cf147a3ce663a45905", null ], [ "setContrast", "classxpcc_1_1_ssd1306.html#a112a648be1028442cf6422b0f8e704d3", null ], [ "setRotation", "classxpcc_1_1_ssd1306.html#ac53b8c13ebb2396c43aa82f8602b09c5", null ], [ "configureScroll", "classxpcc_1_1_ssd1306.html#a209523e37c1581f0bb034b7b245dcd61", null ], [ "enableScroll", "classxpcc_1_1_ssd1306.html#ac4e5fd6baadac023e541a4be7f5214f1", null ], [ "disableScroll", "classxpcc_1_1_ssd1306.html#a81c030614399b137f166a771c0d764a8", null ], [ "writeCommand", "classxpcc_1_1_ssd1306.html#a20cf7a2d9d70ce69796c44fa62c2849b", null ], [ "writeCommand", "classxpcc_1_1_ssd1306.html#ad77b2420be2c98de459756e9c13c7402", null ], [ "writeCommand", "classxpcc_1_1_ssd1306.html#a8f3474c236f85b2401fa23f15b344c83", null ] ];<file_sep>/docs/api/classxpcc_1_1_dynamic_array_1_1const__iterator.js var classxpcc_1_1_dynamic_array_1_1const__iterator = [ [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a2810a2e16dd9b883afa886106823e745", null ], [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6799ad652564e60de4186e4043e8427b", null ], [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a4249f236733b9b5a3fa536e65350f2b4", null ], [ "operator=", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#aac0168e17ffccbb418678850c4d5b438", null ], [ "operator++", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#aca58b806e31739394fa077e039c2d9d0", null ], [ "operator--", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6820a1b92a2837b62a3e985b7b727db9", null ], [ "operator==", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a710ed96b1a3447a3f0ae6dcdf369bc34", null ], [ "operator!=", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a963a71b636aa50192395509e6845602f", null ], [ "operator*", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#ac96c3604a72a8f48fc0c1023a896bb87", null ], [ "operator->", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a59ccd372cf049d2d339e9829e799c2f7", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a845f49ed7330a208136c47af630fe8d3", null ] ];<file_sep>/docs/api/search/classes_b.js var searchData= [ ['master',['Master',['../classxpcc_1_1sab_1_1_master.html',1,'xpcc::sab']]], ['matrix',['Matrix',['../classxpcc_1_1_matrix.html',1,'xpcc']]], ['max6966',['MAX6966',['../classxpcc_1_1_m_a_x6966.html',1,'xpcc']]], ['max7219',['Max7219',['../classxpcc_1_1_max7219.html',1,'xpcc']]], ['max7219_3c_20spi_2c_20cs_2c_20columns_20_2arows_20_3e',['Max7219&lt; SPI, CS, COLUMNS *ROWS &gt;',['../classxpcc_1_1_max7219.html',1,'xpcc']]], ['max7219matrix',['Max7219matrix',['../classxpcc_1_1_max7219matrix.html',1,'xpcc']]], ['mcp23s08',['Mcp23s08',['../classxpcc_1_1_mcp23s08.html',1,'xpcc']]], ['mcp23transporti2c',['Mcp23TransportI2c',['../classxpcc_1_1_mcp23_transport_i2c.html',1,'xpcc']]], ['mcp23transportspi',['Mcp23TransportSpi',['../classxpcc_1_1_mcp23_transport_spi.html',1,'xpcc']]], ['mcp23x17',['mcp23x17',['../structxpcc_1_1mcp23x17.html',1,'xpcc::mcp23x17'],['../classxpcc_1_1_mcp23x17.html',1,'xpcc::Mcp23x17&lt; Transport &gt;']]], ['mcp2515',['Mcp2515',['../classxpcc_1_1_mcp2515.html',1,'xpcc']]], ['mcp4922',['Mcp4922',['../classxpcc_1_1_mcp4922.html',1,'xpcc']]], ['median',['Median',['../classxpcc_1_1filter_1_1_median.html',1,'xpcc::filter']]], ['memorybus',['MemoryBus',['../classxpcc_1_1_memory_bus.html',1,'xpcc']]], ['menuentry',['MenuEntry',['../structxpcc_1_1_menu_entry.html',1,'xpcc']]], ['menuentrycallback',['MenuEntryCallback',['../classxpcc_1_1_menu_entry_callback.html',1,'xpcc']]], ['message',['Message',['../structxpcc_1_1can_1_1_message.html',1,'xpcc::can::Message'],['../structxpcc_1_1rpr_1_1_message.html',1,'xpcc::rpr::Message']]], ['movingaverage',['MovingAverage',['../classxpcc_1_1filter_1_1_moving_average.html',1,'xpcc::filter']]], ['mutex',['Mutex',['../classxpcc_1_1rtos_1_1_mutex.html',1,'xpcc::rtos']]], ['mutexguard',['MutexGuard',['../classxpcc_1_1rtos_1_1_mutex_guard.html',1,'xpcc::rtos']]], ['myclass',['MyClass',['../classmy__namespace_1_1_my_class.html',1,'my_namespace']]] ]; <file_sep>/docs/api/classxpcc_1_1gui_1_1_gui_view_stack.js var classxpcc_1_1gui_1_1_gui_view_stack = [ [ "GuiViewStack", "classxpcc_1_1gui_1_1_gui_view_stack.html#ab8a594cd6085d9238fdaa6a49da12b40", null ], [ "~GuiViewStack", "classxpcc_1_1gui_1_1_gui_view_stack.html#a281d801babbe1cb0cd1f274886e2202e", null ], [ "get", "classxpcc_1_1gui_1_1_gui_view_stack.html#a01bdd4c66ff8deea95c4c102e1a16e70", null ], [ "push", "classxpcc_1_1gui_1_1_gui_view_stack.html#a5438c3373e641377e42071227aedd44a", null ], [ "getInputQueue", "classxpcc_1_1gui_1_1_gui_view_stack.html#ac7e70da7a577163fa0fd6feecf7bc58e", null ], [ "pop", "classxpcc_1_1gui_1_1_gui_view_stack.html#a49a63d1bb25ff5361d385d079f813fba", null ], [ "update", "classxpcc_1_1gui_1_1_gui_view_stack.html#ab3bbf381820d03e9508b4f705df52baf", null ] ];<file_sep>/docs/api/structxpcc_1_1ad7280a_1_1_register_value.js var structxpcc_1_1ad7280a_1_1_register_value = [ [ "device", "structxpcc_1_1ad7280a_1_1_register_value.html#a2a5db13fd8669b7d66df962a75f57272", null ], [ "registerAddress", "structxpcc_1_1ad7280a_1_1_register_value.html#a01e2bd97c0624c370ccca93d5fcd8567", null ], [ "value", "structxpcc_1_1ad7280a_1_1_register_value.html#a8baf335dbbc875eff1c7e4646548b71f", null ], [ "acknowledge", "structxpcc_1_1ad7280a_1_1_register_value.html#a4773dd797bbd612bc53a0a623f41207e", null ] ];<file_sep>/docs/api/classxpcc_1_1amnb_1_1_transmitter.js var classxpcc_1_1amnb_1_1_transmitter = [ [ "send", "classxpcc_1_1amnb_1_1_transmitter.html#a94f2da9f9ea25285e5fd41e849bfc7da", null ] ];<file_sep>/docs/api/structxpcc_1_1lm75_1_1_data.js var structxpcc_1_1lm75_1_1_data = [ [ "getTemperature", "structxpcc_1_1lm75_1_1_data.html#ab1ff9fcd6d116d3066a5f261bb548a88", null ], [ "getTemperatureInteger", "structxpcc_1_1lm75_1_1_data.html#a07e625f16863b24b8bb999adb0fe332a", null ], [ "Lm75", "structxpcc_1_1lm75_1_1_data.html#a1a2a7604df012d01e45e6f9d0b4c1feb", null ] ];<file_sep>/docs/api/classxpcc_1_1_can_connector_1_1_receive_list_item.js var classxpcc_1_1_can_connector_1_1_receive_list_item = [ [ "ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a22c699216fe80273836d32e9faac1925", null ], [ "ReceiveListItem", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#ab5a8fa3970541a2120db18a8ec5ab993", null ], [ "header", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a7525dfac072127535afa2cfe65189b8c", null ], [ "payload", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a01e4a3ffc0f3b6daf9c122ed7ef629d3", null ], [ "receivedFragments", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#a0db7a8077fabae052c924f74d62a47e1", null ], [ "counter", "classxpcc_1_1_can_connector_1_1_receive_list_item.html#ab8ff05e1950351cbc562aaababe89f28", null ] ];<file_sep>/docs/api/structxpcc_1_1hclax_1_1_data.js var structxpcc_1_1hclax_1_1_data = [ [ "getPressure", "structxpcc_1_1hclax_1_1_data.html#accd8c187dd46a1508b6c21ef0354bc2e", null ], [ "HclaX", "structxpcc_1_1hclax_1_1_data.html#a955e7389076fdf4e10d5b0a78e1a8a58", null ] ];<file_sep>/docs/api/namespacexpcc_1_1ui.js var namespacexpcc_1_1ui = [ [ "Animation", "classxpcc_1_1ui_1_1_animation.html", "classxpcc_1_1ui_1_1_animation" ], [ "FastRamp", "classxpcc_1_1ui_1_1_fast_ramp.html", "classxpcc_1_1ui_1_1_fast_ramp" ], [ "Indicator", "classxpcc_1_1ui_1_1_indicator.html", "classxpcc_1_1ui_1_1_indicator" ], [ "KeyFrame", "structxpcc_1_1ui_1_1_key_frame.html", "structxpcc_1_1ui_1_1_key_frame" ], [ "KeyFrameAnimation", "classxpcc_1_1ui_1_1_key_frame_animation.html", "classxpcc_1_1ui_1_1_key_frame_animation" ], [ "Led", "classxpcc_1_1ui_1_1_led.html", "classxpcc_1_1ui_1_1_led" ], [ "Pulse", "classxpcc_1_1ui_1_1_pulse.html", "classxpcc_1_1ui_1_1_pulse" ], [ "RgbLed", "classxpcc_1_1ui_1_1_rgb_led.html", "classxpcc_1_1ui_1_1_rgb_led" ], [ "Strobe", "classxpcc_1_1ui_1_1_strobe.html", "classxpcc_1_1ui_1_1_strobe" ] ];<file_sep>/docs/api/structxpcc_1_1lis3dsh_1_1_data.js var structxpcc_1_1lis3dsh_1_1_data = [ [ "Data", "structxpcc_1_1lis3dsh_1_1_data.html#a1c850d2e53e3865781e7331355f0bcb5", null ], [ "getX", "structxpcc_1_1lis3dsh_1_1_data.html#af1146c92010ab63301e3b3a9a11c1176", null ], [ "getY", "structxpcc_1_1lis3dsh_1_1_data.html#a18ca7f720163fd9a884305eadc362999", null ], [ "getZ", "structxpcc_1_1lis3dsh_1_1_data.html#ad2040f40e88e7f0e13b51906b52f11a2", null ], [ "operator[]", "structxpcc_1_1lis3dsh_1_1_data.html#ada584cb7a20aebc6ab9a60d60c2f7137", null ], [ "getPointer", "structxpcc_1_1lis3dsh_1_1_data.html#a70f5b76c119d73f49a715d6da31dc9fc", null ], [ "Lis3dsh", "structxpcc_1_1lis3dsh_1_1_data.html#ae8124e9e6ba596d32b5c88c3d21eceeb", null ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_input_event.js var classxpcc_1_1gui_1_1_input_event = [ [ "Type", "classxpcc_1_1gui_1_1_input_event.html#aac9aa39d0d42b1de7580c75aae39f878", [ [ "BUTTON", "classxpcc_1_1gui_1_1_input_event.html#aac9aa39d0d42b1de7580c75aae39f878a57b35198356d373bcd2a6e08abcb3795", null ], [ "TOUCH", "classxpcc_1_1gui_1_1_input_event.html#aac9aa39d0d42b1de7580c75aae39f878a2b40a1ea27beb450618885ec87f0ee15", null ] ] ], [ "Direction", "classxpcc_1_1gui_1_1_input_event.html#a55eb1d415b13663f1c7c4fab693c077e", [ [ "UP", "classxpcc_1_1gui_1_1_input_event.html#a55eb1d415b13663f1c7c4fab693c077eafbaedde498cdead4f2780217646e9ba1", null ], [ "DOWN", "classxpcc_1_1gui_1_1_input_event.html#a55eb1d415b13663f1c7c4fab693c077eac4e0e4e3118472beeb2ae75827450f1f", null ] ] ], [ "InputEvent", "classxpcc_1_1gui_1_1_input_event.html#a38792b20fbc3c2163447585cccdc5ed0", null ], [ "InputEvent", "classxpcc_1_1gui_1_1_input_event.html#ad1727b520ab2ec809fecb9371e2eed4e", null ], [ "type", "classxpcc_1_1gui_1_1_input_event.html#a4268fc803ca81baac3cd83376bf0cb84", null ], [ "direction", "classxpcc_1_1gui_1_1_input_event.html#a384f80bb27b9e291539987573d37d016", null ], [ "coord", "classxpcc_1_1gui_1_1_input_event.html#ab45213e8ce1c4c3081518aafc443554d", null ] ];<file_sep>/docs/api/structxpcc_1_1tmp_1_1_same_type.js var structxpcc_1_1tmp_1_1_same_type = [ [ "value", "structxpcc_1_1tmp_1_1_same_type.html#a50cc92e0b0beccc62827f863a823839daca17253c0aeefe215ca376ca6edcc125", null ] ];<file_sep>/docs/api/classxpcc_1_1_dog_s102.js var classxpcc_1_1_dog_s102 = [ [ "initialize", "classxpcc_1_1_dog_s102.html#a61ed2621e5902e68693b17897b5eb53b", null ] ];<file_sep>/docs/api/group__filter.js var group__filter = [ [ "Debounce", "classxpcc_1_1filter_1_1_debounce.html", [ [ "Debounce", "classxpcc_1_1filter_1_1_debounce.html#a2d189eb7711e48fbc9aab3c8efc64a90", null ], [ "update", "classxpcc_1_1filter_1_1_debounce.html#ae38dce0e417ef273c27d083ece126a51", null ], [ "getValue", "classxpcc_1_1filter_1_1_debounce.html#a908ae23d3060e4cc0282f349123ec3e2", null ], [ "reset", "classxpcc_1_1filter_1_1_debounce.html#a636af4c40daff593e51b0d8112c6514c", null ] ] ], [ "Median", "classxpcc_1_1filter_1_1_median.html", [ [ "Median", "classxpcc_1_1filter_1_1_median.html#ab42f104a44d4c403901d9c6111dedefe", null ], [ "append", "classxpcc_1_1filter_1_1_median.html#a26d1edadcb7d074e0955f876e63a8518", null ], [ "udpate", "classxpcc_1_1filter_1_1_median.html#aa64372a5886053228e09388e0887264b", null ], [ "getValue", "classxpcc_1_1filter_1_1_median.html#a5dfc21c1381df88cf3c34ff3a8b30d7d", null ] ] ], [ "MovingAverage", "classxpcc_1_1filter_1_1_moving_average.html", [ [ "MovingAverage", "classxpcc_1_1filter_1_1_moving_average.html#a4931f63f22344ad1514c59d2e5fe8ac7", null ], [ "update", "classxpcc_1_1filter_1_1_moving_average.html#aa3a842ffeca80dadb8dbd36b2c683d86", null ], [ "getValue", "classxpcc_1_1filter_1_1_moving_average.html#ab327ea8a0504a5c3fbe2f55dab5cfcba", null ] ] ], [ "Pid", "classxpcc_1_1_pid.html", [ [ "Parameter", "structxpcc_1_1_pid_1_1_parameter.html", [ [ "Parameter", "structxpcc_1_1_pid_1_1_parameter.html#a39e14e434cd315a3886ecbccd224a010", null ], [ "setKp", "structxpcc_1_1_pid_1_1_parameter.html#a9e110ddb764249fa21c9c2d2be25c4ef", null ], [ "setKi", "structxpcc_1_1_pid_1_1_parameter.html#aea70f62a3844bdcc3d968ab1d4fb5eb1", null ], [ "setKd", "structxpcc_1_1_pid_1_1_parameter.html#a32ca6ab57c56253e06e9e2c46fc585f5", null ], [ "setMaxErrorSum", "structxpcc_1_1_pid_1_1_parameter.html#a147cd1df34e8050fc0e953f2b7a556ff", null ], [ "Pid", "structxpcc_1_1_pid_1_1_parameter.html#aa245417dc2cd8c1415aadfb01d675ce7", null ] ] ], [ "ValueType", "classxpcc_1_1_pid.html#a6d6fb641b46d65837817ed5aa6a5d71b", null ], [ "Pid", "classxpcc_1_1_pid.html#a01002e02163cabe5d5540cd7c0051b09", null ], [ "Pid", "classxpcc_1_1_pid.html#a02dc1f6185871c70b2c97d3e2e72b2a7", null ], [ "setParameter", "classxpcc_1_1_pid.html#a8a83d52516d5c66e8144c27d326d9d82", null ], [ "reset", "classxpcc_1_1_pid.html#a24b30e20caa7f5b15ec70ded5f149f9e", null ], [ "update", "classxpcc_1_1_pid.html#a32e8bfda7701a5cf921a6da172b17552", null ], [ "getValue", "classxpcc_1_1_pid.html#a24c314ebc19bec2e3599d5d8fb5092ea", null ], [ "getLastError", "classxpcc_1_1_pid.html#a7e6337dab435ebd62e10f4f42eda347d", null ], [ "getErrorSum", "classxpcc_1_1_pid.html#aa928e33f0f62e64f626fa9739718d77b", null ] ] ], [ "Ramp", "classxpcc_1_1filter_1_1_ramp.html", [ [ "Ramp", "classxpcc_1_1filter_1_1_ramp.html#a111aa1a01b95f9acd2e63e2fa8e1862c", null ], [ "setTarget", "classxpcc_1_1filter_1_1_ramp.html#a30a56acec2079eb1b5c4719a88ad20af", null ], [ "update", "classxpcc_1_1filter_1_1_ramp.html#ab02a5289479478c89e91d92891f5bd93", null ], [ "reset", "classxpcc_1_1filter_1_1_ramp.html#a545a89e052e6a53919d7c28e884ced90", null ], [ "getValue", "classxpcc_1_1filter_1_1_ramp.html#a179a9a5139a4fd2da5cf316f211c8de9", null ], [ "isTargetReached", "classxpcc_1_1filter_1_1_ramp.html#ada39680ff385e6babdf622d0d0a4e489", null ] ] ], [ "SCurveController", "classxpcc_1_1_s_curve_controller.html", [ [ "Parameter", "structxpcc_1_1_s_curve_controller_1_1_parameter.html", [ [ "Parameter", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#aa6e173bc0ce09bb7d38761cd6d3aacec", null ], [ "targetArea", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a5105511f258c85b762d6cb6e9793e698", null ], [ "increment", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a41e2188f64530a24d71b9f8d6cf1dacb", null ], [ "decreaseFactor", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a11039c3c5c8dfd8f3693652c2513d665", null ], [ "kp", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a2acd0a1796e2cc1b4190b15db5ed4caa", null ], [ "speedMaximum", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a11b63e7ba555f3d4eac334cac5348293", null ], [ "speedMinimum", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a2de16b5d2e5079ac5394257f96741228", null ], [ "speedTarget", "structxpcc_1_1_s_curve_controller_1_1_parameter.html#a607e08f09dfab169f214061bdb0dc022", null ] ] ], [ "SCurveController", "classxpcc_1_1_s_curve_controller.html#a5e2d87f311fe9a3a731d2e0dfe029e75", null ], [ "setParameter", "classxpcc_1_1_s_curve_controller.html#a5ff8ee52072740dfab23634be3ed698a", null ], [ "setSpeedMaximum", "classxpcc_1_1_s_curve_controller.html#afd568834d54af95ef1dba56e292b03eb", null ], [ "setSpeedMinimim", "classxpcc_1_1_s_curve_controller.html#acfa88f644bf85cd534109eead6136a47", null ], [ "setSpeedTarget", "classxpcc_1_1_s_curve_controller.html#a87997a9489cbf36f12e0fe4c9cafb498", null ], [ "isTargetReached", "classxpcc_1_1_s_curve_controller.html#a2866bb2a8beb933f47b43584eee212d8", null ], [ "update", "classxpcc_1_1_s_curve_controller.html#a7b18e844fb3eacd06a1600e0dc516f52", null ], [ "getValue", "classxpcc_1_1_s_curve_controller.html#aa3180792c1ebaca2d49f34e4a297f40e", null ] ] ], [ "SCurveGenerator", "classxpcc_1_1_s_curve_generator.html", [ [ "SCurveGenerator", "classxpcc_1_1_s_curve_generator.html#a9e831771334c5bddcfcd1aa467feccb6", null ], [ "setTarget", "classxpcc_1_1_s_curve_generator.html#a81790d92c449e8cc601551623cfef168", null ], [ "update", "classxpcc_1_1_s_curve_generator.html#ac5380f8f34279ac2327ab699b6a7738b", null ], [ "getValue", "classxpcc_1_1_s_curve_generator.html#a8e1058cb7cf1329f2b32c63673d66557", null ], [ "isTargetReached", "classxpcc_1_1_s_curve_generator.html#a4099871153acf0e3f62c91b1831c97ac", null ] ] ], [ "filter", "namespacexpcc_1_1filter.html", null ] ];<file_sep>/docs/api/group__interpolation.js var group__interpolation = [ [ "Lagrange", "classxpcc_1_1interpolation_1_1_lagrange.html", [ [ "InputType", "classxpcc_1_1interpolation_1_1_lagrange.html#a0af0e8082774eacbb856e800ee6f1f0e", null ], [ "OutputType", "classxpcc_1_1interpolation_1_1_lagrange.html#aa47ca1120851673cd21ca64b16f122c3", null ], [ "Lagrange", "classxpcc_1_1interpolation_1_1_lagrange.html#a9df82c4ac046f617d9950bd082814d3b", null ], [ "interpolate", "classxpcc_1_1interpolation_1_1_lagrange.html#afb39dc41b9a245d602f71741ed0ddc09", null ] ] ], [ "Linear", "classxpcc_1_1interpolation_1_1_linear.html", [ [ "InputType", "classxpcc_1_1interpolation_1_1_linear.html#a42d7092b7d21b1abea6825293f1e454e", null ], [ "OutputType", "classxpcc_1_1interpolation_1_1_linear.html#ac7f5c66754805ea4e90093403d524379", null ], [ "OutputSignedType", "classxpcc_1_1interpolation_1_1_linear.html#abea1dda960348006cc820df6e586a1c4", null ], [ "WideType", "classxpcc_1_1interpolation_1_1_linear.html#a60419b02a1c0b02423b37cef2e1cd77c", null ], [ "Linear", "classxpcc_1_1interpolation_1_1_linear.html#ae93b842d9ffa4feed53ea9f79273dfdd", null ], [ "interpolate", "classxpcc_1_1interpolation_1_1_linear.html#a57c78a717a2e438694a85d47d9da5b5e", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1bme280.js var structxpcc_1_1bme280 = [ [ "Calibration", "structxpcc_1_1bme280.html#a5798719e48719361f3fd1faa60e9ddcc", null ], [ "Data", "structxpcc_1_1bme280.html#a94f8e037d1e7ada3e0326dc5ef761dcc", null ], [ "DataBase", "structxpcc_1_1bme280.html#a2591775dcc5c138c33704784247861a1", null ], [ "DataDouble", "structxpcc_1_1bme280.html#ae68fe752b546d6793f6310dd5bcb5b8b", null ], [ "CtrlHum_t", "structxpcc_1_1bme280.html#a39d6799b6de76a2b6d2de88053f8725b", null ], [ "Status_t", "structxpcc_1_1bme280.html#a7afc318676ab84fc547bd59257da292e", null ], [ "CtrlMeas_t", "structxpcc_1_1bme280.html#ac4939b06aa5c655270f8467b5102b4f3", null ], [ "Mode_t", "structxpcc_1_1bme280.html#adc3de0588813b9d086dfd9a3e6149b71", null ], [ "Pressure", "structxpcc_1_1bme280.html#a2fb661ab30ea8599151839fdb72b23c3", null ], [ "Temperature", "structxpcc_1_1bme280.html#a7b3825dde9aa718306237ad30df54977", null ], [ "Humidity", "structxpcc_1_1bme280.html#a463423880a61c475a81139f37387770c", null ], [ "Config_t", "structxpcc_1_1bme280.html#acb0154868b5c73e6eb6baf7cada78091", null ], [ "TimeStandby_t", "structxpcc_1_1bme280.html#a90fd4b69e02edc1dc1e08721d336d6d2", null ], [ "CtrlHum", "structxpcc_1_1bme280.html#a921b14bc1d8b470a08aec0b2302e48be", [ [ "OSRS_H2", "structxpcc_1_1bme280.html#a921b14bc1d8b470a08aec0b2302e48beaeab8b86bffe34f5859a393c3a3e8bfa3", null ], [ "OSRS_H1", "structxpcc_1_1bme280.html#a921b14bc1d8b470a08aec0b2302e48bea7bcdd058c2fe0a3ac4f7fffdf7ac59f5", null ], [ "OSRS_H0", "structxpcc_1_1bme280.html#a921b14bc1d8b470a08aec0b2302e48bea42bcb0e844383e5f76b71ab66f060dd0", null ] ] ], [ "Status", "structxpcc_1_1bme280.html#a11690f75471a34bcda08b1050c3df0ca", [ [ "MEASURING", "structxpcc_1_1bme280.html#a11690f75471a34bcda08b1050c3df0caa9b7df9879757641ee2e74593308ad606", null ], [ "IM_UPDATE", "structxpcc_1_1bme280.html#a11690f75471a34bcda08b1050c3df0caa9b22f172f8b21b91f2380c63e4174d24", null ] ] ], [ "CtrlMeas", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41", [ [ "OSRS_T2", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41a45101cb65a56ca3d5375dbd22ccbfdbe", null ], [ "OSRS_T1", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41a409f42ffd9e89a595d1f75790c7068a6", null ], [ "OSRS_T0", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41adb8c18aed97a83ce4c318504476daf8f", null ], [ "OSRS_P2", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41a1954cf43850916e37c409f4f733d7d39", null ], [ "OSRS_P1", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41ad1be761ae12212c02552b43f4fb8859d", null ], [ "OSRS_P0", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41aaa20bdfe404911a54e96defa8e78b02d", null ], [ "Mode1", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode0", "structxpcc_1_1bme280.html#a3d1a22ed2efef94c869c98e5baa6bc41a315436bae0e85636381fc939db06aee5", null ] ] ], [ "Mode", "structxpcc_1_1bme280.html#aa2d1d2aa80c6232b90611fac63382b6a", [ [ "Sleep", "structxpcc_1_1bme280.html#aa2d1d<KEY>", null ], [ "Forced", "structxpcc_1_1bme280.html#aa2d1d2aa80c6232b90611fac63382b6aadc2eb84d1f952ad0e6b58014aabd616a", null ], [ "Normal", "structxpcc_1_1bme280.html#aa2d1d2aa80c6232b90611fac63382b6aa960b44c579bc2f6818d2daaf9e4c16f0", null ] ] ], [ "Oversampling", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609", [ [ "Skipped", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609ad9c8f187972e6320a34e9c40b4cba605", null ], [ "Single", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609a66ba162102bbf6ae31b522aec561735e", null ], [ "Double", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609ad909d38d705ce75386dd86e611a82f5b", null ], [ "Quadrupel", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609afb7853337b866bcfb128da1a8d1094ce", null ], [ "Octupel", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609a68004cf9ce5da33ee548cd06b68bb2f6", null ], [ "Sexdecuple", "structxpcc_1_1bme280.html#a4773637ab58d2b44f5df04074dabf609a801be8138177fb3cc364899d5c77cffe", null ] ] ], [ "Config", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0a", [ [ "T_SB_2", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aa689540994616845b273bad1697a5e3c8", null ], [ "T_SB_1", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aa050135b53ba30510ac38c1ce8eca07a4", null ], [ "T_SB_0", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aa534fe9c4dc344a815a7b0986a9e2237c", null ], [ "FILTER_2", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aa24aa12733c278b2e80be73c98d6e8d3e", null ], [ "FILTER_1", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aa0ed5d83389f86ded14d02a7b2ba08744", null ], [ "FILTER_0", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aaf01e4cbdde2c6ea70379450b6118e705", null ], [ "SPI3W_EN", "structxpcc_1_1bme280.html#a6c2c2c12f0e793af51ed53d1e3a72d0aa14db77e491e1a1802a66f1db211ab655", null ] ] ], [ "TimeStandby", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29", [ [ "Us500", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29ab364a0dd72c8b86a4dc295d2041e6a57", null ], [ "Ms62", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29a7e2f50ee08a72c32c9728a8d8361ac08", null ], [ "Ms125", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29af5b24b840de168264342a64a4915996f", null ], [ "Ms250", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29a49f5df095999efc3c3971202d7536bd1", null ], [ "Ms500", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29ac1cd2bb85a2c1190721cc27861158165", null ], [ "S1", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29a67f6274e0ac0bd892f9b1ec09a2253fc", null ], [ "Ms10", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29adbed5f3cbc712b2ef73848a4712590f5", null ], [ "Ms20", "structxpcc_1_1bme280.html#ad3c50dbc151646d64e0156861d910f29ab75d399b9e4c4fbe583e8ff3b703fe64", null ] ] ], [ "FilterSettings", "structxpcc_1_1bme280.html#a1bbd5e1d829107d4467d2439ea3d9220", [ [ "Off", "structxpcc_1_1bme280.html#a1bbd5e1d829107d4467d2439ea3d9220ad15305d7a4e34e02489c74a5ef542f36", null ], [ "F2", "structxpcc_1_1bme280.html#a1bbd5e1d829107d4467d2439ea3d9220afe5c3684dce76cdd9f7f42430868aa74", null ], [ "F4", "structxpcc_1_1bme280.html#a1bbd5e1d829107d4467d2439ea3d9220ae7e0e72401a9f2718ed0f39f2861d702", null ], [ "F8", "structxpcc_1_1bme280.html#a1bbd5e1d829107d4467d2439ea3d9220a4787509ad9f9d747a81a30e9dde3d4a7", null ], [ "F16", "structxpcc_1_1bme280.html#a1bbd5e1d829107d4467d2439ea3d9220a56d8353718e6fdc78b8d69078a2cdb94", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_communicating_view.js var classxpcc_1_1_communicating_view = [ [ "CommunicatingView", "classxpcc_1_1_communicating_view.html#a0025589da3e60672a084044282d6cfc3", null ], [ "getCommunicatingViewStack", "classxpcc_1_1_communicating_view.html#a63931b6dad38bb9693c269286b73b636", null ] ];<file_sep>/docs/api/structxpcc_1_1ft6x06_1_1_data.js var structxpcc_1_1ft6x06_1_1_data = [ [ "getGesture", "structxpcc_1_1ft6x06_1_1_data.html#a278c09545c59f419bb2afd3cb189bf61", null ], [ "getPoints", "structxpcc_1_1ft6x06_1_1_data.html#a52bc6649cc9a6c6dd236e90720446c32", null ], [ "getTouch", "structxpcc_1_1ft6x06_1_1_data.html#acc8afd9df986b2b8a58f607879a9e043", null ], [ "Ft6x06", "structxpcc_1_1ft6x06_1_1_data.html#ade461f20da93ea62448d2162e86211df", null ] ];<file_sep>/docs/api/search/enumvalues_13.js var searchData= [ ['variationangle',['VariationAngle',['../structxpcc_1_1hmc6343.html#a49d2a5db1c646f371ae6932c65d79d91a52756d460c65ceb9f8a3a77e9b0a0221',1,'xpcc::hmc6343']]], ['vfc_5f1',['VFC_1',['../structxpcc_1_1lis3dsh.html#a02c4aae6d594b34f93ee3ea030b33e11a228fedde188f7ea4efe83095554e3168',1,'xpcc::lis3dsh']]], ['vfc_5f2',['VFC_2',['../structxpcc_1_1lis3dsh.html#a02c4aae6d594b34f93ee3ea030b33e11a61acff945bbc49e265691edb12fe86d7',1,'xpcc::lis3dsh']]], ['vfc_5f3',['VFC_3',['../structxpcc_1_1lis3dsh.html#a02c4aae6d594b34f93ee3ea030b33e11a6e27a48293470c1c192a7f294f29e3be',1,'xpcc::lis3dsh']]], ['vfc_5f4',['VFC_4',['../structxpcc_1_1lis3dsh.html#a02c4aae6d594b34f93ee3ea030b33e11a02963068820fd81a33063a8285474dc0',1,'xpcc::lis3dsh']]], ['vfilt',['VFILT',['../structxpcc_1_1lis3dsh.html#a454bbc83cbd179a8357d84b992f51db1ab4cf63e6f791b4cab7b00d731a7029de',1,'xpcc::lis3dsh']]] ]; <file_sep>/docs/api/group__stm32f407vg__spi.js var group__stm32f407vg__spi = [ [ "SpiHal1", "classxpcc_1_1stm32_1_1_spi_hal1.html", null ], [ "SpiHal2", "classxpcc_1_1stm32_1_1_spi_hal2.html", null ], [ "SpiHal3", "classxpcc_1_1stm32_1_1_spi_hal3.html", null ], [ "SpiMaster1", "classxpcc_1_1stm32_1_1_spi_master1.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674", [ [ "Mode0", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674ab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1stm32_1_1_spi_master1.html#a7759c620ea21a231101fd76ee36e0458", [ [ "MsbFirst", "classxpcc_1_1stm32_1_1_spi_master1.html#a7759c620ea21a231101fd76ee36e0458aee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1stm32_1_1_spi_master1.html#a7759c620ea21a231101fd76ee36e0458abdb340581a62499a27a78804ea99a99a", null ] ] ] ] ], [ "SpiMaster2", "classxpcc_1_1stm32_1_1_spi_master2.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446c", [ [ "Mode0", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446ca315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446ca7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446ca04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_spi_master2.html#a829fdd7abfba8de99d6ec7642ff1446cab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1stm32_1_1_spi_master2.html#a2b612e97c24134a984a23412873f3b4f", [ [ "MsbFirst", "classxpcc_1_1stm32_1_1_spi_master2.html#a2b612e97c24134a984a23412873f3b4faee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1stm32_1_1_spi_master2.html#a2b612e97c24134a984a23412873f3b4fabdb340581a62499a27a78804ea99a99a", null ] ] ] ] ], [ "SpiMaster3", "classxpcc_1_1stm32_1_1_spi_master3.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40e", [ [ "Mode0", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40ea315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40ea7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40ea04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40eab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1stm32_1_1_spi_master3.html#ab3e592a85d2b730044bf963021d67bda", [ [ "MsbFirst", "classxpcc_1_1stm32_1_1_spi_master3.html#ab3e592a85d2b730044bf963021d67bdaaee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1stm32_1_1_spi_master3.html#ab3e592a85d2b730044bf963021d67bdaabdb340581a62499a27a78804ea99a99a", null ] ] ] ] ], [ "UartSpiMaster1", "classxpcc_1_1stm32_1_1_uart_spi_master1.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master1.html#a9cdadd836eb8a83b96959eefec3512f1ab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ] ], [ "UartSpiMaster2", "classxpcc_1_1stm32_1_1_uart_spi_master2.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24f", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master2.html#a73b5fb23adad934b6443dd47031ec24fab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ] ], [ "UartSpiMaster3", "classxpcc_1_1stm32_1_1_uart_spi_master3.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7a", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master3.html#aa89da92517a2b4cc8a602d0fe739de7aab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ] ], [ "UartSpiMaster6", "classxpcc_1_1stm32_1_1_uart_spi_master6.html", [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4ab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ] ] ];<file_sep>/docs/api/classxpcc_1_1ui_1_1_key_frame_animation.js var classxpcc_1_1ui_1_1_key_frame_animation = [ [ "KeyFrameAnimation", "classxpcc_1_1ui_1_1_key_frame_animation.html#a23fca4571b131f42e6efceaa9eb6655f", null ], [ "KeyFrameAnimation", "classxpcc_1_1ui_1_1_key_frame_animation.html#aa0ebf17ddb4730cd10bb1110ed8b4f4a", null ], [ "start", "classxpcc_1_1ui_1_1_key_frame_animation.html#a4ae0a95e2159e4307c9e527cb97fdd90", null ], [ "stop", "classxpcc_1_1ui_1_1_key_frame_animation.html#aef824ff7ce0aace7ced1354adeea30c3", null ], [ "cancel", "classxpcc_1_1ui_1_1_key_frame_animation.html#a1da874de029d944b151c0990651486bb", null ], [ "isAnimating", "classxpcc_1_1ui_1_1_key_frame_animation.html#a925bcb3d2f9e948b76636b4a9f7f09b0", null ], [ "update", "classxpcc_1_1ui_1_1_key_frame_animation.html#a780a8f7a7109424de6782b6e26e6c9e7", null ], [ "getKeyFrames", "classxpcc_1_1ui_1_1_key_frame_animation.html#a16258890ec088e983265aebb96383b4d", null ], [ "setKeyFrames", "classxpcc_1_1ui_1_1_key_frame_animation.html#a2d91a3f0a455aa315ffcf7c2ab586c15", null ], [ "getLength", "classxpcc_1_1ui_1_1_key_frame_animation.html#a896070e0d043f4dd3b518fb8b813aa5c", null ], [ "getMode", "classxpcc_1_1ui_1_1_key_frame_animation.html#afefa834bcdfe9e2a269d5baca599cb68", null ], [ "setMode", "classxpcc_1_1ui_1_1_key_frame_animation.html#abc56cd10049d889a0f5b671830e06e9e", null ] ];<file_sep>/docs/api/search/groups_4.js var searchData= [ ['debugging_20utilities',['Debugging utilities',['../group__debug.html',1,'']]], ['display_20menu',['Display Menu',['../group__display__menu.html',1,'']]], ['device_20drivers',['Device drivers',['../group__driver.html',1,'']]], ['digital_2fanalog_20converters',['Digital/Analog Converters',['../group__driver__dac.html',1,'']]], ['displays',['Displays',['../group__driver__display.html',1,'']]], ['ds1302',['DS1302',['../group__ds1302.html',1,'']]], ['dma',['DMA',['../group__stm32f407vg__dma.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1stm32_1_1_spi_master1.js var classxpcc_1_1stm32_1_1_spi_master1 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674", [ [ "Mode0", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_spi_master1.html#a6622d708a0868eda983f4048f3f81674ab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1stm32_1_1_spi_master1.html#a7759c620ea21a231101fd76ee36e0458", [ [ "MsbFirst", "classxpcc_1_1stm32_1_1_spi_master1.html#a7759c620ea21a231101fd76ee36e0458aee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1stm32_1_1_spi_master1.html#a7759c620ea21a231101fd76ee36e0458abdb340581a62499a27a78804ea99a99a", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_choice_menu.js var classxpcc_1_1_choice_menu = [ [ "EntryList", "classxpcc_1_1_choice_menu.html#a1760d449d6b7c0ca082b7eb8458f43b7", null ], [ "ChoiceMenu", "classxpcc_1_1_choice_menu.html#a3977d0a20dee914c2c18f5392337f95d", null ], [ "ChoiceMenu", "classxpcc_1_1_choice_menu.html#a6b043d5e3f16a7789576adfc506957c4", null ], [ "addEntry", "classxpcc_1_1_choice_menu.html#a5f342d7dfbd4fe58d94d31877ed69299", null ], [ "initialise", "classxpcc_1_1_choice_menu.html#a7fcd0b1a3011c40eaa96be78cb6dfedb", null ], [ "setTitle", "classxpcc_1_1_choice_menu.html#a0cf84e208376772e6841a9c4b596432f", null ], [ "shortButtonPress", "classxpcc_1_1_choice_menu.html#ae6eae417776ea0fe703b20e1c126ae6c", null ], [ "hasChanged", "classxpcc_1_1_choice_menu.html#a23cff61305df901c6c036494f7588d65", null ], [ "draw", "classxpcc_1_1_choice_menu.html#af98b0d9e97b2852fb154446210624c5e", null ], [ "openNextScreen", "classxpcc_1_1_choice_menu.html#ada78ebf9a556dbd48bff56bda377767c", null ], [ "entries", "classxpcc_1_1_choice_menu.html#a22200691f4cbe53204fff90cb9b46de0", null ] ];<file_sep>/docs/api/classxpcc_1_1_linked_list.js var classxpcc_1_1_linked_list = [ [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html", "classxpcc_1_1_linked_list_1_1const__iterator" ], [ "iterator", "classxpcc_1_1_linked_list_1_1iterator.html", "classxpcc_1_1_linked_list_1_1iterator" ], [ "Node", "classxpcc_1_1_linked_list.html#structxpcc_1_1_linked_list_1_1_node", [ [ "value", "classxpcc_1_1_linked_list.html#a9daec409fe008e9accddcce3084ca923", null ], [ "next", "classxpcc_1_1_linked_list.html#a5d62cff41a20abc9ca2ac6991652f7a6", null ] ] ], [ "Size", "classxpcc_1_1_linked_list.html#a22c4a454e4386a90716a399ed399bbdb", null ], [ "NodeAllocator", "classxpcc_1_1_linked_list.html#a289fa56c443b91fdb8febada34bd2a32", null ], [ "LinkedList", "classxpcc_1_1_linked_list.html#addf86544f8901cd3327238ffab3a3082", null ], [ "~LinkedList", "classxpcc_1_1_linked_list.html#ac83c14a8a3748f219294b7570a063739", null ], [ "isEmpty", "classxpcc_1_1_linked_list.html#ae481dcd4e2982644c58fd46cc20541fa", null ], [ "getSize", "classxpcc_1_1_linked_list.html#ad6d8fd102a0c6a7d6d5d00a98d0d66a1", null ], [ "prepend", "classxpcc_1_1_linked_list.html#a2a16b34e53976a662ea84d7605cc87fb", null ], [ "append", "classxpcc_1_1_linked_list.html#a3f2cf3b2bdd6c3c32176ae6cff3cb584", null ], [ "removeFront", "classxpcc_1_1_linked_list.html#a95ae873963d11395b40b312eabfa63e4", null ], [ "getFront", "classxpcc_1_1_linked_list.html#ab26092ed4ff07e654ca8d074dd6f592d", null ], [ "getFront", "classxpcc_1_1_linked_list.html#a96c2fac77c65e6529b1a7db35fb12c28", null ], [ "getBack", "classxpcc_1_1_linked_list.html#a9da35cb91c7f08784984a20f1b788bb2", null ], [ "getBack", "classxpcc_1_1_linked_list.html#a3a6b9ca0d0bb11737ed9f0359bdd4392", null ], [ "removeAll", "classxpcc_1_1_linked_list.html#aabcb136609a8bd07001e4475bc1208a2", null ], [ "begin", "classxpcc_1_1_linked_list.html#a404f8b4fcb1cf228440116c9e240bc53", null ], [ "begin", "classxpcc_1_1_linked_list.html#a145b624a6986ecd9737767ce06307ef9", null ], [ "end", "classxpcc_1_1_linked_list.html#ac95f14c9a62cfb1aa38ba1cbc5dc991c", null ], [ "end", "classxpcc_1_1_linked_list.html#a6efa92f12e65d445d92023c57df66eb3", null ], [ "remove", "classxpcc_1_1_linked_list.html#a7a65318c50a31bf2c0b5aeb89107df66", null ], [ "insert", "classxpcc_1_1_linked_list.html#a54cff0656a00b0d29453a5d974f5edd4", null ], [ "const_iterator", "classxpcc_1_1_linked_list.html#ac220ce1c155db1ac44146c12d178056f", null ], [ "iterator", "classxpcc_1_1_linked_list.html#a67171474c4da6cc8efe0c7fafefd2b2d", null ], [ "nodeAllocator", "classxpcc_1_1_linked_list.html#a75f98acd3c90a128f853c444163e02f9", null ], [ "front", "classxpcc_1_1_linked_list.html#ab6683f715568ea3ac30dd3b9169687bd", null ], [ "back", "classxpcc_1_1_linked_list.html#ab15cd9c61a5a1f80898173b23d615c2b", null ] ];<file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01char_01_4.js var structxpcc_1_1_arithmetic_traits_3_01char_01_4 = [ [ "WideType", "group__arithmetic__trais.html#gaba614aab47336801a0db0715290959c3", null ], [ "SignedType", "group__arithmetic__trais.html#ga8ad2539b457a98d55aba25870bf82725", null ], [ "UnsignedType", "group__arithmetic__trais.html#ga05f3731325746129a32b306735d2ea3f", null ] ];<file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01int64__t_01_4.js var structxpcc_1_1_arithmetic_traits_3_01int64__t_01_4 = [ [ "WideType", "group__arithmetic__trais.html#ga85008273c8f7dd51f9023783ab636e39", null ], [ "SignedType", "group__arithmetic__trais.html#ga810d7edf8d7478e6ebd3ea47d152d79c", null ], [ "UnsignedType", "group__arithmetic__trais.html#ga9ed40e9fc7d289ff606d8c53f940c404", null ] ];<file_sep>/docs/api/classxpcc_1_1_location2_d.js var classxpcc_1_1_location2_d = [ [ "Location2D", "classxpcc_1_1_location2_d.html#a5716fc0fc576a3414f7f5fa54ddf597b", null ], [ "Location2D", "classxpcc_1_1_location2_d.html#aa37ab01b4b6ccfb7fee545931df63fc1", null ], [ "Location2D", "classxpcc_1_1_location2_d.html#a92c1353c0ba5f7ba9b50b9c58bfbf373", null ], [ "getPosition", "classxpcc_1_1_location2_d.html#a7747e263104e13f7d3d8b3ee939261fc", null ], [ "getX", "classxpcc_1_1_location2_d.html#a130780118fc00570a08083044646de2c", null ], [ "getY", "classxpcc_1_1_location2_d.html#a6a811b6d4eefc52afa5b7665fb7df3db", null ], [ "setPosition", "classxpcc_1_1_location2_d.html#af613ca86deba114396d887e2d78a7349", null ], [ "setPosition", "classxpcc_1_1_location2_d.html#aa2b93732a85e874920009655cf3c35c3", null ], [ "getOrientation", "classxpcc_1_1_location2_d.html#ab6e24747d57f71f25dac6440d2ec6915", null ], [ "setOrientation", "classxpcc_1_1_location2_d.html#ac5585d823ec761585cfab2f4278d5172", null ], [ "move", "classxpcc_1_1_location2_d.html#ac51123341f76d822d14693002541c581", null ], [ "move", "classxpcc_1_1_location2_d.html#ac0f08e65255b30837062f4c40aa0101d", null ], [ "move", "classxpcc_1_1_location2_d.html#aa777d70817d67e80918d4dc2ede2404d", null ], [ "translated", "classxpcc_1_1_location2_d.html#a0039b0c9df3835f590c878af5fa3a900", null ], [ "convert", "classxpcc_1_1_location2_d.html#af66488c5237442d6eaedefa98506f8a5", null ], [ "operator==", "classxpcc_1_1_location2_d.html#a4c90558b549f3e93a4ee9d54ced279d4", null ], [ "operator!=", "classxpcc_1_1_location2_d.html#aecb4ebe2fb2438796aa27b8969e3def7", null ], [ "operator<<", "classxpcc_1_1_location2_d.html#a2539c5f16ca41078027c6233c5926ae8", null ] ];<file_sep>/docs/api/structxpcc_1_1bmp085.js var structxpcc_1_1bmp085 = [ [ "Calibration", "structxpcc_1_1bmp085.html#a179fe9e0b11c255afc0fd04c2d7ab865", null ], [ "Data", "structxpcc_1_1bmp085.html#aee0f6e88d1e86724cb924edc6e02642d", null ], [ "DataBase", "structxpcc_1_1bmp085.html#ad5e42e2ffc31238e9e54a87b78429d1c", null ], [ "DataDouble", "structxpcc_1_1bmp085.html#a2eb41edcc6e553b69cb2434e55f069cb", null ], [ "Mode", "structxpcc_1_1bmp085.html#a581878d481583ad9c5b1f656a1b74f5c", [ [ "Mask", "structxpcc_1_1bmp085.html#a581878d481583ad9c5b1f656a1b74f5ca4a18312b5b75f549d5551e5912ad6ebf", null ], [ "UltraLowPower", "structxpcc_1_1bmp085.html#a581878d481583ad9c5b1f656a1b74f5ca46ef0499f6dffa9c1fbe0674c93e9d0c", null ], [ "Standard", "structxpcc_1_1bmp085.html#a581878d481583ad9c5b1f656a1b74f5caeb6d8ae6f20283755b339c0dc273988b", null ], [ "HighResolution", "structxpcc_1_1bmp085.html#a581878d481583ad9c5b1f656a1b74f5cab7f3fbc4b2db5eed28935b6508163bc2", null ], [ "UltraHighResolution", "structxpcc_1_1bmp085.html#a581878d481583ad9c5b1f656a1b74f5caf9b6cfe9953d031a8efa5d82c9b2d237", null ] ] ] ];<file_sep>/docs/api/search/searchdata.js var indexSectionsWithContent = { 0: "1abcdefghijklmnopqrstuvwxyz~", 1: "abcdefghiklmnpqrstuvwxz", 2: "x", 3: "t", 4: "abcdefghijklmnopqrstuvwxyz~", 5: "abcdefhilmnoprstuvwyz", 6: "abcdeflmprstu", 7: "abcdefghiklmnopqrstv", 8: "abcdefghijlmnoprstuvwxyz", 9: "ao", 10: "1abcdfgilmnoprstu", 11: "bdot" }; var indexSectionNames = { 0: "all", 1: "classes", 2: "namespaces", 3: "files", 4: "functions", 5: "variables", 6: "typedefs", 7: "enums", 8: "enumvalues", 9: "related", 10: "groups", 11: "pages" }; var indexSectionLabels = { 0: "All", 1: "Classes", 2: "Namespaces", 3: "Files", 4: "Functions", 5: "Variables", 6: "Typedefs", 7: "Enumerations", 8: "Enumerator", 9: "Friends", 10: "Modules", 11: "Pages" }; <file_sep>/docs/api/structxpcc_1_1_spi.js var structxpcc_1_1_spi = [ [ "ConfigurationHandler", "structxpcc_1_1_spi.html#aa8c715419d2370d9feab964cd7da0c04", null ], [ "DataMode", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992f", [ [ "Mode0", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "structxpcc_1_1_spi.html#a71571d129a081e42fdabccf2e18d9d97", [ [ "MsbFirst", "structxpcc_1_1_spi.html#a71571d129a081e42fdabccf2e18d9d97aee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "structxpcc_1_1_spi.html#a71571d129a081e42fdabccf2e18d9d97abdb340581a62499a27a78804ea99a99a", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1log_1_1_style_wrapper.js var classxpcc_1_1log_1_1_style_wrapper = [ [ "StyleWrapper", "classxpcc_1_1log_1_1_style_wrapper.html#ab802ef7b4004b4bb94fe0ed8884b0437", null ], [ "~StyleWrapper", "classxpcc_1_1log_1_1_style_wrapper.html#a3798576d91b11c9c5543c944ad7b676f", null ], [ "write", "classxpcc_1_1log_1_1_style_wrapper.html#a0d7ee7df577a561bafd5f21b05b05570", null ], [ "write", "classxpcc_1_1log_1_1_style_wrapper.html#abb70f56eeb225066532cd02a3243d43b", null ], [ "flush", "classxpcc_1_1log_1_1_style_wrapper.html#a53ae6e69eca9313b91c5bbb09880ec5a", null ], [ "read", "classxpcc_1_1log_1_1_style_wrapper.html#a43487b63caaf11561df77af7ee7e1733", null ] ];<file_sep>/docs/api/search/typedefs_c.js var searchData= [ ['underlyingtype',['UnderlyingType',['../structxpcc_1_1_register.html#a4c2c4eb34f0c968c96d2c002ed12a088',1,'xpcc::Register::UnderlyingType()'],['../structxpcc_1_1tcs3414.html#aaf960407c8ca742f0955e209079d4f08',1,'xpcc::tcs3414::UnderlyingType()'],['../structxpcc_1_1tcs3472.html#a3ef7e794003e0c8970465b6540e7f33b',1,'xpcc::tcs3472::UnderlyingType()']]] ]; <file_sep>/docs/api/classxpcc_1_1_generic_periodic_timer.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>xpcc: xpcc::GenericPeriodicTimer&lt; Clock, TimestampType &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">xpcc </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classxpcc_1_1_generic_periodic_timer.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="classxpcc_1_1_generic_periodic_timer-members.html">List of all members</a> &#124; <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">xpcc::GenericPeriodicTimer&lt; Clock, TimestampType &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__processing.html">Processing</a> &raquo; <a class="el" href="group__software__timer.html">Software Timers</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Generic software timeout class for variable timebase and timestamp width. <a href="classxpcc_1_1_generic_periodic_timer.html#details">More...</a></p> <p><code>#include &lt;xpcc/processing/timer/periodic_timer.hpp&gt;</code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a0bd9d91f101dd3205fa905a398df92e5"><td class="memItemLeft" align="right" valign="top"><a id="a0bd9d91f101dd3205fa905a398df92e5"></a> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a0bd9d91f101dd3205fa905a398df92e5">GenericPeriodicTimer</a> (const TimestampType period)</td></tr> <tr class="memdesc:a0bd9d91f101dd3205fa905a398df92e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create and start the timer. <br /></td></tr> <tr class="separator:a0bd9d91f101dd3205fa905a398df92e5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5d99901a47a34a02830f1acfbe2eed25"><td class="memItemLeft" align="right" valign="top"><a id="a5d99901a47a34a02830f1acfbe2eed25"></a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a5d99901a47a34a02830f1acfbe2eed25">restart</a> ()</td></tr> <tr class="memdesc:a5d99901a47a34a02830f1acfbe2eed25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restart the timer with the current period. <br /></td></tr> <tr class="separator:a5d99901a47a34a02830f1acfbe2eed25"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a51a63783b8a78ae468d74459e9aabd38"><td class="memItemLeft" align="right" valign="top"><a id="a51a63783b8a78ae468d74459e9aabd38"></a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a51a63783b8a78ae468d74459e9aabd38">restart</a> (const TimestampType period)</td></tr> <tr class="memdesc:a51a63783b8a78ae468d74459e9aabd38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restart the timer with a new period value. <br /></td></tr> <tr class="separator:a51a63783b8a78ae468d74459e9aabd38"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abed61c10303a883b47ed0a1bdba141b1"><td class="memItemLeft" align="right" valign="top"><a id="abed61c10303a883b47ed0a1bdba141b1"></a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#abed61c10303a883b47ed0a1bdba141b1">stop</a> ()</td></tr> <tr class="memdesc:abed61c10303a883b47ed0a1bdba141b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the timer and sets <a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a7624cbce4fb8c4be66a63740a5e9b484">isStopped()</a> to <code>true</code>, and isExpired() to <code>false</code>. <br /></td></tr> <tr class="separator:abed61c10303a883b47ed0a1bdba141b1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2bef026e4e683303266e2bebe538c63f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute</a> ()</td></tr> <tr class="separator:a2bef026e4e683303266e2bebe538c63f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a36e261e9debd8c4aa650e9d5aedd7314"><td class="memItemLeft" align="right" valign="top">TimestampType::SignedType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a36e261e9debd8c4aa650e9d5aedd7314">remaining</a> () const</td></tr> <tr class="separator:a36e261e9debd8c4aa650e9d5aedd7314"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac70aa47213a9117802e74e4291acab87"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__software__timer.html#gabcc9087dd7bf4f67559efacad4f622d8">PeriodicTimerState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#ac70aa47213a9117802e74e4291acab87">getState</a> () const</td></tr> <tr class="separator:ac70aa47213a9117802e74e4291acab87"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7624cbce4fb8c4be66a63740a5e9b484"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a7624cbce4fb8c4be66a63740a5e9b484">isStopped</a> () const</td></tr> <tr class="separator:a7624cbce4fb8c4be66a63740a5e9b484"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;class Clock, typename TimestampType = xpcc::Timestamp&gt;<br /> class xpcc::GenericPeriodicTimer&lt; Clock, TimestampType &gt;</h3> <p>This class allows for periodic code execution</p> <p>Its logic can be described by the following annotated waveform:</p> <ul> <li>C: Constructor</li> <li>S: (Re-)Start timer</li> <li>I: Period interval</li> <li>H: Code handler (<code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute()</a></code> returned <code>true</code>)</li> <li>P: Stop timer</li> </ul> <pre class="fragment">Event: C IH I I H I S IH I IH P _ _____________ __ _ ______ Expired: __________/ \_______/ \_____/ \____/ \__/ \____... __________ _______ _____ ____ __ _ Armed: \_/ \_____________/ \__/ \_/ \______/ \__... __ Stopped: ______________________________________________________________/ ... _ _ _ _ Handle: __________/ \___________________/ \_____________/ \_______/ \____... Remaining: + |0| + | - |0| + | -| + |0| +| - |0|+| 0 </pre><p>If you want to execute code once per period interval, poll the <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute()</a></code> method, which returns <code>true</code> exactly once after expiration.</p> <div class="fragment"><div class="line"><span class="keywordflow">if</span> (timer.execute())</div><div class="line">{</div><div class="line"> <span class="comment">// periodically called once</span></div><div class="line"> Led::toggle();</div><div class="line">}</div></div><!-- fragment --><p>Be aware, however, that since this method is polled, it cannot execute exactly at the time of expiration, but some time after expiration, as indicated in the above waveform graph. If one or several periods are missed when polling <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute()</a></code>, these code executions are discarded and will not be cought up. Instead, <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute()</a></code> returns <code>true</code> once and then reschedules itself for the next period, without any period skewing.</p> <dl class="section warning"><dt>Warning</dt><dd>Never use this class when a precise timebase is needed!</dd></dl> <p>Notice, that the <code>PeriodicTimerState::Expired</code> is reset to <code>PeriodicTimerState::Armed</code> only after <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute()</a></code> has returned <code>true</code>. This is different to the behavior of <a class="el" href="classxpcc_1_1_generic_timeout.html" title="Generic software timeout class for variable timebase and timestamp width. ">GenericTimeout</a>, where calls to <code><a class="el" href="classxpcc_1_1_generic_timeout.html#a663cc82e4c469d5ccd2047fd035613d5">GenericTimeout::execute()</a></code> have no impact on class state.</p> <p>The <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a36e261e9debd8c4aa650e9d5aedd7314">remaining()</a></code> time until period expiration is signed positive before, and negative after period expiration until <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f">execute()</a></code> is called. If the timer is stopped, <code><a class="el" href="classxpcc_1_1_generic_periodic_timer.html#a36e261e9debd8c4aa650e9d5aedd7314">remaining()</a></code> returns zero.</p> <dl class="section see"><dt>See also</dt><dd><a class="el" href="classxpcc_1_1_generic_timeout.html" title="Generic software timeout class for variable timebase and timestamp width. ">GenericTimeout</a></dd></dl> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname"><a class="el" href="classxpcc_1_1_clock.html" title="Internal system-tick timer. ">Clock</a></td><td>Used clock which inherits from <a class="el" href="classxpcc_1_1_clock.html" title="Internal system-tick timer. ">xpcc::Clock</a>, may have a variable timebase. </td></tr> <tr><td class="paramname">TimestampType</td><td>Used timestamp which is compatible with the chosen <a class="el" href="classxpcc_1_1_clock.html" title="Internal system-tick timer. ">Clock</a>.</td></tr> </table> </dd> </dl> <dl class="section author"><dt>Author</dt><dd><NAME> </dd> <dd> <NAME> </dd></dl> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a2bef026e4e683303266e2bebe538c63f"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2bef026e4e683303266e2bebe538c63f">&#9670;&nbsp;</a></span>execute()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class Clock, typename TimestampType = xpcc::Timestamp&gt; </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classxpcc_1_1_generic_periodic_timer.html">xpcc::GenericPeriodicTimer</a>&lt; <a class="el" href="classxpcc_1_1_clock.html">Clock</a>, TimestampType &gt;::execute </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd><code>true</code> exactly once during each period </dd></dl> </div> </div> <a id="a36e261e9debd8c4aa650e9d5aedd7314"></a> <h2 class="memtitle"><span class="permalink"><a href="#a36e261e9debd8c4aa650e9d5aedd7314">&#9670;&nbsp;</a></span>remaining()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class Clock, typename TimestampType = xpcc::Timestamp&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">TimestampType::SignedType <a class="el" href="classxpcc_1_1_generic_periodic_timer.html">xpcc::GenericPeriodicTimer</a>&lt; <a class="el" href="classxpcc_1_1_clock.html">Clock</a>, TimestampType &gt;::remaining </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>the time until (positive time) or since (negative time) expiration, or 0 if stopped </dd></dl> </div> </div> <a id="ac70aa47213a9117802e74e4291acab87"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac70aa47213a9117802e74e4291acab87">&#9670;&nbsp;</a></span>getState()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class Clock, typename TimestampType = xpcc::Timestamp&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__software__timer.html#gabcc9087dd7bf4f67559efacad4f622d8">PeriodicTimerState</a> <a class="el" href="classxpcc_1_1_generic_periodic_timer.html">xpcc::GenericPeriodicTimer</a>&lt; <a class="el" href="classxpcc_1_1_clock.html">Clock</a>, TimestampType &gt;::getState </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>the current state of the timer </dd></dl> </div> </div> <a id="a7624cbce4fb8c4be66a63740a5e9b484"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7624cbce4fb8c4be66a63740a5e9b484">&#9670;&nbsp;</a></span>isStopped()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class Clock, typename TimestampType = xpcc::Timestamp&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classxpcc_1_1_generic_periodic_timer.html">xpcc::GenericPeriodicTimer</a>&lt; <a class="el" href="classxpcc_1_1_clock.html">Clock</a>, TimestampType &gt;::isStopped </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd><code>true</code> if the timer has been stopped, <code>false</code> otherwise </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>periodic_timer.hpp</li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespacexpcc.html">xpcc</a></li><li class="navelem"><a class="el" href="classxpcc_1_1_generic_periodic_timer.html">GenericPeriodicTimer</a></li> <li class="footer">Generated on Tue Jun 27 2017 20:03:53 for xpcc by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html> <file_sep>/docs/api/classxpcc_1_1gui_1_1_number_field.js var classxpcc_1_1gui_1_1_number_field = [ [ "NumberField", "classxpcc_1_1gui_1_1_number_field.html#a1fd760d8a12757cb8816c0369d4bdc30", null ], [ "render", "classxpcc_1_1gui_1_1_number_field.html#aca1f3a5365d51278fdb2e60579b22845", null ], [ "setValue", "classxpcc_1_1gui_1_1_number_field.html#ab5c7bc9d45248d2804cd634b4b7f8e85", null ], [ "getValue", "classxpcc_1_1gui_1_1_number_field.html#a7ca574dcf19a6dcbe46c4f3b15857826", null ] ];<file_sep>/docs/api/classxpcc_1_1_unix_time.js var classxpcc_1_1_unix_time = [ [ "UnixTime", "classxpcc_1_1_unix_time.html#aa4fdc5faff748e7c20515fb9ead9f17c", null ], [ "operator uint32_t", "classxpcc_1_1_unix_time.html#ab0b513855a7c3cf02c59e7481eec45fe", null ], [ "toDate", "classxpcc_1_1_unix_time.html#a77b77725d8cf9d86af36f1cfd2933e45", null ] ];<file_sep>/docs/api/classxpcc_1_1_smart_pointer.js var classxpcc_1_1_smart_pointer = [ [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#a35642760a27a1adf865f9aff32ad8cd5", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#af59427b7cfa6f8c7beda74afdf8dc29a", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#a8f614428db9e49b9285c53192eafc1ba", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#ab20d2d0ae241868046b51eec51fe6e7c", null ], [ "~SmartPointer", "classxpcc_1_1_smart_pointer.html#af9d4d69ef2a425a5a45a1f658e8cac4b", null ], [ "getPointer", "classxpcc_1_1_smart_pointer.html#a22977d1c61cdc89727c406529f92ce68", null ], [ "getPointer", "classxpcc_1_1_smart_pointer.html#ace274a5bd94d95ef619ca66fc3f4ea60", null ], [ "getSize", "classxpcc_1_1_smart_pointer.html#a635445da636851d0aa3fba3ec554cc3d", null ], [ "get", "classxpcc_1_1_smart_pointer.html#a6d75f503be3f15751414028cca140eea", null ], [ "get", "classxpcc_1_1_smart_pointer.html#ad2bbbb25171032fef0df015ad17528ef", null ], [ "operator==", "classxpcc_1_1_smart_pointer.html#ae91af79b6fb9e4aa25fad1d94af357d3", null ], [ "operator=", "classxpcc_1_1_smart_pointer.html#ae7ca4ffaefc7b0874ebb11e8e0df8d10", null ], [ "operator<<", "classxpcc_1_1_smart_pointer.html#a96e98848a8890f7429bd90edb1168637", null ], [ "ptr", "classxpcc_1_1_smart_pointer.html#a9cf08c940d47f091c401d0024688f373", null ] ];<file_sep>/docs/api/structxpcc_1_1_configuration.js var structxpcc_1_1_configuration = [ [ "Configuration", "structxpcc_1_1_configuration.html#a33e82b594c0143d24ac417e2bf63c5bf", null ], [ "Configuration", "structxpcc_1_1_configuration.html#a9b6f131ab9f8f605ea1dbba2f827cb25", null ], [ "Configuration", "structxpcc_1_1_configuration.html#a88976ae52646048862d332258ee4880c", null ], [ "Configuration", "structxpcc_1_1_configuration.html#aab4ab78b84929e91ad02e9089ecba729", null ] ];<file_sep>/docs/api/classxpcc_1_1tmp_1_1_conversion.js var classxpcc_1_1tmp_1_1_conversion = [ [ "exists", "classxpcc_1_1tmp_1_1_conversion.html#ac38cf5b3cd44824ebc6fca0df965d0a3adbe1485d1bf8da88be27937665aeded9", null ], [ "existsBothWays", "classxpcc_1_1tmp_1_1_conversion.html#ac38cf5b3cd44824ebc6fca0df965d0a3a161df622500b1bbb8536d50e6f8fbfbb", null ], [ "isSameType", "classxpcc_1_1tmp_1_1_conversion.html#ac<KEY>6<KEY>a24<KEY>7e6ad2bd8389b916", null ] ];<file_sep>/docs/api/namespacexpcc_1_1filter.js var namespacexpcc_1_1filter = [ [ "Debounce", "classxpcc_1_1filter_1_1_debounce.html", "classxpcc_1_1filter_1_1_debounce" ], [ "Fir", "classxpcc_1_1filter_1_1_fir.html", "classxpcc_1_1filter_1_1_fir" ], [ "Median", "classxpcc_1_1filter_1_1_median.html", "classxpcc_1_1filter_1_1_median" ], [ "MovingAverage", "classxpcc_1_1filter_1_1_moving_average.html", "classxpcc_1_1filter_1_1_moving_average" ], [ "Ramp", "classxpcc_1_1filter_1_1_ramp.html", "classxpcc_1_1filter_1_1_ramp" ] ];<file_sep>/docs/api/classxpcc_1_1_i2c_read_transaction.js var classxpcc_1_1_i2c_read_transaction = [ [ "I2cReadTransaction", "classxpcc_1_1_i2c_read_transaction.html#ac5e0a1783cc2bd8fa78ed509a77532aa", null ], [ "configurePing", "classxpcc_1_1_i2c_read_transaction.html#a2f35d3755da096d82341db97afc1226d", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_read_transaction.html#a0a1771b472f859a6fd6fbb5591563efe", null ], [ "configureWrite", "classxpcc_1_1_i2c_read_transaction.html#ab2666bc0daaf025b9c1e357593fdf9b6", null ], [ "configureRead", "classxpcc_1_1_i2c_read_transaction.html#a5f7b9d64207541733686bbea04bdf0e9", null ], [ "starting", "classxpcc_1_1_i2c_read_transaction.html#a7312adeab9bd39c37d471f5e1f5ddd13", null ], [ "writing", "classxpcc_1_1_i2c_read_transaction.html#a6d2251720be59d717580e2248eaf92fe", null ], [ "reading", "classxpcc_1_1_i2c_read_transaction.html#ae0711ff497a0be391eb70b0042d9642a", null ], [ "size", "classxpcc_1_1_i2c_read_transaction.html#af2a0490c9e63045f83ba71e7f70305bc", null ], [ "buffer", "classxpcc_1_1_i2c_read_transaction.html#a173d662234917be77a3abfa61e4654b2", null ] ];<file_sep>/docs/api/classunittest_1_1_test_suite.js var classunittest_1_1_test_suite = [ [ "~TestSuite", "classunittest_1_1_test_suite.html#abd0868ba66cea5fb21905436909ceb00", null ], [ "setUp", "classunittest_1_1_test_suite.html#a4662054009837ddf000e32b70d0c5b0f", null ], [ "tearDown", "classunittest_1_1_test_suite.html#a382e081623cd0bd4e3ff6a4550cd90c9", null ] ];<file_sep>/docs/api/group__freertos.js var group__freertos = [ [ "Mutex", "classxpcc_1_1rtos_1_1_mutex.html", [ [ "Mutex", "classxpcc_1_1rtos_1_1_mutex.html#a499dba84792192d9ef5c2d8d55ac0e3b", null ], [ "~Mutex", "classxpcc_1_1rtos_1_1_mutex.html#a65c912afbb58b96425ee76371d0eb728", null ], [ "Mutex", "classxpcc_1_1rtos_1_1_mutex.html#a499dba84792192d9ef5c2d8d55ac0e3b", null ], [ "~Mutex", "classxpcc_1_1rtos_1_1_mutex.html#a65c912afbb58b96425ee76371d0eb728", null ], [ "acquire", "classxpcc_1_1rtos_1_1_mutex.html#a6fb6dedd3f3fc9c687d549f986c8e3c5", null ], [ "acquire", "classxpcc_1_1rtos_1_1_mutex.html#ac2fbae98d0a569ef95f23b5031463bd9", null ], [ "release", "classxpcc_1_1rtos_1_1_mutex.html#aebe8dddb35e485133b4d178197cd9208", null ], [ "acquire", "classxpcc_1_1rtos_1_1_mutex.html#af5d9dd4f4eff8db9a816007b4dee2fff", null ], [ "release", "classxpcc_1_1rtos_1_1_mutex.html#aebe8dddb35e485133b4d178197cd9208", null ], [ "MutexGuard", "classxpcc_1_1rtos_1_1_mutex.html#a574d54796db4c7253e6a1f4f30b179ca", null ] ] ], [ "QueueBase", "classxpcc_1_1rtos_1_1_queue_base.html", [ [ "QueueBase", "classxpcc_1_1rtos_1_1_queue_base.html#a0d65b289773d1c0a54395d256c638685", null ], [ "~QueueBase", "classxpcc_1_1rtos_1_1_queue_base.html#ab5d9cd958e16152441a6785d08ecb3be", null ], [ "getSize", "classxpcc_1_1rtos_1_1_queue_base.html#aa602c8a59aa0d82120b83d5e967edba2", null ], [ "append", "classxpcc_1_1rtos_1_1_queue_base.html#ae342e298c158bf0fd8ab5279fcfb58b8", null ], [ "prepend", "classxpcc_1_1rtos_1_1_queue_base.html#a051b2310b14374f084d5b83df1744349", null ], [ "peek", "classxpcc_1_1rtos_1_1_queue_base.html#ad88a21f40bb35e3c72d5f37ef2598e41", null ], [ "get", "classxpcc_1_1rtos_1_1_queue_base.html#a86a1402d07f32279de1084363fde0653", null ], [ "appendFromInterrupt", "classxpcc_1_1rtos_1_1_queue_base.html#a48358a6218141f83bd3cdcbd8f8cd583", null ], [ "prependFromInterrupt", "classxpcc_1_1rtos_1_1_queue_base.html#ac1ba924536fb042a34488c06e02a4c30", null ], [ "getFromInterrupt", "classxpcc_1_1rtos_1_1_queue_base.html#a510dd9014e66e2525a899d06bb03a016", null ], [ "handle", "classxpcc_1_1rtos_1_1_queue_base.html#a80a0fd9f456c006b68cd9fd9517a9bf6", null ] ] ], [ "Queue", "classxpcc_1_1rtos_1_1_queue.html", [ [ "Queue", "classxpcc_1_1rtos_1_1_queue.html#a49e3bb75c6a7ba82a07c0dcf357c0633", null ], [ "~Queue", "classxpcc_1_1rtos_1_1_queue.html#afda319461c42c3f214beb6d16b8b4efd", null ], [ "Queue", "classxpcc_1_1rtos_1_1_queue.html#a344b28a5edb0ca1b308a0573bed2dd3b", null ], [ "getSize", "classxpcc_1_1rtos_1_1_queue.html#a4ca77ac7253539f19ce7cdb0e6f8668c", null ], [ "append", "classxpcc_1_1rtos_1_1_queue.html#a8585b8939384e24a134b4e0238216add", null ], [ "prepend", "classxpcc_1_1rtos_1_1_queue.html#aeb02c0e81e6de68c608f5abe0b0484ef", null ], [ "peek", "classxpcc_1_1rtos_1_1_queue.html#a8916a78337bc426a4803fad19c0246a0", null ], [ "get", "classxpcc_1_1rtos_1_1_queue.html#ab6b644f728a9db19926e24baea460978", null ], [ "appendFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a08f7891dabf3228896a1ab5e4e9127b2", null ], [ "prependFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a8a5e76293b9088da7ead7232b60e8ecf", null ], [ "getFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a023dcede9080877aa31501c2087309e3", null ], [ "append", "classxpcc_1_1rtos_1_1_queue.html#a2e95fe36178f243276a7f7c98c63cd52", null ], [ "prepend", "classxpcc_1_1rtos_1_1_queue.html#af96230fc1425d97a48f4f148020e203b", null ], [ "peek", "classxpcc_1_1rtos_1_1_queue.html#ab97d125c0da7675ae2e5ca8def9429e3", null ], [ "get", "classxpcc_1_1rtos_1_1_queue.html#a4104487dbe71ee58b31e1fa0360af5fb", null ], [ "appendFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a08f7891dabf3228896a1ab5e4e9127b2", null ], [ "prependFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a8a5e76293b9088da7ead7232b60e8ecf", null ], [ "getFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a023dcede9080877aa31501c2087309e3", null ] ] ], [ "Scheduler", "classxpcc_1_1rtos_1_1_scheduler.html", null ], [ "Semaphore", "classxpcc_1_1rtos_1_1_semaphore.html", [ [ "Semaphore", "classxpcc_1_1rtos_1_1_semaphore.html#a96912e5e5eae204661ffb07227a0448a", null ], [ "Semaphore", "classxpcc_1_1rtos_1_1_semaphore.html#a440b58a672def186c4acb22df25205c8", null ], [ "acquire", "classxpcc_1_1rtos_1_1_semaphore.html#a3aea7d7633547be493ff9e5f3a73827d", null ], [ "release", "classxpcc_1_1rtos_1_1_semaphore.html#a8fdb0fdbe13bd0ebbf5e14af625af662", null ], [ "releaseFromInterrupt", "classxpcc_1_1rtos_1_1_semaphore.html#a85240089ec174f99e138305436f12c89", null ] ] ], [ "Thread", "classxpcc_1_1rtos_1_1_thread.html", [ [ "Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html", [ [ "Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html#a864790b4dbb62f97391e4c5c43d8abea", null ], [ "~Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html#a7da3f35e8192af0337202bf39cb71889", null ] ] ], [ "Lock", "classxpcc_1_1rtos_1_1_thread.html#a469d88e6ead0200286793207b5041d0f", null ], [ "Thread", "classxpcc_1_1rtos_1_1_thread.html#a76a170dedb6db5be245032171548e6bd", null ], [ "~Thread", "classxpcc_1_1rtos_1_1_thread.html#a1edf0913203cec0382f8556f7f64ba69", null ], [ "Thread", "classxpcc_1_1rtos_1_1_thread.html#aa596af82866c0eb46412ca5ff87bb1db", null ], [ "~Thread", "classxpcc_1_1rtos_1_1_thread.html#a1edf0913203cec0382f8556f7f64ba69", null ], [ "getPriority", "classxpcc_1_1rtos_1_1_thread.html#ae14e320a732cca29bee7d921deb11804", null ], [ "setPriority", "classxpcc_1_1rtos_1_1_thread.html#a2af06f67fed12abd98647ba5632ad760", null ], [ "run", "classxpcc_1_1rtos_1_1_thread.html#abf41cef53d48cd2293c755dda0ea144b", null ], [ "getPriority", "classxpcc_1_1rtos_1_1_thread.html#ad104bcb21bc1a3802dfa6b50179e7ea4", null ], [ "setPriority", "classxpcc_1_1rtos_1_1_thread.html#a59bfb807d8614b19c99a97dc75865821", null ], [ "run", "classxpcc_1_1rtos_1_1_thread.html#abf41cef53d48cd2293c755dda0ea144b", null ], [ "Scheduler", "classxpcc_1_1rtos_1_1_thread.html#afb88c77ea5daaefa6c8fa6bc5b9aa5c1", null ] ] ], [ "TIME_LOOP", "group__freertos.html#ga70bfba14992c65d4acb1d5e90c6b229f", null ], [ "MILLISECONDS", "group__freertos.html#ga523f92e3a3a17c1f64110375785270ee", null ] ];<file_sep>/docs/api/classxpcc_1_1_mcp23x17.js var classxpcc_1_1_mcp23x17 = [ [ "PortType", "classxpcc_1_1_mcp23x17.html#ae1e3f2c10e21eec2393853e6e80dbead", null ], [ "A0", "classxpcc_1_1_mcp23x17.html#a61fe458a657e793a4deca98e7911d97c", null ], [ "A1", "classxpcc_1_1_mcp23x17.html#a40045b541aa56f58e6a8a615c8f00b10", null ], [ "A2", "classxpcc_1_1_mcp23x17.html#a278bf672d8684a509527328d2207480e", null ], [ "A3", "classxpcc_1_1_mcp23x17.html#a5a07133503ec590dd6013f5683905be0", null ], [ "A4", "classxpcc_1_1_mcp23x17.html#a21626559ca81c7d76caa89e88a03673c", null ], [ "A5", "classxpcc_1_1_mcp23x17.html#a5b178aba539b4b5f9a879858132b62a4", null ], [ "A6", "classxpcc_1_1_mcp23x17.html#aa7d9dda870a54034c256f826b9efd7de", null ], [ "A7", "classxpcc_1_1_mcp23x17.html#a0abc59a04214818da58b53fb6cafc5b3", null ], [ "B0", "classxpcc_1_1_mcp23x17.html#aae596572bbe4e95b967d43195b9f532b", null ], [ "B1", "classxpcc_1_1_mcp23x17.html#a97f0bf3710596d7fe90b7805b03cccd9", null ], [ "B2", "classxpcc_1_1_mcp23x17.html#a495da5416177a88abe5d6d3725d2597a", null ], [ "B3", "classxpcc_1_1_mcp23x17.html#a4964e4879d7671ef130658dbc66b2186", null ], [ "B4", "classxpcc_1_1_mcp23x17.html#adf307aa29e3fcabba7c494d4216afa99", null ], [ "B5", "classxpcc_1_1_mcp23x17.html#ab1d01bc3b697fafa4de60a605133948e", null ], [ "B6", "classxpcc_1_1_mcp23x17.html#abff94e16fa79d8d115e1ea6134555f55", null ], [ "B7", "classxpcc_1_1_mcp23x17.html#a769350efb948a997f93ac817863beaec", null ], [ "Port", "classxpcc_1_1_mcp23x17.html#a9e976ff7822d2dc654e1d2d744e88d61", null ], [ "Mcp23x17", "classxpcc_1_1_mcp23x17.html#abb2cc6c1a0e696e92ec4b4649675ccbf", null ], [ "setOutput", "classxpcc_1_1_mcp23x17.html#abc7a79ab13f254b33828278eb7c52419", null ], [ "set", "classxpcc_1_1_mcp23x17.html#a3de9757207e3ad0836448c3829ed6ab5", null ], [ "reset", "classxpcc_1_1_mcp23x17.html#aea9fe2354cd0860c0c0f6db489373e1d", null ], [ "toggle", "classxpcc_1_1_mcp23x17.html#ab017c4e4ac6d377fc0e2c421dcb2dfe7", null ], [ "set", "classxpcc_1_1_mcp23x17.html#a7851ab787d5e0408bb251d9c21dab06c", null ], [ "isSet", "classxpcc_1_1_mcp23x17.html#ae348a377c64685287ba898b8d4fa7b23", null ], [ "getDirection", "classxpcc_1_1_mcp23x17.html#a7d2d4f3a9563fd5c7834a8aebdc1a20a", null ], [ "setInput", "classxpcc_1_1_mcp23x17.html#a12fc9541b3657f842789b5d7bc54a642", null ], [ "setPullUp", "classxpcc_1_1_mcp23x17.html#a0abc1e68b2aea8b8681aee72e125446a", null ], [ "resetPullUp", "classxpcc_1_1_mcp23x17.html#ac0c568fdd8d28ca720bcdd9e629400e6", null ], [ "setInvertInput", "classxpcc_1_1_mcp23x17.html#a9b5757e6a4c4f146d05e6e2f14f52435", null ], [ "resetInvertInput", "classxpcc_1_1_mcp23x17.html#a1e632925d891b647890b72d5343b5478", null ], [ "read", "classxpcc_1_1_mcp23x17.html#aa2fb25942af7f834c608e8d5eb901078", null ], [ "readInput", "classxpcc_1_1_mcp23x17.html#a375f7d421ac2350631405ccda1b7b6e1", null ], [ "readAllInput", "classxpcc_1_1_mcp23x17.html#abd792fa7d2d40eab1d7cb93680d41f7c", null ], [ "writePort", "classxpcc_1_1_mcp23x17.html#a11a95ef92cbba1e7e39f1ad06eb40916", null ], [ "readPort", "classxpcc_1_1_mcp23x17.html#a6be5550de53e0167f857b9d5488d6c94", null ], [ "getDirections", "classxpcc_1_1_mcp23x17.html#ac0403f1d2953f2ec590265ddac4e3666", null ], [ "getOutputs", "classxpcc_1_1_mcp23x17.html#a30c36e301acd230b2d69704f647a4159", null ], [ "getInputs", "classxpcc_1_1_mcp23x17.html#a3e85d77aefc4cca47449491533a388b0", null ], [ "getPolarities", "classxpcc_1_1_mcp23x17.html#a0cb4b5316010a2536318a3f98ac486af", null ] ];<file_sep>/docs/api/classxpcc_1_1_st7565.js var classxpcc_1_1_st7565 = [ [ "~St7565", "classxpcc_1_1_st7565.html#ae3f13d1a3e9650003a9eaf1ca395f74d", null ], [ "update", "classxpcc_1_1_st7565.html#a451c6d182feeb1d43f2a646389d6bdcb", null ], [ "setInvert", "classxpcc_1_1_st7565.html#a3b37cc4b1790d5dd73488cb5dd4d6d5c", null ], [ "initialize", "classxpcc_1_1_st7565.html#a00b06887df3d99e4f961fa51db76d960", null ], [ "spi", "classxpcc_1_1_st7565.html#a2f1246cb6ba12acd1d02175fc78dd3e1", null ], [ "cs", "classxpcc_1_1_st7565.html#ae6128fd555b4745b5a0f863dab2c5934", null ], [ "a0", "classxpcc_1_1_st7565.html#a3161abe4d5b826e879dedf846b88979e", null ], [ "reset", "classxpcc_1_1_st7565.html#a65e0456a44b286ec4495bc1eb3d2c95d", null ] ];<file_sep>/docs/api/classxpcc_1_1_generic_timeout.js var classxpcc_1_1_generic_timeout = [ [ "GenericTimeout", "classxpcc_1_1_generic_timeout.html#a34666f8eb21ac67f3dff10c09521340b", null ], [ "GenericTimeout", "classxpcc_1_1_generic_timeout.html#adea65ca1f1fb5184ad8702be422ef51c", null ], [ "restart", "classxpcc_1_1_generic_timeout.html#a12a4f83e617bb81794d7f3d524bf6700", null ], [ "stop", "classxpcc_1_1_generic_timeout.html#a0e919a5ec0ae34b42602d92a2f5a7e5b", null ], [ "execute", "classxpcc_1_1_generic_timeout.html#a663cc82e4c469d5ccd2047fd035613d5", null ], [ "remaining", "classxpcc_1_1_generic_timeout.html#aadbfd364b1ade3d6f0c110cb29d7be4e", null ], [ "getState", "classxpcc_1_1_generic_timeout.html#a9762fc97412f74cef932122d501065fd", null ], [ "isStopped", "classxpcc_1_1_generic_timeout.html#a579a923ee1fecdd53df23de4a58173fe", null ], [ "isExpired", "classxpcc_1_1_generic_timeout.html#a9b1594f8e48dd04fc33d31bcd5f5bb17", null ], [ "isArmed", "classxpcc_1_1_generic_timeout.html#ac6f716c0c67e9c5c092254e1f3a64b4d", null ], [ "GenericPeriodicTimer< Clock, TimestampType >", "classxpcc_1_1_generic_timeout.html#a01ee9ed70e7abf682b850d906630694d", null ] ];<file_sep>/docs/api/classxpcc_1_1rtos_1_1_thread.js var classxpcc_1_1rtos_1_1_thread = [ [ "Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html", "classxpcc_1_1rtos_1_1_thread_1_1_lock" ], [ "Lock", "classxpcc_1_1rtos_1_1_thread.html#a469d88e6ead0200286793207b5041d0f", null ], [ "Thread", "classxpcc_1_1rtos_1_1_thread.html#a76a170dedb6db5be245032171548e6bd", null ], [ "~Thread", "classxpcc_1_1rtos_1_1_thread.html#a1edf0913203cec0382f8556f7f64ba69", null ], [ "Thread", "classxpcc_1_1rtos_1_1_thread.html#aa596af82866c0eb46412ca5ff87bb1db", null ], [ "~Thread", "classxpcc_1_1rtos_1_1_thread.html#a1edf0913203cec0382f8556f7f64ba69", null ], [ "getPriority", "classxpcc_1_1rtos_1_1_thread.html#ae14e320a732cca29bee7d921deb11804", null ], [ "setPriority", "classxpcc_1_1rtos_1_1_thread.html#a2af06f67fed12abd98647ba5632ad760", null ], [ "run", "classxpcc_1_1rtos_1_1_thread.html#abf41cef53d48cd2293c755dda0ea144b", null ], [ "getPriority", "classxpcc_1_1rtos_1_1_thread.html#ad104bcb21bc1a3802dfa6b50179e7ea4", null ], [ "setPriority", "classxpcc_1_1rtos_1_1_thread.html#a59bfb807d8614b19c99a97dc75865821", null ], [ "run", "classxpcc_1_1rtos_1_1_thread.html#abf41cef53d48cd2293c755dda0ea144b", null ], [ "Scheduler", "classxpcc_1_1rtos_1_1_thread.html#afb88c77ea5daaefa6c8fa6bc5b9aa5c1", null ] ];<file_sep>/docs/api/classxpcc_1_1accessor_1_1_flash.js var classxpcc_1_1accessor_1_1_flash = [ [ "Flash", "classxpcc_1_1accessor_1_1_flash.html#af32bffbc19e3f29d03812f4abb84134f", null ], [ "Flash", "classxpcc_1_1accessor_1_1_flash.html#a302f88ac6457061de711ec981a6a6566", null ], [ "operator*", "classxpcc_1_1accessor_1_1_flash.html#ac11c2c9049d65be443f4fc078c019233", null ], [ "operator[]", "classxpcc_1_1accessor_1_1_flash.html#a71ac2520b5bf2760adeaf119be6a05ed", null ], [ "operator++", "classxpcc_1_1accessor_1_1_flash.html#a0461119ccb0f03f87b8badce22a6f7d3", null ], [ "operator++", "classxpcc_1_1accessor_1_1_flash.html#a1813231f42ee8dba205efd74ea363eab", null ], [ "operator--", "classxpcc_1_1accessor_1_1_flash.html#a37192c8215618adadd21751020882eac", null ], [ "operator--", "classxpcc_1_1accessor_1_1_flash.html#acd3e355730792c871f7873d4ff93cd17", null ], [ "operator+=", "classxpcc_1_1accessor_1_1_flash.html#aef4c0b8b68e1b6ae86e59a419cca3fd4", null ], [ "operator-=", "classxpcc_1_1accessor_1_1_flash.html#ac9ea092c730bb96c218ceecc7d618803", null ], [ "isValid", "classxpcc_1_1accessor_1_1_flash.html#a22b9e5c2d5e3dc273c27075b00a60343", null ], [ "getPointer", "classxpcc_1_1accessor_1_1_flash.html#a4b6c3231ae556e97f0f94e1e7383e6e3", null ], [ "operator<<", "classxpcc_1_1accessor_1_1_flash.html#a42384253ab8b1b455ce018721ca9be45", null ] ];<file_sep>/docs/api/navtreeindex27.js var NAVTREEINDEX27 = { "structxpcc_1_1stm32_1_1_gpio_input_b14.html":[1,1,3,0,5,92], "structxpcc_1_1stm32_1_1_gpio_input_b15.html":[1,1,3,0,5,95], "structxpcc_1_1stm32_1_1_gpio_input_b2.html":[1,1,3,0,5,56], "structxpcc_1_1stm32_1_1_gpio_input_b3.html":[1,1,3,0,5,59], "structxpcc_1_1stm32_1_1_gpio_input_b4.html":[1,1,3,0,5,62], "structxpcc_1_1stm32_1_1_gpio_input_b5.html":[1,1,3,0,5,65], "structxpcc_1_1stm32_1_1_gpio_input_b6.html":[1,1,3,0,5,68], "structxpcc_1_1stm32_1_1_gpio_input_b7.html":[1,1,3,0,5,71], "structxpcc_1_1stm32_1_1_gpio_input_b8.html":[1,1,3,0,5,74], "structxpcc_1_1stm32_1_1_gpio_input_b9.html":[1,1,3,0,5,77], "structxpcc_1_1stm32_1_1_gpio_input_c0.html":[1,1,3,0,5,98], "structxpcc_1_1stm32_1_1_gpio_input_c1.html":[1,1,3,0,5,101], "structxpcc_1_1stm32_1_1_gpio_input_c10.html":[1,1,3,0,5,128], "structxpcc_1_1stm32_1_1_gpio_input_c11.html":[1,1,3,0,5,131], "structxpcc_1_1stm32_1_1_gpio_input_c12.html":[1,1,3,0,5,134], "structxpcc_1_1stm32_1_1_gpio_input_c13.html":[1,1,3,0,5,137], "structxpcc_1_1stm32_1_1_gpio_input_c14.html":[1,1,3,0,5,140], "structxpcc_1_1stm32_1_1_gpio_input_c15.html":[1,1,3,0,5,143], "structxpcc_1_1stm32_1_1_gpio_input_c2.html":[1,1,3,0,5,104], "structxpcc_1_1stm32_1_1_gpio_input_c3.html":[1,1,3,0,5,107], "structxpcc_1_1stm32_1_1_gpio_input_c4.html":[1,1,3,0,5,110], "structxpcc_1_1stm32_1_1_gpio_input_c5.html":[1,1,3,0,5,113], "structxpcc_1_1stm32_1_1_gpio_input_c6.html":[1,1,3,0,5,116], "structxpcc_1_1stm32_1_1_gpio_input_c7.html":[1,1,3,0,5,119], "structxpcc_1_1stm32_1_1_gpio_input_c8.html":[1,1,3,0,5,122], "structxpcc_1_1stm32_1_1_gpio_input_c9.html":[1,1,3,0,5,125], "structxpcc_1_1stm32_1_1_gpio_input_d0.html":[1,1,3,0,5,146], "structxpcc_1_1stm32_1_1_gpio_input_d1.html":[1,1,3,0,5,149], "structxpcc_1_1stm32_1_1_gpio_input_d10.html":[1,1,3,0,5,176], "structxpcc_1_1stm32_1_1_gpio_input_d11.html":[1,1,3,0,5,179], "structxpcc_1_1stm32_1_1_gpio_input_d12.html":[1,1,3,0,5,182], "structxpcc_1_1stm32_1_1_gpio_input_d13.html":[1,1,3,0,5,185], "structxpcc_1_1stm32_1_1_gpio_input_d14.html":[1,1,3,0,5,188], "structxpcc_1_1stm32_1_1_gpio_input_d15.html":[1,1,3,0,5,191], "structxpcc_1_1stm32_1_1_gpio_input_d2.html":[1,1,3,0,5,152], "structxpcc_1_1stm32_1_1_gpio_input_d3.html":[1,1,3,0,5,155], "structxpcc_1_1stm32_1_1_gpio_input_d4.html":[1,1,3,0,5,158], "structxpcc_1_1stm32_1_1_gpio_input_d5.html":[1,1,3,0,5,161], "structxpcc_1_1stm32_1_1_gpio_input_d6.html":[1,1,3,0,5,164], "structxpcc_1_1stm32_1_1_gpio_input_d7.html":[1,1,3,0,5,167], "structxpcc_1_1stm32_1_1_gpio_input_d8.html":[1,1,3,0,5,170], "structxpcc_1_1stm32_1_1_gpio_input_d9.html":[1,1,3,0,5,173], "structxpcc_1_1stm32_1_1_gpio_input_e0.html":[1,1,3,0,5,194], "structxpcc_1_1stm32_1_1_gpio_input_e1.html":[1,1,3,0,5,197], "structxpcc_1_1stm32_1_1_gpio_input_e10.html":[1,1,3,0,5,224], "structxpcc_1_1stm32_1_1_gpio_input_e11.html":[1,1,3,0,5,227], "structxpcc_1_1stm32_1_1_gpio_input_e12.html":[1,1,3,0,5,230], "structxpcc_1_1stm32_1_1_gpio_input_e13.html":[1,1,3,0,5,233], "structxpcc_1_1stm32_1_1_gpio_input_e14.html":[1,1,3,0,5,236], "structxpcc_1_1stm32_1_1_gpio_input_e15.html":[1,1,3,0,5,239], "structxpcc_1_1stm32_1_1_gpio_input_e2.html":[1,1,3,0,5,200], "structxpcc_1_1stm32_1_1_gpio_input_e3.html":[1,1,3,0,5,203], "structxpcc_1_1stm32_1_1_gpio_input_e4.html":[1,1,3,0,5,206], "structxpcc_1_1stm32_1_1_gpio_input_e5.html":[1,1,3,0,5,209], "structxpcc_1_1stm32_1_1_gpio_input_e6.html":[1,1,3,0,5,212], "structxpcc_1_1stm32_1_1_gpio_input_e7.html":[1,1,3,0,5,215], "structxpcc_1_1stm32_1_1_gpio_input_e8.html":[1,1,3,0,5,218], "structxpcc_1_1stm32_1_1_gpio_input_e9.html":[1,1,3,0,5,221], "structxpcc_1_1stm32_1_1_gpio_input_h0.html":[1,1,3,0,5,242], "structxpcc_1_1stm32_1_1_gpio_input_h1.html":[1,1,3,0,5,245], "structxpcc_1_1stm32_1_1_gpio_output_a0.html":[1,1,3,0,5,1], "structxpcc_1_1stm32_1_1_gpio_output_a1.html":[1,1,3,0,5,4], "structxpcc_1_1stm32_1_1_gpio_output_a10.html":[1,1,3,0,5,31], "structxpcc_1_1stm32_1_1_gpio_output_a11.html":[1,1,3,0,5,34], "structxpcc_1_1stm32_1_1_gpio_output_a12.html":[1,1,3,0,5,37], "structxpcc_1_1stm32_1_1_gpio_output_a13.html":[1,1,3,0,5,40], "structxpcc_1_1stm32_1_1_gpio_output_a14.html":[1,1,3,0,5,43], "structxpcc_1_1stm32_1_1_gpio_output_a15.html":[1,1,3,0,5,46], "structxpcc_1_1stm32_1_1_gpio_output_a2.html":[1,1,3,0,5,7], "structxpcc_1_1stm32_1_1_gpio_output_a3.html":[1,1,3,0,5,10], "structxpcc_1_1stm32_1_1_gpio_output_a4.html":[1,1,3,0,5,13], "structxpcc_1_1stm32_1_1_gpio_output_a5.html":[1,1,3,0,5,16], "structxpcc_1_1stm32_1_1_gpio_output_a6.html":[1,1,3,0,5,19], "structxpcc_1_1stm32_1_1_gpio_output_a7.html":[1,1,3,0,5,22], "structxpcc_1_1stm32_1_1_gpio_output_a8.html":[1,1,3,0,5,25], "structxpcc_1_1stm32_1_1_gpio_output_a9.html":[1,1,3,0,5,28], "structxpcc_1_1stm32_1_1_gpio_output_b0.html":[1,1,3,0,5,49], "structxpcc_1_1stm32_1_1_gpio_output_b1.html":[1,1,3,0,5,52], "structxpcc_1_1stm32_1_1_gpio_output_b10.html":[1,1,3,0,5,79], "structxpcc_1_1stm32_1_1_gpio_output_b11.html":[1,1,3,0,5,82], "structxpcc_1_1stm32_1_1_gpio_output_b12.html":[1,1,3,0,5,85], "structxpcc_1_1stm32_1_1_gpio_output_b13.html":[1,1,3,0,5,88], "structxpcc_1_1stm32_1_1_gpio_output_b14.html":[1,1,3,0,5,91], "structxpcc_1_1stm32_1_1_gpio_output_b15.html":[1,1,3,0,5,94], "structxpcc_1_1stm32_1_1_gpio_output_b2.html":[1,1,3,0,5,55], "structxpcc_1_1stm32_1_1_gpio_output_b3.html":[1,1,3,0,5,58], "structxpcc_1_1stm32_1_1_gpio_output_b4.html":[1,1,3,0,5,61], "structxpcc_1_1stm32_1_1_gpio_output_b5.html":[1,1,3,0,5,64], "structxpcc_1_1stm32_1_1_gpio_output_b6.html":[1,1,3,0,5,67], "structxpcc_1_1stm32_1_1_gpio_output_b7.html":[1,1,3,0,5,70], "structxpcc_1_1stm32_1_1_gpio_output_b8.html":[1,1,3,0,5,73], "structxpcc_1_1stm32_1_1_gpio_output_b9.html":[1,1,3,0,5,76], "structxpcc_1_1stm32_1_1_gpio_output_c0.html":[1,1,3,0,5,97], "structxpcc_1_1stm32_1_1_gpio_output_c1.html":[1,1,3,0,5,100], "structxpcc_1_1stm32_1_1_gpio_output_c10.html":[1,1,3,0,5,127], "structxpcc_1_1stm32_1_1_gpio_output_c11.html":[1,1,3,0,5,130], "structxpcc_1_1stm32_1_1_gpio_output_c12.html":[1,1,3,0,5,133], "structxpcc_1_1stm32_1_1_gpio_output_c13.html":[1,1,3,0,5,136], "structxpcc_1_1stm32_1_1_gpio_output_c14.html":[1,1,3,0,5,139], "structxpcc_1_1stm32_1_1_gpio_output_c15.html":[1,1,3,0,5,142], "structxpcc_1_1stm32_1_1_gpio_output_c2.html":[1,1,3,0,5,103], "structxpcc_1_1stm32_1_1_gpio_output_c3.html":[1,1,3,0,5,106], "structxpcc_1_1stm32_1_1_gpio_output_c4.html":[1,1,3,0,5,109], "structxpcc_1_1stm32_1_1_gpio_output_c5.html":[1,1,3,0,5,112], "structxpcc_1_1stm32_1_1_gpio_output_c6.html":[1,1,3,0,5,115], "structxpcc_1_1stm32_1_1_gpio_output_c7.html":[1,1,3,0,5,118], "structxpcc_1_1stm32_1_1_gpio_output_c8.html":[1,1,3,0,5,121], "structxpcc_1_1stm32_1_1_gpio_output_c9.html":[1,1,3,0,5,124], "structxpcc_1_1stm32_1_1_gpio_output_d0.html":[1,1,3,0,5,145], "structxpcc_1_1stm32_1_1_gpio_output_d1.html":[1,1,3,0,5,148], "structxpcc_1_1stm32_1_1_gpio_output_d10.html":[1,1,3,0,5,175], "structxpcc_1_1stm32_1_1_gpio_output_d11.html":[1,1,3,0,5,178], "structxpcc_1_1stm32_1_1_gpio_output_d12.html":[1,1,3,0,5,181], "structxpcc_1_1stm32_1_1_gpio_output_d13.html":[1,1,3,0,5,184], "structxpcc_1_1stm32_1_1_gpio_output_d14.html":[1,1,3,0,5,187], "structxpcc_1_1stm32_1_1_gpio_output_d15.html":[1,1,3,0,5,190], "structxpcc_1_1stm32_1_1_gpio_output_d2.html":[1,1,3,0,5,151], "structxpcc_1_1stm32_1_1_gpio_output_d3.html":[1,1,3,0,5,154], "structxpcc_1_1stm32_1_1_gpio_output_d4.html":[1,1,3,0,5,157], "structxpcc_1_1stm32_1_1_gpio_output_d5.html":[1,1,3,0,5,160], "structxpcc_1_1stm32_1_1_gpio_output_d6.html":[1,1,3,0,5,163], "structxpcc_1_1stm32_1_1_gpio_output_d7.html":[1,1,3,0,5,166], "structxpcc_1_1stm32_1_1_gpio_output_d8.html":[1,1,3,0,5,169], "structxpcc_1_1stm32_1_1_gpio_output_d9.html":[1,1,3,0,5,172], "structxpcc_1_1stm32_1_1_gpio_output_e0.html":[1,1,3,0,5,193], "structxpcc_1_1stm32_1_1_gpio_output_e1.html":[1,1,3,0,5,196], "structxpcc_1_1stm32_1_1_gpio_output_e10.html":[1,1,3,0,5,223], "structxpcc_1_1stm32_1_1_gpio_output_e11.html":[1,1,3,0,5,226], "structxpcc_1_1stm32_1_1_gpio_output_e12.html":[1,1,3,0,5,229], "structxpcc_1_1stm32_1_1_gpio_output_e13.html":[1,1,3,0,5,232], "structxpcc_1_1stm32_1_1_gpio_output_e14.html":[1,1,3,0,5,235], "structxpcc_1_1stm32_1_1_gpio_output_e15.html":[1,1,3,0,5,238], "structxpcc_1_1stm32_1_1_gpio_output_e2.html":[1,1,3,0,5,199], "structxpcc_1_1stm32_1_1_gpio_output_e3.html":[1,1,3,0,5,202], "structxpcc_1_1stm32_1_1_gpio_output_e4.html":[1,1,3,0,5,205], "structxpcc_1_1stm32_1_1_gpio_output_e5.html":[1,1,3,0,5,208], "structxpcc_1_1stm32_1_1_gpio_output_e6.html":[1,1,3,0,5,211], "structxpcc_1_1stm32_1_1_gpio_output_e7.html":[1,1,3,0,5,214], "structxpcc_1_1stm32_1_1_gpio_output_e8.html":[1,1,3,0,5,217], "structxpcc_1_1stm32_1_1_gpio_output_e9.html":[1,1,3,0,5,220], "structxpcc_1_1stm32_1_1_gpio_output_h0.html":[1,1,3,0,5,241], "structxpcc_1_1stm32_1_1_gpio_output_h1.html":[1,1,3,0,5,244], "structxpcc_1_1tcs3414.html":[1,5,8,0], "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2":[1,5,8,0,4], "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a12c5c8d0d9196c9a05f1e52fc2d5cf6e":[1,5,8,0,4,1], "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a182fa1c42a2468f8488e6dcf75a81b81":[1,5,8,0,4,0], "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,0,4,4], "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2a8b16d3fc8545695df507da6749992983":[1,5,8,0,4,3], "structxpcc_1_1tcs3414.html#a43db0819e589f20c9102f84b102aaec2ab8c22647c2fa5df7a09c45e609f71ada":[1,5,8,0,4,2], "structxpcc_1_1tcs3414.html#a714a090e5bf8e8e57c6b5205bc46e3ce":[1,5,8,0,1], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324":[1,5,8,0,7], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a04bab40d95e7d166d56a751e96111a51":[1,5,8,0,7,10], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a0803331e7c3fe03c1938ac408faaa0cc":[1,5,8,0,7,5], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a1184f5f10c2e4ec45dd302bb31bc336d":[1,5,8,0,7,15], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a34609c1662bdc31bd7e2aaf91aa6d6cd":[1,5,8,0,7,3], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a3d85a3115aaeffcb978de2ded55b4f22":[1,5,8,0,7,17], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a4078ba16c48786ddbcc49794c309b7fb":[1,5,8,0,7,12], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a4e7db454ac264600213ccbdc92d36547":[1,5,8,0,7,16], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a7504c8d03e468e63fcc94d85f86c928d":[1,5,8,0,7,14], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a7786bf76ad6671b960d374f257c4bdc3":[1,5,8,0,7,8], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a81b7fe15c43052525db74111aa314cc9":[1,5,8,0,7,2], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a8f9e1889c89e42901ab7c0a033a3347c":[1,5,8,0,7,1], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a91d64ab3e8ec250e7154fee7e9ccce35":[1,5,8,0,7,13], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a94fb9053331bc4a94579dd5a0236b39e":[1,5,8,0,7,9], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324a9743494d7655f857f8d2bec66ff0187d":[1,5,8,0,7,7], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324ab718adec73e04ce3ec720dd11a06a308":[1,5,8,0,7,4], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324ac861cd34025f9002df5912d623326130":[1,5,8,0,7,0], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324ae4c103ee6b29010def4ee2ceca338904":[1,5,8,0,7,6], "structxpcc_1_1tcs3414.html#a7a68c75ed04a60bb998397e5f7a87324aebec0053703eceb0060fa9aa228f05b6":[1,5,8,0,7,11], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111":[1,5,8,0,6], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a4f6c5d2d6d8865cf7075e43494a5809e":[1,5,8,0,6,1], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,0,6,9], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a61739233ce7ed2ae88aac5eecbc2d5b1":[1,5,8,0,6,2], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a7ad167dc44c6b7d2716dc4d69fa8a8fd":[1,5,8,0,6,0], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111a8cbc034aa44c987df3c22b4f260dd706":[1,5,8,0,6,7], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111aa85024b0df85b28772a2575b1dc4b217":[1,5,8,0,6,8], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111aafb2027632bbc38860fa69ab1ff0fa2f":[1,5,8,0,6,6], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111ae8db95cd8d14b21f4f58943656ff229f":[1,5,8,0,6,4], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111af60ffd10c8e88b9cf4b20eb4cffd1460":[1,5,8,0,6,5], "structxpcc_1_1tcs3414.html#a83120f8b9169941673f0965b5d9e8111af83fec35b13141c2f12fecc3db7af573":[1,5,8,0,6,3], "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005":[1,5,8,0,2], "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005a5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,0,2,4], "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005a7d71ed2af4cc5c6a8380324d9bc4a45f":[1,5,8,0,2,1], "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005a8566d518618cc93194d9e7688e2dafa2":[1,5,8,0,2,2], "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005abb7f5ae6220c9828e5ec91faf054197c":[1,5,8,0,2,0], "structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005af0851da0e02bf22830828822f578dc8f":[1,5,8,0,2,3], "structxpcc_1_1tcs3414.html#aaf960407c8ca742f0955e209079d4f08":[1,5,8,0,0], "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11":[1,5,8,0,5], "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a21198118aa88764b53032b1ab9c7f95a":[1,5,8,0,5,1], "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a552357ae9765301bec1db798b6a2a6eb":[1,5,8,0,5,0], "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a57144bdb3e5d0cb7d8d43313c2d45716":[1,5,8,0,5,2], "structxpcc_1_1tcs3414.html#ae078745ac0e486834ed4a95fbb24ab11a5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,0,5,3], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85":[1,5,8,0,3], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a2521dc256a4368da87585c936b451dd7":[1,5,8,0,3,2], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a4a4079e06eb2f7ba7a12821c7c58a3f6":[1,5,8,0,3,0], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,0,3,7], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a653c7a3d42099ef42f611a18fde2a80b":[1,5,8,0,3,6], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85a6fd9ec81643ee5a57f85a71951bfe13d":[1,5,8,0,3,4], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85aa6b2eecc4252564f599b9a979e4e0602":[1,5,8,0,3,5], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85ab1522194d726a396729c3148c2b3a0bd":[1,5,8,0,3,3], "structxpcc_1_1tcs3414.html#ae953f37523f875dcae4967f6ff84dc85ac4d62b6dcca08e5caf06c01889282859":[1,5,8,0,3,1], "structxpcc_1_1tcs3472.html":[1,5,8,2], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eb":[1,5,8,2,4], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba0803331e7c3fe03c1938ac408faaa0cc":[1,5,8,2,4,3], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba0a9736bb1a7123ed218cf8a41ae628cf":[1,5,8,2,4,14], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba341a4d90fbbe4a83e6dd737abb2845cb":[1,5,8,2,4,13], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba3edaf457d6740121350cd2e2fcf371ca":[1,5,8,2,4,11], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba63e734e38dbcd61e7587c3f264fad159":[1,5,8,2,4,15], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba705463a299a6ec2bbefee59d6cde771e":[1,5,8,2,4,9], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba7786bf76ad6671b960d374f257c4bdc3":[1,5,8,2,4,6], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba8c0980c5e57b2bca92a048d36fc66c9b":[1,5,8,2,4,10], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba8f9e1889c89e42901ab7c0a033a3347c":[1,5,8,2,4,1], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba94fb9053331bc4a94579dd5a0236b39e":[1,5,8,2,4,7], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6eba9743494d7655f857f8d2bec66ff0187d":[1,5,8,2,4,5], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebaabd49eeed6b719203801cf9241e2c053":[1,5,8,2,4,8], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebab3285c5cc2526fada89f34dff4decf5a":[1,5,8,2,4,12], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebab332708e4304e13c9b424e7465254954":[1,5,8,2,4,0], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebab718adec73e04ce3ec720dd11a06a308":[1,5,8,2,4,2], "structxpcc_1_1tcs3472.html#a0eb5b18b6bd719fd97d065caefcfe6ebae4c103ee6b29010def4ee2ceca338904":[1,5,8,2,4,4], "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7":[1,5,8,2,2], "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7a5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,2,2,4], "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7a7d71ed2af4cc5c6a8380324d9bc4a45f":[1,5,8,2,2,1], "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7a8566d518618cc93194d9e7688e2dafa2":[1,5,8,2,2,2], "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7abb7f5ae6220c9828e5ec91faf054197c":[1,5,8,2,2,0], "structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7af0851da0e02bf22830828822f578dc8f":[1,5,8,2,2,3], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3e":[1,5,8,2,3], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea01ed152f1ec68064f14f5b79eb45edd7":[1,5,8,2,3,2], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea0bd422886bb873a43bbfe61ff07510bd":[1,5,8,2,3,4], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea117c36310b50816b734bf5f73c3e057d":[1,5,8,2,3,3], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea2f791a36d82b0102afcdf952a7560836":[1,5,8,2,3,1], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ea5b39c8b553c821e7cddc6da64b5bd2ee":[1,5,8,2,3,5], "structxpcc_1_1tcs3472.html#a28754c654aa46860d09a8e4ca85aed3ead27b4dff93acabd01f2b0cdb48e7cf20":[1,5,8,2,3,0], "structxpcc_1_1tcs3472.html#a3ef7e794003e0c8970465b6540e7f33b":[1,5,8,2,0], "structxpcc_1_1tcs3472.html#ac2852064dea9f76fbf4fee9d03a20865":[1,5,8,2,1], "structxpcc_1_1tipc_1_1_header.html":[1,2,4,10,5,0], "structxpcc_1_1tipc_1_1_header.html#a0f0f6bc69dff6d2f86cc13a7ec6a380c":[1,2,4,10,5,0,3], "structxpcc_1_1tipc_1_1_header.html#a52cbd9ed5345ffe1d05847d6991fb39e":[1,2,4,10,5,0,2], "structxpcc_1_1tipc_1_1_header.html#a67aa79f9eec3ed7357d650981c38f1e1a23c5d24a117117c2cf01ea4eac87942d":[1,2,4,10,5,0,0], "structxpcc_1_1tipc_1_1_header.html#a6afe38ead813cfd4def6420c9ad279d0":[1,2,4,10,5,0,4], "structxpcc_1_1tipc_1_1_header.html#ad46dac70927dda979efa123157301e7c":[1,2,4,10,5,0,1], "structxpcc_1_1tmp102.html":[2,0,3,267], "structxpcc_1_1tmp102_1_1_data.html":[2,0,3,267,0], "structxpcc_1_1tmp102_1_1_data.html#a7391c0f595a0a3ec8d3b39c4e842ca45":[2,0,3,267,0,0], "structxpcc_1_1tmp102_1_1_data.html#a997cb64bdb2014224d7b50f1fb6ec1d5":[2,0,3,267,0,2], "structxpcc_1_1tmp102_1_1_data.html#abd145da86151b7d57fe6dd85539ba1d4":[2,0,3,267,0,1], "structxpcc_1_1tmp175.html":[2,0,3,269], "structxpcc_1_1tmp175.html#aec54a812d16db008695d6bd562938a18":[2,0,3,269,0], "structxpcc_1_1tmp175.html#aec54a812d16db008695d6bd562938a18a11ba3b9b19dc2aec4d42ec4ade2aba07":[2,0,3,269,0,2], "structxpcc_1_1tmp175.html#aec54a812d16db008695d6bd562938a18a3eb76becfca744d04d55d9e345e225ec":[2,0,3,269,0,3], "structxpcc_1_1tmp175.html#aec54a812d16db008695d6bd562938a18a74f377712b88917ebfde6f7882f0aa2e":[2,0,3,269,0,0] }; <file_sep>/docs/api/classxpcc_1_1stm32_1_1_basic_timer.js var classxpcc_1_1stm32_1_1_basic_timer = [ [ "Interrupt_t", "classxpcc_1_1stm32_1_1_basic_timer.html#aa751d83a048cc95688bf2d2f6a51a59c", null ], [ "InterruptFlag_t", "classxpcc_1_1stm32_1_1_basic_timer.html#a4e97b55fe85d0f998e4a1c27f35c7c80", null ], [ "Mode", "classxpcc_1_1stm32_1_1_basic_timer.html#a82282d492483986b4746886a84f755cb", [ [ "UpCounter", "classxpcc_1_1stm32_1_1_basic_timer.html#a82282d492483986b4746886a84f755cbaa771e4a30d4558abdc5937d1a36fed9d", null ], [ "OneShotUpCounter", "classxpcc_1_1stm32_1_1_basic_timer.html#a82282d492483986b4746886a84f755cbaca95847671fcb0e671642c316db9c921", null ] ] ], [ "Interrupt", "classxpcc_1_1stm32_1_1_basic_timer.html#a169f417b4b8581c368dd3f084176884e", [ [ "Update", "classxpcc_1_1stm32_1_1_basic_timer.html#a169f417b4b8581c368dd3f084176884ea06933067aafd48425d67bcb01bba5cb6", null ] ] ], [ "InterruptFlag", "classxpcc_1_1stm32_1_1_basic_timer.html#a870b1da054a5b8e95fcc562b6c16bd02", [ [ "Update", "classxpcc_1_1stm32_1_1_basic_timer.html#a870b1da054a5b8e95fcc562b6c16bd02a06933067aafd48425d67bcb01bba5cb6", null ] ] ] ];<file_sep>/docs/api/group__xpcc__comm.js var group__xpcc__comm = [ [ "AbstractComponent", "classxpcc_1_1_abstract_component.html", [ [ "AbstractComponent", "classxpcc_1_1_abstract_component.html#a11ee9013bc3f9c4fc47a8945bf25300c", null ], [ "update", "classxpcc_1_1_abstract_component.html#a6363980d50fb5391b8beef5ac0fb36ff", null ], [ "getCommunicator", "classxpcc_1_1_abstract_component.html#a6a4612874847d8ac11d81ce0fc1ef185", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#a09a497c6a4e124d1c32b144197e3f603", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#a21d3925a34e3238ea49269bba5da30b0", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#ae7aa1f7238f9fa1635d82d60a76162ac", null ], [ "callAction", "classxpcc_1_1_abstract_component.html#af447b8a4f597009c9f558b43cbe64436", null ], [ "publishEvent", "classxpcc_1_1_abstract_component.html#afe089710068346a116d04982fa04b5a6", null ], [ "publishEvent", "classxpcc_1_1_abstract_component.html#a2b60d7705fb3cf7938071a6641396866", null ], [ "sendResponse", "classxpcc_1_1_abstract_component.html#aba064776b749079b1f0c1e0edd8f9d6d", null ], [ "sendResponse", "classxpcc_1_1_abstract_component.html#a0fcc436e2539763a0f0e400a7f90ea47", null ], [ "sendNegativeResponse", "classxpcc_1_1_abstract_component.html#abeab3a15e23337d9e5287b58a09e4aba", null ], [ "sendNegativeResponse", "classxpcc_1_1_abstract_component.html#aa3e4281cd915ca20470e5ec87b47dede", null ] ] ], [ "BackendInterface", "classxpcc_1_1_backend_interface.html", [ [ "~BackendInterface", "classxpcc_1_1_backend_interface.html#ab9491aa21eb406a8216251179b88fdbe", null ], [ "update", "classxpcc_1_1_backend_interface.html#a7c3854da5ae8e5051cd7ff2d74b22fc9", null ], [ "sendPacket", "classxpcc_1_1_backend_interface.html#ae0b877793ee63af70efd7ef7dfb138de", null ], [ "isPacketAvailable", "classxpcc_1_1_backend_interface.html#a7c9de149048bd3b5ccf408a4525fda75", null ], [ "getPacketHeader", "classxpcc_1_1_backend_interface.html#a53efb10c7751f0233f25ae44784f43d7", null ], [ "getPacketPayload", "classxpcc_1_1_backend_interface.html#abae8c33fbd5ca5ff7edb5fc8af4216b0", null ], [ "dropPacket", "classxpcc_1_1_backend_interface.html#a4aa4ac4bb8ae65545e33e87f02a19244", null ] ] ], [ "Communicatable", "classxpcc_1_1_communicatable.html", null ], [ "Communicator", "classxpcc_1_1_communicator.html", [ [ "getIdentifier", "classxpcc_1_1_communicator.html#a697395d2bbfc33059f926b4b239da12e", null ], [ "callAction", "classxpcc_1_1_communicator.html#a2d2c66a52913b7b689582ea186e2fde8", null ], [ "callAction", "classxpcc_1_1_communicator.html#a9f4eeb2d993bb8e6d3dcd5ddd90dc30f", null ], [ "callAction", "classxpcc_1_1_communicator.html#ae51a6194725481cd2673a1de0e861ce4", null ], [ "callAction", "classxpcc_1_1_communicator.html#a3102b10abdd000e5005bd584978cd5a5", null ], [ "publishEvent", "classxpcc_1_1_communicator.html#a552202127c9dec5a17b7c1c00a17bd79", null ], [ "publishEvent", "classxpcc_1_1_communicator.html#ac52693f62fcb91aa0b95f7001e32ba61", null ], [ "sendResponse", "classxpcc_1_1_communicator.html#a0f0230f5449351fa9404da5b691c90ce", null ], [ "sendResponse", "classxpcc_1_1_communicator.html#a1faafaf06f201866a32a1c1463f570e5", null ], [ "sendNegativeResponse", "classxpcc_1_1_communicator.html#ab222748848709ee3a665fa3eaf96df42", null ], [ "sendNegativeResponse", "classxpcc_1_1_communicator.html#abe44e3da50807ff7d85b5b69c30fd434", null ], [ "AbstractComponent", "classxpcc_1_1_communicator.html#a0d033d977d29f763272be80bbd178288", null ] ] ], [ "Dispatcher", "classxpcc_1_1_dispatcher.html", [ [ "Dispatcher", "classxpcc_1_1_dispatcher.html#a13b5cfb2629f958a29ae00410d131fa2", null ], [ "update", "classxpcc_1_1_dispatcher.html#a4dcd5febf1c36b2e450940200e8720a1", null ], [ "Communicator", "classxpcc_1_1_dispatcher.html#ade690b78412fb1a6414ce3a7a81bfa32", null ] ] ], [ "DynamicPostman", "classxpcc_1_1_dynamic_postman.html", [ [ "DynamicPostman", "classxpcc_1_1_dynamic_postman.html#a797d1df8d092d2d06c2b779878294e2a", null ], [ "deliverPacket", "classxpcc_1_1_dynamic_postman.html#a10861441211803af0bf8c66824d4665f", null ], [ "isComponentAvailable", "classxpcc_1_1_dynamic_postman.html#a58b1b59250a7d5d574351e7b1f88455b", null ], [ "registerEventListener", "classxpcc_1_1_dynamic_postman.html#af5d2d5564fc31d317bc29d66bfcf09a3", null ], [ "registerEventListener", "classxpcc_1_1_dynamic_postman.html#ad97dbcc8b05e9bc436fc481bfeeed848", null ], [ "registerActionHandler", "classxpcc_1_1_dynamic_postman.html#a3fef2469a9066e3b06bfd9fdb7fc7779", null ], [ "registerActionHandler", "classxpcc_1_1_dynamic_postman.html#ab51a346cf08a856a18b28cf237abd4bc", null ] ] ], [ "Postman", "classxpcc_1_1_postman.html", [ [ "DeliverInfo", "classxpcc_1_1_postman.html#aa<KEY>", [ [ "OK", "classxpcc_1_1_postman.html#aa<KEY>a1a71425889d446bad54bec3001ceafe2", null ], [ "ERROR", "classxpcc_1_1_postman.html#aa<KEY>da04f43aa02953c46b6d259c88085e80f3fff08e", null ], [ "NO_COMPONENT", "classxpcc_1_1_postman.html#<KEY>", null ], [ "NO_ACTION", "classxpcc_1_1_postman.html#<KEY>", null ], [ "WRONG_ACTION_PARAMETER", "classxpcc_1_1_postman.html#<KEY>", null ], [ "NO_EVENT", "classxpcc_1_1_postman.html#<KEY>", null ], [ "WRONG_EVENT_PARAMETER", "classxpcc_1_1_postman.html#<KEY>", null ], [ "NOT_IMPLEMENTED_YET_ERROR", "classxpcc_1_1_postman.html#<KEY>7e", null ] ] ], [ "deliverPacket", "classxpcc_1_1_postman.html#a6ac029a0ef8d6768b711b4ff868eccd9", null ], [ "isComponentAvailable", "classxpcc_1_1_postman.html#a56d033f2ce76af94fc961629d7a6f5ff", null ] ] ], [ "ActionResult", "classxpcc_1_1_action_result.html", [ [ "ActionResult", "classxpcc_1_1_action_result.html#a7b5f9b2c5f484e389ba832ea90da2c56", null ], [ "ActionResult", "classxpcc_1_1_action_result.html#a95070ca4af742fadd926d66bbfb7f2b8", null ], [ "ActionResult", "classxpcc_1_1_action_result.html#afa84e5418f79d3abcf7b7a926e7e0bcd", null ], [ "response", "classxpcc_1_1_action_result.html#ad4634dffdf2b00b951907e6b3ad42a81", null ], [ "data", "classxpcc_1_1_action_result.html#a472aff79dc71015a7bcdc4882aaad5e2", null ] ] ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html", [ [ "Function", "classxpcc_1_1_response_callback.html#a0b7e7e6d9cffe0b122f56751b4a60865", null ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html#a4d16f35e54364a2bcc014e7af88c121d", null ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html#a34f0a1e2d26a29a35b4498e3127b4abe", null ], [ "ResponseCallback", "classxpcc_1_1_response_callback.html#a56f79eb2533f0a9c741ebb3f43f3056b", null ], [ "isCallable", "classxpcc_1_1_response_callback.html#aec694ee5c7aede7229181eb52895e317", null ], [ "call", "classxpcc_1_1_response_callback.html#a314dcc04e697ad783e5eb296a992f3cc", null ], [ "component", "classxpcc_1_1_response_callback.html#acbd75a3b2fecbef8c9e211c5ae6fbbbc", null ], [ "function", "classxpcc_1_1_response_callback.html#a166429ecbae95a0fe188e09d85ee2001", null ] ] ], [ "ResponseHandle", "classxpcc_1_1_response_handle.html", [ [ "ResponseHandle", "classxpcc_1_1_response_handle.html#a20961aaa5109afe9491a9344252a9bae", null ], [ "ResponseHandle", "classxpcc_1_1_response_handle.html#a91c90f66558bbed1d5ea075ff4558531", null ], [ "getDestination", "classxpcc_1_1_response_handle.html#a01a43f5eaab5f4806266b8f7554009b0", null ], [ "getIdentifier", "classxpcc_1_1_response_handle.html#a5a39fab96a8d473eb39c42c1fd45ddfa", null ], [ "Communicator", "classxpcc_1_1_response_handle.html#ade690b78412fb1a6414ce3a7a81bfa32", null ], [ "destination", "classxpcc_1_1_response_handle.html#a7c2dc3e3f60f5a84c7140fb659d696d5", null ], [ "packetIdentifier", "classxpcc_1_1_response_handle.html#a2a8f020b4f6ce3fbc8115264d492c90a", null ] ] ], [ "Backend", "group__backend.html", "group__backend" ], [ "Response", "group__xpcc__comm.html#gac82fa14e79906dd2443ec4e3fb49bef6", null ] ];<file_sep>/docs/api/classxpcc_1_1_shift_register_input.js var classxpcc_1_1_shift_register_input = [ [ "initialize", "classxpcc_1_1_shift_register_input.html#addde4e882021649f4b264baeb8bfd3b3", null ], [ "operator[]", "classxpcc_1_1_shift_register_input.html#a66e0c45c756dda421807abe5dc786b04", null ], [ "operator[]", "classxpcc_1_1_shift_register_input.html#affc66fcf0e39b42e72b1cea1b8c2d6f3", null ], [ "update", "classxpcc_1_1_shift_register_input.html#afe0bdef6c8044696b9524f90d15b39a7", null ] ];<file_sep>/docs/api/classxpcc_1_1ui_1_1_fast_ramp.js var classxpcc_1_1ui_1_1_fast_ramp = [ [ "StepType", "classxpcc_1_1ui_1_1_fast_ramp.html#a9ce363a691a8ff4952a9e2faf457d7d2", null ], [ "FastRamp", "classxpcc_1_1ui_1_1_fast_ramp.html#a0a47d0f19f11a39f2cf5e76b823f1392", null ], [ "initialize", "classxpcc_1_1ui_1_1_fast_ramp.html#a3e767f57c34508f08abd4d3c4eac86bc", null ], [ "step", "classxpcc_1_1ui_1_1_fast_ramp.html#a429e656a6cc5aa0e480c5a2eea384e9c", null ], [ "getValue", "classxpcc_1_1ui_1_1_fast_ramp.html#af413a68d8321e2be4da414e9ae557b42", null ], [ "stop", "classxpcc_1_1ui_1_1_fast_ramp.html#aac339f751634738d6a1b09340223bccb", null ] ];<file_sep>/docs/api/group__debug.js var group__debug = [ [ "ErrorReport", "classxpcc_1_1_error_report.html", [ [ "Handler", "classxpcc_1_1_error_report.html#aa742b8b820fcd1ac06e9d953b08538d8", null ] ] ], [ "Logger", "group__logger.html", "group__logger" ] ];<file_sep>/docs/api/classxpcc_1_1rtos_1_1_queue.js var classxpcc_1_1rtos_1_1_queue = [ [ "Queue", "classxpcc_1_1rtos_1_1_queue.html#a49e3bb75c6a7ba82a07c0dcf357c0633", null ], [ "~Queue", "classxpcc_1_1rtos_1_1_queue.html#afda319461c42c3f214beb6d16b8b4efd", null ], [ "Queue", "classxpcc_1_1rtos_1_1_queue.html#a344b28a5edb0ca1b308a0573bed2dd3b", null ], [ "getSize", "classxpcc_1_1rtos_1_1_queue.html#a4ca77ac7253539f19ce7cdb0e6f8668c", null ], [ "append", "classxpcc_1_1rtos_1_1_queue.html#a8585b8939384e24a134b4e0238216add", null ], [ "prepend", "classxpcc_1_1rtos_1_1_queue.html#aeb02c0e81e6de68c608f5abe0b0484ef", null ], [ "peek", "classxpcc_1_1rtos_1_1_queue.html#a8916a78337bc426a4803fad19c0246a0", null ], [ "get", "classxpcc_1_1rtos_1_1_queue.html#ab6b644f728a9db19926e24baea460978", null ], [ "appendFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a08f7891dabf3228896a1ab5e4e9127b2", null ], [ "prependFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a8a5e76293b9088da7ead7232b60e8ecf", null ], [ "getFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a023dcede9080877aa31501c2087309e3", null ], [ "append", "classxpcc_1_1rtos_1_1_queue.html#a2e95fe36178f243276a7f7c98c63cd52", null ], [ "prepend", "classxpcc_1_1rtos_1_1_queue.html#af96230fc1425d97a48f4f148020e203b", null ], [ "peek", "classxpcc_1_1rtos_1_1_queue.html#ab97d125c0da7675ae2e5ca8def9429e3", null ], [ "get", "classxpcc_1_1rtos_1_1_queue.html#a4104487dbe71ee58b31e1fa0360af5fb", null ], [ "appendFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a08f7891dabf3228896a1ab5e4e9127b2", null ], [ "prependFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a8a5e76293b9088da7ead7232b60e8ecf", null ], [ "getFromInterrupt", "classxpcc_1_1rtos_1_1_queue.html#a023dcede9080877aa31501c2087309e3", null ] ];<file_sep>/docs/api/classxpcc_1_1_error_report.js var classxpcc_1_1_error_report = [ [ "Handler", "classxpcc_1_1_error_report.html#aa742b8b820fcd1ac06e9d953b08538d8", null ] ];<file_sep>/docs/api/search/enumvalues_9.js var searchData= [ ['jmp',['JMP',['../structxpcc_1_1lis3dsh.html#aa3489efdbd878a99ec2fdecb2ddaa89cae116c0a9c432b0a449e28e8ab816ebc3',1,'xpcc::lis3dsh']]] ]; <file_sep>/docs/api/classxpcc_1_1bme280data_1_1_data.js var classxpcc_1_1bme280data_1_1_data = [ [ "getTemperature", "classxpcc_1_1bme280data_1_1_data.html#a00710bb189c6b18893d32c429b953347", null ], [ "getTemperature", "classxpcc_1_1bme280data_1_1_data.html#a39b7d3554153a81b5d0dc5fdbb1d1f01", null ], [ "getTemperature", "classxpcc_1_1bme280data_1_1_data.html#a0112022bad399e35d7ae030c83a3434d", null ], [ "getTemperature", "classxpcc_1_1bme280data_1_1_data.html#af15c61fa8d8a41a1016c491cbc07f244", null ], [ "getPressure", "classxpcc_1_1bme280data_1_1_data.html#a12e9aa83f4915712be963de9e77ebdb6", null ], [ "getHumidity", "classxpcc_1_1bme280data_1_1_data.html#a2bcaa327aa53d510baf3639f7efdbccd", null ], [ "calculateCalibratedTemperature", "classxpcc_1_1bme280data_1_1_data.html#ace71838d1b6c87ed09a94656f904006e", null ], [ "calculateCalibratedPressure", "classxpcc_1_1bme280data_1_1_data.html#a9ba1d1498fa7f0f0b952e8eecc92c32e", null ], [ "calculateCalibratedHumidity", "classxpcc_1_1bme280data_1_1_data.html#a37df18e4986c59ece61804151b9f6757", null ] ];<file_sep>/docs/api/classxpcc_1_1_backend_interface.js var classxpcc_1_1_backend_interface = [ [ "~BackendInterface", "classxpcc_1_1_backend_interface.html#ab9491aa21eb406a8216251179b88fdbe", null ], [ "update", "classxpcc_1_1_backend_interface.html#a7c3854da5ae8e5051cd7ff2d74b22fc9", null ], [ "sendPacket", "classxpcc_1_1_backend_interface.html#ae0b877793ee63af70efd7ef7dfb138de", null ], [ "isPacketAvailable", "classxpcc_1_1_backend_interface.html#a7c9de149048bd3b5ccf408a4525fda75", null ], [ "getPacketHeader", "classxpcc_1_1_backend_interface.html#a53efb10c7751f0233f25ae44784f43d7", null ], [ "getPacketPayload", "classxpcc_1_1_backend_interface.html#abae8c33fbd5ca5ff7edb5fc8af4216b0", null ], [ "dropPacket", "classxpcc_1_1_backend_interface.html#a4aa4ac4bb8ae65545e33e87f02a19244", null ] ];<file_sep>/docs/api/search/variables_8.js var searchData= [ ['length',['length',['../structxpcc_1_1ui_1_1_key_frame.html#ae84eece7207c9e0624456ba128bc62d0',1,'xpcc::ui::KeyFrame']]], ['logo_5feurobot_5f90x64',['logo_eurobot_90x64',['../group__image.html#ga662e4976011e9fd0a6d45cbcc9908a61',1,'bitmap']]], ['logo_5frca_5f90x64',['logo_rca_90x64',['../group__image.html#gafb3b952b2a4a7506ed039b241f7b77fe',1,'bitmap']]], ['logo_5fxpcc_5f90x64',['logo_xpcc_90x64',['../group__image.html#ga40e37f3e34d5583d1b7811cc7a47e8c5',1,'bitmap']]], ['low',['Low',['../structxpcc_1_1_gpio.html#a07b8979fd5aa8a303beef73db1b45fbd',1,'xpcc::Gpio']]] ]; <file_sep>/docs/api/classxpcc_1_1_clock_dummy.js var classxpcc_1_1_clock_dummy = [ [ "Type", "classxpcc_1_1_clock_dummy.html#a3460221e479fa1350c0391f913091444", null ] ];<file_sep>/docs/api/group__driver.js var group__driver = [ [ "Displays", "group__driver__display.html", "group__driver__display" ], [ "Analog/Digital Converters", "group__driver__adc.html", "group__driver__adc" ], [ "Digital/Analog Converters", "group__driver__dac.html", "group__driver__dac" ], [ "CAN drivers", "group__driver__can.html", "group__driver__can" ], [ "IO-Expander", "group__driver__gpio.html", "group__driver__gpio" ], [ "Inertial measurement", "group__driver__inertial.html", "group__driver__inertial" ], [ "Storage", "group__driver__storage.html", "group__driver__storage" ], [ "Busses", "group__driver__bus.html", "group__driver__bus" ], [ "Other", "group__driver__other.html", "group__driver__other" ], [ "Touch Detection", "group__driver__touch.html", "group__driver__touch" ], [ "Radio", "group__driver__radio.html", "group__driver__radio" ], [ "Position sensors", "group__driver__position.html", "group__driver__position" ], [ "Pressure sensors", "group__driver__pressure.html", "group__driver__pressure" ], [ "Temperature sensors", "group__driver__temperature.html", "group__driver__temperature" ], [ "PWM Drivers", "group__driver__pwm.html", "group__driver__pwm" ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_color_palette.js var classxpcc_1_1gui_1_1_color_palette = [ [ "ColorPalette", "classxpcc_1_1gui_1_1_color_palette.html#a75c053273c6ba763091955230108cb93", null ], [ "ColorPalette", "classxpcc_1_1gui_1_1_color_palette.html#aa8737a86b88d32683c304e9806f3ab75", null ], [ "operator=", "classxpcc_1_1gui_1_1_color_palette.html#a2040705fca95a1ad5bc5e8015377777f", null ], [ "setColor", "classxpcc_1_1gui_1_1_color_palette.html#acfc6267f399f7804380fd871b8f82ba3", null ], [ "getColor", "classxpcc_1_1gui_1_1_color_palette.html#a10fa39f4c9ab62f6e8d81e4e28a1a724", null ], [ "operator[]", "classxpcc_1_1gui_1_1_color_palette.html#af089b95aad81fdc34ece194f864746cc", null ], [ "getPointer", "classxpcc_1_1gui_1_1_color_palette.html#a28f50f85219073034376e8946bb49823", null ] ];<file_sep>/docs/api/classxpcc_1_1_zero_m_q_connector.js var classxpcc_1_1_zero_m_q_connector = [ [ "ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html#ad5234fe1fee59e5fb75e3f1e611b327d", null ], [ "~ZeroMQConnector", "classxpcc_1_1_zero_m_q_connector.html#ad8342473c74376c8df9deb65c6f26ee8", null ], [ "sendPacket", "classxpcc_1_1_zero_m_q_connector.html#a9dd08bd8a48e537bea471862fc1c811f", null ], [ "isPacketAvailable", "classxpcc_1_1_zero_m_q_connector.html#a7353598b7a2ec64beae5125cfaa4e122", null ], [ "getPacketHeader", "classxpcc_1_1_zero_m_q_connector.html#a69b6998df64c439730439e90eb6e373f", null ], [ "getPacketPayload", "classxpcc_1_1_zero_m_q_connector.html#ab5c0cf01d64e35ed3f0d8cf4e08a01c6", null ], [ "dropPacket", "classxpcc_1_1_zero_m_q_connector.html#aa5731d201c5611e1333e8aa289dd3793", null ], [ "update", "classxpcc_1_1_zero_m_q_connector.html#a4956a3c202012af87365cf028abf9fde", null ], [ "context", "classxpcc_1_1_zero_m_q_connector.html#a93f7e85aef9340361f3c9cda8fd3977d", null ], [ "socketIn", "classxpcc_1_1_zero_m_q_connector.html#a937b3218e2a8ffa8e6c748d2b84d131c", null ], [ "socketOut", "classxpcc_1_1_zero_m_q_connector.html#a8677e124ff8fbeeeb74d995b226527d4", null ], [ "reader", "classxpcc_1_1_zero_m_q_connector.html#a967551aa0f8d845f111cb42473563c62", null ] ];<file_sep>/docs/api/search/groups_b.js var searchData= [ ['other',['Other',['../group__driver__other.html',1,'']]] ]; <file_sep>/docs/api/search/enums_9.js var searchData= [ ['keyframeanimationmode',['KeyFrameAnimationMode',['../namespacexpcc_1_1ui.html#a1618a548d23e39693d9675ab4510542f',1,'xpcc::ui']]] ]; <file_sep>/docs/api/group__driver__adc.js var group__driver__adc = [ [ "Ad7280a", "classxpcc_1_1_ad7280a.html", [ [ "::Ad7280aTest", "classxpcc_1_1_ad7280a.html#affc1d452737be22efb8c02a599e64dfc", null ] ] ], [ "AdcSampler", "classxpcc_1_1_adc_sampler.html", [ [ "DataType", "classxpcc_1_1_adc_sampler.html#a3b112b9d2c5b48d9ff603d9e0e2c5569", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_pid.js var classxpcc_1_1_pid = [ [ "Parameter", "structxpcc_1_1_pid_1_1_parameter.html", "structxpcc_1_1_pid_1_1_parameter" ], [ "ValueType", "classxpcc_1_1_pid.html#a6d6fb641b46d65837817ed5aa6a5d71b", null ], [ "Pid", "classxpcc_1_1_pid.html#a01002e02163cabe5d5540cd7c0051b09", null ], [ "Pid", "classxpcc_1_1_pid.html#a02dc1f6185871c70b2c97d3e2e72b2a7", null ], [ "setParameter", "classxpcc_1_1_pid.html#a8a83d52516d5c66e8144c27d326d9d82", null ], [ "reset", "classxpcc_1_1_pid.html#a24b30e20caa7f5b15ec70ded5f149f9e", null ], [ "update", "classxpcc_1_1_pid.html#a32e8bfda7701a5cf921a6da172b17552", null ], [ "getValue", "classxpcc_1_1_pid.html#a24c314ebc19bec2e3599d5d8fb5092ea", null ], [ "getLastError", "classxpcc_1_1_pid.html#a7e6337dab435ebd62e10f4f42eda347d", null ], [ "getErrorSum", "classxpcc_1_1_pid.html#aa928e33f0f62e64f626fa9739718d77b", null ] ];<file_sep>/docs/api/search/related_0.js var searchData= [ ['abs',['abs',['../classxpcc_1_1_saturated.html#a29321a0fcf37a4d88292830593460a91',1,'xpcc::Saturated']]] ]; <file_sep>/docs/api/group__driver__gpio.js var group__driver__gpio = [ [ "Mcp23TransportI2c", "classxpcc_1_1_mcp23_transport_i2c.html", [ [ "Mcp23TransportI2c", "classxpcc_1_1_mcp23_transport_i2c.html#a53cb32124bb0f0065af4b6f109ced3ec", null ], [ "write", "classxpcc_1_1_mcp23_transport_i2c.html#aef6863eb7d1dd0a25deb3305f88f3e43", null ], [ "write16", "classxpcc_1_1_mcp23_transport_i2c.html#a0d86447059033cdbe9818e6cc2ccf48c", null ], [ "read", "classxpcc_1_1_mcp23_transport_i2c.html#a1396a162483335a62dbf2f0c590eae0a", null ], [ "read", "classxpcc_1_1_mcp23_transport_i2c.html#aba3e6178b6b10e00614b0f00a772d08d", null ] ] ], [ "Mcp23TransportSpi", "classxpcc_1_1_mcp23_transport_spi.html", [ [ "Mcp23TransportSpi", "classxpcc_1_1_mcp23_transport_spi.html#ac9ed324cfab357018ef3b5cfa9cf17a2", null ], [ "ping", "classxpcc_1_1_mcp23_transport_spi.html#ac1e1cf4e9800c74e86647d5d31f5d202", null ], [ "write", "classxpcc_1_1_mcp23_transport_spi.html#ac3dd06d4470ea8bc9366326325f12e07", null ], [ "write16", "classxpcc_1_1_mcp23_transport_spi.html#a8b430686235a430b5ee83f536d635053", null ], [ "read", "classxpcc_1_1_mcp23_transport_spi.html#a2560837419436394568991edb2e882f9", null ], [ "read", "classxpcc_1_1_mcp23_transport_spi.html#a99eb010a5b06d3d4a9c264e7f41a06f9", null ] ] ], [ "Mcp23s08", "classxpcc_1_1_mcp23s08.html", [ [ "RegisterAddress", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdb", [ [ "MCP_IODIR", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba36986d495d85b1af840228e334e5d245", null ], [ "MCP_IPOL", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba4ae271df65ed5cd4f7112535e0a044eb", null ], [ "MCP_GPINTEN", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba91db699975c9b60951726da6bb8f3f90", null ], [ "MCP_DEFVAL", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbafd6ed4d66203b40267636ebbd1725aa9", null ], [ "MCP_INTCON", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba61f4bda0ca985ab68c1c1fe0f2251088", null ], [ "MCP_IOCON", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba42343001afbb02de43274df05718b52d", null ], [ "MCP_GPPU", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba14af5bce9670d4c3f0fd70dc1b79657d", null ], [ "MCP_INTF", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba2f6ff26b3af8d2f501d82ecf84191513", null ], [ "MCP_INTCAP", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbadf2a4d99939f4c795e73233d916e9b16", null ], [ "MCP_GPIO", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdba0271ca1d54b33be651c4e0faa8587c93", null ], [ "MCP_OLAT", "classxpcc_1_1_mcp23s08.html#a555755959e90e6a82611b6a03c25abdbac9313c76784ffb6d96748d5e5fcecbdb", null ] ] ], [ "RW", "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304a", [ [ "WRITE", "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304aa336c2dfd66cf1330e508bf3d17eeec83", null ], [ "READ", "classxpcc_1_1_mcp23s08.html#a592f9cd04c685ca26932c767217e304aacf0fafbe6ee82b6adc4d6de724a40cf9", null ] ] ] ] ], [ "Mcp23x17", "classxpcc_1_1_mcp23x17.html", [ [ "PortType", "classxpcc_1_1_mcp23x17.html#ae1e3f2c10e21eec2393853e6e80dbead", null ], [ "A0", "classxpcc_1_1_mcp23x17.html#a61fe458a657e793a4deca98e7911d97c", null ], [ "A1", "classxpcc_1_1_mcp23x17.html#a40045b541aa56f58e6a8a615c8f00b10", null ], [ "A2", "classxpcc_1_1_mcp23x17.html#a278bf672d8684a509527328d2207480e", null ], [ "A3", "classxpcc_1_1_mcp23x17.html#a5a07133503ec590dd6013f5683905be0", null ], [ "A4", "classxpcc_1_1_mcp23x17.html#a21626559ca81c7d76caa89e88a03673c", null ], [ "A5", "classxpcc_1_1_mcp23x17.html#a5b178aba539b4b5f9a879858132b62a4", null ], [ "A6", "classxpcc_1_1_mcp23x17.html#aa7d9dda870a54034c256f826b9efd7de", null ], [ "A7", "classxpcc_1_1_mcp23x17.html#a0abc59a04214818da58b53fb6cafc5b3", null ], [ "B0", "classxpcc_1_1_mcp23x17.html#aae596572bbe4e95b967d43195b9f532b", null ], [ "B1", "classxpcc_1_1_mcp23x17.html#a97f0bf3710596d7fe90b7805b03cccd9", null ], [ "B2", "classxpcc_1_1_mcp23x17.html#a495da5416177a88abe5d6d3725d2597a", null ], [ "B3", "classxpcc_1_1_mcp23x17.html#a4964e4879d7671ef130658dbc66b2186", null ], [ "B4", "classxpcc_1_1_mcp23x17.html#adf307aa29e3fcabba7c494d4216afa99", null ], [ "B5", "classxpcc_1_1_mcp23x17.html#ab1d01bc3b697fafa4de60a605133948e", null ], [ "B6", "classxpcc_1_1_mcp23x17.html#abff94e16fa79d8d115e1ea6134555f55", null ], [ "B7", "classxpcc_1_1_mcp23x17.html#a769350efb948a997f93ac817863beaec", null ], [ "Port", "classxpcc_1_1_mcp23x17.html#a9e976ff7822d2dc654e1d2d744e88d61", null ], [ "Mcp23x17", "classxpcc_1_1_mcp23x17.html#abb2cc6c1a0e696e92ec4b4649675ccbf", null ], [ "setOutput", "classxpcc_1_1_mcp23x17.html#abc7a79ab13f254b33828278eb7c52419", null ], [ "set", "classxpcc_1_1_mcp23x17.html#a3de9757207e3ad0836448c3829ed6ab5", null ], [ "reset", "classxpcc_1_1_mcp23x17.html#aea9fe2354cd0860c0c0f6db489373e1d", null ], [ "toggle", "classxpcc_1_1_mcp23x17.html#ab017c4e4ac6d377fc0e2c421dcb2dfe7", null ], [ "set", "classxpcc_1_1_mcp23x17.html#a7851ab787d5e0408bb251d9c21dab06c", null ], [ "isSet", "classxpcc_1_1_mcp23x17.html#ae348a377c64685287ba898b8d4fa7b23", null ], [ "getDirection", "classxpcc_1_1_mcp23x17.html#a7d2d4f3a9563fd5c7834a8aebdc1a20a", null ], [ "setInput", "classxpcc_1_1_mcp23x17.html#a12fc9541b3657f842789b5d7bc54a642", null ], [ "setPullUp", "classxpcc_1_1_mcp23x17.html#a0abc1e68b2aea8b8681aee72e125446a", null ], [ "resetPullUp", "classxpcc_1_1_mcp23x17.html#ac0c568fdd8d28ca720bcdd9e629400e6", null ], [ "setInvertInput", "classxpcc_1_1_mcp23x17.html#a9b5757e6a4c4f146d05e6e2f14f52435", null ], [ "resetInvertInput", "classxpcc_1_1_mcp23x17.html#a1e632925d891b647890b72d5343b5478", null ], [ "read", "classxpcc_1_1_mcp23x17.html#aa2fb25942af7f834c608e8d5eb901078", null ], [ "readInput", "classxpcc_1_1_mcp23x17.html#a375f7d421ac2350631405ccda1b7b6e1", null ], [ "readAllInput", "classxpcc_1_1_mcp23x17.html#abd792fa7d2d40eab1d7cb93680d41f7c", null ], [ "writePort", "classxpcc_1_1_mcp23x17.html#a11a95ef92cbba1e7e39f1ad06eb40916", null ], [ "readPort", "classxpcc_1_1_mcp23x17.html#a6be5550de53e0167f857b9d5488d6c94", null ], [ "getDirections", "classxpcc_1_1_mcp23x17.html#ac0403f1d2953f2ec590265ddac4e3666", null ], [ "getOutputs", "classxpcc_1_1_mcp23x17.html#a30c36e301acd230b2d69704f647a4159", null ], [ "getInputs", "classxpcc_1_1_mcp23x17.html#a3e85d77aefc4cca47449491533a388b0", null ], [ "getPolarities", "classxpcc_1_1_mcp23x17.html#a0cb4b5316010a2536318a3f98ac486af", null ] ] ], [ "Pca8574", "classxpcc_1_1_pca8574.html", [ [ "PortType", "classxpcc_1_1_pca8574.html#a9e5ca3948ef11f5585f89ebd61412aab", null ], [ "P0", "classxpcc_1_1_pca8574.html#aada76b4da52de631ad3dc3f35a8558ac", null ], [ "P1", "classxpcc_1_1_pca8574.html#ae13e3f94ccc719ae0e06755c303dc621", null ], [ "P2", "classxpcc_1_1_pca8574.html#a88587012dd5e4c17fd49aca33f3988a0", null ], [ "P3", "classxpcc_1_1_pca8574.html#a18c06c3b251616b19c01d1629638b9b0", null ], [ "P4", "classxpcc_1_1_pca8574.html#a0d198f52e4047c19fe23f1283a5a7ef0", null ], [ "P5", "classxpcc_1_1_pca8574.html#a8a5ee733fdd3165af6bac4b840ff154b", null ], [ "P6", "classxpcc_1_1_pca8574.html#aa08b3cb71040c596296a8b95c75558a3", null ], [ "P7", "classxpcc_1_1_pca8574.html#a060bf0d1e06a068ab7c70feed15d951c", null ], [ "Port", "classxpcc_1_1_pca8574.html#af8e3c8f3f24ebd570b930581a8a87123", null ], [ "Pca8574", "classxpcc_1_1_pca8574.html#a6baca731e9f8cc4f197bb038f1201c05", null ], [ "setOutput", "classxpcc_1_1_pca8574.html#a3547594d474525b58338776a49f197a8", null ], [ "set", "classxpcc_1_1_pca8574.html#a5854d5531d1090d428113f51f73d67c6", null ], [ "reset", "classxpcc_1_1_pca8574.html#a9b709a4fde2185f00816ddb77483fa42", null ], [ "toggle", "classxpcc_1_1_pca8574.html#a1916898a3833418d5c56d96f29d3a12a", null ], [ "set", "classxpcc_1_1_pca8574.html#ada28360fef197f85cf530603b6c2752e", null ], [ "isSet", "classxpcc_1_1_pca8574.html#aa9f5f82b0302b3410920f8fc6d9b12d2", null ], [ "getDirection", "classxpcc_1_1_pca8574.html#a81301c887b89bb923dd31e2f04e7d36a", null ], [ "setInput", "classxpcc_1_1_pca8574.html#aa342e233cede3933cd1e0320026386d0", null ], [ "read", "classxpcc_1_1_pca8574.html#a9bd6c93650dcc5f83fd93f2c3b429b56", null ], [ "readInput", "classxpcc_1_1_pca8574.html#a43ad947a29cb1df6bd8b59044d5889ae", null ], [ "writePort", "classxpcc_1_1_pca8574.html#ae0f39eaaa80cb23d7367526aae8f186f", null ], [ "readPort", "classxpcc_1_1_pca8574.html#a2f33ad584ba0c9b7c6e7a885bebd7a6d", null ], [ "getOutputs", "classxpcc_1_1_pca8574.html#a37831039ace21054efd36e78634d04ef", null ], [ "getInputs", "classxpcc_1_1_pca8574.html#aa54da2ccbb3a43e93aa8169b495a3d89", null ], [ "getDirections", "classxpcc_1_1_pca8574.html#a4a006024aad9a426cf2da0639c5f452d", null ] ] ], [ "Pca9535", "classxpcc_1_1_pca9535.html", [ [ "PortType", "classxpcc_1_1_pca9535.html#a69cf1e72e85a85c0adffdf8847e5b48b", null ], [ "P0_0", "classxpcc_1_1_pca9535.html#a2f769b1b421925709a351ca84ccd763e", null ], [ "P0_1", "classxpcc_1_1_pca9535.html#a75d8cdedb189376d7f327a2b18de9c0a", null ], [ "P0_2", "classxpcc_1_1_pca9535.html#a6ad51b65966a90755fc0109d569e4874", null ], [ "P0_3", "classxpcc_1_1_pca9535.html#a3c943edbffd9068b047c60ea37d831c4", null ], [ "P0_4", "classxpcc_1_1_pca9535.html#a0e943c81ceb32f1e4bec35fceaed16d1", null ], [ "P0_5", "classxpcc_1_1_pca9535.html#a2c1f54e2420c75d8cae8c68505468476", null ], [ "P0_6", "classxpcc_1_1_pca9535.html#a6f44801d9f8a18110375d955f9790006", null ], [ "P0_7", "classxpcc_1_1_pca9535.html#ad37ff03af0a74d0b2c41dce6d6704396", null ], [ "P1_0", "classxpcc_1_1_pca9535.html#acd51a6ea42ecbc7dc18cd3e0579e2ab7", null ], [ "P1_1", "classxpcc_1_1_pca9535.html#a49552cd2c572fafbc3cf947889f8a288", null ], [ "P1_2", "classxpcc_1_1_pca9535.html#aee9aeb61a7cae32b2209d7c49f703d23", null ], [ "P1_3", "classxpcc_1_1_pca9535.html#ac91abbaf07bf17197e9ff96907302540", null ], [ "P1_4", "classxpcc_1_1_pca9535.html#a5e1837020d540715556d31cecceb2bee", null ], [ "P1_5", "classxpcc_1_1_pca9535.html#a31fad4c165ba0be83c4e16c2ea3a957b", null ], [ "P1_6", "classxpcc_1_1_pca9535.html#a5f2b63be438a9d64834af3f240338e0a", null ], [ "P1_7", "classxpcc_1_1_pca9535.html#a9cd71b24deda01c81dc6a05a004847c6", null ], [ "Port", "classxpcc_1_1_pca9535.html#a1ed4f9571dd0c65e1e1a38cce05b7d17", null ], [ "Pca9535", "classxpcc_1_1_pca9535.html#aefda6ec632a5b691074eb17e1d58fafb", null ], [ "setOutput", "classxpcc_1_1_pca9535.html#a334d1ae6fcd9b67a37590d75324650bf", null ], [ "set", "classxpcc_1_1_pca9535.html#a3526f9ce826259c356c14cf17ee4cd82", null ], [ "reset", "classxpcc_1_1_pca9535.html#a51d99e4430a40c4e6b3f07464a188180", null ], [ "toggle", "classxpcc_1_1_pca9535.html#a760d674de82659d390754a29ec7ac838", null ], [ "set", "classxpcc_1_1_pca9535.html#aa9eb284cb297ce177bd3bb0a23579599", null ], [ "isSet", "classxpcc_1_1_pca9535.html#a73e5be660d5e4e124a25e11a9bfb4f73", null ], [ "getDirection", "classxpcc_1_1_pca9535.html#a274252daa55eef226a41e0406eb349c3", null ], [ "setInput", "classxpcc_1_1_pca9535.html#a2b8a52d8329c09cf467572f7332c3525", null ], [ "setInvertInput", "classxpcc_1_1_pca9535.html#aebb3a7ba593883dff1ee9f9865ca4ee6", null ], [ "resetInvertInput", "classxpcc_1_1_pca9535.html#a899ed1f4e2ca830e1f5d19348dd51352", null ], [ "read", "classxpcc_1_1_pca9535.html#ad5149f41021b13e3d38b50c9adb78dd4", null ], [ "readInput", "classxpcc_1_1_pca9535.html#aa108e7b2085fc4396edc5e2feb474d1e", null ], [ "writePort", "classxpcc_1_1_pca9535.html#a9ec051b824c15afd435293c7d3ad9096", null ], [ "readPort", "classxpcc_1_1_pca9535.html#a783619fe79ddef5a66cc842249811a46", null ], [ "getDirections", "classxpcc_1_1_pca9535.html#aa51bfa581d1b455d9aea80451e5edeab", null ], [ "getOutputs", "classxpcc_1_1_pca9535.html#a4efc7e323cd6bb5988aeedbb5b6fc194", null ], [ "getInputs", "classxpcc_1_1_pca9535.html#a984d811255bb73c896b06ed86b9b3f1f", null ], [ "getPolarities", "classxpcc_1_1_pca9535.html#a3a0d60e75f2606f22e1e51b0e2d5f006", null ] ] ], [ "ShiftRegisterInput", "classxpcc_1_1_shift_register_input.html", [ [ "initialize", "classxpcc_1_1_shift_register_input.html#addde4e882021649f4b264baeb8bfd3b3", null ], [ "operator[]", "classxpcc_1_1_shift_register_input.html#a66e0c45c756dda421807abe5dc786b04", null ], [ "operator[]", "classxpcc_1_1_shift_register_input.html#affc66fcf0e39b42e72b1cea1b8c2d6f3", null ], [ "update", "classxpcc_1_1_shift_register_input.html#afe0bdef6c8044696b9524f90d15b39a7", null ] ] ], [ "ShiftRegisterOutput", "classxpcc_1_1_shift_register_output.html", [ [ "operator[]", "classxpcc_1_1_shift_register_output.html#a167ba939709e5da032f798d33a9a533f", null ], [ "operator[]", "classxpcc_1_1_shift_register_output.html#a97ef9511946212e8a80a6cd0c80b6f06", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1amnb_1_1_listener.js var structxpcc_1_1amnb_1_1_listener = [ [ "Callback", "structxpcc_1_1amnb_1_1_listener.html#ad92a221854d1194b5a79fd3ed6f3236c", null ], [ "call", "structxpcc_1_1amnb_1_1_listener.html#aed65c4ebe84992f33685685c7792a112", null ], [ "address", "structxpcc_1_1amnb_1_1_listener.html#abb63d4297ee9d136be90da134f26ba0d", null ], [ "command", "structxpcc_1_1amnb_1_1_listener.html#a4bb3471a63ba80a6b3fe0aaf7d179cda", null ], [ "object", "structxpcc_1_1amnb_1_1_listener.html#ae05f145b43e3958206b6177c8a35393c", null ], [ "function", "structxpcc_1_1amnb_1_1_listener.html#a77b1aac07b242de91aacdd28d3b95d8e", null ] ];<file_sep>/docs/api/group__atmega328p.js var group__atmega328p = [ [ "ADC", "group__atmega328p__adc.html", "group__atmega328p__adc" ], [ "Core", "group__atmega328p__core.html", null ], [ "GPIO", "group__atmega328p__gpio.html", "group__atmega328p__gpio" ], [ "I2C", "group__atmega328p__i2c.html", "group__atmega328p__i2c" ], [ "SPI", "group__atmega328p__spi.html", "group__atmega328p__spi" ], [ "UART", "group__atmega328p__uart.html", "group__atmega328p__uart" ] ];<file_sep>/docs/api/structxpcc_1_1lpc_1_1_can_filter_1_1_extended_filter_mask.js var structxpcc_1_1lpc_1_1_can_filter_1_1_extended_filter_mask = [ [ "ExtendedFilterMask", "structxpcc_1_1lpc_1_1_can_filter_1_1_extended_filter_mask.html#a94dd751af24b370e9df94671e12ef708", null ], [ "operator uint32_t", "structxpcc_1_1lpc_1_1_can_filter_1_1_extended_filter_mask.html#a698ff448194cfdcc9ed603fd1089a2be", null ] ];<file_sep>/docs/api/structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask.js var structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask = [ [ "ExtendedFilterMask", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask.html#a312f00eaf16730b2d177db69f2cd904e", null ], [ "operator uint32_t", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask.html#a03096aa68155ae0d3312c9b324e0cd7c", null ] ];<file_sep>/docs/api/structxpcc_1_1ssd1306.js var structxpcc_1_1ssd1306 = [ [ "Rotation", "structxpcc_1_1ssd1306.html#a9eb540ea29832d4a698d54bf3271c387", [ [ "Normal", "structxpcc_1_1ssd1306.html#a9eb540ea29832d4a698d54bf3271c387a960b44c579bc2f6818d2daaf9e4c16f0", null ], [ "UpsideDown", "structxpcc_1_1ssd1306.html#a9eb540ea29832d4a698d54bf3271c387af08af04d07c38567fc6b24634c51f903", null ] ] ], [ "ScrollStep", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449", [ [ "Frames2", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449aeb3e801ad5acf1f80e6c62d3474dcbd7", null ], [ "Frames3", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449ad7e7e92952996931a5236e6895f8816b", null ], [ "Frames4", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449a3caf8a1311e1fcd4714420284533058b", null ], [ "Frames5", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449a263653586b57ab2a7080dc7c31082b07", null ], [ "Frames25", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449aa59fcd4617522eed31e0a8ccd1c787df", null ], [ "Frames64", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449a9cbab526c9ff400fbc7809503bcfff4d", null ], [ "Frames128", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449a17e92f2ec6c475599cc315789bcc30e3", null ], [ "Frames256", "structxpcc_1_1ssd1306.html#a3a758b9d513fc89d150789b535e10449a2d12dfba78cf5f4b0b7ff14bfcf880c1", null ] ] ], [ "ScrollDirection", "structxpcc_1_1ssd1306.html#a47e0dd5457f18de95d351ba385144ded", [ [ "Right", "structxpcc_1_1ssd1306.html#a47e0dd5457f18de95d351ba385144deda92b09c7c48c520c3c55e497875da437c", null ], [ "Left", "structxpcc_1_1ssd1306.html#a47e0dd5457f18de95d351ba385144deda945d5e233cf7d6240f6b783b36a374ff", null ] ] ], [ "DisplayMode", "structxpcc_1_1ssd1306.html#a569053d3cffda42b8a21e9fdd350beb2", [ [ "Normal", "structxpcc_1_1ssd1306.html#a569053d3cffda42b8a21e9fdd350beb2a960b44c579bc2f6818d2daaf9e4c16f0", null ], [ "Inverted", "structxpcc_1_1ssd1306.html#a569053d3cffda42b8a21e9fdd350beb2acf4c2a4bf7c328c4e51f902350475343", null ] ] ] ];<file_sep>/docs/api/search/variables_10.js var searchData= [ ['ubuntu_5f36',['Ubuntu_36',['../group__font.html#ga2f45da0f50ecf1f51b63c130685f0781',1,'xpcc::font']]], ['uid',['uid',['../classxpcc_1_1gui_1_1_widget.html#a1e000ea80722515ae29abcbc3d92b6b6',1,'xpcc::gui::Widget']]] ]; <file_sep>/docs/api/classxpcc_1_1tipc_1_1_transmitter.js var classxpcc_1_1tipc_1_1_transmitter = [ [ "Transmitter", "classxpcc_1_1tipc_1_1_transmitter.html#a0f773279851eedb93f493d1bb47b49fc", null ], [ "~Transmitter", "classxpcc_1_1tipc_1_1_transmitter.html#aa76bd4ccef9badd6bfc2ce0750f6ecef", null ], [ "setDomainId", "classxpcc_1_1tipc_1_1_transmitter.html#a29d36cc61eec15f7af77a394d61bd5b8", null ], [ "transmitRequest", "classxpcc_1_1tipc_1_1_transmitter.html#ab7f2938dd5aa9625df6c1a8879f2298e", null ], [ "transmitEvent", "classxpcc_1_1tipc_1_1_transmitter.html#a2ec06b83f7f996d761ca18d9f577a8b4", null ], [ "getPortId", "classxpcc_1_1tipc_1_1_transmitter.html#a1a242ec94aa81067bc1f27c2294138e6", null ] ];<file_sep>/docs/api/classxpcc_1_1log_1_1_style.js var classxpcc_1_1log_1_1_style = [ [ "Type", "classxpcc_1_1log_1_1_style.html#a29c36c1a9d87a30bf22d1acb5d1dc7ba", null ], [ "Style", "classxpcc_1_1log_1_1_style.html#af2b04985cbd249c44bf758d03f1fa3e4", null ], [ "Style", "classxpcc_1_1log_1_1_style.html#ae4a36208c2265232177e74077ada5155", null ], [ "~Style", "classxpcc_1_1log_1_1_style.html#aff9a85ed67ec64e50388e5b0af452e61", null ], [ "parseArg", "classxpcc_1_1log_1_1_style.html#a140c55ad563d65e7371392c4b0e46970", null ], [ "write", "classxpcc_1_1log_1_1_style.html#a4180df119ff3e81c94e6243f15f31ea1", null ], [ "write", "classxpcc_1_1log_1_1_style.html#a836f02c8edcdef51ef310c94bfdfa55f", null ], [ "flush", "classxpcc_1_1log_1_1_style.html#a5ddec71ad0547e9c91b6c3b7843e69a6", null ] ];<file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01double_01_4.js var structxpcc_1_1_arithmetic_traits_3_01double_01_4 = [ [ "WideType", "group__arithmetic__trais.html#ga776e5cc088baa9b9e1884f488d52e025", null ], [ "SignedType", "group__arithmetic__trais.html#gae3eba81fcac9d351cb7550b1c3705f36", null ], [ "UnsignedType", "group__arithmetic__trais.html#ga185ab6c545fcd05f45c0d5318ea52ec5", null ] ];<file_sep>/docs/api/classxpcc_1_1rtos_1_1_binary_semaphore.js var classxpcc_1_1rtos_1_1_binary_semaphore = [ [ "BinarySemaphore", "classxpcc_1_1rtos_1_1_binary_semaphore.html#aa33e3589b59a81eb3912971802ff3d82", null ], [ "BinarySemaphore", "classxpcc_1_1rtos_1_1_binary_semaphore.html#aa33e3589b59a81eb3912971802ff3d82", null ] ];<file_sep>/docs/api/group__driver__dac.js var group__driver__dac = [ [ "Mcp4922", "classxpcc_1_1_mcp4922.html", [ [ "Register", "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096", [ [ "SHDN", "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a10db7c0b0c5f0e324c25a95eded4ea4d", null ], [ "GA", "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a6591404651030ca167eb7b748fe6d5f6", null ], [ "BUF", "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a74a0db48cc9895782a8888f832f805d1", null ], [ "CHANNEL_B", "classxpcc_1_1_mcp4922.html#a57f88db5fdae273b35abed4a6d3bc096a4540dd7de906a9d42035091b8044125c", null ] ] ] ] ] ];<file_sep>/src/reference/device-files.md # Device Files The device file describes the device metadata and peripheral tree in XML. Information from one device can be extracted by providing the device identifier. ## Device Identifier The device identifier is the canonical representation of the device name within the device file. It consists out of the following elements with examples for device names *stm32f407vg* and *atmega328p*: | Element | STM32 | AVR | |----------|-------|--------| | platform | stm32 | avr | | family | f4 | atmega | | name | 407 | 328 | | type | | p | | pin-id | v | | | size-id | g | 32 | Notice that type and pin-id have different interpretations on the STM32 and AVR platform, which reflects in the device file format. ## Naming Scheme All device files can be currently found in the `xpcc/architecture/platform/devices/`, with the naming schemes dependend on architecture. Examples include: - avr: - AT90: `at90` + `sizes-type` - `at9032_64_128-can.xml` for **AT90CAN(32|64|128)** - ATtiny, ATmega: `atmega` + `sizes-types` - `atmega48_88_168_328-a_none_p_pa.xml` for **ATMEGA(48|88|169|328)(a|p|pa)?** - ATxmega: `xmega` + `sizes-package-types` - `xmega64_128-a1-none_u.xml` for **ATXMEGA(64|128)A1(U)?** - stm32: - STM32F: `stm32f` + `names-pins-sizes` - `stm32f405_407_415_417-i_r_v_z-e_g.xml` for **STM32F(405|407|415|417)(I|R|V|Z)(E|G)** ## File Format The device files encode information about one or several very similar devices using a tree representation. The device tree root declares its device scope using OR'ed device identifier elements. Here is the *ATmega328* device family as an example: ```xml <device platform="avr" family="atmega" name="48|88|168|328" size_id="4|8|16|32" type="a|none|p|pa"> ... </device> ``` This looks very similar for the *STM32F407* device family: ```xml <device platform="stm32" family="f4" name="405|407|415|417" pin_id="i|r|v|z" size_id="e|g"> ... </device> ``` ### Available Elements Inside the device tag, the following elements describe the device: | Element | Description | |----------------|------------------------------------------------| | flash | size of available non-volatile memory in bytes | | ram | size of available volatile memory in bytes | | eeprom | size of available eeprom in bytes (avr-only) | | linkerscript | name of linkerscript (cortex-m-only) | | core | name of CPU core | | mcu | avrdude name of device (avr-only) | | pin-count | number of pins on device | | header | required device header(s) | | define | required device define(s) | | driver | a peripheral driver implementation | For example, all devices in the STM32F407 family have 192kB of RAM: ```xml <ram>196608</ram> ``` However, each element may also declare its device scope by including device identifier attributes. To distinguish filterable device identifier attributes from declaration attributes, they must be prefixed with `device-`. For the ATmega328 family several RAM sizes exist depending on device name: ```xml <ram device-name="48">512</ram> <ram device-name="88|168">1024</ram> <ram device-name="328">2048</ram> ``` You are even able to use the value of these elements to further limit the scope of new elements. An example of this can be seen in the core driver file (discussed later), which uses the core element as device-scope: ```xml <template core="cortex-m3|cortex-m4|cortex-m4f">hard_fault_handler.cpp.in</template> ``` As the device file is declarative, the filtering engine will resolve all dependencies recursively and throw an error in case of unresolved elements or circular referencing. ### Available Drivers The driver elements link the device hardware peripheral with a software implementation, which are found in `xpcc/architecture/platform/driver/`. Each driver is divided into several hardware dependend implementations. A selection of the most important drivers are: driver |-- adc |-- can |-- clock |-- fsmc |-- gpio | |-- at90_tiny_mega | |-- generic | `-- stm32 |-- i2c |-- spi | |-- at90_tiny_mega | |-- at90_tiny_mega_uart | |-- generic | |-- stm32 | `-- stm32_uart |-- timer `-- uart Notice the `generic` folders. These are available for all platforms and are automatically included. Also, notice how there exist two implementations for **spi** for the **stm32** and **at90_tiny_mega** platform. One is for using the dedicated SPI hardware, and the other is for the UART hardware in SPI mode, however, both conform to the same SPI interface: ```xml <driver type="spi" name="stm32" instances="1,2,3"/> <driver type="spi" name="stm32_uart" instances="1,2,3,4,5,6"/> ``` Of course, drivers may also declare device scope. For the STM32F407 family, the FSMC is not available for pin-id `R` (=64 pins): ```xml <driver device-pin-id="i|v|z" type="fsmc" name="stm32"/> ``` Any childen of a driver element will be available inside the driver instance template. Except for the reserved name `parameter`, there are no limitations on data structure or naming. For example, the GPIO driver needs to know which pins are available for the requested device (with the `gpio` element), and what alternate functions to connect to them (with the `af` element). This information is encoded as driver element children (here for the ATmega328 device family): ```xml <driver type="gpio" name="at90_tiny_mega"> <gpio port="B" id="0" pcint="0"/> ... <gpio port="D" id="1" pcint="17"> <af peripheral="Uart0" type="out" name="Txd"/> </gpio> <gpio port="D" id="2" pcint="18" extint="0"/> ... </driver> ``` Of course, device scope may also be declared for individual pins and even alternate functions (here for the STM32F407 device family): ```xml <driver type="gpio" name="stm32"> ... <gpio device-pin-id="i|v|z" port="E" id="1"> <af id="12" peripheral="Fsmc" name="Nbl1"/> </gpio> <gpio device-pin-id="i|v|z" port="E" id="2"> <af id="12" peripheral="Fsmc" name="A23"/> </gpio> <gpio device-pin-id="i|v|z" port="E" id="3"> <af id="12" peripheral="Fsmc" name="A19"/> </gpio> <gpio device-pin-id="i|v|z" port="E" id="4"> <af id="12" peripheral="Fsmc" name="A20"/> </gpio> ... </driver> ``` This structure is then available as a dictionary inside the device driver template files. ## Driver Files The device file only describes which folder contains the driver implementation and metadata for its implementation. It does not specify which files are part of the implementation, and how multiple instances of a driver are created. This is done using the `driver.xml` file inside each driver implemenation. For the `at90_tiny_mega` GPIO driver it contains: ```xml <driver type="gpio" name="at90_tiny_mega"> <static>gpio_define.h</static> <template>gpio.hpp.in</template> ... </driver> ``` Here the elements stand for: - `<static>`: copy source file without modification, - `<template>`: generate source file `gpio.hpp` from `gpio.hpp.in` template with the device file GPIO data Let's look at how to generate several driver instances using a driver file. Here is the `at90_tiny_meta` UART driver file: ```xml <driver type="uart" name="at90_tiny_mega"> <template instances="0,1,2,3" out="uart{{id}}.hpp">uart.hpp.in</template> ... </driver> ``` Here the driver file has the capability to generate the instances 0,1,2 and 3 of the UART classes, and write them into the format specified by the `out` attribute. The `instances` attribute can be used to generate different instances out of different template files as shown in the `stm32` UART driver file: ```xml <driver type="uart" name="stm32"> <template instances="1,2,3,6" out="usart_{{id}}.hpp">uart.hpp.in</template> <template instances="4,5" out="uart_{{id}}.hpp">uart.hpp.in</template> ... </driver> ``` Note, that only the instances declared in the device file will actually be generated! So for the ATmega328, only UART instance 0 will be generated, since that has been declared in the device file: ```xml <driver type="uart" name="at90_tiny_mega" instances="0"/> ``` ### Custom elements In the driver file, custom device-scoped elements may be declared, as in the `at90_tiny_mega` GPIO driver file: ```xml <driver type="gpio" name="at90_tiny_mega"> ... <notoggle device-family="atmega" device-name="8|16|32|64|128|162|8515|8535">True</notoggle> <notoggle device-family="attiny" device-name="26">True</notoggle> ... </driver> ``` Here the `notoggle` element will be added to the substitution dictionary only for the specified devices. ### Parameters In order to customize drivers further parameters may be declared. There are currently three types available: - `int`: has a minimum and a maximum value - `bool`: true/false - `enum`: semicolon-separated values All buffered UART implementations have two parameters named `tx_buffer` and `rx_buffer`, which are of type `int` and set the size of the atomic transmit and receive buffer. ```xml <driver type="uart" name="at90_tiny_mega"> ... <parameter name="tx_buffer" type="int" min="1" max="254">8</parameter> <parameter name="rx_buffer" type="int" min="1" max="254">4</parameter> </driver> ``` Each UART instance receives their own two independent parameters with these default values. The `stm32` core driver features the other two types: ```xml <driver type="core" name="cortex"> <parameter name="allocator" type="enum" values="newlib;block_allocator"> block_allocator </parameter> <parameter name="enable_gpio" type="bool">true</parameter> ... </driver> ``` These parameter may be overwritten in either the device file, or in the `project.cfg` in the section `[parameters]`, which follows the naming scheme `type.name.instance.parameter`: ```python [parameters] uart.at90_tiny_mega.0.tx_buffer = 200 uart.at90_tiny_mega.0.rx_buffer = 100 ``` ## Generator We designed the device file format to use this form of XML to not only be human readable, but much more important, to be human-writeable. We decided to group multiple devices of the same functionality family into one device file, instead of providing one device file for each of these devices. This made accessing the devices files computationally more complex, since we have to evaluate the device-scope, however, it dramatically reduces redundancies and allows a much more natural description of devices in this language. While the first device files were still written manually, a device file generator soon became necessary to allow inclusion of many devices and to help with refactoring during API changes. This generator uses multiple manufacturer provided description files to extract data about multiple devices and compress them into one device file, while preserving readability and correctness. Further information about the device file generator can be found in the Readme at `/tools/device_file_generator`. <file_sep>/docs/api/classxpcc_1_1_bma180.js var classxpcc_1_1_bma180 = [ [ "Bma180", "classxpcc_1_1_bma180.html#a59d59c6b8498626a800d5ccb6b851533", null ], [ "configure", "classxpcc_1_1_bma180.html#a1351d98faca2c640d59b70d5996c0ece", null ], [ "readAccelerometer", "classxpcc_1_1_bma180.html#a68f6803fd4bf91f49e4343af028a3aee", null ], [ "getData", "classxpcc_1_1_bma180.html#a67e9c63a9b936dc0ed7cfc637dd3d8e9", null ], [ "isNewDataAvailable", "classxpcc_1_1_bma180.html#acb1821b99699eccee6489c0adb64f6ab", null ], [ "update", "classxpcc_1_1_bma180.html#a5211e9d37024ea30a66d364487119973", null ], [ "reset", "classxpcc_1_1_bma180.html#ad92a1345bf3603bd0f11ae50a07bd604", null ], [ "writeMaskedRegister", "classxpcc_1_1_bma180.html#a532340a2dd35297f8667fab270475c99", null ] ];<file_sep>/docs/api/search/classes_13.js var searchData= [ ['value',['Value',['../structxpcc_1_1_value.html',1,'xpcc']]], ['vector',['Vector',['../classxpcc_1_1_vector.html',1,'xpcc']]], ['vector_3c_20int16_5ft_2c_202_20_3e',['Vector&lt; int16_t, 2 &gt;',['../classxpcc_1_1_vector.html',1,'xpcc']]], ['vector_3c_20t_2c_201_20_3e',['Vector&lt; T, 1 &gt;',['../classxpcc_1_1_vector_3_01_t_00_011_01_4.html',1,'xpcc']]], ['vector_3c_20t_2c_202_20_3e',['Vector&lt; T, 2 &gt;',['../classxpcc_1_1_vector_3_01_t_00_012_01_4.html',1,'xpcc']]], ['vector_3c_20t_2c_203_20_3e',['Vector&lt; T, 3 &gt;',['../classxpcc_1_1_vector_3_01_t_00_013_01_4.html',1,'xpcc']]], ['vector_3c_20t_2c_204_20_3e',['Vector&lt; T, 4 &gt;',['../classxpcc_1_1_vector_3_01_t_00_014_01_4.html',1,'xpcc']]], ['view',['View',['../classxpcc_1_1gui_1_1_view.html',1,'xpcc::gui']]], ['viewstack',['ViewStack',['../classxpcc_1_1_view_stack.html',1,'xpcc']]], ['virtualgraphicdisplay',['VirtualGraphicDisplay',['../classxpcc_1_1_virtual_graphic_display.html',1,'xpcc']]], ['vl53l0',['vl53l0',['../structxpcc_1_1vl53l0.html',1,'xpcc::vl53l0'],['../classxpcc_1_1_vl53l0.html',1,'xpcc::Vl53l0&lt; I2cMaster &gt;']]], ['vl6180',['Vl6180',['../classxpcc_1_1_vl6180.html',1,'xpcc::Vl6180&lt; I2cMaster &gt;'],['../structxpcc_1_1vl6180.html',1,'xpcc::vl6180']]] ]; <file_sep>/docs/api/group__driver__position.js var group__driver__position = [ [ "Vl53l0", "classxpcc_1_1_vl53l0.html", [ [ "Vl53l0", "classxpcc_1_1_vl53l0.html#a493d95fb46e4743d48654cc29cdf1436", null ], [ "ping", "classxpcc_1_1_vl53l0.html#a7690693dc3320b0aee5424db103a8fa1", null ], [ "initialize", "classxpcc_1_1_vl53l0.html#a6aed3c7b2a489c440beb381a8219aefe", null ], [ "setDeviceAddress", "classxpcc_1_1_vl53l0.html#a6314ddf84c8d8f62c833f2adc0e43c2a", null ], [ "readDistance", "classxpcc_1_1_vl53l0.html#a393c549390eb6045d1a8d66072fa554c", null ], [ "getRangeError", "classxpcc_1_1_vl53l0.html#a25eaa22df8e039b5b9ad119558761185", null ], [ "updateRegister", "classxpcc_1_1_vl53l0.html#aa3b72e103f5459a22c9232229b17096b", null ], [ "getData", "classxpcc_1_1_vl53l0.html#ad77eba332a9ba2f102236f2c989cd634", null ], [ "setMaxMeasurementTime", "classxpcc_1_1_vl53l0.html#a115072359ea63862b41f2fa7ec635ccf", null ], [ "getMaxMeasurementTime", "classxpcc_1_1_vl53l0.html#abc6deef8aff2cfebb3c5d35d2b26bb61", null ] ] ], [ "Vl6180", "classxpcc_1_1_vl6180.html", [ [ "Vl6180", "classxpcc_1_1_vl6180.html#a50252a5cfdda3f6d5fe703a8b5f3b3d7", null ], [ "ping", "classxpcc_1_1_vl6180.html#a7c8597829fc80232846aa75553c27cf3", null ], [ "initialize", "classxpcc_1_1_vl6180.html#a118c595804903888754f24575c2f8b39", null ], [ "setDeviceAddress", "classxpcc_1_1_vl6180.html#a520a59a2d7d7d4e8332f0afd15309bf3", null ], [ "setGain", "classxpcc_1_1_vl6180.html#a8e1f25d95eefd1583885118fd83f8206", null ], [ "setIntegrationTime", "classxpcc_1_1_vl6180.html#a2b77bcdf2f878325cf7fb4f543f37b6c", null ], [ "readDistance", "classxpcc_1_1_vl6180.html#a6cbaa740d7046de158364d6a3e9575c6", null ], [ "readAmbientLight", "classxpcc_1_1_vl6180.html#a5d7a734a6b7d5c8a4da7857be7e1a052", null ], [ "getRangeError", "classxpcc_1_1_vl6180.html#a71b56e4b8bb3059ef74a4ece8e766d9e", null ], [ "getALS_Error", "classxpcc_1_1_vl6180.html#a7a5daebdce51bd6f2a3e3e27dcc4b960", null ], [ "updateRegister", "classxpcc_1_1_vl6180.html#a3c9a55742fe6b19676397ebb367da379", null ], [ "write", "classxpcc_1_1_vl6180.html#ac377545c8032f1480acf0401e8955927", null ], [ "getData", "classxpcc_1_1_vl6180.html#ac656029ca190e42b844fdaf91b0ab17b", null ], [ "read", "classxpcc_1_1_vl6180.html#a86e8c0d2eec0c00984017e093a092c46", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_postman.js var classxpcc_1_1_postman = [ [ "DeliverInfo", "classxpcc_1_1_postman.html#<KEY>", [ [ "OK", "classxpcc_1_1_postman.html#aa440ccd20c324f7f6d429c792da04f43a1a71425889d446bad54bec3001ceafe2", null ], [ "ERROR", "classxpcc_1_1_postman.html#<KEY>", null ], [ "NO_COMPONENT", "classxpcc_1_1_postman.html#<KEY>", null ], [ "NO_ACTION", "classxpcc_1_1_postman.html#<KEY>", null ], [ "WRONG_ACTION_PARAMETER", "classxpcc_1_1_postman.html#<KEY>", null ], [ "NO_EVENT", "classxpcc_1_1_postman.html#<KEY>43a19c7280fc1e4d46e0116cfe84a8cc40f", null ], [ "WRONG_EVENT_PARAMETER", "classxpcc_1_1_postman.html#aa440ccd20c324f7f6d429c792da04f43a40568053fdb52b13cfb68fc2b6a7e671", null ], [ "NOT_IMPLEMENTED_YET_ERROR", "classxpcc_1_1_postman.html#aa440ccd20c324f7f6d429c792da04f43a6448e58e6d8b4848b784ee66ed70997e", null ] ] ], [ "deliverPacket", "classxpcc_1_1_postman.html#a6ac029a0ef8d6768b711b4ff868eccd9", null ], [ "isComponentAvailable", "classxpcc_1_1_postman.html#a56d033f2ce76af94fc961629d7a6f5ff", null ] ];<file_sep>/docs/api/classxpcc_1_1ui_1_1_led.js var classxpcc_1_1ui_1_1_led = [ [ "Led", "classxpcc_1_1ui_1_1_led.html#adc48a7f4d4b1f721fc37b9bd166b5975", null ], [ "Led", "classxpcc_1_1ui_1_1_led.html#a2b603934aec4cc2af7e0e3e59ca207f6", null ], [ "setBrightness", "classxpcc_1_1ui_1_1_led.html#a467878d059b4fe59d9e858340bdb6ea1", null ], [ "getBrightness", "classxpcc_1_1ui_1_1_led.html#a51b40a433c78d4579e6af84fb96be203", null ], [ "isFading", "classxpcc_1_1ui_1_1_led.html#a79eb74bfa88a2df14628e1c2c495ceec", null ], [ "fadeTo", "classxpcc_1_1ui_1_1_led.html#a950afd5bdbd20a194788840afe3cc9bc", null ], [ "on", "classxpcc_1_1ui_1_1_led.html#acbabf82037b7aed550b64aa439f31905", null ], [ "off", "classxpcc_1_1ui_1_1_led.html#a7e1fc42f26e70671e7fbc0aa9595e6df", null ], [ "update", "classxpcc_1_1ui_1_1_led.html#aa7b066c49cf6784f185230be3245ae12", null ], [ "operator Animation< uint8_t > &", "classxpcc_1_1ui_1_1_led.html#ace1b8ca4de248f2187565cd1045b2e50", null ] ];<file_sep>/docs/api/search/groups_6.js var searchData= [ ['geometry',['Geometry',['../group__geometry.html',1,'']]], ['general_20purpose_20input_20and_2for_20output_20pins_20_28gpio_29',['General purpose input and/or output pins (GPIO)',['../group__gpio.html',1,'']]], ['graphics',['Graphics',['../group__graphics.html',1,'']]], ['graphical_20user_20interface',['Graphical User Interface',['../group__gui.html',1,'']]], ['general_20purpose_20register_20classes',['General Purpose Register classes',['../group__register.html',1,'']]], ['gpio',['GPIO',['../group__stm32f407vg__gpio.html',1,'']]] ]; <file_sep>/docs/api/annotated_dup.js var annotated_dup = [ [ "Board", null, [ [ "systemClock", "struct_board_1_1system_clock.html", null ] ] ], [ "my_namespace", null, [ [ "MyClass", "classmy__namespace_1_1_my_class.html", "classmy__namespace_1_1_my_class" ] ] ], [ "unittest", null, [ [ "Controller", "classunittest_1_1_controller.html", "classunittest_1_1_controller" ], [ "CountType", "classunittest_1_1_count_type.html", "classunittest_1_1_count_type" ], [ "Reporter", "classunittest_1_1_reporter.html", "classunittest_1_1_reporter" ], [ "TestSuite", "classunittest_1_1_test_suite.html", "classunittest_1_1_test_suite" ] ] ], [ "xpcc", "namespacexpcc.html", "namespacexpcc" ] ];<file_sep>/src/index.md # xpcc: C++ microcontroller framework <span style="float:right;"><a href="https://travis-ci.org/roboterclubaachen/xpcc" style="border-bottom:none">![Build Status](https://travis-ci.org/roboterclubaachen/xpcc.svg?branch=develop)</a></span> The xpcc framework consists of powerful hardware abstraction layers for many different microcontrollers, a set of drivers for various external targets and a general purpose toolbox for building hardware orientated applications. The main goal of xpcc is to provide a usable API for barebone microcontroller programming, which is efficient enough to be deployed on a small ATtiny, yet powerful enough to make use of advanced capabilities found on the 32bit ARM Cortex-M. xpcc is [battle-tested](#who-we-are) in the real-world, highly competitive environment of [Eurobot][]. It is the foundation of all of [@RCA_eV][rca]'s robot code, and is the culmination of many years worth of effort, experience and improvements. - [Feast your eyes on lots of working examples][examples]. - [API reference is available here][reference]. - [We have continuous integration as well][travis_ci]. - [And we care a lot about testing][testing]. This project also has [guide for developers][guide] as well as a [technical blog][blog] to document larger design concepts. - You have questions? [Ask them on our mailing list][mailing_list] or [have a look at the archive][mailing_archive]. - You found a bug? [Open up an issue, we don't bite][issues]. - You want to contribute? [Read the contribution guidelines][contributing] and [open a pull request so we can merge it][prs]. - You want to port xpcc? [Read our porting guide][porting]. The source code is freely available under a 3-clause BSD license, so feel free to fork this project and adapt it to your needs. The only thing we ask of you is to contribute your changes back. That way everyone can profit. ## Features - Efficient and fast object-oriented C++11 API. - Support of AVR and ARM Cortex-M based microcontrollers from Atmel, ST and NXP. - Build system based on SCons and extendable using Python. - Data-driven HAL generation using Jinja2 template engine. - No memory allocations in HAL with very low overall RAM consumption. - Cross platform peripheral interfaces incl. bit banging: - GPIO & GPIO expanders - ADC - UART, I2C, SPI - CAN - Interfaces for external I2C and SPI device drivers. - Debug/logging system with IOStream interface. - Lightweight, stackless threads and resumable functions using cooperative multitasking. - Useful mathematical and geometric algorithms optimized for microcontrollers. - Lightweight unit testing system (suitable for AVRs). - Graphical user interface for small binary displays. ## Supported hardware Here is a list of supported **and tested** microcontrollers and development boards: | Controller | Development Board | Support | |:-----------|:------------------------|:------------------------------------| | AT90can | custom | &#9733;&#9733;&#9733; | | ATtiny44a | custom | &#9733;&#9733;&#9733; | | ATtiny85 | custom | &#9733;&#9733;&#9733; | | ATmega328p | [Arduino Uno][] | &#9733;&#9733;&#9733; | | STM32F072 | [STM32F072 Discovery][] | &#9733;&#9733;&#9733;&#9733; | | STM32F100 | [STM32F1 Discovery][] | &#9733;&#9733;&#9733;&#9733; | | STM32F103 | [Nucleo F103RB][] | &#9733;&#9733;&#9733;&#9733; | | STM32F103 | [STM32F1 Blue Pill][] | &#9733;&#9733;&#9733;&#9733; | | STM32F303 | [STM32F3 Discovery][] | &#9733;&#9733;&#9733;&#9733;&#9733; | | STM32F303 | [Nucleo F303K8][] | &#9733;&#9733;&#9733;&#9733; | | STM32F407 | [STM32F4 Discovery][] | &#9733;&#9733;&#9733;&#9733;&#9733; | | STM32F411 | [Nucleo F411RE][] | &#9733;&#9733;&#9733;&#9733; | | STM32F429 | [STM32F429 Discovery][] | &#9733;&#9733;&#9733;&#9733;&#9733; | | STM32F429 | [Nucleo F429ZI][] | &#9733;&#9733;&#9733;&#9733; | | STM32F469 | [STM32F469 Discovery][] | &#9733;&#9733;&#9733;&#9733; | | STM32F746 | [STM32F746 Discovery][] | &#9733;&#9733;&#9733;&#9733; | | STM32F769 | [STM32F769 Discovery][] | &#9733;&#9733;&#9733;&#9733; | | LPC11C24 | [LPCxpresso][] | &#9733;&#9733; | All of these targets are compiling and booting correctly (&#9733;) and have GPIO and UART working (&#9733;&#9733;). Most targets have support for basic peripherals, like I2C, SPI and ADC (&#9733;&#9733;&#9733;) as well as complicated peripherals, like Timers, CAN and external memory (&#9733;&#9733;&#9733;&#9733;). We also use a few targets in everyday development, which are very well tested (&#9733;&#9733;&#9733;&#9733;&#9733;). Please see [our examples for a complete list][examples] of tested projects. ### Your target While the xpcc API is designed to be portable, we are only a small team of developers and are limited in the amount of platforms we can support and test in hardware. The following microcontrollers should be able to compile, but *have not been tested extensively* in hardware: - All AT90 targets - All ATtiny targets - All ATmega targets - All STM32F0 targets - All STM32F1 targets - All STM32F3 targets - All STM32F4 targets - All STM32F7 targets There are more platforms which we have prepared, but currently not finished support for (Xmega, STM32F2, STM32L). [Drop us an email][mailing_list] to ask if your specific target is supported out-of-the-box and what you can do if it's not. ## Who we are During the last decade the [Roboterclub Aachen e.V.][rca_ev] has developed a software library for communication among components that are distributed on PCs and microcontrollers. This library was used in autonomous robots for the [Eurobot competition][eurobot]. In 2009, xpcc became a separate project and since then focussed on a new approach to cross target microcontroller libraries. Over the years xpcc grew from a communication library to a general purpose framework suitable for all kinds of embedded applications. The xpcc project is maintained by <NAME> ([@salkinium](https://github.com/salkinium)) and <NAME> ([@ekiwi](https://github.com/ekiwi)) with significant contributions from <NAME> ([@dergraaf](https://github.com/dergraaf)), <NAME> ([@daniel-k](https://github.com/daniel-k)), [@georgi-g](https://github.com/georgi-g) and [@thundernail](https://github.com/thundernail). Have a look at the quarter finals of the [Eurobot 2015 competition][eurobot]. Both our robots are running xpcc and starting from the right: <div class="videoWrapper"> <iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/K7obV0avUoQ?start=25925&amp;end=26071" frameborder="0" allowfullscreen></iframe> </div> [prs]: https://github.com/roboterclubaachen/xpcc/pulls [contributing]: https://github.com/roboterclubaachen/xpcc/tree/develop/CONTRIBUTING.md [porting]: https://github.com/roboterclubaachen/xpcc/blob/develop/PORTING.md [issues]: https://github.com/roboterclubaachen/xpcc/issues [rca_ev]: http://www.roboterclub.rwth-aachen.de/ [eurobot]: http://www.eurobot.org/ [travis_ci]: https://travis-ci.org/roboterclubaachen/xpcc [testing]: guide/testing [mailing_archive]: https://www.mail-archive.com/<EMAIL> [examples]: https://github.com/roboterclubaachen/xpcc/tree/develop/examples [mailing_list]: https://mailman.rwth-aachen.de/mailman/listinfo/xpcc-dev [guide]: guide/getting-started [reference]: reference/api [blog]: http://blog.xpcc.io [rca]: http://www.roboterclub.rwth-aachen.de [Arduino Uno]: https://www.arduino.cc/en/Main/ArduinoBoardUno [STM32F072 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF259724 [STM32F1 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF250863 [Nucleo F103RB]: http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF259875 [STM32F1 Blue Pill]: http://wiki.stm32duino.com/index.php?title=Blue_Pill [STM32F3 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF254044 [Nucleo F303K8]: http://www.st.com/en/evaluation-tools/nucleo-f303k8.html [STM32F4 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF252419 [Nucleo F411RE]: http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260320 [STM32F429 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF259090 [Nucleo F429ZI]: http://www.st.com/web/en/catalog/tools/PF262637 [STM32F469 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF262395 [STM32F746 Discovery]: http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF261641 [STM32F769 Discovery]: http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32f769idiscovery.html [LPCxpresso]: https://www.lpcware.com/LPCXpressoV1Boards <file_sep>/README.md # xpcc.io website and documentation This repo contains the website, user guide and reference manual for the xpcc microcontroller framework. This documentation is written in Markdown and uses MkDocs to generate HTML documents. To get a live preview of the website while your editing, execute `mkdocs serve` and then point your browser to http://127.0.0.1:8000. To build the website, execute `mkdocs build`, then `xpcc_doxygen.sh` to build and move the xpcc doxygen documentation into place. The `site` folder contains the entire website and is all that is required to host xpcc.io. The theme is [Material for MkDocs](http://squidfunk.github.io/mkdocs-material/), which is modified to replace the download button with a forks button. ### Markdown extensions A couple of canonical extensions are enabled, like `tables` and `admonition`. Two custom extensions are used to render both LaTeX and Markdeep into statically hosted, inlined SVG, which removes the need to include client-side Javascript rendering for either. It makes the site load faster and works for browser not having Javascript enabled. It also makes this site not require fetching some third party JS library, which might disappear in the future. Note: These plugins were adapted without much love and are therefore very hacked together. We're here to write documentation, not plugins. Please feel free to make them nice. #### LaTeX Adapted from [here](https://github.com/justinvh/Markdown-LaTeX). It renders the LaTeX formula into inlined SVG. Use $formula$ for math mode, or $$formula$$ for equations. Note that a `latex.cache` file is used to not have to render everything again. Required `pdflatex`, `pdfcrop`, `pdf2svg` and `svgo` command line tools installed. #### Markdeep To create beautiful geometric diagrams, this plugin renders markdeep diagrams into inline SVG. You need to have Selenium install for it (`pip install selenium`). Wrap the diagram in `<markdeep-diagram> </markdeep-diagram>` html tags. <file_sep>/docs/api/classxpcc_1_1gui_1_1_view.js var classxpcc_1_1gui_1_1_view = [ [ "View", "classxpcc_1_1gui_1_1_view.html#a5b5d3597a028b3b0c003e9b8ece5958c", null ], [ "~View", "classxpcc_1_1gui_1_1_view.html#ace27185cfc711c1e8e3a244b2c966941", null ], [ "update", "classxpcc_1_1gui_1_1_view.html#a7ca018425dfe8f9251df5e7bcd8b7b02", null ], [ "preUpdate", "classxpcc_1_1gui_1_1_view.html#a7435ef3f5ee83e60d5d7e8593be946c1", null ], [ "postUpdate", "classxpcc_1_1gui_1_1_view.html#ae24cd6ed3bd3a091c232e001e9b36a74", null ], [ "draw", "classxpcc_1_1gui_1_1_view.html#a25dd176d79c26556f88786541e5e9d62", null ], [ "pack", "classxpcc_1_1gui_1_1_view.html#a61afc0535c3a761b1bc333feb481c474", null ], [ "remove", "classxpcc_1_1gui_1_1_view.html#a01b1c9305312823e336ab357ec989f02", null ], [ "setColorPalette", "classxpcc_1_1gui_1_1_view.html#a7084cef7f3274f5436531341ab5c7e4c", null ], [ "getColorPalette", "classxpcc_1_1gui_1_1_view.html#ae1f1b096dfdddf045235129ea80179c6", null ], [ "markDirty", "classxpcc_1_1gui_1_1_view.html#afb90d50b647a2f0c2378e91f8108e530", null ], [ "markDrawn", "classxpcc_1_1gui_1_1_view.html#a4925e2849a38214826413494bcfb0a0f", null ], [ "getViewStack", "classxpcc_1_1gui_1_1_view.html#a12b527dbdb10d44044b50cc4c225193d", null ], [ "GuiViewStack", "classxpcc_1_1gui_1_1_view.html#adb448c19f6b4ff930dcd05d100a3beb8", null ], [ "stack", "classxpcc_1_1gui_1_1_view.html#ad228821c88e5e448b4b126e8e87d1f1a", null ], [ "dimension", "classxpcc_1_1gui_1_1_view.html#ac4ec8e9313e9c04249a2c87b8613674e", null ], [ "widgets", "classxpcc_1_1gui_1_1_view.html#accf8f8a32887c5d3baf3ca6c5603b22d", null ], [ "colorpalette", "classxpcc_1_1gui_1_1_view.html#ae6fb680f4c1ebece841fbac687aeb613", null ] ];<file_sep>/docs/api/navtreeindex0.js var NAVTREEINDEX0 = { "../index.html":[3], ".html":[2,0,1], ".html":[2,0,2], ".html":[2,0,3,0], ".html":[2,0,3,1], ".html":[2,0,3,2], ".html":[2,0,3,3], ".html":[2,0,3,5], ".html":[2,0,3,6], ".html":[2,0,3,7], ".html":[2,0,3,8], ".html":[2,0,3,9], ".html":[2,0,3,10], ".html":[2,0,3,11], ".html":[2,0,3,13], ".html":[2,0,3,14], ".html":[2,0,3,15], ".html":[2,0,3,16], ".html":[2,0,3,18,0], ".html":[2,0,3,19], ".html":[2,0,3,20], ".html":[2,0,3,21], ".html":[2,0,3,22], ".html":[2,0,3,23], ".html":[2,0,3,24], ".html":[2,0,3,25], ".html":[2,0,3,26], ".html":[2,0,3,26,0], ".html":[2,0,3,26,1], ".html":[2,0,3,27], ".html":[2,0,3,29], ".html":[2,0,3,31], ".html":[2,0,3,31,0], ".html":[2,0,0], "annotated.html":[2,0], "classes.html":[2,1], "classmy__namespace_1_1_my_class.html":[2,0,1,0], "classmy__namespace_1_1_my_class.html#a5423bb07e3401f6f777325dda20c71cf":[2,0,1,0,0], "classmy__namespace_1_1_my_class.html#a98f0a83810792f7fae9ae54619888721":[2,0,1,0,3], "classmy__namespace_1_1_my_class.html#ad1c00d6dbc0d5c7b9baba814959085c8":[2,0,1,0,2], "classmy__namespace_1_1_my_class.html#adbec462259093c0835682fd47b150b21":[2,0,1,0,1], "classunittest_1_1_controller.html":[1,0,0], "classunittest_1_1_controller.html#a5770d8c0b2f6ba39c6458aff8681b7ca":[1,0,0,2], "classunittest_1_1_controller.html#a8fa11f8e0928555b7490ed7b807a4e67":[1,0,0,1], "classunittest_1_1_controller.html#ac971c08cc6a9543ce617e03914924333":[1,0,0,0], "classunittest_1_1_count_type.html":[1,0,3], "classunittest_1_1_count_type.html#a217aebc55140203e7ce782007f735b86":[1,0,3,3], "classunittest_1_1_count_type.html#a393017741bb86930a18242ae26831962":[1,0,3,1], "classunittest_1_1_count_type.html#a720e97c990fca14fdb2fd591dae8a34e":[1,0,3,0], "classunittest_1_1_count_type.html#a7404048fba7c8ada215b965192ab9a16":[1,0,3,2], "classunittest_1_1_reporter.html":[1,0,1], "classunittest_1_1_reporter.html#a4039551f95da98ea7c91f58829c239da":[1,0,1,1], "classunittest_1_1_reporter.html#a522fc4efffe98b73421bb913808f7560":[1,0,1,4], "classunittest_1_1_reporter.html#a5490ab9d47edf604fd110c5361af4758":[1,0,1,0], "classunittest_1_1_reporter.html#a5b8c277947b333413ad4d2db31e571dc":[1,0,1,2], "classunittest_1_1_reporter.html#ae99ec1f3ee5c6e71ea642183e1559af3":[1,0,1,3], "classunittest_1_1_test_suite.html":[1,0,2], "classunittest_1_1_test_suite.html#a382e081623cd0bd4e3ff6a4550cd90c9":[1,0,2,2], "classunittest_1_1_test_suite.html#a4662054009837ddf000e32b70d0c5b0f":[1,0,2,1], "classunittest_1_1_test_suite.html#abd0868ba66cea5fb21905436909ceb00":[1,0,2,0], "classxpcc_1_1_a_d840x.html":[1,5,8,6], "classxpcc_1_1_abstract_component.html":[1,2,4,0], "classxpcc_1_1_abstract_component.html#a09a497c6a4e124d1c32b144197e3f603":[1,2,4,0,3], "classxpcc_1_1_abstract_component.html#a0fcc436e2539763a0f0e400a7f90ea47":[1,2,4,0,10], "classxpcc_1_1_abstract_component.html#a11ee9013bc3f9c4fc47a8945bf25300c":[1,2,4,0,0], "classxpcc_1_1_abstract_component.html#a21d3925a34e3238ea49269bba5da30b0":[1,2,4,0,4], "classxpcc_1_1_abstract_component.html#a2b60d7705fb3cf7938071a6641396866":[1,2,4,0,8], "classxpcc_1_1_abstract_component.html#a6363980d50fb5391b8beef5ac0fb36ff":[1,2,4,0,1], "classxpcc_1_1_abstract_component.html#a6a4612874847d8ac11d81ce0fc1ef185":[1,2,4,0,2], "classxpcc_1_1_abstract_component.html#aa3e4281cd915ca20470e5ec87b47dede":[1,2,4,0,12], "classxpcc_1_1_abstract_component.html#aba064776b749079b1f0c1e0edd8f9d6d":[1,2,4,0,9], "classxpcc_1_1_abstract_component.html#abeab3a15e23337d9e5287b58a09e4aba":[1,2,4,0,11], "classxpcc_1_1_abstract_component.html#ae7aa1f7238f9fa1635d82d60a76162ac":[1,2,4,0,5], "classxpcc_1_1_abstract_component.html#af447b8a4f597009c9f558b43cbe64436":[1,2,4,0,6], "classxpcc_1_1_abstract_component.html#afe089710068346a116d04982fa04b5a6":[1,2,4,0,7], "classxpcc_1_1_abstract_menu.html":[1,10,8,0], "classxpcc_1_1_abstract_menu.html#a48918191696dfa6e3c6a9bb41ba43895":[1,10,8,0,0], "classxpcc_1_1_abstract_menu.html#a50460345d9d3d6fc731f4fa0868e3b0a":[1,10,8,0,1], "classxpcc_1_1_abstract_view.html":[1,10,8,1], "classxpcc_1_1_abstract_view.html#a09abded7166e1d2efbef19c374f52349":[1,10,8,1,7], "classxpcc_1_1_abstract_view.html#a0cbcf339a93d03c9734da316c2061fdd":[1,10,8,1,6], "classxpcc_1_1_abstract_view.html#a0f9980986c50e15a9dcd9325345dde95":[1,10,8,1,1], "classxpcc_1_1_abstract_view.html#a26fd3e9d545bc88f3825ae3b1054263b":[1,10,8,1,10], "classxpcc_1_1_abstract_view.html#a4416378a0f604018eea966d1e4901656":[1,10,8,1,9], "classxpcc_1_1_abstract_view.html#a5af10ab104234515698722bbda5b5642":[1,10,8,1,11], "classxpcc_1_1_abstract_view.html#a62be69db682328212bb107993a1dc68f":[1,10,8,1,14], "classxpcc_1_1_abstract_view.html#a99357fa5ed844c39beb12e0ae8f76df4":[1,10,8,1,0], "classxpcc_1_1_abstract_view.html#a99b048e66790d3bbbc8c586d9b2082df":[1,10,8,1,8], "classxpcc_1_1_abstract_view.html#aa88d8a4ad62fadc9542f1cb765907fd3":[1,10,8,1,5], "classxpcc_1_1_abstract_view.html#aac1ece11dad3d983a08559617dd835f5":[1,10,8,1,3], "classxpcc_1_1_abstract_view.html#ab1b547848ee5b48ec6212730c0692dce":[1,10,8,1,12], "classxpcc_1_1_abstract_view.html#abcc3376d3d938ca9f66923b025d9b205":[1,10,8,1,4], "classxpcc_1_1_abstract_view.html#ac7e1e9691c503b0cde8ef7c92c8624cd":[1,10,8,1,2], "classxpcc_1_1_abstract_view.html#adfdcad9b56306a5d77c85034d055b4c7":[1,10,8,1,13], "classxpcc_1_1_action_result.html":[1,2,4,7], "classxpcc_1_1_action_result.html#a472aff79dc71015a7bcdc4882aaad5e2":[1,2,4,7,4], "classxpcc_1_1_action_result.html#a7b5f9b2c5f484e389ba832ea90da2c56":[1,2,4,7,0], "classxpcc_1_1_action_result.html#a95070ca4af742fadd926d66bbfb7f2b8":[1,2,4,7,1], "classxpcc_1_1_action_result.html#ad4634dffdf2b00b951907e6b3ad42a81":[1,2,4,7,3], "classxpcc_1_1_action_result.html#afa84e5418f79d3abcf7b7a926e7e0bcd":[1,2,4,7,2], "classxpcc_1_1_action_result_3_01void_01_4.html":[2,0,3,36], "classxpcc_1_1_action_result_3_01void_01_4.html#a1b08d3ccb841323091db18c957a4f78a":[2,0,3,36,2], "classxpcc_1_1_action_result_3_01void_01_4.html#a32b9b8937e492ed7035fc217804dcf72":[2,0,3,36,0], "classxpcc_1_1_action_result_3_01void_01_4.html#a8a7f7ac3631f0895f84ac5c845020ee3":[2,0,3,36,1], "classxpcc_1_1_ad7280a.html":[1,5,1,0], "classxpcc_1_1_ad7280a.html#affc1d452737be22efb8c02a599e64dfc":[1,5,1,0,0], "classxpcc_1_1_adc.html":[1,1,4,0,0], "classxpcc_1_1_adc.html#ab4ad09b0e8dbf2d2f4ede2c985140798":[1,1,4,0,0,0], "classxpcc_1_1_adc_interrupt.html":[1,1,4,0,1], "classxpcc_1_1_adc_interrupt.html#a97b3cc8ecd95b32dc68d0cc4a9b01378":[1,1,4,0,1,0], "classxpcc_1_1_adc_sampler.html":[1,5,1,1], "classxpcc_1_1_adc_sampler.html#a3b112b9d2c5b48d9ff603d9e0e2c5569":[1,5,1,1,0], "classxpcc_1_1_adns9800.html":[2,0,3,43], "classxpcc_1_1_ads7843.html":[1,5,9,0], "classxpcc_1_1_adxl345.html":[1,5,5,0], "classxpcc_1_1_adxl345.html#a135fce9c967168e401b550d654c818dd":[1,5,5,0,4], "classxpcc_1_1_adxl345.html#a3661252d964c000f925e5ff820e34dd7":[1,5,5,0,0], "classxpcc_1_1_adxl345.html#a4f2ed37696869a1ccf94652aa210f7a6":[1,5,5,0,6], "classxpcc_1_1_adxl345.html#a621fb7cdf6c28e7d951637c9985986da":[1,5,5,0,1], "classxpcc_1_1_adxl345.html#aaeaab187049cee13aaca42a8466d6e78":[1,5,5,0,5], "classxpcc_1_1_adxl345.html#acad903ecf4d2f46e8ead962ca65a4d9d":[1,5,5,0,2], "classxpcc_1_1_adxl345.html#acb4130aa8d240bea1a499060d992c54f":[1,5,5,0,3], "classxpcc_1_1_angle.html":[1,8,3,0], "classxpcc_1_1_angle.html#adfdd030c52e037e1e807e239827476d3":[1,8,3,0,0], "classxpcc_1_1_at45db0x1d.html":[1,5,6,0], "classxpcc_1_1_at45db0x1d.html#a09f3e9af74076729a14d9769d1b62e4f":[1,5,6,0,1], "classxpcc_1_1_at45db0x1d.html#a09f3e9af74076729a14d9769d1b62e4fa0b205ef742b0fb5357cf999850322989":[1,5,6,0,1,3], "classxpcc_1_1_at45db0x1d.html#a09f3e9af74076729a14d9769d1b62e4fa5621e1cdc530fe14b4221b7e0e1f1db4":[1,5,6,0,1,2], "classxpcc_1_1_at45db0x1d.html#a09f3e9af74076729a14d9769d1b62e4fa8e2e9758ec5b94f80de1e17c37d57dfe":[1,5,6,0,1,1], "classxpcc_1_1_at45db0x1d.html#a09f3e9af74076729a14d9769d1b62e4fade47601ac9d324f95b4b8236c8367cf2":[1,5,6,0,1,0], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3":[1,5,6,0,0], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a08cbeb0fff198469992dc9b19ffb8fa6":[1,5,6,0,0,21], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a14c74b6805f486c07e6cd4e009964aaf":[1,5,6,0,0,11], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a2bf434242419c6d1b6164c7ad6ea57de":[1,5,6,0,0,9], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a2f9ecffd4d55199c935fbfd6ad985b78":[1,5,6,0,0,24], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a3570cdc9458c8ef9a12ce7c09e141005":[1,5,6,0,0,1], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a39a4a6586e4d2dfac0bbaf737877a5da":[1,5,6,0,0,22], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a445be39cb529fb07d00b534e5b8ccc94":[1,5,6,0,0,15], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a577135bcf7a07a939ab1fdfc06edfeec":[1,5,6,0,0,8], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a636312753cd6163c6d7705cc3b48be12":[1,5,6,0,0,14], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a68a42fcb6bdaf38c0a15cd89c2354961":[1,5,6,0,0,6], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a6b17f336512f2f82bcccdceb8a42248d":[1,5,6,0,0,3], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a76458da63f362503516f982516166bb5":[1,5,6,0,0,2], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a7bd0890af9b6b70cc5f870c141bfaf51":[1,5,6,0,0,20], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a7f5600b81e366cb984cc31e79cff87e9":[1,5,6,0,0,13], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a81131d2f3394e2d9e9cf7ac6e014ba64":[1,5,6,0,0,5], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a8996b86a94e3723c3b3a854973446c6c":[1,5,6,0,0,16], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3a8eca70668fac3a5c941fa3d53384cf07":[1,5,6,0,0,0], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3aae20869990688e0b47c3ee0384b9a593":[1,5,6,0,0,10], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3ab10bd60d5a81ef64b8e96de9dd94974e":[1,5,6,0,0,4], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3ab265ca7589d2852d8f642a665627d0db":[1,5,6,0,0,17], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3ab6ef070833bdcc220ad28d33831928f0":[1,5,6,0,0,23], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3abb9319247c0b276b65182d5a518c36df":[1,5,6,0,0,18], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3ad8e6aaf78b59ee6779e692db3d3e30bc":[1,5,6,0,0,19], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3aeeff8750de7f78b4c5e2928c9d748457":[1,5,6,0,0,12], "classxpcc_1_1_at45db0x1d.html#a86b0a35c694e9b591a9a27b9c052ced3afc0a49eeb4bed5da4f02714c88b3617c":[1,5,6,0,0,7], "classxpcc_1_1_backend_interface.html":[1,2,4,1], "classxpcc_1_1_backend_interface.html#a4aa4ac4bb8ae65545e33e87f02a19244":[1,2,4,1,6], "classxpcc_1_1_backend_interface.html#a53efb10c7751f0233f25ae44784f43d7":[1,2,4,1,4], "classxpcc_1_1_backend_interface.html#a7c3854da5ae8e5051cd7ff2d74b22fc9":[1,2,4,1,1], "classxpcc_1_1_backend_interface.html#a7c9de149048bd3b5ccf408a4525fda75":[1,2,4,1,3], "classxpcc_1_1_backend_interface.html#ab9491aa21eb406a8216251179b88fdbe":[1,2,4,1,0], "classxpcc_1_1_backend_interface.html#abae8c33fbd5ca5ff7edb5fc8af4216b0":[1,2,4,1,5], "classxpcc_1_1_backend_interface.html#ae0b877793ee63af70efd7ef7dfb138de":[1,2,4,1,2], "classxpcc_1_1_bitbang_memory_interface.html":[1,5,7,0], "classxpcc_1_1_block_allocator.html":[2,0,3,62], "classxpcc_1_1_block_allocator.html#a92f348611e265e5272b7d0b39782be94":[2,0,3,62,1], "classxpcc_1_1_block_allocator.html#a9b2f9ed33b54a45b8e64f1ec483038e9":[2,0,3,62,3], "classxpcc_1_1_block_allocator.html#ac6fd58f9a7d817b121aed7be84e16abb":[2,0,3,62,2], "classxpcc_1_1_block_allocator.html#ad36ee3b1b0d755c0cc3407ff397b2c48":[2,0,3,62,0], "classxpcc_1_1_bma180.html":[1,5,5,1], "classxpcc_1_1_bma180.html#a1351d98faca2c640d59b70d5996c0ece":[1,5,5,1,1], "classxpcc_1_1_bma180.html#a5211e9d37024ea30a66d364487119973":[1,5,5,1,5], "classxpcc_1_1_bma180.html#a532340a2dd35297f8667fab270475c99":[1,5,5,1,7], "classxpcc_1_1_bma180.html#a59d59c6b8498626a800d5ccb6b851533":[1,5,5,1,0], "classxpcc_1_1_bma180.html#a67e9c63a9b936dc0ed7cfc637dd3d8e9":[1,5,5,1,3], "classxpcc_1_1_bma180.html#a68f6803fd4bf91f49e4343af028a3aee":[1,5,5,1,2], "classxpcc_1_1_bma180.html#acb1821b99699eccee6489c0adb64f6ab":[1,5,5,1,4], "classxpcc_1_1_bma180.html#ad92a1345bf3603bd0f11ae50a07bd604":[1,5,5,1,6], "classxpcc_1_1_bme280.html":[1,5,12,0], "classxpcc_1_1_bme280.html#a3d3acd4713304376bfca6990822592b3":[1,5,12,0,1], "classxpcc_1_1_bme280.html#a64c038a7449c33ad0913c7070184b66f":[1,5,12,0,0], "classxpcc_1_1_bme280.html#ab30ae8de7e007cebec7f9437345bbc53":[1,5,12,0,2], "classxpcc_1_1_bme280.html#ad1ffa1e1c323efac48fd8fb4768d4783":[1,5,12,0,3], "classxpcc_1_1_bmp085.html":[1,5,12,1], "classxpcc_1_1_bmp085.html#a6a1a2f3be0f78121e562d7373ad11bc9":[1,5,12,1,1], "classxpcc_1_1_bmp085.html#a6f9dc81bfe2987b9aa41e0f4406c2a21":[1,5,12,1,4], "classxpcc_1_1_bmp085.html#a789dbde1e51f975e29138a4ef034b81d":[1,5,12,1,0], "classxpcc_1_1_bmp085.html#aedb8d4f899aa9c80d9c1fa34f7f5540a":[1,5,12,1,3], "classxpcc_1_1_bmp085.html#af28691459bf02cd00eb6f8e06fff9059":[1,5,12,1,2], "classxpcc_1_1_bounded_deque.html":[1,3,0], "classxpcc_1_1_bounded_deque.html#a16c39ee16b4bc1a8f27689818b3d8487":[1,3,0,8], "classxpcc_1_1_bounded_deque.html#a391333d995d96f0d7ec8ea9e90d6e49e":[1,3,0,13], "classxpcc_1_1_bounded_deque.html#a3e969ebeea58a20418145f6515c6eebc":[1,3,0,1], "classxpcc_1_1_bounded_deque.html#a46af3ea80511e3a027cd934f34907ed7":[1,3,0,26], "classxpcc_1_1_bounded_deque.html#a4cdeee12310fd76e45a03d107be2a2df":[1,3,0,23], "classxpcc_1_1_bounded_deque.html#a4e3f619cc20de62b076eed645faab79c":[1,3,0,19], "classxpcc_1_1_bounded_deque.html#a50b453454ee6c4b2c9780b20baa7c3fd":[1,3,0,17], "classxpcc_1_1_bounded_deque.html#a6b15bed4c9d6e3122e42cf45dd739ad6":[1,3,0,15], "classxpcc_1_1_bounded_deque.html#a719854cad321913eb3d3bdb9c3c2f4b3":[1,3,0,7], "classxpcc_1_1_bounded_deque.html#a778b79fd9989de92c4e800b721ef2463":[1,3,0,12], "classxpcc_1_1_bounded_deque.html#a8aaa6c7ffc24ac16ef870dd348ad7120":[1,3,0,16], "classxpcc_1_1_bounded_deque.html#a9f7fc97e0ef4e095ab99d4e92f40c611":[1,3,0,5], "classxpcc_1_1_bounded_deque.html#aa6d63eacd20be99f69b11daf4d4f5603":[1,3,0,25], "classxpcc_1_1_bounded_deque.html#aab18cf0f608383b1a719849b77afb5f2":[1,3,0,11], "classxpcc_1_1_bounded_deque.html#aac6c7cd0de763b1b720fe7c03eb795b1":[1,3,0,14], "classxpcc_1_1_bounded_deque.html#aaf31a5b67ebc144acbbab00b33656d28":[1,3,0,21], "classxpcc_1_1_bounded_deque.html#abbcc154c06e00991bf14c97bd5cb8017":[1,3,0,3], "classxpcc_1_1_bounded_deque.html#abcca58042c73c9a31a758e9e948dafc4":[1,3,0,18], "classxpcc_1_1_bounded_deque.html#abd924a92b459c268385eab4c1658de7b":[1,3,0,2], "classxpcc_1_1_bounded_deque.html#ac220ce1c155db1ac44146c12d178056f":[1,3,0,29], "classxpcc_1_1_bounded_deque.html#ac803e02511ed26bec9d801981b8d6888":[1,3,0,4], "classxpcc_1_1_bounded_deque.html#acec35598f10e247b96012986ac4b23d9":[1,3,0,22], "classxpcc_1_1_bounded_deque.html#ad07c56d2f75de6535ffe97e3da7a1623":[1,3,0,9], "classxpcc_1_1_bounded_deque.html#ad53bf4356666807136a2b2fb2e39c9f2":[1,3,0,24], "classxpcc_1_1_bounded_deque.html#ae39ecedebe39c6c3c829caf556a4f569":[1,3,0,20], "classxpcc_1_1_bounded_deque.html#aecea72517c30291afee40ee27635b6f4":[1,3,0,6], "classxpcc_1_1_bounded_deque.html#aed2bbd1199bf45676b69bed08fa3edf2":[1,3,0,28], "classxpcc_1_1_bounded_deque.html#aedf6a1f292824200916b2689f9e063e5":[1,3,0,27], "classxpcc_1_1_bounded_deque.html#afa56fa09f5ab18a6c2eeda8e67173158":[1,3,0,10], "classxpcc_1_1_bounded_deque_1_1const__iterator.html":[1,3,0,0], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a0963c95bc99b14c0d114006148771887":[1,3,0,0,9], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a0daaf97e83ab9e7b26ecc665dab4fd12":[1,3,0,0,4], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a26e02a746c495e628ce2b2d89dc44a72":[1,3,0,0,7], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a33ff5d79ce5b9bdadd7dd389ecad19bf":[1,3,0,0,0], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a3982764aeec831b525ef6ec78041f1a3":[1,3,0,0,5], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a429def27e9ff2876321b91904bd00e58":[1,3,0,0,1], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a4659da9815f787e7a5213e7e3f244487":[1,3,0,0,6], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a8018b6f2de59de31c4937ce0f678d55d":[1,3,0,0,2], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#aa6edd253d63db0d3b3485ac9f87768a4":[1,3,0,0,8], "classxpcc_1_1_bounded_deque_1_1const__iterator.html#aeccf95307404d9abbc3f7e0326d9fbce":[1,3,0,0,3], "classxpcc_1_1_bounded_queue.html":[1,3,6], "classxpcc_1_1_bounded_stack.html":[1,3,9], "classxpcc_1_1_buffered_graphic_display.html":[1,10,5,0], "classxpcc_1_1_buffered_graphic_display.html#a2396ef36141759b2579558b20f6d17ab":[1,10,5,0,4], "classxpcc_1_1_buffered_graphic_display.html#a353598d6769984a4e4fb2fe57e46d458":[1,10,5,0,7], "classxpcc_1_1_buffered_graphic_display.html#a3d140f5ed168e0f71c7fdaa07080dc26":[1,10,5,0,1], "classxpcc_1_1_buffered_graphic_display.html#a471c0ebc52c59887c46477098522f3c8":[1,10,5,0,0], "classxpcc_1_1_buffered_graphic_display.html#a4d1934411448299a6d37e3e230aa7215":[1,10,5,0,8], "classxpcc_1_1_buffered_graphic_display.html#a55729a9b5cd313886ca42ad29498c36c":[1,10,5,0,3], "classxpcc_1_1_buffered_graphic_display.html#a6e27b4cce968e65f0a8973d0eb1e28d7":[1,10,5,0,2], "classxpcc_1_1_buffered_graphic_display.html#abda3c8c8c264d01b494b65f93754dc4b":[1,10,5,0,6], "classxpcc_1_1_buffered_graphic_display.html#abe2e54d8570e0b52d9782794408bb5a0":[1,10,5,0,9], "classxpcc_1_1_buffered_graphic_display.html#ae525b78a671d9bc318f605fa77ec7d58":[1,10,5,0,5], "classxpcc_1_1_button.html":[1,10,0], "classxpcc_1_1_button_group.html":[1,10,1], "classxpcc_1_1_button_group.html#a26e6f526b30888d92e8c0584916bae18":[1,10,1,16], "classxpcc_1_1_button_group.html#a43f5b54a271461e2329755a8d2b9aeeb":[1,10,1,5], "classxpcc_1_1_button_group.html#a47643a4d831e193be47b4bd52280a72e":[1,10,1,6], "classxpcc_1_1_button_group.html#a4df673cfc086c4d149ab57f867e8b52d":[1,10,1,12] }; <file_sep>/docs/api/structxpcc_1_1_zero_m_q_reader_1_1_packet.js var structxpcc_1_1_zero_m_q_reader_1_1_packet = [ [ "Packet", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html#a2a30a26df9906e6f22f1772790f3976b", null ], [ "header", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html#ad5d7b693f84c7b5f052e73221ba0048c", null ], [ "payload", "structxpcc_1_1_zero_m_q_reader_1_1_packet.html#a3cb2f0cff68d27709b93a40c52ba27e6", null ] ];<file_sep>/docs/api/classxpcc_1_1atomic_1_1_queue.js var classxpcc_1_1atomic_1_1_queue = [ [ "Index", "classxpcc_1_1atomic_1_1_queue.html#a39b184917cdbe5eb5d07a11f7b903668", null ], [ "Size", "classxpcc_1_1atomic_1_1_queue.html#a330cf801491d3a6675041e2987145d53", null ], [ "Queue", "classxpcc_1_1atomic_1_1_queue.html#a9fa2bc4ecf3c021b80e387fc2a9bb6d7", null ], [ "isFull", "classxpcc_1_1atomic_1_1_queue.html#a03e60ddbc6a7120732b113e4be83d338", null ], [ "isNotFull", "classxpcc_1_1atomic_1_1_queue.html#a40f5e3589e1cbe5c67fece75199ee296", null ], [ "isNearlyFull", "classxpcc_1_1atomic_1_1_queue.html#a1386b2287f8e4547e216ee8f86609cdb", null ], [ "isEmpty", "classxpcc_1_1atomic_1_1_queue.html#ae7e8c9f1742c9113e5d53a13eb6340b7", null ], [ "isNearlyEmpty", "classxpcc_1_1atomic_1_1_queue.html#a94e6807aa598bff9cd39f97167bba185", null ], [ "getMaxSize", "classxpcc_1_1atomic_1_1_queue.html#aea55414369c43a4c2c501592c6e9bb9e", null ], [ "get", "classxpcc_1_1atomic_1_1_queue.html#a12f6356350ecf0eac4d43c0b4fb72c0a", null ], [ "push", "classxpcc_1_1atomic_1_1_queue.html#a2e3ae55c3528d48ee8c48b3a971b3ec9", null ], [ "pop", "classxpcc_1_1atomic_1_1_queue.html#ad393604167ad689e417e257794483fb2", null ] ];<file_sep>/docs/api/search/groups_3.js var searchData= [ ['controller_20area_20network_20_28can_29',['Controller Area Network (CAN)',['../group__can.html',1,'']]], ['communication',['Communication',['../group__communication.html',1,'']]], ['containers',['Containers',['../group__container.html',1,'']]], ['can_20drivers',['CAN drivers',['../group__driver__can.html',1,'']]], ['can',['CAN',['../group__stm32f407vg__can.html',1,'']]], ['cross_20platform_20component_20communication_20_28xpcc_29',['Cross Platform Component Communication (XPCC)',['../group__xpcc__comm.html',1,'']]] ]; <file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01signed_01char_01_4.js var structxpcc_1_1_arithmetic_traits_3_01signed_01char_01_4 = [ [ "WideType", "group__arithmetic__trais.html#gadb6af3da941e3af987b11b0d87b01a47", null ], [ "SignedType", "group__arithmetic__trais.html#gacfe7609ce3f42e29f9df3df52cd44b67", null ], [ "UnsignedType", "group__arithmetic__trais.html#ga0c5f7a2224f59881ff4c032d77e8e914", null ] ];<file_sep>/docs/api/classxpcc_1_1_siemens_s65_common.js var classxpcc_1_1_siemens_s65_common = [ [ "writeCmd", "classxpcc_1_1_siemens_s65_common.html#a305c8c62ed479ddb99c21de80a7e5a64", null ], [ "writeReg", "classxpcc_1_1_siemens_s65_common.html#a0424bf7a8fa18196cfc532bf80bebc44", null ], [ "writeData", "classxpcc_1_1_siemens_s65_common.html#a90926890000bc399f7bc3b2287e3775c", null ], [ "lcdCls", "classxpcc_1_1_siemens_s65_common.html#a866f89c713897a8ced62abf56b02e96b", null ], [ "lcdSettings", "classxpcc_1_1_siemens_s65_common.html#ac188813dca9f27da5583339582bb3488", null ] ];<file_sep>/docs/api/search/groups_e.js var searchData= [ ['storage',['Storage',['../group__driver__storage.html',1,'']]], ['supported_20platforms',['Supported Platforms',['../group__platform.html',1,'']]], ['sensor_20actuator_20bus_20_28sab_29',['Sensor Actuator Bus (SAB)',['../group__sab.html',1,'']]], ['sensor_20actuator_20bus_20v2_20_28sab2_29',['Sensor Actuator Bus v2 (SAB2)',['../group__sab2.html',1,'']]], ['software_20timers',['Software Timers',['../group__software__timer.html',1,'']]], ['serial_20peripheral_20interface_20_28spi_29',['Serial Peripheral Interface (SPI)',['../group__spi.html',1,'']]], ['stm32f407vg',['Stm32f407vg',['../group__stm32f407vg.html',1,'']]], ['system_20clock',['System Clock',['../group__stm32f407vg__clock.html',1,'']]], ['spi',['SPI',['../group__stm32f407vg__spi.html',1,'']]] ]; <file_sep>/docs/reference/build-system/index.html <!DOCTYPE html> <!--[if lt IE 7 ]> <html class="no-js ie6"> <![endif]--> <!--[if IE 7 ]> <html class="no-js ie7"> <![endif]--> <!--[if IE 8 ]> <html class="no-js ie8"> <![endif]--> <!--[if IE 9 ]> <html class="no-js ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1"> <title>Build system - xpcc microcontroller framework</title> <link rel="canonical" href="http://docs.xpcc.io/reference/build-system/"> <meta name="author" content="Robot<NAME> e.V."> <meta property="og:url" content="http://docs.xpcc.io/reference/build-system/"> <meta property="og:title" content="xpcc microcontroller framework"> <meta property="og:image" content="http://docs.xpcc.io/reference/build-system//../../images/logo.svg"> <meta name="apple-mobile-web-app-title" content="xpcc microcontroller framework"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <link rel="apple-touch-icon" href="../../images/logo.svg"> <link rel="shortcut icon" type="image/x-icon" href="../../None"> <link rel="icon" type="image/x-icon" href="../../None"> <style> @font-face { font-family: 'Icon'; src: url('../../assets/fonts/icon.eot?52m981'); src: url('../../assets/fonts/icon.eot?#iefix52m981') format('embedded-opentype'), url('../../assets/fonts/icon.woff?52m981') format('woff'), url('../../assets/fonts/icon.ttf?52m981') format('truetype'), url('../../assets/fonts/icon.svg?52m981#icon') format('svg'); font-weight: normal; font-style: normal; } </style> <link rel="stylesheet" href="../../assets/stylesheets/application-997e458b3e.css"> <link rel="stylesheet" href="../../assets/stylesheets/palettes-2d6c5d2926.css"> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono"> <style> body, input { font-family: 'Ubuntu', Helvetica, Arial, sans-serif; } pre, code { font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace; } </style> <link rel="stylesheet" href="../../extra.css"> <script src="../../assets/javascripts/modernizr-4a5cc7e01e.js"></script> </head> <body class="palette-primary-indigo palette-accent-cyan"> <div class="backdrop"> <div class="backdrop-paper"></div> </div> <input class="toggle" type="checkbox" id="toggle-drawer"> <input class="toggle" type="checkbox" id="toggle-search"> <label class="toggle-button overlay" for="toggle-drawer"></label> <header class="header"> <nav aria-label="Header"> <div class="bar default"> <div class="button button-menu" role="button" aria-label="Menu"> <label class="toggle-button icon icon-menu" for="toggle-drawer"> <span></span> </label> </div> <div class="stretch"> <div class="title"> <span class="path"> Reference <i class="icon icon-link"></i> </span> Build system </div> </div> <div class="button button-twitter" role="button" aria-label="Twitter"> <a href="https://twitter.com/RCA_eV" title="@RCA_eV on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a> </div> <div class="button button-github" role="button" aria-label="GitHub"> <a href="https://github.com/RoboterclubAachen" title="@RoboterclubAachen on GitHub" target="_blank" class="toggle-button icon icon-github"></a> </div> <div class="button button-search" role="button" aria-label="Search"> <label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label> </div> </div> <div class="bar search"> <div class="button button-close" role="button" aria-label="Close"> <label class="toggle-button icon icon-back" for="toggle-search"></label> </div> <div class="stretch"> <div class="field"> <input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false"> </div> </div> <div class="button button-reset" role="button" aria-label="Search"> <button class="toggle-button icon icon-close" id="reset-search"></button> </div> </div> </nav> </header> <main class="main"> <div class="drawer"> <nav aria-label="Navigation"> <a href="https://github.com/RoboterclubAachen/xpcc" class="project"> <div class="banner"> <div class="logo"> <img src="../../images/logo.svg"> </div> <div class="name"> <strong> xpcc microcontroller framework <span class="version"> </span> </strong> <br> RoboterclubAachen/xpcc </div> </div> </a> <div class="scrollable"> <div class="wrapper"> <ul class="repo"> <li class="repo-network"> <a href="https://github.com/RoboterclubAachen/xpcc/network" target="_blank" title="Forks" data-action="forks"> <i class="icon icon-fork"></i> Forks <span class="count">&ndash;</span> </a> </li> <li class="repo-stars"> <a href="https://github.com/RoboterclubAachen/xpcc/stargazers" target="_blank" title="Stargazers" data-action="star"> <i class="icon icon-star"></i> Stars <span class="count">&ndash;</span> </a> </li> </ul> <hr> <div class="toc"> <ul> <li> <a class="" title="Home" href="../.."> Home </a> </li> <li> <a class="" title="Why use xpcc?" href="../../why-use-xpcc/"> Why use xpcc? </a> </li> <li> <a class="" title="Installation" href="../../installation/"> Installation </a> </li> <li> <span class="section">Guide</span> <ul> <li> <a class="" title="Getting started" href="../../guide/getting-started/"> Getting started </a> </li> <li> <a class="" title="Qt Creator" href="../../guide/qtcreator/"> Qt Creator </a> </li> <li> <a class="" title="Testing" href="../../guide/testing/"> Testing </a> </li> </ul> </li> <li> <span class="section">Reference</span> <ul> <li> <a class="" title="API reference" href="../api/"> API reference </a> </li> <li> <a class="current" title="Build system" href="./"> Build system </a> <ul> <li class="anchor"> <a title="Build commands" href="#build-commands"> Build commands </a> </li> <li class="anchor"> <a title="Project configuration" href="#project-configuration"> Project configuration </a> </li> </ul> </li> <li> <a class="" title="Device files" href="../device-files/"> Device files </a> </li> </ul> </li> </ul> <hr> <span class="section">The author</span> <ul> <li> <a href="https://twitter.com/RCA_eV" target="_blank" title="@RCA_eV on Twitter"> @RCA_eV on Twitter </a> </li> <li> <a href="https://github.com/RoboterclubAachen" target="_blank" title="@RoboterclubAachen on GitHub"> @RoboterclubAachen on GitHub </a> </li> </ul> </div> </div> </div> </nav> </div> <article class="article"> <div class="wrapper"> <style scoped>img.latex-inline { vertical-align: middle; }</style> <style scoped> svg.diagram{display:block;font-family:'Ubuntu Mono';font-size:14px;text-align:center;stroke-linecap:round;stroke-width:1.5px;stroke:#000;fill:#000}.md svg.diagram .opendot{fill:#FFF}.md svg.diagram text{stroke:none}.md </style> <h1 id="build-system">Build system<a class="headerlink" href="#build-system" title="Permanent link">#</a></h1> <p>xpcc uses the <a href="http://www.scons.org/">SCons build system</a> to generate, build and program your application. We've extended it with many utilities to allow a smooth integration of embedded tools.</p> <h2 id="build-commands">Build commands<a class="headerlink" href="#build-commands" title="Permanent link">#</a></h2> <p>You can use these command in all our examples to get a feel of how it works.</p> <h3 id="common">Common<a class="headerlink" href="#common" title="Permanent link">#</a></h3> <ul> <li><code>build</code>: Generates the HAL and compiles your program into an executable.</li> <li><code>size</code>: Displays the static Flash and RAM consumption.</li> <li><code>program</code>: Writes the executable onto your target. <!-- - <code>doc</code>: Generates the doxygen documentation for xpcc with your configuration. --></li> </ul> <p>By default <code>scons</code> executes <code>scons build size</code>.</p> <ul> <li><code>listing</code>: Decompiles your executable into an annotated assembly listing.</li> <li><code>symbols</code>: Displays the symbol table for your executable.</li> <li><code>-c</code>: Cleans the project's build files.</li> <li><code>verbose=1</code>: Makes the printout more verbose.</li> <li><code>optimization=[0,1,2,3,s]</code>: Forces compilation with specified optimization level. Can be used for debug builds.</li> </ul> <h3 id="avr-only">AVR only:<a class="headerlink" href="#avr-only" title="Permanent link">#</a></h3> <ul> <li><code>fuse</code>: Writes the fuse bits onto your target.</li> <li><code>eeprom</code>: Writes the EEPROM memory onto your target.</li> </ul> <h3 id="arm-cortex-m-only">ARM Cortex-M only:<a class="headerlink" href="#arm-cortex-m-only" title="Permanent link">#</a></h3> <ul> <li><code>debug</code>: Starts the GDB debug session of your current application in text UI mode.<br /> You must execute <code>openocd-debug</code> or <code>lpclink-debug</code> before running this command!</li> <li><code>openocd-debug</code>: Starts the OpenOCD debug server for your target.</li> <li><code>lpclink-debug</code>: Starts the LPC-Link debug server for your target.</li> <li><code>lpclink-init</code>: Initialize the LPC-Link with its proprietary firmware.</li> </ul> <h2 id="project-configuration">Project configuration<a class="headerlink" href="#project-configuration" title="Permanent link">#</a></h2> <p>Your <code>project.cfg</code> file contains configuration information for your target. For the device identify naming scheme, see the <a href="../../reference/device-files/#device-identifier">Device File reference</a>.</p> <div class="code"><pre><span></span><span class="k">[build]</span> <span class="c1"># use a predefined board config file from xpcc/architecture/platform/board/</span> <span class="c1"># it defines the configuration for a board, which you can overwrite here.</span> <span class="na">board</span> <span class="o">=</span> <span class="s">stm32f4_discovery</span> <span class="c1"># declare the name of your project. Default is enclosing folder name.</span> <span class="na">name</span> <span class="o">=</span> <span class="s">blinky</span> <span class="c1"># the target of your project, use the full name of the device here</span> <span class="na">device</span> <span class="o">=</span> <span class="s">stm32f407vg</span> <span class="c1"># AVR only: declare the clock frequency in Hz</span> <span class="na">clock</span> <span class="o">=</span> <span class="s">16000000</span> <span class="c1"># overwrite the default `./build/` folder path</span> <span class="na">buildpath</span> <span class="o">=</span> <span class="s">../../build/${name}</span> <span class="c1"># optimization level for compilation [0,1,2,3,s]</span> <span class="na">optimization</span> <span class="o">=</span> <span class="s">0</span> <span class="c1"># declare additional compilation flags for your project</span> <span class="na">ccflags</span> <span class="o">=</span> <span class="s">-Werror -Wall -Wextra</span> <span class="c1"># parametrize HAL drivers here, see section on Parameters</span> <span class="k">[parameters]</span> <span class="na">uart.stm32.3.tx_buffer</span> <span class="o">=</span> <span class="s">2048</span> <span class="na">uart.stm32.3.rx_buffer</span> <span class="o">=</span> <span class="s">256</span> <span class="c1"># AVR only: declare fuse bits for use with $ scons fuse</span> <span class="k">[fusebits]</span> <span class="c1"># only the fuses declared here are written</span> <span class="na">efuse</span> <span class="o">=</span> <span class="s">0x41</span> <span class="na">hfuse</span> <span class="o">=</span> <span class="s">0x42</span> <span class="na">lfuse</span> <span class="o">=</span> <span class="s">0x43</span> <span class="c1"># AVR only: configure avrdude for $ scons program</span> <span class="c1"># Consult the avrdude documentation for options.</span> <span class="k">[avrdude]</span> <span class="c1"># using the AVR ISP mk2 programmer</span> <span class="na">port</span> <span class="o">=</span> <span class="s">usb</span> <span class="na">programmer</span> <span class="o">=</span> <span class="s">avrispmkII</span> <span class="c1"># or using a serial bootloader</span> <span class="na">port</span> <span class="o">=</span> <span class="s">/dev/ttyUSB0</span> <span class="na">programmer</span> <span class="o">=</span> <span class="s">arduino</span> <span class="c1"># baudrate only required for serial bootloaders</span> <span class="na">baudrate</span> <span class="o">=</span> <span class="s">115200</span> <span class="c1"># ARM only: configure OpenOCD for $ scons program</span> <span class="k">[openocd]</span> <span class="c1"># OpenOCD has predefined configs in its searchpaths</span> <span class="na">configfile</span> <span class="o">=</span> <span class="s">board/stm32f4discovery.cfg</span> <span class="c1"># but you can also use your own special config file</span> <span class="na">configfile</span> <span class="o">=</span> <span class="s">openocd.cfg</span> <span class="c1"># the commands to run on $ scons program. Defaults are:</span> <span class="na">commands</span> <span class="o">=</span><span class="s"></span> <span class="s"> init</span> <span class="s"> reset halt</span> <span class="s"> flash write_image erase $SOURCE</span> <span class="s"> reset run</span> <span class="s"> shutdown</span> <span class="c1"># ARM only: configure Black Magic Probe for $ scons program</span> <span class="k">[black_magic_probe]</span> <span class="c1"># using a serial port</span> <span class="na">port</span> <span class="o">=</span> <span class="s">/dev/ttyUSB0</span> <span class="c1"># LPC targets with LPC-Linkv2 programmer only</span> <span class="k">[lpclink]</span> <span class="c1"># base path of the lpcxpresso installation</span> <span class="c1"># Default on Linux: /opt/lpcxpresso/</span> <span class="c1"># Default on OS X: /Applications/lcpxpresso_*/ (first match)</span> <span class="na">basepath</span> <span class="o">=</span> <span class="s">../lpcxpresso</span> </pre></div> <h3 id="parameters">Parameters<a class="headerlink" href="#parameters" title="Permanent link">#</a></h3> <p>In order to customize drivers further, driver parameters may be declared. These follow the naming scheme <code>type.name.instance.parameter</code> and are restrictive in the values they accept. Here is an overview of the available parameters.</p> <p>Set the software queue size for CAN messages for peripheral instance <code>N</code> in addition to the hardware queues:</p> <ul> <li><code>can.stm32.N.tx_buffer ∈ [0,254] = 32</code></li> <li><code>can.stm32.N.rx_buffer ∈ [0,254] = 32</code></li> </ul> <p>Sets the main stack size. Note that the linkerscript may increase this to satisfy alignment requirements, especially with the vector table mapped to RAM. Default size is <code>3kB - 32B</code>.</p> <ul> <li><code>core.cortex.0.main_stack_size ∈ [512, 8192] = 3040</code></li> </ul> <p>Places the vector table in RAM. When your stack and interrupt vector table reside in the <em>same</em> RAM section, this will <em>increase</em> interrupt response time! The default setting is the fastest setting.</p> <ul> <li><code>core.cortex.0.vector_table_in_ram ∈ bool = false (true on STM32F3/STM32F7)</code></li> </ul> <p>Enables the blinking LED inside the hard fault handler. Use this feature to easily identify a crashed processor!</p> <ul> <li><code>core.cortex.0.enable_hardfault_handler_led ∈ bool = false</code></li> <li><code>core.cortex.0.hardfault_handler_led_port ∈ {A,B,C,D,E,F,G,H,I,J,K}</code></li> <li><code>core.cortex.0.hardfault_handler_led_pin ∈ [0,15]</code></li> </ul> <p>Enables the serial logger inside the hard fault handler. Use <code>basic</code> for a minimal failure trace or <code>true</code> for a complete trace. You must provide the peripheral instance of the used serial port as well as a <code>XPCC_LOG_ERROR</code> output stream!</p> <ul> <li><code>core.cortex.0.enable_hardfault_handler_log ∈ {false,basic,true} = false</code></li> <li><code>core.cortex.0.hardfault_handler_uart ∈ [1,8]</code></li> </ul> <p>Sets the size of the transaction buffer for peripheral instance <code>N</code>. Increase this if you have many connected I2C slaves.</p> <ul> <li><code>i2c.stm32.N.transaction_buffer ∈ [1,100] = 8</code></li> </ul> <p>Forces the SPI driver on AVRs to poll for transfer completion rather than to delegate execution back to the main loop. Enabling this only makes sense for very high SPI frequencies.</p> <ul> <li><code>spi.at90_tiny_mega.0.busywait ∈ bool = false</code></li> </ul> <p>Set the software buffer for UART data for peripheral instance <code>N</code>. The size is limited on AVRs, due to atomicity requirements!</p> <ul> <li><code>uart.at90_tiny_mega.N.tx_buffer ∈ [1,254] = 64</code></li> <li> <p><code>uart.at90_tiny_mega.N.rx_buffer ∈ [1,254] = 8</code></p> </li> <li> <p><code>uart.lpc.0.tx_buffer ∈ [1,65534] = 250</code></p> </li> <li> <p><code>uart.lpc.0.rx_buffer ∈ [1,65534] = 16</code></p> </li> <li> <p><code>uart.stm32.N.tx_buffer ∈ [1,65534] = 250</code></p> </li> <li><code>uart.stm32.N.rx_buffer ∈ [1,65534] = 16</code></li> </ul> <aside class="copyright" role="note"> Copyright &copy 2016 Roboterclub Aachen e.V. &ndash; Documentation built with <a href="http://www.mkdocs.org" target="_blank">MkDocs</a> using the <a href="http://squidfunk.github.io/mkdocs-material/" target="_blank"> Material </a> theme. </aside> <footer class="footer"> <nav class="pagination" aria-label="Footer"> <div class="previous"> <a href="../api/" title="API reference"> <span class="direction"> Previous </span> <div class="page"> <div class="button button-previous" role="button" aria-label="Previous"> <i class="icon icon-back"></i> </div> <div class="stretch"> <div class="title"> API reference </div> </div> </div> </a> </div> <div class="next"> <a href="../device-files/" title="Device files"> <span class="direction"> Next </span> <div class="page"> <div class="stretch"> <div class="title"> Device files </div> </div> <div class="button button-next" role="button" aria-label="Next"> <i class="icon icon-forward"></i> </div> </div> </a> </div> </nav> </footer> </div> </article> <div class="results" role="status" aria-live="polite"> <div class="scrollable"> <div class="wrapper"> <div class="meta"></div> <div class="list"></div> </div> </div> </div> </main> <script> var base_url = '../..'; var repo_id = 'RoboterclubAachen/xpcc'; </script> <script src="../../assets/javascripts/application-153ebaf1fd.js"></script> </body> </html><file_sep>/docs/api/classxpcc_1_1gui_1_1_widget.js var classxpcc_1_1gui_1_1_widget = [ [ "Widget", "classxpcc_1_1gui_1_1_widget.html#aea04e574b694fc85ce9f3135c81a7029", null ], [ "~Widget", "classxpcc_1_1gui_1_1_widget.html#ace2f205be35ab0dac9f8ac0b5e2945ac", null ], [ "render", "classxpcc_1_1gui_1_1_widget.html#a4d8c036f47cbcc9b8b6ff77c43fbf5c5", null ], [ "draw", "classxpcc_1_1gui_1_1_widget.html#a8cdd702a7701faee67cc5af6c6af30d2", null ], [ "handleInputEvent", "classxpcc_1_1gui_1_1_widget.html#a66786e7b77808c6fdee3ff9382b88a27", null ], [ "checkIntersection", "classxpcc_1_1gui_1_1_widget.html#a58b855eafeb0b53ad388b69d41b34cd2", null ], [ "updateIntersections", "classxpcc_1_1gui_1_1_widget.html#a0e221ddc141c40987096dfddc35e7a6b", null ], [ "hasIntersections", "classxpcc_1_1gui_1_1_widget.html#a61006e8a4ac1b39a14f0a6df4acd9d19", null ], [ "activate", "classxpcc_1_1gui_1_1_widget.html#a5adfb9bfb3a81f9574157d515aad974d", null ], [ "deactivate", "classxpcc_1_1gui_1_1_widget.html#a23fdbdaadd4d1fd61350e8eb1ba67fbe", null ], [ "getColorPalette", "classxpcc_1_1gui_1_1_widget.html#a3a1b4c731a48f46051299a7a6d53d840", null ], [ "setColorPalette", "classxpcc_1_1gui_1_1_widget.html#a7cc182f0f8f953516dbd80353358441e", null ], [ "setColor", "classxpcc_1_1gui_1_1_widget.html#ae46a2e28470276fa49ce2aee942f5282", null ], [ "setPosition", "classxpcc_1_1gui_1_1_widget.html#a46ec42402680bb29e26a78621c742ee6", null ], [ "getPosition", "classxpcc_1_1gui_1_1_widget.html#ad44c053ca34813fc8e7c2e558ab9bf52", null ], [ "getRelativePosition", "classxpcc_1_1gui_1_1_widget.html#a032d6c86e0aa90bf488073b267e25988", null ], [ "setRelativePosition", "classxpcc_1_1gui_1_1_widget.html#a67f528cca5d902013408ca3cb43bbdac", null ], [ "updatePosition", "classxpcc_1_1gui_1_1_widget.html#abb0805a55619d3000f7b4d65faec3073", null ], [ "setParent", "classxpcc_1_1gui_1_1_widget.html#a0f087a0978264f2b8af31b31baa99cfb", null ], [ "getDimension", "classxpcc_1_1gui_1_1_widget.html#a3b9c80950a8901c199ad7111b1614029", null ], [ "getWidth", "classxpcc_1_1gui_1_1_widget.html#a782955e6770efb7c748aa9c800ebd72e", null ], [ "getHeight", "classxpcc_1_1gui_1_1_widget.html#a36484c269c46816ecf6a88bbb9bb3ff2", null ], [ "isDirty", "classxpcc_1_1gui_1_1_widget.html#a2cb0386592de58f60b7e3b4ca05f1003", null ], [ "isInteractive", "classxpcc_1_1gui_1_1_widget.html#affc3ee28e93366dd7145ec589c2b2290", null ], [ "markDrawn", "classxpcc_1_1gui_1_1_widget.html#af09981c7208c1ce4463e79dd725518fe", null ], [ "markDirty", "classxpcc_1_1gui_1_1_widget.html#a2741e1b671b0ae3582f500494491baf5", null ], [ "setFont", "classxpcc_1_1gui_1_1_widget.html#ac9db7a138b6ee81d8568e869f729fcc0", null ], [ "setFont", "classxpcc_1_1gui_1_1_widget.html#a4883e359a50905dbf99c489391525e24", null ], [ "setCallbackData", "classxpcc_1_1gui_1_1_widget.html#a29e4696e1fb6a7ba9e2fd9ea0dd0d8b3", null ], [ "parent", "classxpcc_1_1gui_1_1_widget.html#a878a95192ad0a49a33a0e5f5562188fe", null ], [ "uid", "classxpcc_1_1gui_1_1_widget.html#a1e000ea80722515ae29abcbc3d92b6b6", null ], [ "dimension", "classxpcc_1_1gui_1_1_widget.html#a232298c502ae04fd9e9432507c417e9c", null ], [ "activated", "classxpcc_1_1gui_1_1_widget.html#a13779366f738fc0001991b1176319a85", null ], [ "cbData", "classxpcc_1_1gui_1_1_widget.html#ad6346a00199546a0452f413d581ec981", null ], [ "cb_activate", "classxpcc_1_1gui_1_1_widget.html#a6c0ca8904fa3d807457bd1d54ba4336b", null ], [ "cb_deactivate", "classxpcc_1_1gui_1_1_widget.html#a65c47954c7cc1ccfcadcc8d952833940", null ], [ "color_palette", "classxpcc_1_1gui_1_1_widget.html#a3cc34e7f67d202fa504f2985e07f8946", null ], [ "position", "classxpcc_1_1gui_1_1_widget.html#a62060516514c6035e26c6b4582ca28d2", null ], [ "relative_position", "classxpcc_1_1gui_1_1_widget.html#ab70f1b2fa363c2901760ba82eef8d895", null ], [ "dirty", "classxpcc_1_1gui_1_1_widget.html#a2829cd46af2301c39a6dce9481dc4fce", null ], [ "is_interactive", "classxpcc_1_1gui_1_1_widget.html#a18ac3213557917f6c195522a67e24dac", null ], [ "font", "classxpcc_1_1gui_1_1_widget.html#a9d5504e96336306f0ea4e87c4e925567", null ], [ "intersecting_widgets", "classxpcc_1_1gui_1_1_widget.html#ad3b991fb561195ea43aeea3eec514b2a", null ] ];<file_sep>/docs/api/classxpcc_1_1_max7219matrix.js var classxpcc_1_1_max7219matrix = [ [ "initialize", "classxpcc_1_1_max7219matrix.html#a1344a170f042c4a5562807c3a249529d", null ], [ "update", "classxpcc_1_1_max7219matrix.html#a8f1dae9c7035f7172b5112338a98e702", null ], [ "max", "classxpcc_1_1_max7219matrix.html#a1785abc13c5fa1080f4a3729606a1bc7", null ] ];<file_sep>/docs/api/search/all_a.js var searchData= [ ['jmp',['JMP',['../structxpcc_1_1lis3dsh.html#aa3489efdbd878a99ec2fdecb2ddaa89cae116c0a9c432b0a449e28e8ab816ebc3',1,'xpcc::lis3dsh']]], ['joinresumables',['joinResumables',['../classxpcc_1_1_resumable.html#aedc20cfcb7b61074d2065e476e23bd9a',1,'xpcc::Resumable']]] ]; <file_sep>/docs/api/group__stm32f407vg__dma.js var group__stm32f407vg__dma = [ [ "Dma1", "classxpcc_1_1stm32_1_1_dma1.html", [ [ "Stream0", "classxpcc_1_1stm32_1_1_dma1_1_1_stream0.html", null ], [ "Stream1", "classxpcc_1_1stm32_1_1_dma1_1_1_stream1.html", null ], [ "Stream2", "classxpcc_1_1stm32_1_1_dma1_1_1_stream2.html", null ], [ "Stream3", "classxpcc_1_1stm32_1_1_dma1_1_1_stream3.html", null ], [ "Stream4", "classxpcc_1_1stm32_1_1_dma1_1_1_stream4.html", null ], [ "Stream5", "classxpcc_1_1stm32_1_1_dma1_1_1_stream5.html", null ], [ "Stream6", "classxpcc_1_1stm32_1_1_dma1_1_1_stream6.html", null ], [ "Stream7", "classxpcc_1_1stm32_1_1_dma1_1_1_stream7.html", null ] ] ], [ "Dma2", "classxpcc_1_1stm32_1_1_dma2.html", [ [ "Stream0", "classxpcc_1_1stm32_1_1_dma2_1_1_stream0.html", null ], [ "Stream1", "classxpcc_1_1stm32_1_1_dma2_1_1_stream1.html", null ], [ "Stream2", "classxpcc_1_1stm32_1_1_dma2_1_1_stream2.html", null ], [ "Stream3", "classxpcc_1_1stm32_1_1_dma2_1_1_stream3.html", null ], [ "Stream4", "classxpcc_1_1stm32_1_1_dma2_1_1_stream4.html", null ], [ "Stream5", "classxpcc_1_1stm32_1_1_dma2_1_1_stream5.html", null ], [ "Stream6", "classxpcc_1_1stm32_1_1_dma2_1_1_stream6.html", null ], [ "Stream7", "classxpcc_1_1stm32_1_1_dma2_1_1_stream7.html", null ] ] ], [ "DmaBase", "classxpcc_1_1stm32_1_1_dma_base.html", [ [ "Channel", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0", [ [ "Channel0", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0aa103e02952aa83a69bdb843834d4b406", null ], [ "Channel1", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0a6e7930d9e45cf08519eb5ea33285a737", null ], [ "Channel2", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0aa41a549bb6e132a1807a57bb17a83211", null ], [ "Channel3", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0ab7824fd5b5e65fc437a3a617797983cf", null ], [ "Channel4", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0a5c7e076937da7c1e9a00f383432a05fd", null ], [ "Channel5", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0a3f189c670b7f27cd75e266eade42d425", null ], [ "Channel6", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0a3d5ba04e0b2fda24744b67b2d8548dbf", null ], [ "Channel7", "classxpcc_1_1stm32_1_1_dma_base.html#a0f6e72376ecfbbc3a0702080d36474b0a8284862e267c6989622db69cb7e4602b", null ] ] ], [ "MemoryBurstTransfer", "classxpcc_1_1stm32_1_1_dma_base.html#a7ffb7f5ecaef4e06202f095a3ebfa819", [ [ "Single", "classxpcc_1_1stm32_1_1_dma_base.html#a7ffb7f5ecaef4e06202f095a3ebfa819a66ba162102bbf6ae31b522aec561735e", null ], [ "Increment4", "classxpcc_1_1stm32_1_1_dma_base.html#a7ffb7f5ecaef4e06202f095a3ebfa819a014f38da3905b5ee94b766e87aaf4596", null ], [ "Increment8", "classxpcc_1_1stm32_1_1_dma_base.html#a7ffb7f5ecaef4e06202f095a3ebfa819adc99757017ddfed08a0eeed2e1a9056e", null ], [ "Increment16", "classxpcc_1_1stm32_1_1_dma_base.html#a7ffb7f5ecaef4e06202f095a3ebfa819acfe4f342bb51b66589443635d44f73ac", null ] ] ], [ "PeripheralBurstTransfer", "classxpcc_1_1stm32_1_1_dma_base.html#a64b70f91dbccae1e70384a980fd55fd5", [ [ "Single", "classxpcc_1_1stm32_1_1_dma_base.html#a64b70f91dbccae1e70384a980fd55fd5a66ba162102bbf6ae31b522aec561735e", null ], [ "Increment4", "classxpcc_1_1stm32_1_1_dma_base.html#a64b70f91dbccae1e70384a980fd55fd5a014f38da3905b5ee94b766e87aaf4596", null ], [ "Increment8", "classxpcc_1_1stm32_1_1_dma_base.html#a64b70f91dbccae1e70384a980fd55fd5adc99757017ddfed08a0eeed2e1a9056e", null ], [ "Increment16", "classxpcc_1_1stm32_1_1_dma_base.html#a64b70f91dbccae1e70384a980fd55fd5acfe4f342bb51b66589443635d44f73ac", null ] ] ], [ "FlowControl", "classxpcc_1_1stm32_1_1_dma_base.html#ad619b67435ac6190adbac6fd54a4d1e9", [ [ "Dma", "classxpcc_1_1stm32_1_1_dma_base.html#ad619b67435ac6190adbac6fd54a4d1e9a206202eaf7fe52b08be45313fe66d1e5", null ], [ "Peripheral", "classxpcc_1_1stm32_1_1_dma_base.html#ad619b67435ac6190adbac6fd54a4d1e9a911e8211a55efee5a43a609b7bcb5db9", null ] ] ], [ "Priority", "classxpcc_1_1stm32_1_1_dma_base.html#af3a4d861026b2bc3ca9825d420493cc7", [ [ "Low", "classxpcc_1_1stm32_1_1_dma_base.html#af3a4d861026b2bc3ca9825d420493cc7a28d0edd045e05cf5af64e35ae0c4c6ef", null ], [ "Medium", "classxpcc_1_1stm32_1_1_dma_base.html#af3a4d861026b2bc3ca9825d420493cc7a87f8a6ab85c9ced3702b4ea641ad4bb5", null ], [ "High", "classxpcc_1_1stm32_1_1_dma_base.html#af3a4d861026b2bc3ca9825d420493cc7a655d20c1ca69519ca647684edbb2db35", null ], [ "VeryHigh", "classxpcc_1_1stm32_1_1_dma_base.html#af3a4d861026b2bc3ca9825d420493cc7af0b44f10edcd3bdee6720430ac4111cd", null ] ] ], [ "MemoryDataSize", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965e", [ [ "Byte", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965eaa245c3230debe5c956484ecc6fa93877", null ], [ "Bit8", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965ea17434210d4ad0740bc77b2b161241758", null ], [ "HalfWord", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965ea2804ec524435771cc2e37e38857ab3b1", null ], [ "Bit16", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965eaf2a31fec5cbf6b1ce668e791feb81e27", null ], [ "Word", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965ea07a094a210794e74a0e5e1a1457a92ee", null ], [ "Bit32", "classxpcc_1_1stm32_1_1_dma_base.html#a54a90e94f3cc62ddc2353cc22dc4965ead6a94992f7ac52da69040b96b9be71c4", null ] ] ], [ "PeripheralDataSize", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53", [ [ "Byte", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53aa245c3230debe5c956484ecc6fa93877", null ], [ "Bit8", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53a17434210d4ad0740bc77b2b161241758", null ], [ "HalfWord", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53a2804ec524435771cc2e37e38857ab3b1", null ], [ "Bit16", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53af2a31fec5cbf6b1ce668e791feb81e27", null ], [ "Word", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53a07a094a210794e74a0e5e1a1457a92ee", null ], [ "Bit32", "classxpcc_1_1stm32_1_1_dma_base.html#a651d9803af5551b97fd542fabe7a6f53ad6a94992f7ac52da69040b96b9be71c4", null ] ] ], [ "MemoryIncrementMode", "classxpcc_1_1stm32_1_1_dma_base.html#a835f8a46a23165320ffaad3c24f62056", [ [ "Fixed", "classxpcc_1_1stm32_1_1_dma_base.html#a835f8a46a23165320ffaad3c24f62056a4457d440870ad6d42bab9082d9bf9b61", null ], [ "Increment", "classxpcc_1_1stm32_1_1_dma_base.html#a835f8a46a23165320ffaad3c24f62056a6f15bdfa71aa83b0d197cad75757d580", null ] ] ], [ "PeripheralIncrementMode", "classxpcc_1_1stm32_1_1_dma_base.html#aa20dbfab863595ad1cf623ea2ae239f3", [ [ "Fixed", "classxpcc_1_1stm32_1_1_dma_base.html#aa20dbfab863595ad1cf623ea2ae239f3a4457d440870ad6d42bab9082d9bf9b61", null ], [ "Increment", "classxpcc_1_1stm32_1_1_dma_base.html#aa20dbfab863595ad1cf623ea2ae239f3a6f15bdfa71aa83b0d197cad75757d580", null ] ] ], [ "CircularMode", "classxpcc_1_1stm32_1_1_dma_base.html#a7c112619f7775af5d3baee2ffdf45757", [ [ "Disabled", "classxpcc_1_1stm32_1_1_dma_base.html#a7c112619f7775af5d3baee2ffdf45757ab9f5c797ebbf55adccdd8539a65a0241", null ], [ "Enabled", "classxpcc_1_1stm32_1_1_dma_base.html#a7c112619f7775af5d3baee2ffdf45757a00d23a76e43b46dae9ec7aa9dcbebb32", null ] ] ], [ "DataTransferDirection", "classxpcc_1_1stm32_1_1_dma_base.html#afb303eb4e8821e09b34fe8d1a159244e", [ [ "PeripheralToMemory", "classxpcc_1_1stm32_1_1_dma_base.html#afb303eb4e8821e09b34fe8d1a159244ea21917ba65ee6ebaffcd6b287b2411fba", null ], [ "MemoryToPeripheral", "classxpcc_1_1stm32_1_1_dma_base.html#afb303eb4e8821e09b34fe8d1a159244ea77896a110bc21fb2f91ae1206b065001", null ], [ "MemoryToMemory", "classxpcc_1_1stm32_1_1_dma_base.html#afb303eb4e8821e09b34fe8d1a159244eabcf758fd2e6ffac4ae3c64a340d70a76", null ] ] ] ] ] ];<file_sep>/docs/api/group__driver__bus.js var group__driver__bus = [ [ "BitbangMemoryInterface", "classxpcc_1_1_bitbang_memory_interface.html", null ], [ "TftMemoryBus16Bit", "classxpcc_1_1_tft_memory_bus16_bit.html", [ [ "TftMemoryBus16Bit", "classxpcc_1_1_tft_memory_bus16_bit.html#a57c608904e4d8eba1d74a24405448637", null ], [ "writeIndex", "classxpcc_1_1_tft_memory_bus16_bit.html#ad586b9d07b8de4be65919805df5e19d0", null ], [ "writeData", "classxpcc_1_1_tft_memory_bus16_bit.html#af7fa03ec1f1f7011a0235d250df41459", null ], [ "readData", "classxpcc_1_1_tft_memory_bus16_bit.html#a267730113b953e68ab566599b785f3f7", null ], [ "writeRegister", "classxpcc_1_1_tft_memory_bus16_bit.html#a728a9e202112bf27a683f6b1395db195", null ], [ "readRegister", "classxpcc_1_1_tft_memory_bus16_bit.html#af9907c215974122e47a8f410a72239a5", null ] ] ], [ "TftMemoryBus8Bit", "classxpcc_1_1_tft_memory_bus8_bit.html", [ [ "TftMemoryBus8Bit", "classxpcc_1_1_tft_memory_bus8_bit.html#a53d945e084dfe07faf84a65efe9218b6", null ], [ "writeIndex", "classxpcc_1_1_tft_memory_bus8_bit.html#aa4a7e3d420d2bcc96ca3381389de65e0", null ], [ "writeData", "classxpcc_1_1_tft_memory_bus8_bit.html#a55f20c647a2e56375c7f4acff02ec05d", null ], [ "writeRegister", "classxpcc_1_1_tft_memory_bus8_bit.html#a82ee51bd16bc692deffdb316d5cf9400", null ] ] ], [ "MemoryBus", "classxpcc_1_1_memory_bus.html", null ], [ "TftMemoryBus8BitGpio", "classxpcc_1_1_tft_memory_bus8_bit_gpio.html", [ [ "BUS", "classxpcc_1_1_tft_memory_bus8_bit_gpio.html#a51ac6fa75a80460ac0a23e040117cc85", null ] ] ] ];<file_sep>/src/installation.md # Installation This is the minimum required software for the xpcc build system: - [Python 3](http://www.python.org/) - [Software Construct](http://www.scons.org/) - [Jinja2 Template Engine](http://jinja.pocoo.org/) - AVR toolchain: [avr-gcc](http://www.nongnu.org/avr-libc) and [avrdude](http://www.nongnu.org/avrdude) - ARM toolchain: [arm-none-eabi-gcc](https://launchpad.net/gcc-arm-embedded) and [openocd](http://openocd.org/) To start actively developing on xpcc, you will also need these packages: - [python-lxml](http://lxml.de/) - [doxygen](http://www.stack.nl/~dimitri/doxygen) Note that xpcc requires C++14, so you need a reasonably new compiler (at least GCC 5). *Please help us keep these instructions up-to-date by [opening a Pull Request](https://github.com/roboterclubaachen/xpcc.io/pulls)!* ## Installing on Linux For Ubuntu 16.04LTS, these commands install the basic build system: sudo apt-get install python python-pip python-jinja2 scons git Install the AVR toochain: sudo apt-get install gcc-avr binutils-avr avr-libc avrdude And the ARM toolchain as well: sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa sudo apt-get update sudo apt-get install gcc-arm-embedded openocd To compile programs for x86 systems install the following packets: sudo apt-get install gcc build-essential libboost-thread-dev \ libboost-system-dev libasio-dev For active xpcc development install these packets too: sudo apt-get --no-install-recommends install doxygen pip install --user lxml This installs `doxygen` without LaTeX support, which saves ~600MB of disk space. ## Installing on OS X First install [`homebrew`](http://brew.sh/), a great packet manager for OS X, then use it to install the minimum build system: brew install python3 scons git pip3 install --user jinja2 future # Unless you use virtualenv (which you should!) # you may need to default your python to python3 # ln -s /usr/local/bin/python3 /usr/local/bin/python Install the [upstream (!) AVR toolchain](https://github.com/osx-cross/homebrew-avr): brew tap osx-cross/avr brew install avr-gcc And the [official ARM toolchain](https://github.com/armmbed/homebrew-formulae) as well: brew tap ARMmbed/formulae brew install arm-none-eabi-gcc To program and debug your ARM Cortex-M device, you need to install the latest [OpenOCD](http://openocd.org) version: brew install openocd --HEAD For active xpcc development install these packets too: brew install doxygen pip install --user lxml ## Installing on Windows First thing you need is Python 2.7. On Windows it is strongly recommended to use a Python enviroment manager instead of plain Python/pip, e.g. Anaconda. ### Installation with Anaconda First we create a new Python 2.7 enviroment and install all nescessary packages. conda create --name xpcc python=2.7 activate xpcc conda install -c conda-forge jinja2 scons git For now you will also need the following packages: conda install -c conda-forge configparser future For ARM development you will need the Windows 32-bit build of the [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads). The binary sources of this toolchain (.../bin) have to be added to your PATH variable. For programming and debugging ARM Cortex-M devices you will also need prebuild [OpenOCD binaries](http://gnutoolchains.com/arm-eabi/openocd/). The binary sources (.../bin) have to be added to your PATH variable as well. ### Current bugs As for now, you cant use project and build paths, that contain non-ASCII characters (ä,ö, ...), since they are not parsed correctly. [examples]: https://github.com/roboterclubaachen/xpcc/tree/develop/examples<file_sep>/docs/api/structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4.js var structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4 = [ [ "exists", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4.html#ac203c45f01830eb1818e471a436fb562a661b3b1fa4f23e978ed7b4550683a30c", null ], [ "existsBothWays", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4.html#ac203c45f01830eb1818e471a436fb562ab935a062cf15b4a11c0731fdafb91b0d", null ], [ "isSameType", "structxpcc_1_1tmp_1_1_conversion_3_01_t_00_01void_01_4.html#ac203c45f01830eb1818e471a436fb562ad0366f21bc8444f1649638394a5b7342", null ] ];<file_sep>/docs/api/classxpcc_1_1atmega_1_1_gpio_port.js var classxpcc_1_1atmega_1_1_gpio_port = [ [ "PortType", "classxpcc_1_1atmega_1_1_gpio_port.html#a56b37efca7468d2d8fcd1d938a8e6ab4", null ] ];<file_sep>/docs/api/classxpcc_1_1_pca9685.js var classxpcc_1_1_pca9685 = [ [ "Pca9685", "classxpcc_1_1_pca9685.html#a723212c0f1a461c47a918901624ceeb3", null ], [ "initialize", "classxpcc_1_1_pca9685.html#a13a240f38991c4f88aa3d7c722c9c597", null ], [ "setChannel", "classxpcc_1_1_pca9685.html#a2b0a4787639276888dbd628eaf0105d2", null ], [ "setAllChannels", "classxpcc_1_1_pca9685.html#aa275555c38a1d2224993793d33b7f035", null ] ];<file_sep>/docs/api/structxpcc_1_1itg3200.js var structxpcc_1_1itg3200 = [ [ "Data", "structxpcc_1_1itg3200_1_1_data.html", "structxpcc_1_1itg3200_1_1_data" ], [ "Interrupt_t", "structxpcc_1_1itg3200.html#a4748c39d2d3e9828a74c786d85ce396d", null ], [ "Status_t", "structxpcc_1_1itg3200.html#a21ceba28f5b20419d2b26e573847a50c", null ], [ "Power_t", "structxpcc_1_1itg3200.html#a81d459f38aaa1c38f156a2b6b0cb9f4f", null ], [ "ClockSource_t", "structxpcc_1_1itg3200.html#a6f2df469cd5e968f2f45b34abfd75cfd", null ], [ "LowPassFilter", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0", [ [ "Hz256", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0a279b601a29f426a3bed926d609353350", null ], [ "Hz188", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0a76752b0ce440bbea2a9de9099532a1f1", null ], [ "Hz98", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0afdbb7294d2ff7762f7e8728a125176c1", null ], [ "Hz42", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0abec46ac8410c1ed044f4586bf4b0175d", null ], [ "Hz20", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0a59e319e6a3fefbb95ad69c8c28ec349e", null ], [ "Hz10", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0aeea5e98ba2a18623c87216a225ee4e0d", null ], [ "Hz5", "structxpcc_1_1itg3200.html#ad4bfadbe5c05881ba72e1810d600a3b0a8b174e282eb19025ebfbf8e82ba0c4dd", null ] ] ], [ "Interrupt", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2", [ [ "ACTL", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2acd94a192b595c60cfe4a5492a01f24d0", null ], [ "OPEN", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2aa38bd5138bf35514df41a1795ebbf5c3", null ], [ "LATCH_INT_EN", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2a22a6ab12e1ba07fe24725d60998d10cc", null ], [ "INT_ANYRD_2CLEAR", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2a3a84964cf5e8f279b4b4171478f95f83", null ], [ "ITG_RDY_EN", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2aca914532df457e0153d554f4b6f76208", null ], [ "RAW_RDY_EN", "structxpcc_1_1itg3200.html#af14284afe01aa93bc07e3645261c83f2a47ead0b18b7d815cf252bc9280cd9c9c", null ] ] ], [ "Status", "structxpcc_1_1itg3200.html#a20da87c05d584694dc5085da90716edb", [ [ "ITG_RDY", "structxpcc_1_1itg3200.html#a20da87c05d584694dc5085da90716edba52034a628022913703b76fbe13bcb2ba", null ], [ "RAW_DATA_RDY", "structxpcc_1_1itg3200.html#a20da87c05d584694dc5085da90716edbab66d909b40ec051d6b822bd74426ba61", null ] ] ], [ "Power", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80", [ [ "H_RESET", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80ac2298ceeb6e68e9596b0a0ee22cff2b9", null ], [ "SLEEP", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80ab32bd403b93dc6deffdab7af55e82596", null ], [ "STBY_XG", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80a6f14655927847dfaae7ed73ebebcf031", null ], [ "STBY_YG", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80af36865c5bb0a5a8d869278633265f00a", null ], [ "STBY_ZG", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80a7d6bf252c3946cae5c4d489e753261c9", null ], [ "CLK_SEL2", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80a4a5cc77cea23830beb2bf87ab95fb83c", null ], [ "CLK_SEL1", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80adf2adc07ab7d1965f727c62f5c40a732", null ], [ "CLK_SEL0", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80a3d345a2ac89ab66751fb97a89c39083b", null ], [ "CLK_SEL_Mask", "structxpcc_1_1itg3200.html#a8e4a1f02d105d5120d845d482768fc80acd3c111316057841ab3138eca8ddcafd", null ] ] ], [ "ClockSource", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783", [ [ "Internal", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783aafbf0897a5a83fdd873dfb032ec695d3", null ], [ "PllX", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783af3b1482bee33b07dad6a16c2ff7d1734", null ], [ "PllY", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783a831145aaa2c30dd33b5395aa7074411c", null ], [ "PllZ", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783a8610305480f6f21688ddd5bc08720b61", null ], [ "PllExternal32kHz", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783a7d6c7bd10b1d4d520aace5a964b4791c", null ], [ "PllExternal19MHz", "structxpcc_1_1itg3200.html#a9cbf7c9297f2ebc7673a189af6702783a0a47e183e8ba687222ea0234513b9ed9", null ] ] ] ];<file_sep>/docs/api/search/enums_1.js var searchData= [ ['baudrate',['Baudrate',['../classxpcc_1_1_i2c_master.html#a8334095ac3f913c0e044db1fe0f80f3d',1,'xpcc::I2cMaster::Baudrate()'],['../classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99',1,'xpcc::Uart::Baudrate()']]], ['bfpctrl',['BFPCTRL',['../group__mcp2515.html#ga0cd6dd287ed5ac93a148a5ab4ac2b582',1,'xpcc::mcp2515']]], ['bitrate',['Bitrate',['../classxpcc_1_1_can.html#ac1620213e755b5768d5951e93d44a720',1,'xpcc::Can']]], ['busstate',['BusState',['../classxpcc_1_1_can.html#a16107bae38ba2a85ce09048e35ede50f',1,'xpcc::Can']]], ['button',['Button',['../group__display__menu.html#ga39086596b10fefccbda908be340c5fa3',1,'xpcc::MenuButtons']]] ]; <file_sep>/docs/api/classxpcc_1_1stm32_1_1_clock_output2.js var classxpcc_1_1stm32_1_1_clock_output2 = [ [ "Division", "classxpcc_1_1stm32_1_1_clock_output2.html#ae95e886681511c9dac7a6b4b5dca0e28", [ [ "By1", "classxpcc_1_1stm32_1_1_clock_output2.html#ae95e886681511c9dac7a6b4b5dca0e28a43550529c3cefc46dab550c7498f9b48", null ], [ "By2", "classxpcc_1_1stm32_1_1_clock_output2.html#ae95e886681511c9dac7a6b4b5dca0e28a0f4a5b48f4ebe1f735c7183de5cf83d0", null ], [ "By3", "classxpcc_1_1stm32_1_1_clock_output2.html#ae95e886681511c9dac7a6b4b5dca0e28a587251a235be5a67fae81e5cdf85f138", null ], [ "By4", "classxpcc_1_1stm32_1_1_clock_output2.html#ae95e886681511c9dac7a6b4b5dca0e28a57d7b0fdf567e26ff1b2a5af0ea7d04e", null ], [ "By5", "classxpcc_1_1stm32_1_1_clock_output2.html#ae95e886681511c9dac7a6b4b5dca0e28a9e727e1b38b45e3c756cd9268f2ff967", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_button_widget.js var classxpcc_1_1gui_1_1_button_widget = [ [ "ButtonWidget", "classxpcc_1_1gui_1_1_button_widget.html#ae6c6fd0b0d9d62061312e989abec6bd5", null ], [ "render", "classxpcc_1_1gui_1_1_button_widget.html#a0e4808021a92795cabee22597e14832a", null ], [ "setLabel", "classxpcc_1_1gui_1_1_button_widget.html#a7ae244b10f45671866e9851417aff001", null ] ];<file_sep>/docs/api/group__register.js var group__register = [ [ "Register", "structxpcc_1_1_register.html", [ [ "UnderlyingType", "structxpcc_1_1_register.html#a4c2c4eb34f0c968c96d2c002ed12a088", null ], [ "Register", "structxpcc_1_1_register.html#a92ec8cc1f33614e59aa0bd7987c215a7", null ], [ "Register", "structxpcc_1_1_register.html#ad8e4239f936b80e01a5ec96a161694e9", null ], [ "operator bool", "structxpcc_1_1_register.html#a986d04d3cf3712b17b2b51a7e57d6458", null ], [ "operator!", "structxpcc_1_1_register.html#a196ef010a3c4a4ad88a72a6c8333a698", null ], [ "operator<<", "structxpcc_1_1_register.html#a0f260e509aed71042161a12a270d45c8", null ], [ "value", "structxpcc_1_1_register.html#aa4f7e6b17d9cbf6e80bff4014cc829fd", null ] ] ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html", [ [ "EnumType", "structxpcc_1_1_flags_operators.html#acf3e7988c89b5a464e075d20d6334d33", null ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html#abca028a0deb740b28e7bfdb35d43247c", null ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html#a1f56fecec5040f9612550f58a06830a7", null ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html#a872bd56bf2ee6a03f8647632a64c5173", null ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html#ace5fbcaef6b7d418dd845f809b9d335c", null ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html#a2527d68131d87883deb4b76f342ccba9", null ], [ "FlagsOperators", "structxpcc_1_1_flags_operators.html#ae868f5f3c0f7d737aee4c176498b6c86", null ], [ "operator=", "structxpcc_1_1_flags_operators.html#ad420ffeda606d36a01dfd98818b42106", null ], [ "operator=", "structxpcc_1_1_flags_operators.html#a1e58ba739c86048bc890d3376608e5c8", null ], [ "operator~", "structxpcc_1_1_flags_operators.html#a07b7034f6e1ed5f91c2d5830271a32c0", null ], [ "operator &", "structxpcc_1_1_flags_operators.html#a1d118c35ab1e55ab45c3e5b5c267c9df", null ], [ "operator|", "structxpcc_1_1_flags_operators.html#ab4b8e760e6a8d8e90315acb141eebefe", null ], [ "operator^", "structxpcc_1_1_flags_operators.html#a15be9a41d4a07ca63dffb6f1bf318483", null ], [ "operator &=", "structxpcc_1_1_flags_operators.html#a0809d3367d5f2ecc41f17ad5e6f4ee54", null ], [ "operator|=", "structxpcc_1_1_flags_operators.html#ade43ca762b880f70a93932222fba7ef0", null ], [ "operator^=", "structxpcc_1_1_flags_operators.html#ada10bb24b72d2142ca5e23634fac90b1", null ], [ "operator &=", "structxpcc_1_1_flags_operators.html#a83e736546385634fafc8e5fb06aa53b2", null ], [ "operator|=", "structxpcc_1_1_flags_operators.html#a006af3abf31d4e46ebefe0990b4893ca", null ], [ "operator^=", "structxpcc_1_1_flags_operators.html#a32535bb614c0cac29e2451eddf570540", null ], [ "operator &", "structxpcc_1_1_flags_operators.html#af242a1c559780336753e58183ca51104", null ], [ "operator|", "structxpcc_1_1_flags_operators.html#a94848dda5041d305f367abc4c39f327a", null ], [ "operator^", "structxpcc_1_1_flags_operators.html#a3a49f7e1c7caf05575bb4f2e4bfec29e", null ], [ "operator &", "structxpcc_1_1_flags_operators.html#a587d5c947e1b1688cc8b8463d8104cfd", null ], [ "operator|", "structxpcc_1_1_flags_operators.html#a26e004c57eba88d8201df7be071bf84d", null ], [ "operator^", "structxpcc_1_1_flags_operators.html#a3ca154d188fea587c7589f49cfbb034b", null ], [ "operator &", "structxpcc_1_1_flags_operators.html#ad2f92bd4fb96ddcbabc4f501b052a94a", null ], [ "operator|", "structxpcc_1_1_flags_operators.html#a45e47c0db507bf89a29d8ecdd5ce5bd4", null ], [ "operator^", "structxpcc_1_1_flags_operators.html#a12d86a9a77241c13b80ef5bbca1f2718", null ], [ "operator==", "structxpcc_1_1_flags_operators.html#a9d8c3a729e59ad02477d5cc0e0166cff", null ], [ "operator!=", "structxpcc_1_1_flags_operators.html#a756878b7f29d2226ff2c4fd0b0716d42", null ], [ "operator==", "structxpcc_1_1_flags_operators.html#a4defdead1819f5bf32b63a3e4f05866e", null ], [ "operator!=", "structxpcc_1_1_flags_operators.html#a7bea73f21e1b1a7a41e2104126caee0f", null ] ] ], [ "Flags", "structxpcc_1_1_flags.html", [ [ "EnumType", "structxpcc_1_1_flags.html#ad36f975972b7533b6efea7fa35f41c6c", null ], [ "Flags", "structxpcc_1_1_flags.html#a9696ef8ecda6422cf57cd6e4d35d27e9", null ], [ "Flags", "structxpcc_1_1_flags.html#a2248c7dfb16af1e6b56c535456a3a711", null ], [ "Flags", "structxpcc_1_1_flags.html#a0aad98429dbb24279cff3df04ddfe67b", null ], [ "Flags", "structxpcc_1_1_flags.html#afd51f6f55075bf102f8a5885a2819e0f", null ], [ "Flags", "structxpcc_1_1_flags.html#afa58f26177327ba2773064650503314c", null ], [ "Flags", "structxpcc_1_1_flags.html#ad6e8b6779683dbf033e838525fdcbb34", null ], [ "Flags", "structxpcc_1_1_flags.html#a4dabf8c22c4abdce95e62c749a322963", null ], [ "operator=", "structxpcc_1_1_flags.html#a25d9d111e10a7619fed97b17605340c4", null ], [ "operator=", "structxpcc_1_1_flags.html#a1731596de3312964152d9010bf900de7", null ], [ "set", "structxpcc_1_1_flags.html#aa7712d94df88f4592f6c15fad8404b2e", null ], [ "set", "structxpcc_1_1_flags.html#a9238cacb1bac0cb40957c5ae87f59b3c", null ], [ "reset", "structxpcc_1_1_flags.html#a81c85bb7356ffea91e3fd5aac6058148", null ], [ "reset", "structxpcc_1_1_flags.html#a0a786034294e5af0ddcd514cd6b40db1", null ], [ "toggle", "structxpcc_1_1_flags.html#ad268608429ef5dae6e3773c36739e472", null ], [ "toggle", "structxpcc_1_1_flags.html#adf887753df75db396de910828bdcd865", null ], [ "update", "structxpcc_1_1_flags.html#a33b6a8df8aff8995b0b413583beeb66a", null ], [ "update", "structxpcc_1_1_flags.html#af2ad5160a2ee32ce8abd7b345ec29d2f", null ], [ "all", "structxpcc_1_1_flags.html#aa87018f9fc225bf38ae307d2f6684b9d", null ], [ "any", "structxpcc_1_1_flags.html#a045e6f8caf92e1ff3de3aba3e11005f0", null ], [ "none", "structxpcc_1_1_flags.html#ad8c85c40fba32344dcddc21050276cfe", null ], [ "all", "structxpcc_1_1_flags.html#ae1e50d05da3726c6307f265e0c315e52", null ], [ "any", "structxpcc_1_1_flags.html#a54c227091cdeb8a8d176df417b6d3b3e", null ], [ "none", "structxpcc_1_1_flags.html#ac8182708ee2cfd94d7721dd6e766fd99", null ] ] ], [ "FlagsGroup< T... >", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html", [ [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a106938991ef31b237ae20a9c894deed2", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a49e2aabf030051119cb88c4e7d12bfb9", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#af804df27a2608832c2a09d36096ba6f7", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a96614d3ba9a626c9b32c68577554bb72", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a4c1dddde91cdb4ecee8a850b1d4de302", null ] ] ], [ "Configuration", "structxpcc_1_1_configuration.html", [ [ "Configuration", "structxpcc_1_1_configuration.html#a33e82b594c0143d24ac417e2bf63c5bf", null ], [ "Configuration", "structxpcc_1_1_configuration.html#a9b6f131ab9f8f605ea1dbba2f827cb25", null ], [ "Configuration", "structxpcc_1_1_configuration.html#a88976ae52646048862d332258ee4880c", null ], [ "Configuration", "structxpcc_1_1_configuration.html#aab4ab78b84929e91ad02e9089ecba729", null ] ] ], [ "Value", "structxpcc_1_1_value.html", [ [ "Value", "structxpcc_1_1_value.html#a3a1a113c845e482023cda938e9fc10d9", null ], [ "Value", "structxpcc_1_1_value.html#ad7431a7a8a330bc6e5f731d73f3e65d1", null ], [ "Value", "structxpcc_1_1_value.html#a91e700c71206382d1edb9f4ab668c46b", null ] ] ], [ "XPCC_FLAGS8", "group__register.html#ga96c311392d636d6fd607dcb9bdc64b79", null ], [ "XPCC_FLAGS16", "group__register.html#gaad8d44188df911c618b5a770e8f3941c", null ], [ "XPCC_FLAGS32", "group__register.html#ga6fab1b65449b2ff0ab2dd9bcbc85224b", null ], [ "XPCC_TYPE_FLAGS", "group__register.html#ga7db670b9768fc70d490ac317fda5e8b2", null ], [ "Register8", "group__register.html#gac82600d3b4d79b80e601b8e03f4d3efb", null ], [ "Flags8", "group__register.html#ga893a272cf44433787b69b9097b01dc04", null ], [ "Register16", "group__register.html#gaf50110b5b40521dc0dc10cee6f3fe7ea", null ], [ "Register32", "group__register.html#ga13f6ff67091cdf706220bb3283342dbf", null ], [ "Flags16", "group__register.html#ga6590d0450d384cae9e9e626fb3efd504", null ], [ "Flags32", "group__register.html#ga878a50776c1c9e6d27bd82ad4c579efd", null ] ];<file_sep>/docs/api/classxpcc_1_1_graphic_display_1_1_writer.js var classxpcc_1_1_graphic_display_1_1_writer = [ [ "Writer", "classxpcc_1_1_graphic_display_1_1_writer.html#ae459703edd121abb7293173ae160c57a", null ], [ "write", "classxpcc_1_1_graphic_display_1_1_writer.html#a70c09ba1e43cb7ee698a214d0aa4da38", null ], [ "flush", "classxpcc_1_1_graphic_display_1_1_writer.html#a0b4a81a06ef182a33e2bc0780b9962e0", null ], [ "read", "classxpcc_1_1_graphic_display_1_1_writer.html#a79d7bf17def1dd612c7a9fba7730d4cc", null ] ];<file_sep>/docs/api/classxpcc_1_1_tmp102.js var classxpcc_1_1_tmp102 = [ [ "Tmp102", "classxpcc_1_1_tmp102.html#ae444ab0e2c0d7be648463484d9d19375", null ], [ "update", "classxpcc_1_1_tmp102.html#a702cadde302da544fa6002d5ac8532d4", null ], [ "setUpdateRate", "classxpcc_1_1_tmp102.html#a2ff83918abaab0b855a7c3ff5c4fb37c", null ], [ "enableExtendedMode", "classxpcc_1_1_tmp102.html#adeed72bf8d87b19ef6bd5ee732460d10", null ], [ "readComparatorMode", "classxpcc_1_1_tmp102.html#a1ad8b47409dfcc89c283dffbbdb84d8f", null ], [ "setUpperLimit", "classxpcc_1_1_tmp102.html#a72bbe466b5c90e57719875645edd2167", null ], [ "setLowerLimit", "classxpcc_1_1_tmp102.html#a68d93699054422d884b189bb5daeef06", null ], [ "startConversion", "classxpcc_1_1_tmp102.html#af636c4db11441248e2e10f143c9c46e4", null ], [ "getData", "classxpcc_1_1_tmp102.html#a33e688226daec293691d70c11f744a98", null ] ];<file_sep>/src/guide/qtcreator.md Make sure you have gone through the [Installation guide](http://xpcc.io/installation/) so you have the necessary toolchain installed. # Qt Creator integration This tutorial shows how to adapt the Qt Creator IDE for comfortable developing and debugging of xpcc projects on STM32 microcontrollers. This tutorial uses xpcc’s `hello-world` example project of [our `getting-started-with-xpcc` repository](https://github.com/roboterclubaachen/getting-started-with-xpcc) for the STM32F4 Discovery board. ## Installation Install [Qt Creator version 4.0 or above](https://www.qt.io/ide/). ``` # On Fedora 22 and up sudo dnf install qtcreator # On Ubuntu 16.04 sudo apt-get install qtcreator # On OS X brew cask install qtcreator ``` ## Global setup ### Enable Bare Metal plugin OS X: *Qt Creator* → *About Plugins...* Linux: *Help* → *About Plugins...* <center>![Enable BareMetal plugin](../images/qt-creator-tutorial/enable-baremetal-plugin.png)</center> Enable the BareMetal plugin and restart Qt Creator. ### Code Style OS X: *Qt Creator* → *Preferences...* Linux: Go to *Options* dialog: *Tools* → *Options...* Go to Tab *C++*, create a copy of the `Qt [builtin]` code style, name it `xpcc` and click *Edit...*. <center>![Code Style](../images/qt-creator-tutorial/code-style.png)</center> Set *Tab policy* to `Tabs only`, save and exit. ### Add debugger Refer to the [Installation guide](http://xpcc.io/installation/) on how to install the arm-none-eabi toolchain. In *Build & Run* and sub-tab *Debuggers* click *Add* to add the `arm-none-eabi-gdb` debugger to Qt Creator: <center>![Create new `arm-none-eabi-gdb` debugger](../images/qt-creator-tutorial/add-arm-none-eabi-gdb.png)</center> Qt Creator requires the debugger to support Python scripting. If you use the precompiled [arm-none-eabi toolchain from ARM](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads) you need to use `arm-none-eabi-gdb-py` here! For Linux distributions that ship the toolchain themselves and have Python scripting enabled by default, you can use `/usr/bin/arm-none-eabi-gdb` (without the `-py`). ### Add OpenOCD server If you have not installed OpenOCD yet, do so now: ``` # On Fedora 22 and up sudo dnf install openocd # On Ubuntu 16.04 sudo apt-get install openocd # On OS X brew install openocd --HEAD ``` Go to tab *Bare Metal* and select *Add* → *OpenOCD*. <!-- <center>![Add new OpenOCD GDB server provider](../images/qt-creator-tutorial/add-openocd-provider.png)</center> --> <center>![OpenOCD GDB server provider settings](../images/qt-creator-tutorial/openocd-provider-settings.png)</center> Use the following settings: - Startup mode: *Startup in TCP/IP Mode* - Executable file: Path to OpenOCD binary: `/usr/local/bin/openocd` (OS X), or `/usr/bin/openocd` (Linux) - Root scripts directory: Absolute path to OpenOCD script directory: `/usr/local/share/openocd/scripts` (OS X), or `/usr/share/openocd/scripts` (Linux) - Configuration File: `board/stm32f4discovery.cfg`, do not worry if the text field turns red. If you want to use other targets, create an *OpenOCD provider*, *Device* and *Kit* for each or them. Have a look at the OpenOCD script directory to find a configuration file for your target. ### Add target device For the next step go to the *Devices* tab and *Add...* a new *Bare Metal Device*. <!-- <center>![Add a new device](../images/qt-creator-tutorial/add-bare-metal-device.png)</center> --> Use the following settings: <center>![Qt Creator device settings](../images/qt-creator-tutorial/bare-metal-device-settings.png)</center> Again, go to tab *Build & Run*, sub-tab *Kits* and click *Add* to add a new so called Kit. <center>![Settings for the STM32F4-DISCO Kit](../images/qt-creator-tutorial/stm32f-kit-settings.png)</center> - Device type: *Bare Metal Device* - Device: *STM32F4-DISCO* (the device we just created) - Compiler: Irrelevant, we won't use it. - Debugger: *arm-none-eabi-gdb* - Qt version: *None* Click *Ok*. ## xpcc project setup Check out the getting started repository: ```sh git clone --recursive https://github.com/roboterclubaachen/getting-started-with-xpcc.git ``` Change to the project folder and run `scons qtcreator` to generate the Qt creator project files for the xpcc project: ```sh cd getting-started-with-xpcc/hello-world scons scons qtcreator scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... Template: 'getting-started-with-xpcc/xpcc/templates/qtcreator/project.creator.in' to 'hello-world.creator' Template: 'getting-started-with-xpcc/xpcc/templates/qtcreator/project.config.in' to 'hello-world.config' Template: 'getting-started-with-xpcc/xpcc/templates/qtcreator/project.files.in' to 'hello-world.files' Template: 'getting-started-with-xpcc/xpcc/templates/qtcreator/project.includes.in' to 'hello-world.includes' scons: done building targets. ``` Open project with Qt Creator: *File* → *Open File or Project* <center>![Select `*.creator` file](../images/qt-creator-tutorial/open-creator-file.png)</center> <center>![The view should be like this](../images/qt-creator-tutorial/qtcreator-1.png)</center> Select the *Projects* view from the *Mode Selector* on the left side (*Window* → *Show Mode Selector* if not visible). First, click *Add Kit* → *STM32F4-DISCO*, then remove the created *Default* using the icon to the right of it: *Default* → *Remove Kit*. <center>![Remove the desktop kit](../images/qt-creator-tutorial/remove-desktop-kit.png)</center> Next go to the *Build Settings* and remove all existing *Build Steps* and *Clean Steps* and: - add a new *Custom Process Step* build step with command `scons` and argument `program`. - add a new *Custom Process Step* clean step with command `scons` and argument `-c`. - add a custom `PATH` to the *System Environment*, if you need to. <center>![Qt Creator project build settings](../images/qt-creator-tutorial/project-build-settings.png)</center> Switch to *Run Settings* and select *Run on GDB server or hardware debugger* as *Run Configuration*. Select the **.elf*-file as executable. <center>![Qt creator project run settings](../images/qt-creator-tutorial/project-run-settings.png)</center> Congratulations, you can now compile, program and debug your xpcc application comfortably in Qt Creator. <file_sep>/docs/api/search/groups_f.js var searchData= [ ['temperature_20sensors',['Temperature sensors',['../group__driver__temperature.html',1,'']]], ['touch_20detection',['Touch Detection',['../group__driver__touch.html',1,'']]], ['timer',['Timer',['../group__stm32f407vg__timer.html',1,'']]], ['template_20metaprogramming',['Template Metaprogramming',['../group__tmp.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1_vl53l0.js var classxpcc_1_1_vl53l0 = [ [ "Vl53l0", "classxpcc_1_1_vl53l0.html#a493d95fb46e4743d48654cc29cdf1436", null ], [ "ping", "classxpcc_1_1_vl53l0.html#a7690693dc3320b0aee5424db103a8fa1", null ], [ "initialize", "classxpcc_1_1_vl53l0.html#a6aed3c7b2a489c440beb381a8219aefe", null ], [ "setDeviceAddress", "classxpcc_1_1_vl53l0.html#a6314ddf84c8d8f62c833f2adc0e43c2a", null ], [ "readDistance", "classxpcc_1_1_vl53l0.html#a393c549390eb6045d1a8d66072fa554c", null ], [ "getRangeError", "classxpcc_1_1_vl53l0.html#a25eaa22df8e039b5b9ad119558761185", null ], [ "updateRegister", "classxpcc_1_1_vl53l0.html#aa3b72e103f5459a22c9232229b17096b", null ], [ "getData", "classxpcc_1_1_vl53l0.html#ad77eba332a9ba2f102236f2c989cd634", null ], [ "setMaxMeasurementTime", "classxpcc_1_1_vl53l0.html#a115072359ea63862b41f2fa7ec635ccf", null ], [ "getMaxMeasurementTime", "classxpcc_1_1_vl53l0.html#abc6deef8aff2cfebb3c5d35d2b26bb61", null ] ];<file_sep>/docs/api/group__ds1302.js var group__ds1302 = [ [ "Ds1302", "classxpcc_1_1_ds1302.html", null ] ];<file_sep>/docs/api/structxpcc_1_1_geometric_traits_3_01double_01_4.js var structxpcc_1_1_geometric_traits_3_01double_01_4 = [ [ "FloatType", "structxpcc_1_1_geometric_traits_3_01double_01_4.html#ac3f389cbafaad684378234c4ba416961", null ], [ "WideType", "structxpcc_1_1_geometric_traits_3_01double_01_4.html#a30b5d78bd5bc0b7b6078a587aafe8fd1", null ] ];<file_sep>/docs/api/group__font.js var group__font = [ [ "AllCaps3x5", "group__font.html#gae131edda37f56c3f9bd50cc079959292", null ], [ "ArcadeClassic", "group__font.html#gaece3ff5d83b781645a78608f08edd863", null ], [ "Assertion", "group__font.html#gabcf7039891b79dfa4c148938c6a75730", null ], [ "FixedWidth5x8", "group__font.html#gaec9eae1fbc378e2cf66c172781bf3ab0", null ], [ "Matrix8x8", "group__font.html#gac867adf40d07df0c9939225488fa1cb9", null ], [ "Numbers14x32", "group__font.html#ga95649b45b685e1712891f1c93238b6bb", null ], [ "Numbers40x57", "group__font.html#gafe72f8c025ad0c1b49fd0305b2b8e6be", null ], [ "Numbers46x64", "group__font.html#ga54118cee96b5e3aac7d41aa8aefcb0dd", null ], [ "ScriptoNarrow", "group__font.html#ga6b8dfc4d1ff6621fbe286b0139bcdf3f", null ], [ "Ubuntu_36", "group__font.html#ga2f45da0f50ecf1f51b63c130685f0781", null ] ];<file_sep>/docs/api/classxpcc_1_1lpc_1_1_adc_manual_single.js var classxpcc_1_1lpc_1_1_adc_manual_single = [ [ "StartCondition", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653", [ [ "START_NOW", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653a4ed0b29cf189e1feaefe43f683aebb28", null ], [ "START_PIO0_2", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653ab627005d9e898ca0b3f0688f0084e95d", null ], [ "START_PIO1_5", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653a4f3a61ab85684c035f86b38895938521", null ], [ "START_CT32B0_MAT0", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653a81bc90a56bc90840d327c68f32a5cc7e", null ], [ "START_CT32B0_MAT1", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653ad7b7a9d195726bfed99144bbfd514b18", null ], [ "START_CT16B0_MAT0", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653a28cdbd20c1bba92dbef70514e92a708b", null ], [ "START_CT16B0_MAT1", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2690cf3725b00a400079ede002a32653a4a27b4466002a6ffd759d84b8bf6c46e", null ] ] ], [ "StartEdge", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2fcc19f69e637fbe6a8f1bf78f386a8d", [ [ "RISING", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2fcc19f69e637fbe6a8f1bf78f386a8dab3762d500f2ada6030da058853c195d6", null ], [ "FALLING", "classxpcc_1_1lpc_1_1_adc_manual_single.html#a2fcc19f69e637fbe6a8f1bf78f386a8da4f9d4539ac1e11a251e2afe022eba4e6", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1_i2c_transaction_1_1_writing.js var structxpcc_1_1_i2c_transaction_1_1_writing = [ [ "Writing", "structxpcc_1_1_i2c_transaction_1_1_writing.html#a91a98ed32eaa91459c194f1a0d355b1a", null ], [ "buffer", "structxpcc_1_1_i2c_transaction_1_1_writing.html#afff0ae8b30c62b9bc414e6413b01b5f2", null ], [ "length", "structxpcc_1_1_i2c_transaction_1_1_writing.html#ae9cfb2906f10a2cd01321604dab7de35", null ], [ "next", "structxpcc_1_1_i2c_transaction_1_1_writing.html#ab88ca96e4551d2e0729b0a048ab03846", null ] ];<file_sep>/docs/api/classxpcc_1_1_bounded_deque_1_1const__iterator.js var classxpcc_1_1_bounded_deque_1_1const__iterator = [ [ "const_iterator", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a33ff5d79ce5b9bdadd7dd389ecad19bf", null ], [ "const_iterator", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a429def27e9ff2876321b91904bd00e58", null ], [ "operator=", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a8018b6f2de59de31c4937ce0f678d55d", null ], [ "operator++", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#aeccf95307404d9abbc3f7e0326d9fbce", null ], [ "operator--", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a0daaf97e83ab9e7b26ecc665dab4fd12", null ], [ "operator==", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a3982764aeec831b525ef6ec78041f1a3", null ], [ "operator!=", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a4659da9815f787e7a5213e7e3f244487", null ], [ "operator*", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a26e02a746c495e628ce2b2d89dc44a72", null ], [ "operator->", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#aa6edd253d63db0d3b3485ac9f87768a4", null ], [ "BoundedDeque", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a0963c95bc99b14c0d114006148771887", null ] ];<file_sep>/docs/api/structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask_short.js var structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask_short = [ [ "ExtendedFilterMaskShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask_short.html#ad06c8bee4f74f713e1b27813ec4dfd9d", null ], [ "operator uint16_t", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_filter_mask_short.html#aaaa53d377630d77c6931ab23a8f8b515", null ] ];<file_sep>/docs/api/group__resumable.js var group__resumable = [ [ "NestedResumable", "classxpcc_1_1_nested_resumable.html", [ [ "NestedResumable", "classxpcc_1_1_nested_resumable.html#a484d5699e2e38fa7635911fcbfa27ef8", null ], [ "stopResumable", "classxpcc_1_1_nested_resumable.html#ae55408162e3606d174c9391c9fc82d0c", null ], [ "isResumableRunning", "classxpcc_1_1_nested_resumable.html#a0c3b3d2db6cc352c351b661773ddf228", null ], [ "getResumableDepth", "classxpcc_1_1_nested_resumable.html#a69d709c2fc46674945ef502b068d8cb1", null ] ] ], [ "ResumableResult", "structxpcc_1_1_resumable_result.html", [ [ "ResumableResult", "structxpcc_1_1_resumable_result.html#a6fee477fa4f295d5f15eec1e0870cab9", null ], [ "ResumableResult", "structxpcc_1_1_resumable_result.html#ad7c25dfa013c49907e88c03a680c4325", null ], [ "getState", "structxpcc_1_1_resumable_result.html#a6d1dac08035f4992e0e244e53e98171f", null ], [ "getResult", "structxpcc_1_1_resumable_result.html#ae0da63e99f2720ea874d0c98eb11a9d2", null ] ] ], [ "Resumable", "classxpcc_1_1_resumable.html", [ [ "Resumable", "classxpcc_1_1_resumable.html#ab5407c162cdf0d4f6ec64bd0e7e08a62", null ], [ "stopAllResumables", "classxpcc_1_1_resumable.html#a7d6a7a3dd3e718674009d7c8f9f7ded5", null ], [ "stopResumable", "classxpcc_1_1_resumable.html#a248c8ea10f003e90da6e735bb513953f", null ], [ "isResumableRunning", "classxpcc_1_1_resumable.html#a25da41992bfa7bd129aca048a257d649", null ], [ "areAnyResumablesRunning", "classxpcc_1_1_resumable.html#a359d87fdc7d60de8b99e151566e22383", null ], [ "areAnyResumablesRunning", "classxpcc_1_1_resumable.html#a196fc7b54aa5aa74f09a19024212ad82", null ], [ "areAllResumablesRunning", "classxpcc_1_1_resumable.html#add85af846745935a9ebcbcfcec177c0c", null ], [ "joinResumables", "classxpcc_1_1_resumable.html#aedc20cfcb7b61074d2065e476e23bd9a", null ] ] ], [ "RF_BEGIN", "group__resumable.html#gac8a210fcd55041e209c715e6c2d20046", null ], [ "RF_BEGIN", "group__resumable.html#gadb13fb5ba3b91305efb86b131157b7e1", null ], [ "RF_END_RETURN", "group__resumable.html#gadae4d1967a2940541461c43be4e32772", null ], [ "RF_END", "group__resumable.html#ga2052f0001fb0e336a076e5e2c9ef769e", null ], [ "RF_END_RETURN_CALL", "group__resumable.html#gab96493c0cfb6c1da968c8dfb0d39ba3f", null ], [ "RF_YIELD", "group__resumable.html#ga50fda47255530910b40d0e883b097f68", null ], [ "RF_WAIT_THREAD", "group__resumable.html#gac58b699432d4e11a92a7e10c5bb8b36d", null ], [ "RF_WAIT_WHILE", "group__resumable.html#ga28077ce37251f81f1def791421af551d", null ], [ "RF_WAIT_UNTIL", "group__resumable.html#gaf68766e4a9dae0d7b42b0e82d3d3f7ad", null ], [ "RF_CALL", "group__resumable.html#ga6201af643c44f46e0448a2fb612a03b2", null ], [ "RF_CALL_BLOCKING", "group__resumable.html#gafd59ed8e97e74cda1c1ef58fcee95988", null ], [ "RF_RETURN_CALL", "group__resumable.html#gaefb8c4d6c23c55a9718295ef5810cff2", null ], [ "RF_RETURN", "group__resumable.html#ga51baeaa00320b4f640c229ff8dbf7ef8", null ], [ "RF_RETURN", "group__resumable.html#ga068f9f637000e3da0f8d04d8b4e88f95", null ], [ "XPCC_RESUMABLE_CHECK_NESTING_DEPTH", "group__resumable.html#ga10fc62ea34c6aa7550012b8a0f8bc9f3", null ] ];<file_sep>/docs/api/classxpcc_1_1fat_1_1_directory.js var classxpcc_1_1fat_1_1_directory = [ [ "directory", "classxpcc_1_1fat_1_1_directory.html#a6a2805c1593066ebf57910c461da8193", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_dma1.js var classxpcc_1_1stm32_1_1_dma1 = [ [ "Stream0", "classxpcc_1_1stm32_1_1_dma1_1_1_stream0.html", null ], [ "Stream1", "classxpcc_1_1stm32_1_1_dma1_1_1_stream1.html", null ], [ "Stream2", "classxpcc_1_1stm32_1_1_dma1_1_1_stream2.html", null ], [ "Stream3", "classxpcc_1_1stm32_1_1_dma1_1_1_stream3.html", null ], [ "Stream4", "classxpcc_1_1stm32_1_1_dma1_1_1_stream4.html", null ], [ "Stream5", "classxpcc_1_1stm32_1_1_dma1_1_1_stream5.html", null ], [ "Stream6", "classxpcc_1_1stm32_1_1_dma1_1_1_stream6.html", null ], [ "Stream7", "classxpcc_1_1stm32_1_1_dma1_1_1_stream7.html", null ] ];<file_sep>/docs/api/classxpcc_1_1allocator_1_1_static.js var classxpcc_1_1allocator_1_1_static = [ [ "rebind", "classxpcc_1_1allocator_1_1_static.html#structxpcc_1_1allocator_1_1_static_1_1rebind", [ [ "other", "classxpcc_1_1allocator_1_1_static.html#a4f919a234b77474092bb01f97e7f841c", null ] ] ], [ "Static", "classxpcc_1_1allocator_1_1_static.html#a6fb1ef279139d02cb69259237b46cce2", null ], [ "Static", "classxpcc_1_1allocator_1_1_static.html#a514f9bf841927f374e90d84277631de5", null ], [ "Static", "classxpcc_1_1allocator_1_1_static.html#a70e47dd4914abbf97150dc39490d5ea5", null ], [ "allocate", "classxpcc_1_1allocator_1_1_static.html#ac2479755a473e0ff255b3329621193d8", null ], [ "deallocate", "classxpcc_1_1allocator_1_1_static.html#a44dc04c214703fcbc4064feaeb7ed979", null ] ];<file_sep>/docs/api/group__display__menu.js var group__display__menu = [ [ "AbstractMenu", "classxpcc_1_1_abstract_menu.html", [ [ "AbstractMenu", "classxpcc_1_1_abstract_menu.html#a48918191696dfa6e3c6a9bb41ba43895", null ], [ "shortButtonPress", "classxpcc_1_1_abstract_menu.html#a50460345d9d3d6fc731f4fa0868e3b0a", null ] ] ], [ "AbstractView", "classxpcc_1_1_abstract_view.html", [ [ "AbstractView", "classxpcc_1_1_abstract_view.html#a99357fa5ed844c39beb12e0ae8f76df4", null ], [ "~AbstractView", "classxpcc_1_1_abstract_view.html#a0f9980986c50e15a9dcd9325345dde95", null ], [ "update", "classxpcc_1_1_abstract_view.html#ac7e1e9691c503b0cde8ef7c92c8624cd", null ], [ "hasChanged", "classxpcc_1_1_abstract_view.html#aac1ece11dad3d983a08559617dd835f5", null ], [ "draw", "classxpcc_1_1_abstract_view.html#abcc3376d3d938ca9f66923b025d9b205", null ], [ "shortButtonPress", "classxpcc_1_1_abstract_view.html#aa88d8a4ad62fadc9542f1cb765907fd3", null ], [ "isAlive", "classxpcc_1_1_abstract_view.html#a0cbcf339a93d03c9734da316c2061fdd", null ], [ "remove", "classxpcc_1_1_abstract_view.html#a09abded7166e1d2efbef19c374f52349", null ], [ "getIdentifier", "classxpcc_1_1_abstract_view.html#a99b048e66790d3bbbc8c586d9b2082df", null ], [ "display", "classxpcc_1_1_abstract_view.html#a4416378a0f604018eea966d1e4901656", null ], [ "onRemove", "classxpcc_1_1_abstract_view.html#a26fd3e9d545bc88f3825ae3b1054263b", null ], [ "getViewStack", "classxpcc_1_1_abstract_view.html#a5af10ab104234515698722bbda5b5642", null ], [ "ViewStack", "classxpcc_1_1_abstract_view.html#ab1b547848ee5b48ec6212730c0692dce", null ], [ "identifier", "classxpcc_1_1_abstract_view.html#adfdcad9b56306a5d77c85034d055b4c7", null ], [ "alive", "classxpcc_1_1_abstract_view.html#a62be69db682328212bb107993a1dc68f", null ] ] ], [ "ChoiceMenu", "classxpcc_1_1_choice_menu.html", [ [ "EntryList", "classxpcc_1_1_choice_menu.html#a1760d449d6b7c0ca082b7eb8458f43b7", null ], [ "ChoiceMenu", "classxpcc_1_1_choice_menu.html#a3977d0a20dee914c2c18f5392337f95d", null ], [ "ChoiceMenu", "classxpcc_1_1_choice_menu.html#a6b043d5e3f16a7789576adfc506957c4", null ], [ "addEntry", "classxpcc_1_1_choice_menu.html#a5f342d7dfbd4fe58d94d31877ed69299", null ], [ "initialise", "classxpcc_1_1_choice_menu.html#a7fcd0b1a3011c40eaa96be78cb6dfedb", null ], [ "setTitle", "classxpcc_1_1_choice_menu.html#a0cf84e208376772e6841a9c4b596432f", null ], [ "shortButtonPress", "classxpcc_1_1_choice_menu.html#ae6eae417776ea0fe703b20e1c126ae6c", null ], [ "hasChanged", "classxpcc_1_1_choice_menu.html#a23cff61305df901c6c036494f7588d65", null ], [ "draw", "classxpcc_1_1_choice_menu.html#af98b0d9e97b2852fb154446210624c5e", null ], [ "openNextScreen", "classxpcc_1_1_choice_menu.html#ada78ebf9a556dbd48bff56bda377767c", null ], [ "entries", "classxpcc_1_1_choice_menu.html#a22200691f4cbe53204fff90cb9b46de0", null ] ] ], [ "ScrollableText", "classxpcc_1_1_scrollable_text.html", [ [ "ScrollableText", "classxpcc_1_1_scrollable_text.html#a935a79b9966b80980eb2ebcc190a85c3", null ], [ "ScrollableText", "classxpcc_1_1_scrollable_text.html#ae12acf0b7637a29921a1855a6a6a7e74", null ], [ "~ScrollableText", "classxpcc_1_1_scrollable_text.html#a3ee31d488789793a8c8529d5a38a5366", null ], [ "operator=", "classxpcc_1_1_scrollable_text.html#aaad4b063957919f792c098ac8ee6f2cd", null ], [ "needsScrolling", "classxpcc_1_1_scrollable_text.html#aa46e9b145ad105d47dea972c76227e08", null ], [ "getText", "classxpcc_1_1_scrollable_text.html#a37924278ba0d83d38fc2bb3ae7b06fc7", null ], [ "toogle", "classxpcc_1_1_scrollable_text.html#aa20d3db015c9d03f1c724de4900889ec", null ], [ "scroll", "classxpcc_1_1_scrollable_text.html#a16b12a1d4f04a7661131616cb27ffc26", null ], [ "pause", "classxpcc_1_1_scrollable_text.html#a526933432f08fdc6e428fb8ab2c847ce", null ], [ "setToStart", "classxpcc_1_1_scrollable_text.html#ab4f8dcd569da0d36bfa7b99ff9073509", null ], [ "isPaused", "classxpcc_1_1_scrollable_text.html#ad3bcc4eca4a632f73b05c2df02a48f8e", null ] ] ], [ "MenuEntry", "structxpcc_1_1_menu_entry.html", [ [ "MenuEntry", "structxpcc_1_1_menu_entry.html#a6ff02e2307175a9309648b0e0a58dbfc", null ], [ "text", "structxpcc_1_1_menu_entry.html#a2ce321ab37c18e35af84955b257e29c7", null ], [ "callback", "structxpcc_1_1_menu_entry.html#ad7571cb4e65856420b115fa4d9b47702", null ] ] ], [ "StandardMenu", "classxpcc_1_1_standard_menu.html", [ [ "EntryList", "classxpcc_1_1_standard_menu.html#a932faca8fa10b2857ebfecb3bfee9205", null ], [ "StandardMenu", "classxpcc_1_1_standard_menu.html#a4a851f9f8ea5163dd72a526f98cbb3c6", null ], [ "~StandardMenu", "classxpcc_1_1_standard_menu.html#a4168d6f028d94a7f749b4977ffbd0029", null ], [ "StandardMenu", "classxpcc_1_1_standard_menu.html#a31ec77137e2813e6c80b454ba36481b5", null ], [ "addEntry", "classxpcc_1_1_standard_menu.html#a3cb73e54a23418aa8becf7ed9b9d8da9", null ], [ "setTitle", "classxpcc_1_1_standard_menu.html#a14eb30309c8c876cb9abdf066962c898", null ], [ "shortButtonPress", "classxpcc_1_1_standard_menu.html#a04f5f737e5acf24c007f69582d9bd428", null ], [ "hasChanged", "classxpcc_1_1_standard_menu.html#aafb415651a31a46a7d514e8b55e76b80", null ], [ "draw", "classxpcc_1_1_standard_menu.html#a58f5bf9a58476b931db61e8531965fc3", null ], [ "selectedEntryFunction", "classxpcc_1_1_standard_menu.html#a1e6bd6f1773e5d99c6096ea853e25435", null ], [ "setUpdateTime", "classxpcc_1_1_standard_menu.html#afb8656ddae8db697c9f15fc96999cb55", null ], [ "entries", "classxpcc_1_1_standard_menu.html#a8eb56d81a256a66b714c5a43c6f4a9df", null ] ] ], [ "ViewStack", "classxpcc_1_1_view_stack.html", [ [ "ViewStack", "classxpcc_1_1_view_stack.html#a547bc57bda734543e08fe07f2d4be8a0", null ], [ "~ViewStack", "classxpcc_1_1_view_stack.html#abee5a6c1e33ad89a59f215d08499f55a", null ], [ "get", "classxpcc_1_1_view_stack.html#a86cd18412f27b69657b413526c067487", null ], [ "push", "classxpcc_1_1_view_stack.html#af450c7c038e885ec60dd06913b9a24eb", null ], [ "getDisplay", "classxpcc_1_1_view_stack.html#a3349dbfa59503e5450617386524d59ce", null ], [ "pop", "classxpcc_1_1_view_stack.html#a9a59c99bd926240bf941a4a7af5b95ef", null ], [ "update", "classxpcc_1_1_view_stack.html#a400d0aebf86648999d971749f0a905b7", null ], [ "shortButtonPress", "classxpcc_1_1_view_stack.html#ac632c9a617885b9a42b74c07c4cc1329", null ], [ "display", "classxpcc_1_1_view_stack.html#ad33872862c277b3fe52ca80840ddc39b", null ], [ "stack", "classxpcc_1_1_view_stack.html#a9982d07a99a3c3be435e6e2884ae6e2e", null ] ] ], [ "Button", "group__display__menu.html#ga39086596b10fefccbda908be340c5fa3", null ] ];<file_sep>/docs/api/structxpcc_1_1ds1302_1_1_data.js var structxpcc_1_1ds1302_1_1_data = [ [ "getSeconds", "structxpcc_1_1ds1302_1_1_data.html#a08b364d64a308dce1e362e7c4882c900", null ], [ "getMinutes", "structxpcc_1_1ds1302_1_1_data.html#a7c5cf4e0a5a90e1f2916549b3dc9bb58", null ], [ "is24hours", "structxpcc_1_1ds1302_1_1_data.html#af45eb507f8ae0aad272e8bf3f04e5a81", null ], [ "isPm", "structxpcc_1_1ds1302_1_1_data.html#a74a17dcf4ea9704787642524ee9219c8", null ], [ "isAm", "structxpcc_1_1ds1302_1_1_data.html#a125ccb301bcec824b7e846c5cffa8aaa", null ], [ "getHours", "structxpcc_1_1ds1302_1_1_data.html#a058f892f2e895e55ace01b8fdc31c6ff", null ], [ "getDate", "structxpcc_1_1ds1302_1_1_data.html#a8b8e87b25109f861fe59a89e82f81a29", null ], [ "getMonth", "structxpcc_1_1ds1302_1_1_data.html#a6d88b3e7181c250c7dd3ad061aa5d511", null ], [ "getDayOfWeek", "structxpcc_1_1ds1302_1_1_data.html#a25e7fd8c1096676887b07f87eedcd6d4", null ], [ "getYear", "structxpcc_1_1ds1302_1_1_data.html#a6eee04ea9fd65fc4cc48d64abc468246", null ], [ "isWriteProtected", "structxpcc_1_1ds1302_1_1_data.html#a3be1f088d15c25b0ad4ca844f5800244", null ], [ "doubleBcdToDecimal", "structxpcc_1_1ds1302_1_1_data.html#a045cab1270de664471f1092378e64b51", null ], [ "data", "structxpcc_1_1ds1302_1_1_data.html#a89b1a470569dd1d46e2a130cc9bacfba", null ] ];<file_sep>/docs/api/classxpcc_1_1bme280data_1_1_data_double.js var classxpcc_1_1bme280data_1_1_data_double = [ [ "getTemperature", "classxpcc_1_1bme280data_1_1_data_double.html#ac184bfbba7488476c8a513e3ba52a4e8", null ], [ "getTemperature", "classxpcc_1_1bme280data_1_1_data_double.html#ad3676e2828b5815832aa5ea623c31e1e", null ], [ "getTemperature", "classxpcc_1_1bme280data_1_1_data_double.html#aba965cab260a82f89b0ede978e122de7", null ], [ "getTemperature", "classxpcc_1_1bme280data_1_1_data_double.html#abd40971579a10cc1272ec9060e29ad3d", null ], [ "getPressure", "classxpcc_1_1bme280data_1_1_data_double.html#a931d309aa69566b582619c98c0110b1a", null ], [ "getHumidity", "classxpcc_1_1bme280data_1_1_data_double.html#a79774deca7925d45afb60fc57c66470c", null ], [ "calculateCalibratedTemperature", "classxpcc_1_1bme280data_1_1_data_double.html#afef9b42d890cef3a267c5b613fe52c49", null ], [ "calculateCalibratedPressure", "classxpcc_1_1bme280data_1_1_data_double.html#a2c3451cc8296cff8ed8f262d832ca689", null ], [ "calculateCalibratedHumidity", "classxpcc_1_1bme280data_1_1_data_double.html#ade2b197f54d1e37b70dce0f3ad40a0b2", null ] ];<file_sep>/docs/api/structxpcc_1_1hmc6343_1_1_data.js var structxpcc_1_1hmc6343_1_1_data = [ [ "getAccelerationX", "structxpcc_1_1hmc6343_1_1_data.html#af25f76044b59d9ee7907ad5bb2722c7b", null ], [ "getAccelerationY", "structxpcc_1_1hmc6343_1_1_data.html#adcaed1f5bfeef78dbd20fd46d3bef408", null ], [ "getAccelerationZ", "structxpcc_1_1hmc6343_1_1_data.html#a605f38d3a6647f19235bfcafcefb5b3a", null ], [ "getMagneticFieldX", "structxpcc_1_1hmc6343_1_1_data.html#a7dcef9b7210bd08eb6d131be55fdc927", null ], [ "getMagneticFieldY", "structxpcc_1_1hmc6343_1_1_data.html#adc1f69d8ea3c2cd888519a80bfc95401", null ], [ "getMagneticFieldZ", "structxpcc_1_1hmc6343_1_1_data.html#a2151807a8da738da93ee568e0f0f3431", null ], [ "getHeading", "structxpcc_1_1hmc6343_1_1_data.html#af278355263c364b3606b5acd98c4e243", null ], [ "getPitch", "structxpcc_1_1hmc6343_1_1_data.html#aca5170cb3aebf697bae58f8e62a87414", null ], [ "getRoll", "structxpcc_1_1hmc6343_1_1_data.html#a9b7d067c0c25e2b106c1ff76fbac21c9", null ], [ "getTemperature", "structxpcc_1_1hmc6343_1_1_data.html#a7dc84159fd3feabe0d493710cb09469e", null ], [ "getOperationMode", "structxpcc_1_1hmc6343_1_1_data.html#a78efaa482d6fafd17de8f2406f1c2856", null ], [ "operator[]", "structxpcc_1_1hmc6343_1_1_data.html#a0d04acb09d7fc770111b6c100acbd680", null ], [ "Hmc6343", "structxpcc_1_1hmc6343_1_1_data.html#a60354b27e2a0613ca15fd5752326fdf8", null ] ];<file_sep>/docs/api/namespacexpcc_1_1tmp_structxpcc_1_1tmp_1_1_select_3_01false_00_01_t_00_01_u_01_4_dup.js var namespacexpcc_1_1tmp_structxpcc_1_1tmp_1_1_select_3_01false_00_01_t_00_01_u_01_4_dup = [ [ "Result", "namespacexpcc_1_1tmp.html#a0b8288c3e1d14be4a75e6a90ee0fb0ce", null ] ];<file_sep>/docs/api/structxpcc_1_1tmp102_1_1_data.js var structxpcc_1_1tmp102_1_1_data = [ [ "getTemperature", "structxpcc_1_1tmp102_1_1_data.html#a7391c0f595a0a3ec8d3b39c4e842ca45", null ], [ "getTemperatureInteger", "structxpcc_1_1tmp102_1_1_data.html#abd145da86151b7d57fe6dd85539ba1d4", null ], [ "Tmp102", "structxpcc_1_1tmp102_1_1_data.html#a997cb64bdb2014224d7b50f1fb6ec1d5", null ] ];<file_sep>/docs/api/structxpcc_1_1ft6x06.js var structxpcc_1_1ft6x06 = [ [ "Data", "structxpcc_1_1ft6x06_1_1_data.html", "structxpcc_1_1ft6x06_1_1_data" ], [ "touch_t", "structxpcc_1_1ft6x06_1_1touch__t.html", "structxpcc_1_1ft6x06_1_1touch__t" ], [ "Gesture", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9e", [ [ "NoGesture", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9ea12d85ea8bedef9f5049438582c58d08d", null ], [ "MoveUp", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9eaa56a3ff692c679e34e0f52202fd9be5c", null ], [ "MoveRight", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9ea78af9b7fcdf1574f729de1454e15257b", null ], [ "MoveDown", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9ea8c95fa949833ae3c6a217f55dec17dd5", null ], [ "MoveLeft", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9eae8a98c6fabdea857c20c91e9bfd318ca", null ], [ "ZoomIn", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9ea5a0f3c981ba9ec235133016ef47d447f", null ], [ "ZoomOut", "structxpcc_1_1ft6x06.html#a1027dacbc138c4a78597baff31c6ab9ea2f0d8494b24b27f03ae198ee780b8b03", null ] ] ], [ "Event", "structxpcc_1_1ft6x06.html#a1b3f795e9afab52164f9031d4f2899b6", [ [ "NoEvent", "structxpcc_1_1ft6x06.html#a1b3f795e9afab52164f9031d4f2899b6a9b8e7e8d81a268a2240a96b7962a0183", null ], [ "PressDown", "structxpcc_1_1ft6x06.html#a1b3f795e9afab52164f9031d4f2899b6a162ac8adde4f1714680610dc7236bbab", null ], [ "LiftUp", "structxpcc_1_1ft6x06.html#a1b3f795e9afab52164f9031d4f2899b6a9abbaa6f225d37c86e4aabf2f5f2185f", null ], [ "Contact", "structxpcc_1_1ft6x06.html#a1b3f795e9afab52164f9031d4f2899b6abbaff12800505b22a853e8b7f4eb6a22", null ] ] ], [ "InterruptMode", "structxpcc_1_1ft6x06.html#a44092b3643dcb1c3a531a166e7dbaa55", [ [ "Polling", "structxpcc_1_1ft6x06.html#a44092b3643dcb1c3a531a166e7dbaa55ade20877b0f870524114c6e0a571dcc6b", null ], [ "Trigger", "structxpcc_1_1ft6x06.html#a44092b3643dcb1c3a531a166e7dbaa55af698f67f5666aff10729d8a1cb1c14d2", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_saturated.js var classxpcc_1_1_saturated = [ [ "Saturated", "classxpcc_1_1_saturated.html#aa8c12c0a646449c4c27c96a73fc45ef0", null ], [ "Saturated", "classxpcc_1_1_saturated.html#a4e33eb32d57c9d4d435dc23f4ae6a1e2", null ], [ "getValue", "classxpcc_1_1_saturated.html#ad5e15b07ecefe9cf4515626c18016bc3", null ], [ "operator+=", "classxpcc_1_1_saturated.html#a468c112d6ff737f842f7fb3b09822a80", null ], [ "operator-=", "classxpcc_1_1_saturated.html#a124402c79f88e60a8add8409c28104d7", null ], [ "absolute", "classxpcc_1_1_saturated.html#ae13ec568e4b464339b5c69bee3757994", null ], [ "operator-", "classxpcc_1_1_saturated.html#ad3c1d1016da4a9f48ee8d357b4de3c8a", null ], [ "abs", "classxpcc_1_1_saturated.html#a29321a0fcf37a4d88292830593460a91", null ], [ "operator-", "classxpcc_1_1_saturated.html#a1cb3572bff02c15241305c741f0da7fd", null ], [ "operator+", "classxpcc_1_1_saturated.html#a992f08b0aa2a0f5bce837a1fe557d6de", null ], [ "operator==", "classxpcc_1_1_saturated.html#a976457c8ac01a2c7d2c93acb2a9cd4c3", null ], [ "operator!=", "classxpcc_1_1_saturated.html#aa1f21025d903b7239f9d92c33e0d0af7", null ] ];<file_sep>/markdeep_diagram.py import re import os import string import base64 import tempfile import markdown import hashlib from selenium import webdriver from subprocess import call, PIPE # Defines our basic inline image DIAGRAM_EXPR = "<center class=\"md\">{}</center>" # Base CSS template DIAGRAM_CSS = r"""<style scoped> svg.diagram{display:block;font-family:'Ubuntu Mono';font-size:14px;text-align:center;stroke-linecap:round;stroke-width:1.5px;stroke:#000;fill:#000}.md svg.diagram .opendot{fill:#FFF}.md svg.diagram text{stroke:none}.md </style> """ class MarkdeepDiagramPreprocessor(markdown.preprocessors.Preprocessor): # These are our cached expressions that are stored in latex.cache cached = {} # Basic markdeep setup markdeep_preamble = r""" <!DOCTYPE html> <html> <body> <diagram> {} </diagram> <script>window.markdeepOptions = {{mode: 'html'}};</script> <script src="https://casual-effects.com/markdeep/latest/markdeep.min.js"></script> </body> </html> """ def __init__(self, configs): try: cache_file = open('markdeep.cache', 'r+') for line in cache_file.readlines(): key, val = line.strip("\n").split("$") self.cached[key] = val except IOError: pass self.re_diagram = re.compile(r'<markdeep-diagram>[\n\r]*(?P<code>.*?)[\n\r]*</markdeep-diagram>', re.MULTILINE | re.DOTALL) def _diagram_to_svg(self, markdeep): """Generates a SVG representation of Diagram string""" import urlparse, urllib def path2url(path): return urlparse.urljoin( 'file:', urllib.pathname2url(os.path.abspath(path))) # Generate the temporary file tempfile.tempdir = "" tmp_file_fd, path = tempfile.mkstemp() with open(path + ".html", "w") as fd: fd.write(self.markdeep_preamble.format(markdeep + " ")) driver = webdriver.PhantomJS() # or add to your PATH driver.set_window_size(1024*2, 768*2) # optional driver.get(path2url(path + ".html")) ps = driver.page_source driver.quit() re_svg = re.compile("<svg.*?</svg>", re.MULTILINE | re.DOTALL) svg = re_svg.findall(ps)[0] fsvg = "%s.svg" % path fsvgo = "%s-opt.svg" % path with open(fsvg, "w") as f: f.write(svg) cmd = "svgo --multipass %s %s" % (fsvg, fsvgo) status = call(cmd.split(), stdout=PIPE) # Read the png and encode the data svg = open(fsvgo, "rb") data = svg.read() svg.close() self._cleanup(path) return data def _cleanup(self, path, err=False): # don't clean up the log if there's an error extensions = ["", "-opt.svg", ".svg", ".html"] if err: extensions.pop() # now do the actual cleanup, passing on non-existent files for extension in extensions: try: os.remove("%s%s" % (path, extension)) except (IOError, OSError): pass def run(self, lines): """Parses the actual page""" # Re-creates the entire page so we can parse in a multine env. page = "\n".join(lines) # Figure out our text strings and math-mode strings tex_expr = [(self.re_diagram, x) for x in self.re_diagram.findall(page)] # No sense in doing the extra work if not len(tex_expr): return page.split("\n") # Parse the expressions new_cache = {} id = 0 for reg, expr in tex_expr: # print reg, mode, expr hash_expr = hashlib.sha1(expr).hexdigest() if hash_expr in self.cached: data = self.cached[hash_expr] else: print expr data = self._diagram_to_svg(expr) new_cache[hash_expr] = data id += 1 diagram = DIAGRAM_EXPR.format(data) page = reg.sub(diagram, page, 1) # Cache our data cache_file = open('markdeep.cache', 'a') for key, value in new_cache.items(): cache_file.write("%s$%s\n" % (key, value)) cache_file.close() # Make sure to resplit the lines return page.split("\n") class MarkdeepDiagramPostprocessor(markdown.postprocessors.Postprocessor): """This post processor extension just allows us to further refine, if necessary, the document after it has been parsed.""" def run(self, text): # Inline a style for default behavior text = DIAGRAM_CSS + text return text class MarkdeepDiagram(markdown.Extension): """Wrapper for LaTeXPreprocessor""" def extendMarkdown(self, md, md_globals): # Our base LaTeX extension md.preprocessors.add('markdeep', MarkdeepDiagramPreprocessor(self), ">html_block") # Our cleanup postprocessing extension md.postprocessors.add('markdeep', MarkdeepDiagramPostprocessor(self), ">amp_substitute") def makeExtension(*args, **kwargs): """Wrapper for a MarkDeep extension""" return MarkdeepDiagram(*args, **kwargs) <file_sep>/docs/api/classxpcc_1_1_tft_memory_bus8_bit_gpio.js var classxpcc_1_1_tft_memory_bus8_bit_gpio = [ [ "BUS", "classxpcc_1_1_tft_memory_bus8_bit_gpio.html#a51ac6fa75a80460ac0a23e040117cc85", null ] ];<file_sep>/docs/api/classxpcc_1_1_mcp2515.js var classxpcc_1_1_mcp2515 = [ [ "SpiCommand", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68", [ [ "RESET", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ae12f7a67ab5087b2206b64cbefb9b56e", null ], [ "READ", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ad6564b6bc88869910920adece16956e2", null ], [ "READ_RX", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68aae51ece4ce832937b636cf37c1aebe3b", null ], [ "WRITE", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ac4c41f65b63f86c138f7fde81903ff2e", null ], [ "WRITE_TX", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68af7df8965bf007f2c37dbe2068bf84b7f", null ], [ "RTS", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68af2ef3880a6e98104f78dca881eb79397", null ], [ "READ_STATUS", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68a8c6984304f341bf66ffa4478066ab77c", null ], [ "RX_STATUS", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68afa75320b54228e407ce1947998e8c029", null ], [ "BIT_MODIFY", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68afe25d9967d9577841207ef05eeebc411", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1ds1631.js var structxpcc_1_1ds1631 = [ [ "Data", "structxpcc_1_1ds1631.html#a0f70be58e87a09a3e03c97469e3a643d", null ], [ "ConversionMode", "structxpcc_1_1ds1631.html#ad739bf33815c626351443db3b70043b4", [ [ "Continous", "structxpcc_1_1ds1631.html#ad739bf33815c626351443db3b70043b4ac7b4a7b11db72be8e0755d14d63d0a58", null ], [ "OneShot", "structxpcc_1_1ds1631.html#ad739bf33815c626351443db3b70043b4ac7fc2ee61fad0e2bba6754efdee31481", null ] ] ], [ "AlertPolarity", "structxpcc_1_1ds1631.html#a3e3d1a54a30aedaf5d8343fe2b1d2495", [ [ "ActiveLow", "structxpcc_1_1ds1631.html#a3e3d1a54a30aedaf5d8343fe2b1d2495a06d7f9066ffa302a03435a26fb345168", null ], [ "ActiveHigh", "structxpcc_1_1ds1631.html#a3e3d1a54a30aedaf5d8343fe2b1d2495a5d51eb090a6bb620cf3aa90c6e5b0797", null ] ] ], [ "Resolution", "structxpcc_1_1ds1631.html#a0b5db0b7800864b40492a331746333f1", [ [ "Bits9", "structxpcc_1_1ds1631.html#a0b5db0b7800864b40492a331746333f1a74f377712b88917ebfde6f7882f0aa2e", null ], [ "Bits10", "structxpcc_1_1ds1631.html#a0b5db0b7800864b40492a331746333f1a88d0722c9291a76dda496c3af70a0836", null ], [ "Bits11", "structxpcc_1_1ds1631.html#a0b5db0b7800864b40492a331746333f1a11ba3b9b19dc2aec4d42ec4ade2aba07", null ], [ "Bits12", "structxpcc_1_1ds1631.html#a0b5db0b7800864b40492a331746333f1a3eb76becfca744d04d55d9e345e225ec", null ] ] ] ];<file_sep>/docs/api/search/enums_7.js var searchData= [ ['historycontrol',['HistoryControl',['../structxpcc_1_1vl6180.html#a25df1a0ed60e3079978632bdba880cd2',1,'xpcc::vl6180']]] ]; <file_sep>/docs/api/structxpcc_1_1vl53l0_1_1_data.js var structxpcc_1_1vl53l0_1_1_data = [ [ "Data", "structxpcc_1_1vl53l0_1_1_data.html#a0e1962e2d4416353229ccf67b061c9d3", null ], [ "getDistance", "structxpcc_1_1vl53l0_1_1_data.html#a323289df22b5c04aaa2de49eb07e668f", null ], [ "isValid", "structxpcc_1_1vl53l0_1_1_data.html#a017e9b92d29bfcd6a9f6c5f10b94e978", null ], [ "getRangeError", "structxpcc_1_1vl53l0_1_1_data.html#a74d9f016c3c20080fe1d8b07e9c460fc", null ], [ "reset", "structxpcc_1_1vl53l0_1_1_data.html#a8551725466c8839719c993b3e6ff09d0", null ], [ "Vl53l0", "structxpcc_1_1vl53l0_1_1_data.html#a82edec2ff5140abd348c08822e906598", null ] ];<file_sep>/docs/api/namespacexpcc_1_1atomic.js var namespacexpcc_1_1atomic = [ [ "Container", "classxpcc_1_1atomic_1_1_container.html", "classxpcc_1_1atomic_1_1_container" ], [ "Flag", "classxpcc_1_1atomic_1_1_flag.html", "classxpcc_1_1atomic_1_1_flag" ], [ "Lock", "classxpcc_1_1atomic_1_1_lock.html", "classxpcc_1_1atomic_1_1_lock" ], [ "Queue", "classxpcc_1_1atomic_1_1_queue.html", "classxpcc_1_1atomic_1_1_queue" ], [ "Unlock", "classxpcc_1_1atomic_1_1_unlock.html", "classxpcc_1_1atomic_1_1_unlock" ] ];<file_sep>/docs/api/classxpcc_1_1tipc_1_1_receiver_socket.js var classxpcc_1_1tipc_1_1_receiver_socket = [ [ "ReceiverSocket", "classxpcc_1_1tipc_1_1_receiver_socket.html#a4d9a09c17d2b5827e8a08e71034fdd52", null ], [ "~ReceiverSocket", "classxpcc_1_1tipc_1_1_receiver_socket.html#a4afc8545b41c495c0151df9cf2b72a8a", null ], [ "registerOnPacket", "classxpcc_1_1tipc_1_1_receiver_socket.html#ab1f38d97e985cf8ed8c8ee9204eab43f", null ], [ "receiveHeader", "classxpcc_1_1tipc_1_1_receiver_socket.html#aa9faa4c5d44798f79137f7159c92f1ea", null ], [ "receivePayload", "classxpcc_1_1tipc_1_1_receiver_socket.html#a08ba5d3303e98e2e758ca57304ead9a5", null ], [ "popPayload", "classxpcc_1_1tipc_1_1_receiver_socket.html#a4772d037c792153062acf31506301904", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_spi_master3.js var classxpcc_1_1stm32_1_1_spi_master3 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40e", [ [ "Mode0", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40ea315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40ea7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40ea04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_spi_master3.html#a685d8da853eac1b8a0d05fa34e7ce40eab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1stm32_1_1_spi_master3.html#ab3e592a85d2b730044bf963021d67bda", [ [ "MsbFirst", "classxpcc_1_1stm32_1_1_spi_master3.html#ab3e592a85d2b730044bf963021d67bdaaee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1stm32_1_1_spi_master3.html#ab3e592a85d2b730044bf963021d67bdaabdb340581a62499a27a78804ea99a99a", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_tab_panel.js var classxpcc_1_1gui_1_1_tab_panel = [ [ "TabPanel", "classxpcc_1_1gui_1_1_tab_panel.html#a56be49421fb9cf1af108b1b9b1d2dc92", null ], [ "packPanel", "classxpcc_1_1gui_1_1_tab_panel.html#ab896b4727dc15b3368167ee2e13e0d89", null ], [ "packTabLeft", "classxpcc_1_1gui_1_1_tab_panel.html#a16ca19300293cbec44be1523fd56046e", null ], [ "packTabMiddle", "classxpcc_1_1gui_1_1_tab_panel.html#a9b241030a4e19dc4c8b0018a8415fb6f", null ], [ "packTabRight", "classxpcc_1_1gui_1_1_tab_panel.html#a102698510634fdb29cfbb61534bb46d2", null ], [ "panelDimension", "classxpcc_1_1gui_1_1_tab_panel.html#a2797f30b8c71f5448d4ec014780e2fdd", null ], [ "buttonDimension", "classxpcc_1_1gui_1_1_tab_panel.html#aaecb53e1cc864ad93bb694745e7d52a7", null ] ];<file_sep>/docs/api/group__atmega328p__i2c.js var group__atmega328p__i2c = [ [ "I2c", "structxpcc_1_1atmega_1_1_i2c.html", [ [ "Prescaler", "structxpcc_1_1atmega_1_1_i2c.html#aeb6249aa2468274cf3b5a67cd1c04dfb", [ [ "Div1", "structxpcc_1_1atmega_1_1_i2c.html#aeb6249aa2468274cf3b5a67cd1c04dfba0265654857f7b6ac0b716d3b07999e32", null ], [ "Div4", "structxpcc_1_1atmega_1_1_i2c.html#aeb6249aa2468274cf3b5a67cd1c04dfbad64dbe7aa107b2a36953d4d00618b565", null ], [ "Div16", "structxpcc_1_1atmega_1_1_i2c.html#aeb6249aa2468274cf3b5a67cd1c04dfba1233ec2bc170c916c15eb1f7939cbf0e", null ], [ "Div64", "structxpcc_1_1atmega_1_1_i2c.html#aeb6249aa2468274cf3b5a67cd1c04dfba5c7984decebb2b58ccba70395b2d52ff", null ] ] ] ] ], [ "I2cMaster", "classxpcc_1_1atmega_1_1_i2c_master.html", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_uart_spi_master6.js var classxpcc_1_1stm32_1_1_uart_spi_master6 = [ [ "DataMode", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4", [ [ "Mode0", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1stm32_1_1_uart_spi_master6.html#a9ae90b5b563e216de9f7129008d695b4ab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1unaligned__t.js var structxpcc_1_1unaligned__t = [ [ "unaligned_t", "structxpcc_1_1unaligned__t.html#a301cf543489eed92a86cf149a7ec0259", null ], [ "unaligned_t", "structxpcc_1_1unaligned__t.html#a151eb1bb3c404a53ece3a00dea536028", null ], [ "operator T", "structxpcc_1_1unaligned__t.html#aa624062afc15c12eecebc8753fe1e490", null ], [ "write", "structxpcc_1_1unaligned__t.html#abb8e936f51aff9b6f474e3ca23985df2", null ], [ "read", "structxpcc_1_1unaligned__t.html#ae6849bcce5517e37000aa36b010a3e16", null ], [ "data", "structxpcc_1_1unaligned__t.html#a59aa5980a8d2694b46213c5b696aa375", null ] ];<file_sep>/docs/api/navtreeindex7.js var NAVTREEINDEX7 = { "classxpcc_1_1_smart_pointer.html#af59427b7cfa6f8c7beda74afdf8dc29a":[1,3,7,1], "classxpcc_1_1_smart_pointer.html#af9d4d69ef2a425a5a45a1f658e8cac4b":[1,3,7,4], "classxpcc_1_1_software_gpio_port.html":[1,1,4,3,9], "classxpcc_1_1_software_gpio_port.html#a5b425bc5c577792a05b21e481dd959f9":[1,1,4,3,9,0], "classxpcc_1_1_software_gpio_port.html#a5b425bc5c577792a05b21e481dd959f9":[1,1,4,3,9,1], "classxpcc_1_1_software_i2c_master.html":[1,1,4,4,7], "classxpcc_1_1_software_one_wire_master.html":[1,1,4,6,0], "classxpcc_1_1_software_spi_master.html":[1,1,4,8,3], "classxpcc_1_1_spi_device.html":[1,1,4,8,1], "classxpcc_1_1_spi_device.html#a39a06f50aa7eff7ff2a9456593ab8dc1":[1,1,4,8,1,0], "classxpcc_1_1_spi_device.html#aa0d07cef4bebed6ad8102fe225fefc3e":[1,1,4,8,1,3], "classxpcc_1_1_spi_device.html#aa934cbd04dca197f1a0f1da152e46156":[1,1,4,8,1,2], "classxpcc_1_1_spi_device.html#addeed2b88121e6d1388f357349d08667":[1,1,4,8,1,1], "classxpcc_1_1_spi_master.html":[1,1,4,8,2], "classxpcc_1_1_spi_ram.html":[1,5,6,2], "classxpcc_1_1_spi_ram.html#a3086ff92ebf3b1e94854482bc3440466":[1,5,6,2,3], "classxpcc_1_1_spi_ram.html#a403a729e701fbf90682552e686f9b7d4":[1,5,6,2,1], "classxpcc_1_1_spi_ram.html#a403a729e701fbf90682552e686f9b7d4a92716ebc81403170f760429c2a1d3b01":[1,5,6,2,1,0], "classxpcc_1_1_spi_ram.html#a403a729e701fbf90682552e686f9b7d4aae161644b5ef2ae52602462462ebe6f2":[1,5,6,2,1,1], "classxpcc_1_1_spi_ram.html#a403a729e701fbf90682552e686f9b7d4acd18d1ff958ac7649ceee139c0a49675":[1,5,6,2,1,3], "classxpcc_1_1_spi_ram.html#a403a729e701fbf90682552e686f9b7d4ad2d23b8e39f2ef6fee002abedfb4b8c0":[1,5,6,2,1,2], "classxpcc_1_1_spi_ram.html#a5b9cb7ca9710d7c8d34c3367603055ab":[1,5,6,2,0], "classxpcc_1_1_spi_ram.html#a5b9cb7ca9710d7c8d34c3367603055aba2dcb20c887d0b5d4f0eda871dbc673eb":[1,5,6,2,0,2], "classxpcc_1_1_spi_ram.html#a5b9cb7ca9710d7c8d34c3367603055aba48fdf313d513dbd2e67e22aa84ff341e":[1,5,6,2,0,0], "classxpcc_1_1_spi_ram.html#a5b9cb7ca9710d7c8d34c3367603055aba94cc44748b0e77e3ef4d534fb8900a23":[1,5,6,2,0,1], "classxpcc_1_1_spi_ram.html#a5b9cb7ca9710d7c8d34c3367603055abab34d93b5bf89307dd58bda46d8d33749":[1,5,6,2,0,3], "classxpcc_1_1_spi_ram.html#a6363f36d7ba56866054ad03ec4b47a71":[1,5,6,2,2], "classxpcc_1_1_ssd1306.html":[1,5,0,11], "classxpcc_1_1_ssd1306.html#a112a648be1028442cf6422b0f8e704d3":[1,5,0,11,8], "classxpcc_1_1_ssd1306.html#a209523e37c1581f0bb034b7b245dcd61":[1,5,0,11,10], "classxpcc_1_1_ssd1306.html#a20cf7a2d9d70ce69796c44fa62c2849b":[1,5,0,11,13], "classxpcc_1_1_ssd1306.html#a5113e400aa2ef0596b753aa7c27b106d":[1,5,0,11,0], "classxpcc_1_1_ssd1306.html#a511493c4b9034faee348f7b0668f7305":[1,5,0,11,4], "classxpcc_1_1_ssd1306.html#a81c030614399b137f166a771c0d764a8":[1,5,0,11,12], "classxpcc_1_1_ssd1306.html#a8269dd957a47c4074e7cc269482bc05b":[1,5,0,11,3], "classxpcc_1_1_ssd1306.html#a8f3474c236f85b2401fa23f15b344c83":[1,5,0,11,15], "classxpcc_1_1_ssd1306.html#aac4a43f45c9f3b46ab23faa6e02b461c":[1,5,0,11,1], "classxpcc_1_1_ssd1306.html#aad724b286946e4c2aca609c97e6bb072":[1,5,0,11,6], "classxpcc_1_1_ssd1306.html#aad88a6a7a16c90877336d937abbe36e3":[1,5,0,11,2], "classxpcc_1_1_ssd1306.html#ac4e5fd6baadac023e541a4be7f5214f1":[1,5,0,11,11], "classxpcc_1_1_ssd1306.html#ac53b8c13ebb2396c43aa82f8602b09c5":[1,5,0,11,9], "classxpcc_1_1_ssd1306.html#ad169e6b81a4f50cf147a3ce663a45905":[1,5,0,11,7], "classxpcc_1_1_ssd1306.html#ad77b2420be2c98de459756e9c13c7402":[1,5,0,11,14], "classxpcc_1_1_ssd1306.html#aedd344c38942fa6196543877510cf6e9":[1,5,0,11,5], "classxpcc_1_1_st7036.html":[1,5,0,12], "classxpcc_1_1_st7036.html#a0438cd38f50365b34c785df59585000e":[1,5,0,12,4], "classxpcc_1_1_st7036.html#a609cc093936e1f4fa480e38768d3e7e2":[1,5,0,12,2], "classxpcc_1_1_st7036.html#a87ede776e8ff73b40f4e5405f02afe28":[1,5,0,12,3], "classxpcc_1_1_st7036.html#abca9ca37b61eaa22a41eb8ffc2b755d0":[1,5,0,12,1], "classxpcc_1_1_st7036.html#ae6561c5a5afa1f237a6777d51156faf3":[1,5,0,12,5], "classxpcc_1_1_st7036.html#af62d293b7cbd583ec81bbe93354df14e":[1,5,0,12,0], "classxpcc_1_1_st7565.html":[1,5,0,13], "classxpcc_1_1_st7565.html#a00b06887df3d99e4f961fa51db76d960":[1,5,0,13,3], "classxpcc_1_1_st7565.html#a2f1246cb6ba12acd1d02175fc78dd3e1":[1,5,0,13,4], "classxpcc_1_1_st7565.html#a3161abe4d5b826e879dedf846b88979e":[1,5,0,13,6], "classxpcc_1_1_st7565.html#a3b37cc4b1790d5dd73488cb5dd4d6d5c":[1,5,0,13,2], "classxpcc_1_1_st7565.html#a451c6d182feeb1d43f2a646389d6bdcb":[1,5,0,13,1], "classxpcc_1_1_st7565.html#a65e0456a44b286ec4495bc1eb3d2c95d":[1,5,0,13,7], "classxpcc_1_1_st7565.html#ae3f13d1a3e9650003a9eaf1ca395f74d":[1,5,0,13,0], "classxpcc_1_1_st7565.html#ae6128fd555b4745b5a0f863dab2c5934":[1,5,0,13,5], "classxpcc_1_1_stack.html":[1,3,8], "classxpcc_1_1_stack.html#a170739384306575a1888929d2acf5d6a":[1,3,8,8], "classxpcc_1_1_stack.html#a17dcd51b812b942797b83075b7b76a69":[1,3,8,0], "classxpcc_1_1_stack.html#a17f71b2b820103aef042eb85398e00ea":[1,3,8,5], "classxpcc_1_1_stack.html#a7586b9e4ebdede5d70b5e34de81efc9e":[1,3,8,2], "classxpcc_1_1_stack.html#ac050d548462c218e76d27c831d90523d":[1,3,8,9], "classxpcc_1_1_stack.html#aca2efee6371a52f7d02fe1d4fe956d6b":[1,3,8,4], "classxpcc_1_1_stack.html#af1ef507c0745d83a11ca5a413482a87d":[1,3,8,3], "classxpcc_1_1_stack.html#af84856b68f903d913bf7e8551618a48f":[1,3,8,1], "classxpcc_1_1_stack.html#af87ce6aa0785150bebdda6b5fcda6643":[1,3,8,6], "classxpcc_1_1_stack.html#afbb89e64f93644d5a60253deb870c642":[1,3,8,7], "classxpcc_1_1_standard_menu.html":[1,10,8,5], "classxpcc_1_1_standard_menu.html#a04f5f737e5acf24c007f69582d9bd428":[1,10,8,5,6], "classxpcc_1_1_standard_menu.html#a14eb30309c8c876cb9abdf066962c898":[1,10,8,5,5], "classxpcc_1_1_standard_menu.html#a1e6bd6f1773e5d99c6096ea853e25435":[1,10,8,5,9], "classxpcc_1_1_standard_menu.html#a31ec77137e2813e6c80b454ba36481b5":[1,10,8,5,3], "classxpcc_1_1_standard_menu.html#a3cb73e54a23418aa8becf7ed9b9d8da9":[1,10,8,5,4], "classxpcc_1_1_standard_menu.html#a4168d6f028d94a7f749b4977ffbd0029":[1,10,8,5,2], "classxpcc_1_1_standard_menu.html#a4a851f9f8ea5163dd72a526f98cbb3c6":[1,10,8,5,1], "classxpcc_1_1_standard_menu.html#a58f5bf9a58476b931db61e8531965fc3":[1,10,8,5,8], "classxpcc_1_1_standard_menu.html#a8eb56d81a256a66b714c5a43c6f4a9df":[1,10,8,5,11], "classxpcc_1_1_standard_menu.html#a932faca8fa10b2857ebfecb3bfee9205":[1,10,8,5,0], "classxpcc_1_1_standard_menu.html#aafb415651a31a46a7d514e8b55e76b80":[1,10,8,5,7], "classxpcc_1_1_standard_menu.html#afb8656ddae8db697c9f15fc96999cb55":[1,10,8,5,10], "classxpcc_1_1_t_l_c594_x.html":[1,5,14,2], "classxpcc_1_1_task.html":[1,9,1], "classxpcc_1_1_task.html#a26bf847d086d18efb62a1b1980622e4e":[1,9,1,3], "classxpcc_1_1_task.html#a52dab0d6749729fb7220b2ff92558282":[1,9,1,0], "classxpcc_1_1_task.html#a6084a0f4d6307771136f9b66953f3773":[1,9,1,2], "classxpcc_1_1_task.html#ad16aba6a103d3120fa432936f7d85940":[1,9,1,1], "classxpcc_1_1_tcs3414.html":[1,5,8,1], "classxpcc_1_1_tcs3414.html#a01bc6f8efa4202821e95f4fdf6298b30":[1,5,8,1,0,3], "classxpcc_1_1_tcs3414.html#a199c6ee805ef86a55e56ff8cb3bc3e58":[1,5,8,1,4], "classxpcc_1_1_tcs3414.html#a216b0daf6dff793d53212fd9f1517492":[1,5,8,1,2], "classxpcc_1_1_tcs3414.html#a31b935c618868af3a916675e78d0dd50":[1,5,8,1,1], "classxpcc_1_1_tcs3414.html#a48d6215903dff56238e52e8891380c8f":[1,5,8,1,0,2], "classxpcc_1_1_tcs3414.html#a5b2a2ba10cd66cdd49f2c864ea15fb51":[1,5,8,1,6], "classxpcc_1_1_tcs3414.html#a66902f64da3e21b6b54c858a86449fdd":[1,5,8,1,7], "classxpcc_1_1_tcs3414.html#a8f25825dda1b9af63c2f448c282ae50f":[1,5,8,1,8], "classxpcc_1_1_tcs3414.html#a9f27410725ab8cc8854a2769c7a516b8":[1,5,8,1,0,0], "classxpcc_1_1_tcs3414.html#ab3160a1d6d2cf6d51a261893e32fb469":[1,5,8,1,5], "classxpcc_1_1_tcs3414.html#abda9643ac6601722a28f238714274da4":[1,5,8,1,0,1], "classxpcc_1_1_tcs3414.html#af2b88e4cf351696e712897df8bb85ab6":[1,5,8,1,3], "classxpcc_1_1_tcs3414.html#structxpcc_1_1_tcs3414_1_1_data_8____unnamed____":[1,5,8,1,0], "classxpcc_1_1_tcs3472.html":[1,5,8,3], "classxpcc_1_1_tcs3472.html#a01bc6f8efa4202821e95f4fdf6298b30":[1,5,8,3,0,0], "classxpcc_1_1_tcs3472.html#a09472f58f3c6e9c6e22ac9fcc249cdeb":[1,5,8,3,5], "classxpcc_1_1_tcs3472.html#a2b7b3aa6664066b3ce6a2646c5868623":[1,5,8,3,4], "classxpcc_1_1_tcs3472.html#a37e21d9b5224a97a7da1eb0c93ec72ac":[1,5,8,3,1], "classxpcc_1_1_tcs3472.html#a48d6215903dff56238e52e8891380c8f":[1,5,8,3,0,3], "classxpcc_1_1_tcs3472.html#a9f27410725ab8cc8854a2769c7a516b8":[1,5,8,3,0,2], "classxpcc_1_1_tcs3472.html#ab985686724d5be72ba2abdc10248b2d0":[1,5,8,3,6], "classxpcc_1_1_tcs3472.html#abda9643ac6601722a28f238714274da4":[1,5,8,3,0,1], "classxpcc_1_1_tcs3472.html#aef91f1dd880f40fd265261935f870fe9":[1,5,8,3,2], "classxpcc_1_1_tcs3472.html#af1b4f021b9da99d086dd801a528d5e14":[1,5,8,3,3], "classxpcc_1_1_tcs3472.html#structxpcc_1_1_tcs3472_1_1_data_8____unnamed____":[1,5,8,3,0], "classxpcc_1_1_tft_memory_bus16_bit.html":[1,5,7,1], "classxpcc_1_1_tft_memory_bus16_bit.html#a267730113b953e68ab566599b785f3f7":[1,5,7,1,3], "classxpcc_1_1_tft_memory_bus16_bit.html#a57c608904e4d8eba1d74a24405448637":[1,5,7,1,0], "classxpcc_1_1_tft_memory_bus16_bit.html#a728a9e202112bf27a683f6b1395db195":[1,5,7,1,4], "classxpcc_1_1_tft_memory_bus16_bit.html#ad586b9d07b8de4be65919805df5e19d0":[1,5,7,1,1], "classxpcc_1_1_tft_memory_bus16_bit.html#af7fa03ec1f1f7011a0235d250df41459":[1,5,7,1,2], "classxpcc_1_1_tft_memory_bus16_bit.html#af9907c215974122e47a8f410a72239a5":[1,5,7,1,5], "classxpcc_1_1_tft_memory_bus8_bit.html":[1,5,7,2], "classxpcc_1_1_tft_memory_bus8_bit.html#a53d945e084dfe07faf84a65efe9218b6":[1,5,7,2,0], "classxpcc_1_1_tft_memory_bus8_bit.html#a55f20c647a2e56375c7f4acff02ec05d":[1,5,7,2,2], "classxpcc_1_1_tft_memory_bus8_bit.html#a82ee51bd16bc692deffdb316d5cf9400":[1,5,7,2,3], "classxpcc_1_1_tft_memory_bus8_bit.html#aa4a7e3d420d2bcc96ca3381389de65e0":[1,5,7,2,1], "classxpcc_1_1_tft_memory_bus8_bit_gpio.html":[1,5,7,4], "classxpcc_1_1_tft_memory_bus8_bit_gpio.html#a51ac6fa75a80460ac0a23e040117cc85":[1,5,7,4,0], "classxpcc_1_1_tipc_connector.html":[1,2,4,10,2], "classxpcc_1_1_tipc_connector.html#a04f0616cbaf86675b52e3406502be329":[1,2,4,10,2,2], "classxpcc_1_1_tipc_connector.html#a100fc64407abdb52fd6464bfed2bc391":[1,2,4,10,2,4], "classxpcc_1_1_tipc_connector.html#a2357e6c978395dabbc9fd6d1e422f7bb":[1,2,4,10,2,0], "classxpcc_1_1_tipc_connector.html#a76f7e663797f55fef9a43378d902937d":[1,2,4,10,2,10], "classxpcc_1_1_tipc_connector.html#a79768273528ef96a379a7382229cbb78":[1,2,4,10,2,6], "classxpcc_1_1_tipc_connector.html#a8b9e1719fcb6896c24ff8109f647fe11":[1,2,4,10,2,3], "classxpcc_1_1_tipc_connector.html#a8de087abddb10352dee3e0b5bbae93e7":[1,2,4,10,2,9], "classxpcc_1_1_tipc_connector.html#aa9e72f7e4a08a991180d7a8742e2feb3":[1,2,4,10,2,1], "classxpcc_1_1_tipc_connector.html#ab70b6fdfa247716a4e6e65dd1e952bd4":[1,2,4,10,2,5], "classxpcc_1_1_tipc_connector.html#ab72d717e76c3cfdc4342cd475bd9f81e":[1,2,4,10,2,8], "classxpcc_1_1_tipc_connector.html#ab7c3976ffde255125a670f908814324a":[1,2,4,10,2,7], "classxpcc_1_1_tmp102.html":[1,5,13,3], "classxpcc_1_1_tmp102.html#a1ad8b47409dfcc89c283dffbbdb84d8f":[1,5,13,3,4], "classxpcc_1_1_tmp102.html#a2ff83918abaab0b855a7c3ff5c4fb37c":[1,5,13,3,2], "classxpcc_1_1_tmp102.html#a33e688226daec293691d70c11f744a98":[1,5,13,3,8], "classxpcc_1_1_tmp102.html#a68d93699054422d884b189bb5daeef06":[1,5,13,3,6], "classxpcc_1_1_tmp102.html#a702cadde302da544fa6002d5ac8532d4":[1,5,13,3,1], "classxpcc_1_1_tmp102.html#a72bbe466b5c90e57719875645edd2167":[1,5,13,3,5], "classxpcc_1_1_tmp102.html#adeed72bf8d87b19ef6bd5ee732460d10":[1,5,13,3,3], "classxpcc_1_1_tmp102.html#ae444ab0e2c0d7be648463484d9d19375":[1,5,13,3,0], "classxpcc_1_1_tmp102.html#af636c4db11441248e2e10f143c9c46e4":[1,5,13,3,7], "classxpcc_1_1_tmp175.html":[1,5,13,4], "classxpcc_1_1_tmp175.html#a34891b8bdf577ac1a2921bab73739a74":[1,5,13,4,1], "classxpcc_1_1_tmp175.html#a42ff0f630237507697a5fe13af283257":[1,5,13,4,5], "classxpcc_1_1_tmp175.html#a665aa096afb58ac42c985cee339577e3":[1,5,13,4,3], "classxpcc_1_1_tmp175.html#aa3b9a5cd8102166c4959bc5dd3ce7649":[1,5,13,4,6], "classxpcc_1_1_tmp175.html#aaa4f0e6a147e05358e700326b657f971":[1,5,13,4,2], "classxpcc_1_1_tmp175.html#aafc93e08ca36b985e96307ba15a479fb":[1,5,13,4,7], "classxpcc_1_1_tmp175.html#ad5aa8dfc6e79b588e0811da7aa87a527":[1,5,13,4,4], "classxpcc_1_1_tmp175.html#ad90bd299c2d29d027989c0d6957ee987":[1,5,13,4,0], "classxpcc_1_1_tolerance.html":[1,8,1], "classxpcc_1_1_uart.html":[1,1,4,9,0], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99":[1,1,4,9,0,0], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a048831ed640406145404247d274f2b38":[1,1,4,9,0,0,10], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a2724c311521a7d8763b4314f8bf8a02d":[1,1,4,9,0,0,1], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a568ce05ce5456229254e6a6e8b37681f":[1,1,4,9,0,0,7], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a56db70f2db001ec68201d293fdaf1d52":[1,1,4,9,0,0,2], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a73f2d4ee3536929d064020fb9af455a6":[1,1,4,9,0,0,4], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a77ca0b7aa148cab868faf2f5f875014a":[1,1,4,9,0,0,6], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a86fb2f75ef7ce42c8d51f57621d71b8d":[1,1,4,9,0,0,0], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a8b7c3d05c0eb03108b84026e70947a30":[1,1,4,9,0,0,9], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a92670c632140eac890541645d2c82cc0":[1,1,4,9,0,0,13], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99a9e2c294257a79aa13deee50d72481a84":[1,1,4,9,0,0,12], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99aaab759203a56286e229a78c3a19fede6":[1,1,4,9,0,0,15], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99ab0f6ae1fdca9829fd0289f62f73e6b7d":[1,1,4,9,0,0,5], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99abefb63e01362e0ef22e3adf5f85f2877":[1,1,4,9,0,0,17], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99ac618574273b64e131e1f574f23fec3c8":[1,1,4,9,0,0,16], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99acdc28e2711abcfa91f229ceaf23c2509":[1,1,4,9,0,0,11], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99adf10706bd0db2e5820887378e139f29d":[1,1,4,9,0,0,3], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99af952e5f8ea6f533e09d5511cb98e12f5":[1,1,4,9,0,0,8], "classxpcc_1_1_uart.html#a0807bf263d4b30c1b65eb9153a1fbe99afcfb4fb3bd863b2e348914adb1b9a97c":[1,1,4,9,0,0,14], "classxpcc_1_1_unix_time.html":[1,10,2], "classxpcc_1_1_unix_time.html#a77b77725d8cf9d86af36f1cfd2933e45":[1,10,2,2], "classxpcc_1_1_unix_time.html#aa4fdc5faff748e7c20515fb9ead9f17c":[1,10,2,0], "classxpcc_1_1_unix_time.html#ab0b513855a7c3cf02c59e7481eec45fe":[1,10,2,1], "classxpcc_1_1_vector.html":[1,8,3,10], "classxpcc_1_1_vector.html#a084f1fd8ef96da3697ce674626737f52":[1,8,3,10,39], "classxpcc_1_1_vector.html#a08b36fea64c1ec36429a1110ae5fd179":[1,8,3,10,6], "classxpcc_1_1_vector.html#a0ad757017e3386270ab2ea32ec968364":[1,8,3,10,8], "classxpcc_1_1_vector.html#a0f1426ea46b181fe43b13e13e8487d75":[1,8,3,10,0], "classxpcc_1_1_vector.html#a11fd7fc8db557a147d6d5a94e6591af6":[1,8,3,10,11], "classxpcc_1_1_vector.html#a12670a04e96158a77a8bc79e95241bed":[1,8,3,10,29], "classxpcc_1_1_vector.html#a16ba49a5fdcdd22c9f946159811a07db":[1,8,3,10,19], "classxpcc_1_1_vector.html#a1a30642ed29ea564c4ab7cfb90f8ca9f":[1,8,3,10,5], "classxpcc_1_1_vector.html#a1a7cd427b2bcd67f3b136738ced62728":[1,8,3,10,26], "classxpcc_1_1_vector.html#a23c97fa568ad913d9bfcb179c7fb25b0":[1,8,3,10,13], "classxpcc_1_1_vector.html#a2993150d0d744566cbf9a4baa1e3fb89":[1,8,3,10,1], "classxpcc_1_1_vector.html#a2dd33e7251bc22f9213e87c966cf8211":[1,8,3,10,31], "classxpcc_1_1_vector.html#a3e5f246a53ba445bcb4b73d588d367f1":[1,8,3,10,23], "classxpcc_1_1_vector.html#a419b247b437e02f7f9b276388d847f36":[1,8,3,10,22], "classxpcc_1_1_vector.html#a542d762d7a2c505f37a5bcb329e95303":[1,8,3,10,18], "classxpcc_1_1_vector.html#a5b3485586ea97519c3d2bce4c4b36854":[1,8,3,10,32], "classxpcc_1_1_vector.html#a6dda6423f69310eec83cc2d03bc2fe72":[1,8,3,10,15], "classxpcc_1_1_vector.html#a7b1b997fc1ff09410ed8910857fee98c":[1,8,3,10,35], "classxpcc_1_1_vector.html#a7d46eaffdf6f5dcaa40c9ba7b3c829ef":[1,8,3,10,34], "classxpcc_1_1_vector.html#a83c6c8665e133026c30e6be92ea7cf4f":[1,8,3,10,12], "classxpcc_1_1_vector.html#a878887eebcbd261654caf1acb6c7b736":[1,8,3,10,30], "classxpcc_1_1_vector.html#a8e0dd464ae79341bfe17c26b04fb01dc":[1,8,3,10,24], "classxpcc_1_1_vector.html#a94297b5c4954d8d9421b6c6a3765bc03":[1,8,3,10,21], "classxpcc_1_1_vector.html#a9f5dba18f6df979b4d237ca46bfd57b6":[1,8,3,10,4], "classxpcc_1_1_vector.html#aaa43179c102424265b404347ef9e4b36":[1,8,3,10,33], "classxpcc_1_1_vector.html#aae18f1aae7e3d383d76b5675d1842d40":[1,8,3,10,2], "classxpcc_1_1_vector.html#ab6793929c0aa72897663e713eaf8383a":[1,8,3,10,3], "classxpcc_1_1_vector.html#abdaafe05805d1d9911def21da1412a6c":[1,8,3,10,14], "classxpcc_1_1_vector.html#abe2b3f55fd4884241deb086557d50363":[1,8,3,10,16], "classxpcc_1_1_vector.html#ac5fd90a1053c69f9ec650f27d9dc374f":[1,8,3,10,37], "classxpcc_1_1_vector.html#ad3e0ab32f72225f237a01ccec35a42f4":[1,8,3,10,7], "classxpcc_1_1_vector.html#ad686edc0bdcf894fb1c473b9c0af9195":[1,8,3,10,38], "classxpcc_1_1_vector.html#ad6c7c27c0db36c702b6af0e95b30f313":[1,8,3,10,28], "classxpcc_1_1_vector.html#adef87e37d9956a54136247966ee2d7e8":[1,8,3,10,27], "classxpcc_1_1_vector.html#ae3daa4870c213657ea5a82cfdcc06abb":[1,8,3,10,17], "classxpcc_1_1_vector.html#aee590c66fd23da814f3ae4823643b7f7":[1,8,3,10,9], "classxpcc_1_1_vector.html#aef22a80dd9ca430eb7f6af0646df301e":[1,8,3,10,25], "classxpcc_1_1_vector.html#af288c084c3992ac6ddae9586922e1686":[1,8,3,10,36], "classxpcc_1_1_vector.html#afc759b2e58353395be9a75cc18c0ef9b":[1,8,3,10,10], "classxpcc_1_1_vector.html#afcabaac92f26902dd8997fdf7e0fb8ba":[1,8,3,10,20], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html":[1,8,3,11], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a003d4d3ea4d8aadb7c75c0fd9ba900db":[1,8,3,11,28], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a00a5808620ce82643427788b8d63a7d7":[1,8,3,11,8], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a04ce8f9efe56318642d8dad2007132df":[1,8,3,11,4], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a0d195997c18b32cccd77b442fcf9acbe":[1,8,3,11,35], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a1e35758918b120913c141cfb67ab92e4":[1,8,3,11,17], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a33bd6bafb85cd974adb72cdd66c4c861":[1,8,3,11,5], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a36d8c94780411881b2f1d063768840b1":[1,8,3,11,29], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a3cc800cbe3b4f6acc59b7ec97b386116":[1,8,3,11,23], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a57508c53b09279ad9b59f5fa817333b8":[1,8,3,11,1], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a59ddb63b0cd8b7e8a00b95c7fb9ab0fc":[1,8,3,11,24], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a5f35204115390e86afeb0d9e4807659c":[1,8,3,11,11], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a68b8b7242b3ff5b6b8b4bede3e8b9bf5":[1,8,3,11,12], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a6d43a04e21b8d39ca3861e3155f20bb1":[1,8,3,11,26], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a709a5723dde4cc93be40f2047c24e32b":[1,8,3,11,3], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a7308eafa567442df8e5fe035af797f29":[1,8,3,11,21], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a76858f6864d707ebefa3bd9395222b06":[1,8,3,11,33], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a78025bf8463ff5117f6f5a9d11182c5b":[1,8,3,11,9], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a8c6e057ffbf2d0b45765307b9648fc1b":[1,8,3,11,2], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a90906abf13d08196e8c45fe8c3fcccbd":[1,8,3,11,32], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a90a4062a0cfec50142020b9cb7e556af":[1,8,3,11,15], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a90deb4d66968c800447170802fd2309c":[1,8,3,11,22], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a9b732f6ba6b89f0b083f9f0fb26c7f8e":[1,8,3,11,30] }; <file_sep>/docs/api/structxpcc_1_1rpr_1_1_listener.js var structxpcc_1_1rpr_1_1_listener = [ [ "Callback", "structxpcc_1_1rpr_1_1_listener.html#ade0f44a3a69a8c87598f76417f69558e", null ], [ "call", "structxpcc_1_1rpr_1_1_listener.html#a68d78dec173ded1e064a8cb7e95f2fe7", null ], [ "type", "structxpcc_1_1rpr_1_1_listener.html#a9dce32a2dbb49139cb349d7675661d12", null ], [ "source", "structxpcc_1_1rpr_1_1_listener.html#ac211bf9ee7e2e542c485eeb7235b076c", null ], [ "command", "structxpcc_1_1rpr_1_1_listener.html#a3e2d1d65f7498b3036bb0a9d0195a658", null ], [ "object", "structxpcc_1_1rpr_1_1_listener.html#aca52bf2a9260f244d84f98dd99dfd27a", null ], [ "function", "structxpcc_1_1rpr_1_1_listener.html#a08f322f790783b2c9c71b68b3cc782fb", null ] ];<file_sep>/docs/api/search/enums_6.js var searchData= [ ['gain',['Gain',['../structxpcc_1_1tcs3414.html#a924ab7f1e0d183a6620c0d2a67d65005',1,'xpcc::tcs3414::Gain()'],['../structxpcc_1_1tcs3472.html#a1b67f6dade085c45f707ef8d9e886bd7',1,'xpcc::tcs3472::Gain()']]], ['gpiomode',['GpioMode',['../structxpcc_1_1vl6180.html#af2a0872932589590552e482c23a68208',1,'xpcc::vl6180']]] ]; <file_sep>/docs/api/structxpcc_1_1_gpio.js var structxpcc_1_1_gpio = [ [ "Direction", "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50b", [ [ "In", "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50baefeb369cccbd560588a756610865664c", null ], [ "Out", "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50ba7c147cda9e49590f6abe83d118b7353b", null ], [ "InOut", "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50ba47a54d9da8952a3980d27488b00a21c1", null ], [ "Special", "structxpcc_1_1_gpio.html#a686abf36d8fbbde7a7a26d50b567e50bab4c2b550635fe54fd29f2b64dfaca55d", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1amnb_1_1_action.js var structxpcc_1_1amnb_1_1_action = [ [ "Callback", "structxpcc_1_1amnb_1_1_action.html#a34c2325481033586bf8d19e69d07ae91", null ], [ "call", "structxpcc_1_1amnb_1_1_action.html#ae38f1312514364263ca6244606792239", null ], [ "command", "structxpcc_1_1amnb_1_1_action.html#aa94dbb6be9e25716dbde7010431a73f1", null ], [ "payloadLength", "structxpcc_1_1amnb_1_1_action.html#a4abf25b00ae0d220347d953591102c3e", null ], [ "object", "structxpcc_1_1amnb_1_1_action.html#a9c84731e3019db057939d5752b1e9289", null ], [ "function", "structxpcc_1_1amnb_1_1_action.html#aae7fe663e4e9e42f1a01d0fe5cf3a54f", null ] ];<file_sep>/docs/api/search/enumvalues_12.js var searchData= [ ['undefined',['Undefined',['../group__nrf24.html#ggac466c7ce11b5b6eaead992f21cc2e6a2aec0fc0100c4fc1ce4eea230c3dc10360',1,'xpcc::Nrf24Data']]], ['unknown',['Unknown',['../classxpcc_1_1_i2c_master.html#aa5fc6cd1d1fb14ea2d6b5438df4c2f2ea88183b946cc5f0e8c96b2e66e1c74a7e',1,'xpcc::I2cMaster']]], ['uprightedgeorientation',['UprightEdgeOrientation',['../structxpcc_1_1hmc6343.html#ae41be04813e9044ca4a39b01116093c0acf4ea29322c2c3e200d31fee7d7bc99c',1,'xpcc::hmc6343']]], ['uprightfrontorientation',['UprightFrontOrientation',['../structxpcc_1_1hmc6343.html#ae41be04813e9044ca4a39b01116093c0a0713911685bd1a22e5266000687621b9',1,'xpcc::hmc6343']]] ]; <file_sep>/docs/api/classxpcc_1_1rtos_1_1_semaphore_base.js var classxpcc_1_1rtos_1_1_semaphore_base = [ [ "~SemaphoreBase", "classxpcc_1_1rtos_1_1_semaphore_base.html#af185ca42794b7e3636c36eba56294dcb", null ], [ "SemaphoreBase", "classxpcc_1_1rtos_1_1_semaphore_base.html#a91b8d2488d7aa9b84ddc90cdaa7738a9", null ], [ "acquire", "classxpcc_1_1rtos_1_1_semaphore_base.html#a0b7b068974747e2e8841d2c7c2332bc0", null ], [ "release", "classxpcc_1_1rtos_1_1_semaphore_base.html#a374349827dd06ac79ce0ddd7ed82f115", null ], [ "releaseFromInterrupt", "classxpcc_1_1rtos_1_1_semaphore_base.html#aa67b180e3f87f5632c10f77f8b2fdc12", null ], [ "handle", "classxpcc_1_1rtos_1_1_semaphore_base.html#a766755cdc38e082cd2aeabebdd4a79e7", null ] ];<file_sep>/docs/api/search/groups_d.js var searchData= [ ['radio',['Radio',['../group__driver__radio.html',1,'']]], ['resumables',['Resumables',['../group__resumable.html',1,'']]], ['resilient_20packet_20ring_20_28rpr_29',['Resilient Packet Ring (RPR)',['../group__rpr.html',1,'']]], ['random',['Random',['../group__stm32f407vg__random.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1rtos_1_1_thread_1_1_lock.js var classxpcc_1_1rtos_1_1_thread_1_1_lock = [ [ "Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html#a864790b4dbb62f97391e4c5c43d8abea", null ], [ "~Lock", "classxpcc_1_1rtos_1_1_thread_1_1_lock.html#a7da3f35e8192af0337202bf39cb71889", null ] ];<file_sep>/docs/api/group__spi.js var group__spi = [ [ "Spi", "structxpcc_1_1_spi.html", [ [ "ConfigurationHandler", "structxpcc_1_1_spi.html#aa8c715419d2370d9feab964cd7da0c04", null ], [ "DataMode", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992f", [ [ "Mode0", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "structxpcc_1_1_spi.html#a2e3c0bd1b2738a3a94e77997abb1992fab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "structxpcc_1_1_spi.html#a71571d129a081e42fdabccf2e18d9d97", [ [ "MsbFirst", "structxpcc_1_1_spi.html#a71571d129a081e42fdabccf2e18d9d97aee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "structxpcc_1_1_spi.html#a71571d129a081e42fdabccf2e18d9d97abdb340581a62499a27a78804ea99a99a", null ] ] ] ] ], [ "SpiDevice", "classxpcc_1_1_spi_device.html", [ [ "SpiDevice", "classxpcc_1_1_spi_device.html#a39a06f50aa7eff7ff2a9456593ab8dc1", null ], [ "attachConfigurationHandler", "classxpcc_1_1_spi_device.html#addeed2b88121e6d1388f357349d08667", null ], [ "acquireMaster", "classxpcc_1_1_spi_device.html#aa934cbd04dca197f1a0f1da152e46156", null ], [ "releaseMaster", "classxpcc_1_1_spi_device.html#aa0d07cef4bebed6ad8102fe225fefc3e", null ] ] ], [ "SpiMaster", "classxpcc_1_1_spi_master.html", null ], [ "SoftwareSpiMaster", "classxpcc_1_1_software_spi_master.html", null ] ];<file_sep>/docs/api/group__tmp_structxpcc_1_1tmp_1_1_super_subclass_3_01_t_00_01void_01_4.js var group__tmp_structxpcc_1_1tmp_1_1_super_subclass_3_01_t_00_01void_01_4 = [ [ "value", "group__tmp.html#a6bb3519d5967801d75919660a41de431a51c7b1b4156facf55fecc21c95524685", null ], [ "dontUseWithIncompleteTypes", "group__tmp.html#a3b3e45df0082c1dd40d7d0c2c1ee5b11a6591136db21825d83fd3b3e7c1eb51a0", null ] ];<file_sep>/docs/api/classxpcc_1_1color_1_1_hsv_t.js var classxpcc_1_1color_1_1_hsv_t = [ [ "HsvT", "classxpcc_1_1color_1_1_hsv_t.html#a16cf3ea07992a798088b5f7a840640b5", null ], [ "HsvT", "classxpcc_1_1color_1_1_hsv_t.html#a840e7a63ec0abd8752fa4358a0ac1c41", null ], [ "toRgb", "classxpcc_1_1color_1_1_hsv_t.html#a2da46dbc27e3dda2a45e1ed06dd9b005", null ], [ "hue", "classxpcc_1_1color_1_1_hsv_t.html#a26d6376f20295a7ea3ad93c3038d1fef", null ], [ "saturation", "classxpcc_1_1color_1_1_hsv_t.html#a03dbf4ebbfba0e93e52ce322cdd1825c", null ], [ "value", "classxpcc_1_1color_1_1_hsv_t.html#aee56e9f76f057f792acf4cf5a83dfb75", null ] ];<file_sep>/docs/api/structxpcc_1_1lis302dl.js var structxpcc_1_1lis302dl = [ [ "Data", "structxpcc_1_1lis302dl_1_1_data.html", "structxpcc_1_1lis302dl_1_1_data" ], [ "Control1_t", "structxpcc_1_1lis302dl.html#a07f1367c240f032ea0b701258dee0c3c", null ], [ "Control2_t", "structxpcc_1_1lis302dl.html#ad0ba7069e4caf0cfe67c4546f33689e4", null ], [ "Control3_t", "structxpcc_1_1lis302dl.html#ae399a5a37f3d41dce8604c97a0829659", null ], [ "Control_t", "structxpcc_1_1lis302dl.html#a7483e25e6c5cc4710adaa928a016ac93", null ], [ "Status_t", "structxpcc_1_1lis302dl.html#ae95f7d7c3769349249ef3f4774722d92", null ], [ "FreeFallConfig_t", "structxpcc_1_1lis302dl.html#a3311f6ff5dbf1df6963dcbfb8326f183", null ], [ "FreeFallSource_t", "structxpcc_1_1lis302dl.html#a3594630ff7194df9ca7585802a4abae3", null ], [ "FreeFallThreshold_t", "structxpcc_1_1lis302dl.html#a9d65dffd6898bcb9ab8fa4acc77c88b0", null ], [ "ClickConfig_t", "structxpcc_1_1lis302dl.html#a472c07d5e9ae02ea2cce1f9f9ce88fa5", null ], [ "ClickSource_t", "structxpcc_1_1lis302dl.html#a940dc41bb365493f75b541d301215f30", null ], [ "Register_t", "structxpcc_1_1lis302dl.html#ad3b56271b6a2bca619f7591c814cc677", null ], [ "Control1", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496", [ [ "DR", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496a3754385271c4f2a2648b471683d21149", null ], [ "PD", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496aadf824caef0cef6b0e0f81df60a71a34", null ], [ "FS", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496a4a436c564cf21ff91983ab79399fa185", null ], [ "STP", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496a69aae3cdce9fca74a3bd273e53f75d11", null ], [ "STM", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496a0c2132b36166716de0d0220567fb911f", null ], [ "Zen", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496ae566cc5f20887adf2bad47f5389ba59a", null ], [ "Yen", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496a69e8187a8af4c2ca3b95e6027ecfc9bf", null ], [ "Xen", "structxpcc_1_1lis302dl.html#a802a2c43c159cae1851984e1ecc85496a7c17f87f3d09f3cc1a779dbd42908a3a", null ] ] ], [ "Control2", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0", [ [ "SIM", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0a26296209d6c79aa8c645bc2b21be4df3", null ], [ "BOOT", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0adf9a77cdc2fe29972274b189cf7bac7c", null ], [ "FDS", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0a1478cfa1e4c4889089d4c70273b1f5ac", null ], [ "HP_FF_WU2", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0ac1ba82d1339429616550e4ff52cd0677", null ], [ "HP_FF_WU1", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0a88312d04c0ddbe908f3a604710496d67", null ], [ "HP_COEFF2", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0a873ef556f9ba0d79d4d88b2a297c45cc", null ], [ "HP_COEFF1", "structxpcc_1_1lis302dl.html#aa9bc47a17da0791163565f965f8d2fb0a5e0ad2b1e1b19813ff43735987fcc5cd", null ] ] ], [ "Control3", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609", [ [ "IHL", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609ac88b27c63875062ac7c85ff1a92fc780", null ], [ "PP_OD", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609af10682192c1d018a3566f29247aaa01b", null ], [ "I2CFG2", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609a6996c670d64a245356ee322e5bb40eaf", null ], [ "I2CFG1", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609a2fba5ad2a65b595fc6d01ab44097896c", null ], [ "I2CFG0", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609a3b9ea201e818a81ff15c67c8355b69a9", null ], [ "I1CFG2", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609a9eca3257a204c8d5ae84556fe35e7ae5", null ], [ "I1CFG1", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609a464af0d0be8dcb3ae184ee8393d96184", null ], [ "I1CFG0", "structxpcc_1_1lis302dl.html#a90f487193bb6ccd17422436bc6806609ae1b3c3dac3a8218e87ca284498b7240f", null ] ] ], [ "Status", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14", [ [ "ZYXOR", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14a07c8a8a238077ea5a1fe5f7d27ce17ea", null ], [ "ZOR", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14a75648af599de2ecff06e8b74e5fd15c2", null ], [ "YOR", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14ab4652c70616921163675fc666a87567c", null ], [ "XOR", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14a97675eb3f268048604dc5155511a2a4d", null ], [ "ZYXDA", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14a15030e356314d13fffae2797cdbdfe21", null ], [ "ZDA", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14a177ec88f1770157c912abd69c5051d44", null ], [ "YDA", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14ae6186cebdf082153447731aa7471d43e", null ], [ "XDA", "structxpcc_1_1lis302dl.html#a7b7a62657d463d388c8324a684b64e14a4b97b426dbe516bfb0eea3074435e076", null ] ] ], [ "FreeFallConfig", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062", [ [ "AOI", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062a5a62b5103b7099b74f6646acc7ea33cf", null ], [ "LIR", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062af0882f02c3b094ddcbb4e6068f36d797", null ], [ "ZHIE", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062a8102890bf4c2292d963ced7365d9227c", null ], [ "ZLIE", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062af0f52eb64863a2f3693c22a6bfb3f7e9", null ], [ "YHIE", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062add590333749908e81f88c3a1a79caa77", null ], [ "YLIE", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062a55cc43aebfcec012d26c538bccecc8ab", null ], [ "XHIE", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062a33aa6cd5413d9a8639bc822f4b7ca62b", null ], [ "XLIE", "structxpcc_1_1lis302dl.html#a5d84249b6775b7e43602a415ed555062ac02ac8ce3ced73f50eaf3fbc38a88a57", null ] ] ], [ "FreeFallSource", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2", [ [ "IA", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2ab97267fa7855e04401fb12fa8a4c516f", null ], [ "ZH", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2a2f360b70e0ecf402694429fac3a9255d", null ], [ "ZL", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2ad53106f43f77d1f19dd046e0aa90253a", null ], [ "YH", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2a5c17f960b70dab695f51d47c723877c9", null ], [ "YL", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2a13db97f091ad35dd7718cbec004ce20a", null ], [ "XH", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2a5c03a72e9aff13360a8fcbdb9455f0cc", null ], [ "XL", "structxpcc_1_1lis302dl.html#a446f06a828a1f4e2f969f776acf478a2aa7a4ccc5e1a068d87f4965e014329201", null ] ] ], [ "FreeFallThreshold", "structxpcc_1_1lis302dl.html#a3984a603a385fa95354cf749c393aaff", [ [ "DRCM", "structxpcc_1_1lis302dl.html#a3984a603a385fa95354cf749c393aaffa2369e0a096383ea48c2d5e1facc89da4", null ], [ "THS_Mask", "structxpcc_1_1lis302dl.html#a3984a603a385fa95354cf749c393aaffa9e6a5fea4d1f18858b2a35b3228ed8ca", null ] ] ], [ "ClickConfig", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8", [ [ "LIR", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8af0882f02c3b094ddcbb4e6068f36d797", null ], [ "DoubleZ", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8a2eb733b194aaf69bf2c7338e2f9354c3", null ], [ "SingleZ", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8a941afcfe681fbcccfd4f42b8e2330e02", null ], [ "DoubleY", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8a7eb6df505ba5fbfe0b5a2858e816af0e", null ], [ "SingleY", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8a4c08dcace0a77d0c8629c7335d5b30d6", null ], [ "DoubleX", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8a7f30e07f3c92049a3fb8f7df4ccb1d12", null ], [ "SingleX", "structxpcc_1_1lis302dl.html#ad2c1e9ea5e2fec16fa6d4554919725b8a9fc3c0b4cba1fb8509ac1f6aee41f0ba", null ] ] ], [ "ClickSource", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfa", [ [ "IA", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaab97267fa7855e04401fb12fa8a4c516f", null ], [ "DoubleZ", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaa2eb733b194aaf69bf2c7338e2f9354c3", null ], [ "SingleZ", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaa941afcfe681fbcccfd4f42b8e2330e02", null ], [ "DoubleY", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaa7eb6df505ba5fbfe0b5a2858e816af0e", null ], [ "SingleY", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaa4c08dcace0a77d0c8629c7335d5b30d6", null ], [ "DoubleX", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaa7f30e07f3c92049a3fb8f7df4ccb1d12", null ], [ "SingleX", "structxpcc_1_1lis302dl.html#a11cbe95bf6cc0dbb75eb947daeb57dfaa9fc3c0b4cba1fb8509ac1f6aee41f0ba", null ] ] ], [ "InterruptSource", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8b", [ [ "GND", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8baeec5ca16eb7a29985d7dcb84eac54c07", null ], [ "FF_WU_1", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8ba4b7f2035f978b7ee52b9bf665adf3564", null ], [ "FF_WU_2", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8baf274fa718f842a4730a2c8afc193d9b8", null ], [ "FF_WU_1_OR_2", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8bae92927205c9cb7d06682ca7fa1f5698e", null ], [ "DataReady", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8bacb7658367c9fdd7110ebe09c34077d2c", null ], [ "Click", "structxpcc_1_1lis302dl.html#a5f26fa5fd9fe090309057a022a76bc8ba316853cc3718335f11c048e33b9be98a", null ] ] ], [ "MeasurementRate", "structxpcc_1_1lis302dl.html#a1fefa768f6029df73b5d436a04cb1967", [ [ "Hz100", "structxpcc_1_1lis302dl.html#a1fefa768f6029df73b5d436a04cb1967a0867776b73b2a43ba3013ad6691cf5bf", null ], [ "Hz400", "structxpcc_1_1lis302dl.html#a1fefa768f6029df73b5d436a04cb1967a7eb2a3d202ddb5cfb6578c642c6df2ad", null ] ] ], [ "Scale", "structxpcc_1_1lis302dl.html#a9bb39f03c09ee03ddace9dca40254c00", [ [ "G2", "structxpcc_1_1lis302dl.html#a9bb39f03c09ee03ddace9dca40254c00ad24bade136bc8cd77e37395ea94226eb", null ], [ "G8", "structxpcc_1_1lis302dl.html#a9bb39f03c09ee03ddace9dca40254c00ae034278428deb1ad937eb98f2ad0217a", null ] ] ], [ "Interrupt", "structxpcc_1_1lis302dl.html#a3eb39f113a773e2f72dca209dee4900a", [ [ "One", "structxpcc_1_1lis302dl.html#a3eb39f113a773e2f72dca209dee4900aa06c2cea18679d64399783748fa367bdd", null ], [ "Two", "structxpcc_1_1lis302dl.html#a3eb39f113a773e2f72dca209dee4900aaaada29daee1d64ed0fe907043855cb7e", null ] ] ], [ "Axis", "structxpcc_1_1lis302dl.html#a43cc1c25b249730fe7e8b8bd67074113", [ [ "X", "structxpcc_1_1lis302dl.html#a43cc1c25b249730fe7e8b8bd67074113a02129bb861061d1a052c592e2dc6b383", null ], [ "Y", "structxpcc_1_1lis302dl.html#a43cc1c25b249730fe7e8b8bd67074113a57cec4137b614c87cb4e24a3d003a3e0", null ], [ "Z", "structxpcc_1_1lis302dl.html#a43cc1c25b249730fe7e8b8bd67074113a21c2e59531c8710156d34a3c30ac81d5", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_ds18b20.js var classxpcc_1_1_ds18b20 = [ [ "Ds18b20", "classxpcc_1_1_ds18b20.html#a49d368cb3403df7a2d23315c97d28bf9", null ], [ "isAvailable", "classxpcc_1_1_ds18b20.html#a83083bf438fd193faff06b330eb337ec", null ], [ "startConversion", "classxpcc_1_1_ds18b20.html#ad50884d983cfe884ddf1c1fd60819413", null ], [ "startConversions", "classxpcc_1_1_ds18b20.html#a99b70d7ec05487c75ff649561f2b8fc2", null ], [ "isConversionDone", "classxpcc_1_1_ds18b20.html#a2ef6054d868ff31582738a34527fc2d3", null ], [ "readTemperature", "classxpcc_1_1_ds18b20.html#aea95e03bb1d9eb102fd2d806719f205a", null ], [ "selectDevice", "classxpcc_1_1_ds18b20.html#af1b05683ca51e25195f95c3631dd91c3", null ], [ "identifier", "classxpcc_1_1_ds18b20.html#ad15eaf76a11d5c130c42b80c8af0b099", null ] ];<file_sep>/docs/api/classxpcc_1_1atmega_1_1_adc.js var classxpcc_1_1atmega_1_1_adc = [ [ "Channel", "classxpcc_1_1atmega_1_1_adc.html#a4dc0ed1adfdafff6449d322a64ec9511", null ], [ "Reference", "classxpcc_1_1atmega_1_1_adc.html#acb2b05d142d84a5813022e6bc170dbac", [ [ "ExternalRef", "classxpcc_1_1atmega_1_1_adc.html#acb2b05d142d84a5813022e6bc170dbacadcb477490fdcf66b51257f35e1275c41", null ], [ "InternalVcc", "classxpcc_1_1atmega_1_1_adc.html#acb2b05d142d84a5813022e6bc170dbaca665935fb1b5300c4a5a06ff045e92f70", null ], [ "Internal2V56", "classxpcc_1_1atmega_1_1_adc.html#acb2b05d142d84a5813022e6bc170dbacac58ec7ad86ed1450f3f0219ecfc4ba78", null ], [ "Internal1V1", "classxpcc_1_1atmega_1_1_adc.html#acb2b05d142d84a5813022e6bc170dbaca47926a8a3a6d633538cae756278f3483", null ] ] ] ];<file_sep>/docs/api/group__platform.js var group__platform = [ [ "Stm32f407vg", "group__stm32f407vg.html", "group__stm32f407vg" ], [ "XPCC__COMPILER_STRING", "group__platform.html#ga26b46d1bedd3c1aac0660c5822a34c8d", null ], [ "XPCC__COMPILER_GCC", "group__platform.html#ga994e424bad7577d932194b13d7a23099", null ], [ "XPCC__OS_STRING", "group__platform.html#gad81c41b44edc12481e23da5432861139", null ], [ "XPCC__OS_UNIX", "group__platform.html#ga537dead81b8b55f21187e8804d8bb75e", null ], [ "XPCC__CPU_STRING", "group__platform.html#ga236bc9f604f8b1831e603e7dace542de", null ], [ "XPCC__CPU_AVR", "group__platform.html#ga2b7a16379c4b206600fa34859b13838a", null ], [ "XPCC__ALIGNMENT", "group__platform.html#ga802ad73dc32342463448faa31a291e6d", null ], [ "XPCC_ISR_NAME", "group__platform.html#ga70d80a19dae3916bfc040f43dcb9ace1", null ], [ "XPCC_ISR_DECL", "group__platform.html#ga8aaa12fe37c031c7c4749245189c70f3", null ], [ "XPCC_ISR_CALL", "group__platform.html#ga06dd1233847db10b3cf5ed8d721d4ffe", null ], [ "XPCC_ISR", "group__platform.html#ga8c519bcbffa546525acc426192db9f73", null ], [ "XPCC_STRINGIFY", "group__platform.html#ga538e4a576b14d5cc0d04c8a3989c7ab5", null ], [ "XPCC__COMPILER_MSVC", "group__platform.html#ga64710ff1131fa2e4f82d52cb41c5c5ca", null ], [ "XPCC__OS_LINUX", "group__platform.html#gadec15f573a2e02d1cac211b0356b842c", null ], [ "XPCC__OS_OSX", "group__platform.html#ga48df08a84c258128344bedd7e903eb72", null ], [ "XPCC__OS_WIN32", "group__platform.html#gab986d54b786c6c61deb0c67471cd12ce", null ], [ "XPCC__OS_WIN64", "group__platform.html#ga1f92258bc8d7bbf8d8ee0292634dfaf4", null ], [ "XPCC__CPU_ATXMEGA", "group__platform.html#ga16c14dcb32d26e6c49e4e42c8b5a7597", null ], [ "XPCC__CPU_ATMEGA", "group__platform.html#ga12ca36181e6629b057422e71d8e367db", null ], [ "XPCC__CPU_ATTINY", "group__platform.html#ga95b7b044d5377f5c5b049d51930162b4", null ], [ "XPCC__CPU_ARM", "group__platform.html#ga384d6eff615d9857ba315c4359303284", null ], [ "XPCC__CPU_ARM7TDMI", "group__platform.html#gabbdfb793d1c6e252b30f0f4c5334fa35", null ], [ "XPCC__CPU_CORTEX_M0", "group__platform.html#gae3577266c9f1d40100f173ef22e74fcb", null ], [ "XPCC__CPU_CORTEX_M4", "group__platform.html#ga44c3a1bfd9101b63229b922d823b7634", null ], [ "XPCC__CPU_CORTEX_M4", "group__platform.html#ga44c3a1bfd9101b63229b922d823b7634", null ], [ "XPCC__OS_HOSTED", "group__platform.html#gaa1742550c2d75f1b56487997d8cae801", null ], [ "XPCC__OS_HOSTED_64", "group__platform.html#ga5ca719d180a9b807d4cada4045f88d66", null ], [ "XPCC__ORDER_BIG_ENDIAN", "group__platform.html#ga9b50b32673038aaa5e704e0ee8d77cc3", null ], [ "XPCC__ORDER_LITTLE_ENDIAN", "group__platform.html#ga043eec4031ea8f602ec79dedb35af02c", null ], [ "XPCC__ORDER_PDP_ENDIAN", "group__platform.html#gac7c355d32f1a8da5c1b39c22a71394b3", null ], [ "XPCC__BYTE_ORDER", "group__platform.html#ga122b749e27c2b396e036755e6d64651e", null ], [ "XPCC__IS_BIG_ENDIAN", "group__platform.html#ga2dd0bb35507a566e380d1286038d7384", null ], [ "XPCC__IS_LITTLE_ENDIAN", "group__platform.html#ga112b5791137febd2e8d27fcb13eb5f80", null ], [ "XPCC__SIZEOF_POINTER", "group__platform.html#ga91e47c41ee0b626c9058443b27fa5ee5", null ], [ "XPCC_CONCAT", "group__platform.html#ga226572a264c4563b5abfe90d8bed86e1", null ], [ "XPCC_CONCAT3", "group__platform.html#ga1fa36d861ed024eb2603d0e602ae2a41", null ], [ "XPCC_CONCAT4", "group__platform.html#ga33e52117860a1d2e37010a0a50738532", null ], [ "XPCC_CONCAT5", "group__platform.html#gaf989ec80f8919ef767ee2d2bad743094", null ], [ "XPCC_ARRAY_SIZE", "group__platform.html#ga682434ae1ce205d29465a5dc5aebac64", null ], [ "xpcc_always_inline", "group__platform.html#ga0bee7aaaaa70cef94904fd124673f438", null ], [ "xpcc_unused", "group__platform.html#ga4aac833c78a7a3d20e29dfaa6655cf57", null ], [ "xpcc_weak", "group__platform.html#gab52a1bd815b06033615a759c93c77355", null ], [ "xpcc_aligned", "group__platform.html#ga9d2e7d420e517bf98683960a2eed5047", null ], [ "xpcc_packed", "group__platform.html#ga27518a93535e6ec8ab695bf5d5401028", null ], [ "xpcc_section", "group__platform.html#ga608575191ac19d142660a11d09bc6710", null ], [ "xpcc_fastcode", "group__platform.html#gab255577ba5fe79efd20163fb4133ece9", null ], [ "xpcc_fastdata", "group__platform.html#gaa2ff87a1086c0db10b501b41941f3466", null ], [ "xpcc_likely", "group__platform.html#ga762f985b4bb01aad5f6a5af078395e8f", null ], [ "xpcc_unlikely", "group__platform.html#ga1897540123cc00516bbd81df1ed351d1", null ] ];<file_sep>/docs/api/structxpcc_1_1ad7280a_1_1_conversion_value.js var structxpcc_1_1ad7280a_1_1_conversion_value = [ [ "device", "structxpcc_1_1ad7280a_1_1_conversion_value.html#ab1e161fb5548686fe367136ca9da3398", null ], [ "channel", "structxpcc_1_1ad7280a_1_1_conversion_value.html#ababe817e9dc602ffa432990f08922e58", null ], [ "value", "structxpcc_1_1ad7280a_1_1_conversion_value.html#a202d63f1e887924dacf3ce6f0b4bf57d", null ], [ "acknowledge", "structxpcc_1_1ad7280a_1_1_conversion_value.html#a06b3e2158afaca877de0e47195a81f45", null ] ];<file_sep>/docs/api/search/typedefs_2.js var searchData= [ ['channel',['Channel',['../classxpcc_1_1_adc.html#ab4ad09b0e8dbf2d2f4ede2c985140798',1,'xpcc::Adc']]], ['configurationhandler',['ConfigurationHandler',['../structxpcc_1_1_i2c.html#a1e2ee33e8c5cba6b043367ff032c2e59',1,'xpcc::I2c::ConfigurationHandler()'],['../structxpcc_1_1_spi.html#aa8c715419d2370d9feab964cd7da0c04',1,'xpcc::Spi::ConfigurationHandler()']]] ]; <file_sep>/docs/api/group__container.js var group__container = [ [ "BoundedDeque", "classxpcc_1_1_bounded_deque.html", [ [ "const_iterator", "classxpcc_1_1_bounded_deque_1_1const__iterator.html", [ [ "const_iterator", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a33ff5d79ce5b9bdadd7dd389ecad19bf", null ], [ "const_iterator", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a429def27e9ff2876321b91904bd00e58", null ], [ "operator=", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a8018b6f2de59de31c4937ce0f678d55d", null ], [ "operator++", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#aeccf95307404d9abbc3f7e0326d9fbce", null ], [ "operator--", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a0daaf97e83ab9e7b26ecc665dab4fd12", null ], [ "operator==", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a3982764aeec831b525ef6ec78041f1a3", null ], [ "operator!=", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a4659da9815f787e7a5213e7e3f244487", null ], [ "operator*", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a26e02a746c495e628ce2b2d89dc44a72", null ], [ "operator->", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#aa6edd253d63db0d3b3485ac9f87768a4", null ], [ "BoundedDeque", "classxpcc_1_1_bounded_deque_1_1const__iterator.html#a0963c95bc99b14c0d114006148771887", null ] ] ], [ "Index", "classxpcc_1_1_bounded_deque.html#a3e969ebeea58a20418145f6515c6eebc", null ], [ "Size", "classxpcc_1_1_bounded_deque.html#abd924a92b459c268385eab4c1658de7b", null ], [ "BoundedDeque", "classxpcc_1_1_bounded_deque.html#abbcc154c06e00991bf14c97bd5cb8017", null ], [ "isEmpty", "classxpcc_1_1_bounded_deque.html#ac803e02511ed26bec9d801981b8d6888", null ], [ "isNotEmpty", "classxpcc_1_1_bounded_deque.html#a9f7fc97e0ef4e095ab99d4e92f40c611", null ], [ "isFull", "classxpcc_1_1_bounded_deque.html#aecea72517c30291afee40ee27635b6f4", null ], [ "isNotFull", "classxpcc_1_1_bounded_deque.html#a719854cad321913eb3d3bdb9c3c2f4b3", null ], [ "getSize", "classxpcc_1_1_bounded_deque.html#a16c39ee16b4bc1a8f27689818b3d8487", null ], [ "getMaxSize", "classxpcc_1_1_bounded_deque.html#ad07c56d2f75de6535ffe97e3da7a1623", null ], [ "clear", "classxpcc_1_1_bounded_deque.html#afa56fa09f5ab18a6c2eeda8e67173158", null ], [ "getFront", "classxpcc_1_1_bounded_deque.html#aab18cf0f608383b1a719849b77afb5f2", null ], [ "getFront", "classxpcc_1_1_bounded_deque.html#a778b79fd9989de92c4e800b721ef2463", null ], [ "get", "classxpcc_1_1_bounded_deque.html#a391333d995d96f0d7ec8ea9e90d6e49e", null ], [ "get", "classxpcc_1_1_bounded_deque.html#aac6c7cd0de763b1b720fe7c03eb795b1", null ], [ "operator[]", "classxpcc_1_1_bounded_deque.html#a6b15bed4c9d6e3122e42cf45dd739ad6", null ], [ "operator[]", "classxpcc_1_1_bounded_deque.html#a8aaa6c7ffc24ac16ef870dd348ad7120", null ], [ "rget", "classxpcc_1_1_bounded_deque.html#a50b453454ee6c4b2c9780b20baa7c3fd", null ], [ "rget", "classxpcc_1_1_bounded_deque.html#abcca58042c73c9a31a758e9e948dafc4", null ], [ "getBack", "classxpcc_1_1_bounded_deque.html#a4e3f619cc20de62b076eed645faab79c", null ], [ "getBack", "classxpcc_1_1_bounded_deque.html#ae39ecedebe39c6c3c829caf556a4f569", null ], [ "append", "classxpcc_1_1_bounded_deque.html#aaf31a5b67ebc144acbbab00b33656d28", null ], [ "appendOverwrite", "classxpcc_1_1_bounded_deque.html#acec35598f10e247b96012986ac4b23d9", null ], [ "prepend", "classxpcc_1_1_bounded_deque.html#a4cdeee12310fd76e45a03d107be2a2df", null ], [ "prependOverwrite", "classxpcc_1_1_bounded_deque.html#ad53bf4356666807136a2b2fb2e39c9f2", null ], [ "removeBack", "classxpcc_1_1_bounded_deque.html#aa6d63eacd20be99f69b11daf4d4f5603", null ], [ "removeFront", "classxpcc_1_1_bounded_deque.html#a46af3ea80511e3a027cd934f34907ed7", null ], [ "begin", "classxpcc_1_1_bounded_deque.html#aedf6a1f292824200916b2689f9e063e5", null ], [ "end", "classxpcc_1_1_bounded_deque.html#aed2bbd1199bf45676b69bed08fa3edf2", null ], [ "const_iterator", "classxpcc_1_1_bounded_deque.html#ac220ce1c155db1ac44146c12d178056f", null ] ] ], [ "DoublyLinkedList", "classxpcc_1_1_doubly_linked_list.html", [ [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html", [ [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a9acb244001f7f2b19299c2cd8d04548f", null ], [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#ad271ff40b7992838c3bb458fa084a70a", null ], [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a8b053cbdb489192760d3e7c177d67622", null ], [ "operator=", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a31df8514327ddb17692aaa066f6609eb", null ], [ "operator++", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#aeb514825566f668d903e054f1e5b4158", null ], [ "operator--", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#aec54905c7df608c98856a12e7398440e", null ], [ "operator==", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a7bb79d59482685bea4a3a5929a740dbc", null ], [ "operator!=", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#adf71dc25e1d4d7c29b04fcf2af2bef63", null ], [ "operator*", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a25c39619f1b0aff8508a702de4502c8a", null ], [ "operator->", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a50d8ec97c4181dec87b6ded9aed86287", null ], [ "DoublyLinkedList", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html#a8518425fc192346c00bedb825184bcf1", null ] ] ], [ "iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html", [ [ "iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a02e3480d80fcabee390832912facbb2b", null ], [ "iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa5225f3035f8a5f8aa510b63f4846ae8", null ], [ "operator=", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa82ae6f76457e4c7a0b080a9b56127b6", null ], [ "operator++", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a3434e148ba87561fc0a799403b5badd8", null ], [ "operator--", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#ad5d5726920b2fb8b61496c63a416f5e4", null ], [ "operator==", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a28faa210baff0cdc1a9bbb72f53ee089", null ], [ "operator!=", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a0cd66f210c065c508055f965feca468c", null ], [ "operator*", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa5ba9f050ddb46f6b8ee01bb09f05af4", null ], [ "operator->", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a92e7747e7fdbbbae4b776f60ae95616f", null ], [ "DoublyLinkedList", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a8518425fc192346c00bedb825184bcf1", null ], [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f", null ] ] ], [ "Node", "classxpcc_1_1_doubly_linked_list.html#structxpcc_1_1_doubly_linked_list_1_1_node", [ [ "value", "classxpcc_1_1_doubly_linked_list.html#a81520a31188c2a7fcdae67a329fdf830", null ], [ "previous", "classxpcc_1_1_doubly_linked_list.html#a737bffabe85c9901949c42035200d605", null ], [ "next", "classxpcc_1_1_doubly_linked_list.html#a44658487886ea776bcaaa848d600ce15", null ] ] ], [ "NodeAllocator", "classxpcc_1_1_doubly_linked_list.html#a95f614ffcdcc6aed1b370bc2ae0156e3", null ], [ "DoublyLinkedList", "classxpcc_1_1_doubly_linked_list.html#ae13d96f3b094875fe4ae051090053119", null ], [ "~DoublyLinkedList", "classxpcc_1_1_doubly_linked_list.html#ad475aacf96e3c20c280b6e13093bdf62", null ], [ "isEmpty", "classxpcc_1_1_doubly_linked_list.html#a256985e646a1d228cd080d551bf4e192", null ], [ "getSize", "classxpcc_1_1_doubly_linked_list.html#a19b63ba9f1eccc03e562623e3ebe47e8", null ], [ "prepend", "classxpcc_1_1_doubly_linked_list.html#a0426f041ad12dfc2ab4ee347197911c7", null ], [ "append", "classxpcc_1_1_doubly_linked_list.html#ad0dfde3a9638f7786eb04a4eb1592afa", null ], [ "removeFront", "classxpcc_1_1_doubly_linked_list.html#ab329a46b97cba6724961e88fa348726f", null ], [ "removeBack", "classxpcc_1_1_doubly_linked_list.html#ac769e838e547d99cdd6dc77b82488079", null ], [ "getFront", "classxpcc_1_1_doubly_linked_list.html#ac241dd57997d49b901685d37dcd126b4", null ], [ "getBack", "classxpcc_1_1_doubly_linked_list.html#a2f59547cd1ea8c04f089f7d1c03296d4", null ], [ "begin", "classxpcc_1_1_doubly_linked_list.html#ae539d0076584c05a69b2ebf7865da8cd", null ], [ "begin", "classxpcc_1_1_doubly_linked_list.html#a030b94a8852e729eef9cfbbb16aaf9c5", null ], [ "end", "classxpcc_1_1_doubly_linked_list.html#a9c646a89d4713fb1db8a0d945b9c9930", null ], [ "end", "classxpcc_1_1_doubly_linked_list.html#a3598ce2bc9fc423eb35aa0515f08f563", null ], [ "erase", "classxpcc_1_1_doubly_linked_list.html#a8afbc40c458ef42a58633e83f58269b3", null ], [ "const_iterator", "classxpcc_1_1_doubly_linked_list.html#ac220ce1c155db1ac44146c12d178056f", null ], [ "iterator", "classxpcc_1_1_doubly_linked_list.html#a67171474c4da6cc8efe0c7fafefd2b2d", null ], [ "nodeAllocator", "classxpcc_1_1_doubly_linked_list.html#a7193731e1158b080c38672539b4cddf5", null ], [ "front", "classxpcc_1_1_doubly_linked_list.html#ac173d68175eb07dd8adeeca35376cccd", null ], [ "back", "classxpcc_1_1_doubly_linked_list.html#aee784b541f756f7bd4721c16a6d24663", null ] ] ], [ "DynamicArray", "classxpcc_1_1_dynamic_array.html", [ [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html", [ [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a2810a2e16dd9b883afa886106823e745", null ], [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6799ad652564e60de4186e4043e8427b", null ], [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a4249f236733b9b5a3fa536e65350f2b4", null ], [ "operator=", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#aac0168e17ffccbb418678850c4d5b438", null ], [ "operator++", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#aca58b806e31739394fa077e039c2d9d0", null ], [ "operator--", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6820a1b92a2837b62a3e985b7b727db9", null ], [ "operator==", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a710ed96b1a3447a3f0ae6dcdf369bc34", null ], [ "operator!=", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a963a71b636aa50192395509e6845602f", null ], [ "operator*", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#ac96c3604a72a8f48fc0c1023a896bb87", null ], [ "operator->", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a59ccd372cf049d2d339e9829e799c2f7", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a845f49ed7330a208136c47af630fe8d3", null ] ] ], [ "iterator", "classxpcc_1_1_dynamic_array_1_1iterator.html", [ [ "iterator", "classxpcc_1_1_dynamic_array_1_1iterator.html#aa8a3c37ba0e0bd226f329f0df64ef518", null ], [ "iterator", "classxpcc_1_1_dynamic_array_1_1iterator.html#ab46098cae57584f905a8626816e70849", null ], [ "operator=", "classxpcc_1_1_dynamic_array_1_1iterator.html#a17f0a753e0dcfa9a3182a75461aa68ed", null ], [ "operator++", "classxpcc_1_1_dynamic_array_1_1iterator.html#ae990105fd206c8fdee038c693e0da071", null ], [ "operator--", "classxpcc_1_1_dynamic_array_1_1iterator.html#a6948a39c8af41b733ea421c5a44d37a2", null ], [ "operator==", "classxpcc_1_1_dynamic_array_1_1iterator.html#a7ea67d2070463051dcf2574252270114", null ], [ "operator!=", "classxpcc_1_1_dynamic_array_1_1iterator.html#a88203fedba35251d9bc2544a339dd5af", null ], [ "operator<", "classxpcc_1_1_dynamic_array_1_1iterator.html#a4dc26776c96d44d6420d42db30acdca2", null ], [ "operator>", "classxpcc_1_1_dynamic_array_1_1iterator.html#ac2947732c5613bf9016c1dcc89df1964", null ], [ "operator*", "classxpcc_1_1_dynamic_array_1_1iterator.html#a88def1037cad12ad13d2b0f5e11abe3a", null ], [ "operator->", "classxpcc_1_1_dynamic_array_1_1iterator.html#a93c1047e5fde91971bb505e35d4f49bb", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array_1_1iterator.html#a845f49ed7330a208136c47af630fe8d3", null ], [ "const_iterator", "classxpcc_1_1_dynamic_array_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f", null ] ] ], [ "SizeType", "classxpcc_1_1_dynamic_array.html#abb14add54aeb78cc25dfbe5763d321d7", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array.html#a691d10d74f2c175dcdb1669412be2241", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array.html#a0d845b79d13e99f594807b8be8e4d25f", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array.html#a11bfd806707d308ba7b66d8a853ff4f5", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array.html#a03b91efdf4b1bc7a17f201a796986344", null ], [ "DynamicArray", "classxpcc_1_1_dynamic_array.html#a3d7377482d2cd9497043a29248657fbf", null ], [ "~DynamicArray", "classxpcc_1_1_dynamic_array.html#a53e29008a6e2426b14d381011427ce9d", null ], [ "operator=", "classxpcc_1_1_dynamic_array.html#a5a166da5033f94b20b1a5b33908f5635", null ], [ "isEmpty", "classxpcc_1_1_dynamic_array.html#a69688615274f64d964475d736aa81d24", null ], [ "getSize", "classxpcc_1_1_dynamic_array.html#ad6068d81fa04239f0da27ee5cbb80a9a", null ], [ "getCapacity", "classxpcc_1_1_dynamic_array.html#aa7d9b14e3cc5a6736b65bb248aac6cf4", null ], [ "reserve", "classxpcc_1_1_dynamic_array.html#acb3c6b43d308d2755220f5ab207f1626", null ], [ "clear", "classxpcc_1_1_dynamic_array.html#a88855d0b6d2bf609cdc54f1402cd35f2", null ], [ "removeAll", "classxpcc_1_1_dynamic_array.html#a53290f2e2b45ec4230742b2dd90233f8", null ], [ "operator[]", "classxpcc_1_1_dynamic_array.html#a2bd5abf0e6c383232977c857c124e920", null ], [ "operator[]", "classxpcc_1_1_dynamic_array.html#ad99f3d8a82122fcb5fd204709cbb71eb", null ], [ "append", "classxpcc_1_1_dynamic_array.html#ae8065ed33b329979c2f97573e28066ae", null ], [ "removeBack", "classxpcc_1_1_dynamic_array.html#a23641556787591624ee78618012d185b", null ], [ "getFront", "classxpcc_1_1_dynamic_array.html#a5df0b8745901c2af0ffcb77632fa587d", null ], [ "getFront", "classxpcc_1_1_dynamic_array.html#a8de3c7b83041debd4c7880b902d8225c", null ], [ "getBack", "classxpcc_1_1_dynamic_array.html#a805eca2d585c9bb5075c57fc9bfaac12", null ], [ "getBack", "classxpcc_1_1_dynamic_array.html#aad0759a9e16008fe52405b380cf23063", null ], [ "begin", "classxpcc_1_1_dynamic_array.html#a948a1cf01e6916c5a011e9158d06a41a", null ], [ "begin", "classxpcc_1_1_dynamic_array.html#a2148b0f855a4882f47e57ce2bf58af3e", null ], [ "end", "classxpcc_1_1_dynamic_array.html#a68fb16d638a9f5991861e65ce6023bd4", null ], [ "end", "classxpcc_1_1_dynamic_array.html#a5e1a8be3f8862086f755f6737a2187c2", null ], [ "find", "classxpcc_1_1_dynamic_array.html#aac41df48db952c0204aab52d14064260", null ], [ "find", "classxpcc_1_1_dynamic_array.html#a896174903468040bdf580e51302deecf", null ], [ "const_iterator", "classxpcc_1_1_dynamic_array.html#ac220ce1c155db1ac44146c12d178056f", null ], [ "iterator", "classxpcc_1_1_dynamic_array.html#a67171474c4da6cc8efe0c7fafefd2b2d", null ] ] ], [ "LinkedList", "classxpcc_1_1_linked_list.html", [ [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html", [ [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html#a5ca6f222cad4128e040a414c03fddfcd", null ], [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html#a2e86a58d9282e74606a59b278e08d100", null ], [ "const_iterator", "classxpcc_1_1_linked_list_1_1const__iterator.html#a48454a8b849b4dab7d281ab7a286e441", null ], [ "operator=", "classxpcc_1_1_linked_list_1_1const__iterator.html#a853968739b0cd93424657936ff4ab86f", null ], [ "operator++", "classxpcc_1_1_linked_list_1_1const__iterator.html#abc3058f226040ef3ca552060662aefe8", null ], [ "operator==", "classxpcc_1_1_linked_list_1_1const__iterator.html#a3ad2aa187824f52f86092aa61f1f4612", null ], [ "operator!=", "classxpcc_1_1_linked_list_1_1const__iterator.html#a7e9f1a9ac766a3a3b797d63f67c5908d", null ], [ "operator*", "classxpcc_1_1_linked_list_1_1const__iterator.html#a64c504096e1c45957d95ef16df5566d9", null ], [ "operator->", "classxpcc_1_1_linked_list_1_1const__iterator.html#acfca38b707206e63ece974956eeb2727", null ], [ "LinkedList", "classxpcc_1_1_linked_list_1_1const__iterator.html#af71fad9f4990e232af55c73aeddb3823", null ] ] ], [ "iterator", "classxpcc_1_1_linked_list_1_1iterator.html", [ [ "iterator", "classxpcc_1_1_linked_list_1_1iterator.html#ab8bb7f268a6d0b7cdf09b86df2130500", null ], [ "iterator", "classxpcc_1_1_linked_list_1_1iterator.html#a349b2812c03fc1e485b95003f2e59277", null ], [ "operator=", "classxpcc_1_1_linked_list_1_1iterator.html#a2b280b98751d0f72a747e701d2337a94", null ], [ "operator++", "classxpcc_1_1_linked_list_1_1iterator.html#a9f5db15218bd4ee7a52803664a22a48a", null ], [ "operator==", "classxpcc_1_1_linked_list_1_1iterator.html#a1757fa18c9e1597126d65fbe6566e225", null ], [ "operator!=", "classxpcc_1_1_linked_list_1_1iterator.html#a670bd2f494a95501ba60b4e0424dc702", null ], [ "operator*", "classxpcc_1_1_linked_list_1_1iterator.html#a56201fb7e5fe71e8c64cd260d315f275", null ], [ "operator->", "classxpcc_1_1_linked_list_1_1iterator.html#a192748345412791d20e9f5dc5ed688f6", null ], [ "LinkedList", "classxpcc_1_1_linked_list_1_1iterator.html#af71fad9f4990e232af55c73aeddb3823", null ], [ "const_iterator", "classxpcc_1_1_linked_list_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f", null ] ] ], [ "Node", "classxpcc_1_1_linked_list.html#structxpcc_1_1_linked_list_1_1_node", [ [ "value", "classxpcc_1_1_linked_list.html#a9daec409fe008e9accddcce3084ca923", null ], [ "next", "classxpcc_1_1_linked_list.html#a5d62cff41a20abc9ca2ac6991652f7a6", null ] ] ], [ "Size", "classxpcc_1_1_linked_list.html#a22c4a454e4386a90716a399ed399bbdb", null ], [ "NodeAllocator", "classxpcc_1_1_linked_list.html#a289fa56c443b91fdb8febada34bd2a32", null ], [ "LinkedList", "classxpcc_1_1_linked_list.html#addf86544f8901cd3327238ffab3a3082", null ], [ "~LinkedList", "classxpcc_1_1_linked_list.html#ac83c14a8a3748f219294b7570a063739", null ], [ "isEmpty", "classxpcc_1_1_linked_list.html#ae481dcd4e2982644c58fd46cc20541fa", null ], [ "getSize", "classxpcc_1_1_linked_list.html#ad6d8fd102a0c6a7d6d5d00a98d0d66a1", null ], [ "prepend", "classxpcc_1_1_linked_list.html#a2a16b34e53976a662ea84d7605cc87fb", null ], [ "append", "classxpcc_1_1_linked_list.html#a3f2cf3b2bdd6c3c32176ae6cff3cb584", null ], [ "removeFront", "classxpcc_1_1_linked_list.html#a95ae873963d11395b40b312eabfa63e4", null ], [ "getFront", "classxpcc_1_1_linked_list.html#ab26092ed4ff07e654ca8d074dd6f592d", null ], [ "getFront", "classxpcc_1_1_linked_list.html#a96c2fac77c65e6529b1a7db35fb12c28", null ], [ "getBack", "classxpcc_1_1_linked_list.html#a9da35cb91c7f08784984a20f1b788bb2", null ], [ "getBack", "classxpcc_1_1_linked_list.html#a3a6b9ca0d0bb11737ed9f0359bdd4392", null ], [ "removeAll", "classxpcc_1_1_linked_list.html#aabcb136609a8bd07001e4475bc1208a2", null ], [ "begin", "classxpcc_1_1_linked_list.html#a404f8b4fcb1cf228440116c9e240bc53", null ], [ "begin", "classxpcc_1_1_linked_list.html#a145b624a6986ecd9737767ce06307ef9", null ], [ "end", "classxpcc_1_1_linked_list.html#ac95f14c9a62cfb1aa38ba1cbc5dc991c", null ], [ "end", "classxpcc_1_1_linked_list.html#a6efa92f12e65d445d92023c57df66eb3", null ], [ "remove", "classxpcc_1_1_linked_list.html#a7a65318c50a31bf2c0b5aeb89107df66", null ], [ "insert", "classxpcc_1_1_linked_list.html#a54cff0656a00b0d29453a5d974f5edd4", null ], [ "const_iterator", "classxpcc_1_1_linked_list.html#ac220ce1c155db1ac44146c12d178056f", null ], [ "iterator", "classxpcc_1_1_linked_list.html#a67171474c4da6cc8efe0c7fafefd2b2d", null ], [ "nodeAllocator", "classxpcc_1_1_linked_list.html#a75f98acd3c90a128f853c444163e02f9", null ], [ "front", "classxpcc_1_1_linked_list.html#ab6683f715568ea3ac30dd3b9169687bd", null ], [ "back", "classxpcc_1_1_linked_list.html#ab15cd9c61a5a1f80898173b23d615c2b", null ] ] ], [ "Pair", "classxpcc_1_1_pair.html", [ [ "FirstType", "classxpcc_1_1_pair.html#aaef2ef1af1dc3c22171cfdc1d7cf973a", null ], [ "SecondType", "classxpcc_1_1_pair.html#acd085a5ab8b5841b568da62b65e09936", null ], [ "getFirst", "classxpcc_1_1_pair.html#adb57dab5672820c5e4740f31987d3d59", null ], [ "getFirst", "classxpcc_1_1_pair.html#a6a62c80f31555fffc8f2f8e14bd9c5b0", null ], [ "getSecond", "classxpcc_1_1_pair.html#a5215e5567410d2c770d13e701c4422da", null ], [ "getSecond", "classxpcc_1_1_pair.html#a59ea7074c39966f3c596a782034bdb15", null ], [ "first", "classxpcc_1_1_pair.html#a8878863fb28f9a46c28c63d7704881d8", null ], [ "second", "classxpcc_1_1_pair.html#a99ea08d424b9f1d7008dba2866f63e9a", null ] ] ], [ "Queue", "classxpcc_1_1_queue.html", [ [ "Size", "classxpcc_1_1_queue.html#a22b626c9cea492425dee0907fb84c5b6", null ], [ "isEmpty", "classxpcc_1_1_queue.html#adc215c52ba3fba7bdefe5d5d8b3ada59", null ], [ "isNotEmpty", "classxpcc_1_1_queue.html#a5f80f8c589e86835fe5298606925da8a", null ], [ "isFull", "classxpcc_1_1_queue.html#a848eef1df0b79b64677b66c4207606c2", null ], [ "isNotFull", "classxpcc_1_1_queue.html#adf21c386538cea91ee0c3f48767df667", null ], [ "getSize", "classxpcc_1_1_queue.html#ac794a57ea4f5c28dbfaca408da022dd9", null ], [ "getMaxSize", "classxpcc_1_1_queue.html#a43ec2fcdfb6a028217f4206dbe7c9c02", null ], [ "get", "classxpcc_1_1_queue.html#adf6c9fea53aa053c3f377dd861521697", null ], [ "get", "classxpcc_1_1_queue.html#a2e52c024b49ca66183190c1851307ff0", null ], [ "push", "classxpcc_1_1_queue.html#a71f8ab3511278b9d1fd8becb2d10b83a", null ], [ "pop", "classxpcc_1_1_queue.html#a9c09f7820c051f39f73a8b42653bc700", null ], [ "c", "classxpcc_1_1_queue.html#abaabfe78c130c443eb50b1ce7b3de0be", null ] ] ], [ "BoundedQueue", "classxpcc_1_1_bounded_queue.html", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html", [ [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#a35642760a27a1adf865f9aff32ad8cd5", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#af59427b7cfa6f8c7beda74afdf8dc29a", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#a8f614428db9e49b9285c53192eafc1ba", null ], [ "SmartPointer", "classxpcc_1_1_smart_pointer.html#ab20d2d0ae241868046b51eec51fe6e7c", null ], [ "~SmartPointer", "classxpcc_1_1_smart_pointer.html#af9d4d69ef2a425a5a45a1f658e8cac4b", null ], [ "getPointer", "classxpcc_1_1_smart_pointer.html#a22977d1c61cdc89727c406529f92ce68", null ], [ "getPointer", "classxpcc_1_1_smart_pointer.html#ace274a5bd94d95ef619ca66fc3f4ea60", null ], [ "getSize", "classxpcc_1_1_smart_pointer.html#a635445da636851d0aa3fba3ec554cc3d", null ], [ "get", "classxpcc_1_1_smart_pointer.html#a6d75f503be3f15751414028cca140eea", null ], [ "get", "classxpcc_1_1_smart_pointer.html#ad2bbbb25171032fef0df015ad17528ef", null ], [ "operator==", "classxpcc_1_1_smart_pointer.html#ae91af79b6fb9e4aa25fad1d94af357d3", null ], [ "operator=", "classxpcc_1_1_smart_pointer.html#ae7ca4ffaefc7b0874ebb11e8e0df8d10", null ], [ "operator<<", "classxpcc_1_1_smart_pointer.html#a96e98848a8890f7429bd90edb1168637", null ], [ "ptr", "classxpcc_1_1_smart_pointer.html#a9cf08c940d47f091c401d0024688f373", null ] ] ], [ "Stack", "classxpcc_1_1_stack.html", [ [ "Size", "classxpcc_1_1_stack.html#a17dcd51b812b942797b83075b7b76a69", null ], [ "isEmpty", "classxpcc_1_1_stack.html#af84856b68f903d913bf7e8551618a48f", null ], [ "isFull", "classxpcc_1_1_stack.html#a7586b9e4ebdede5d70b5e34de81efc9e", null ], [ "getSize", "classxpcc_1_1_stack.html#af1ef507c0745d83a11ca5a413482a87d", null ], [ "getMaxSize", "classxpcc_1_1_stack.html#aca2efee6371a52f7d02fe1d4fe956d6b", null ], [ "get", "classxpcc_1_1_stack.html#a17f71b2b820103aef042eb85398e00ea", null ], [ "get", "classxpcc_1_1_stack.html#af87ce6aa0785150bebdda6b5fcda6643", null ], [ "push", "classxpcc_1_1_stack.html#afbb89e64f93644d5a60253deb870c642", null ], [ "pop", "classxpcc_1_1_stack.html#a170739384306575a1888929d2acf5d6a", null ], [ "c", "classxpcc_1_1_stack.html#ac050d548462c218e76d27c831d90523d", null ] ] ], [ "BoundedStack", "classxpcc_1_1_bounded_stack.html", null ] ];<file_sep>/docs/api/structxpcc_1_1_arithmetic_traits_3_01uint64__t_01_4.js var structxpcc_1_1_arithmetic_traits_3_01uint64__t_01_4 = [ [ "WideType", "group__arithmetic__trais.html#ga3054c4475388e186ea8ab898d0ca1d3a", null ], [ "SignedType", "group__arithmetic__trais.html#ga1f164b13dc84820ad5c9e0b98591efe5", null ], [ "UnsignedType", "group__arithmetic__trais.html#gacf0c50e46b2105a8d0a73784e217b6c7", null ] ];<file_sep>/docs/api/structxpcc_1_1_flags.js var structxpcc_1_1_flags = [ [ "EnumType", "structxpcc_1_1_flags.html#ad36f975972b7533b6efea7fa35f41c6c", null ], [ "Flags", "structxpcc_1_1_flags.html#a9696ef8ecda6422cf57cd6e4d35d27e9", null ], [ "Flags", "structxpcc_1_1_flags.html#a2248c7dfb16af1e6b56c535456a3a711", null ], [ "Flags", "structxpcc_1_1_flags.html#a0aad98429dbb24279cff3df04ddfe67b", null ], [ "Flags", "structxpcc_1_1_flags.html#afd51f6f55075bf102f8a5885a2819e0f", null ], [ "Flags", "structxpcc_1_1_flags.html#afa58f26177327ba2773064650503314c", null ], [ "Flags", "structxpcc_1_1_flags.html#ad6e8b6779683dbf033e838525fdcbb34", null ], [ "Flags", "structxpcc_1_1_flags.html#a4dabf8c22c4abdce95e62c749a322963", null ], [ "operator=", "structxpcc_1_1_flags.html#a25d9d111e10a7619fed97b17605340c4", null ], [ "operator=", "structxpcc_1_1_flags.html#a1731596de3312964152d9010bf900de7", null ], [ "set", "structxpcc_1_1_flags.html#aa7712d94df88f4592f6c15fad8404b2e", null ], [ "set", "structxpcc_1_1_flags.html#a9238cacb1bac0cb40957c5ae87f59b3c", null ], [ "reset", "structxpcc_1_1_flags.html#a81c85bb7356ffea91e3fd5aac6058148", null ], [ "reset", "structxpcc_1_1_flags.html#a0a786034294e5af0ddcd514cd6b40db1", null ], [ "toggle", "structxpcc_1_1_flags.html#ad268608429ef5dae6e3773c36739e472", null ], [ "toggle", "structxpcc_1_1_flags.html#adf887753df75db396de910828bdcd865", null ], [ "update", "structxpcc_1_1_flags.html#a33b6a8df8aff8995b0b413583beeb66a", null ], [ "update", "structxpcc_1_1_flags.html#af2ad5160a2ee32ce8abd7b345ec29d2f", null ], [ "all", "structxpcc_1_1_flags.html#aa87018f9fc225bf38ae307d2f6684b9d", null ], [ "any", "structxpcc_1_1_flags.html#a045e6f8caf92e1ff3de3aba3e11005f0", null ], [ "none", "structxpcc_1_1_flags.html#ad8c85c40fba32344dcddc21050276cfe", null ], [ "all", "structxpcc_1_1_flags.html#ae1e50d05da3726c6307f265e0c315e52", null ], [ "any", "structxpcc_1_1_flags.html#a54c227091cdeb8a8d176df417b6d3b3e", null ], [ "none", "structxpcc_1_1_flags.html#ac8182708ee2cfd94d7721dd6e766fd99", null ] ];<file_sep>/docs/api/structxpcc_1_1_i2c_transaction_1_1_starting.js var structxpcc_1_1_i2c_transaction_1_1_starting = [ [ "Starting", "structxpcc_1_1_i2c_transaction_1_1_starting.html#a5f6ff356fdf897b9175333bde75fb474", null ], [ "address", "structxpcc_1_1_i2c_transaction_1_1_starting.html#a341e91ed00b16c729efc586ca91c93eb", null ], [ "next", "structxpcc_1_1_i2c_transaction_1_1_starting.html#a0d9dc6dfe4867c4c74de4d76e957c213", null ] ];<file_sep>/docs/api/group__attiny85.js var group__attiny85 = [ [ "ADC", "group__attiny85__adc.html", "group__attiny85__adc" ], [ "Core", "group__attiny85__core.html", null ], [ "GPIO", "group__attiny85__gpio.html", "group__attiny85__gpio" ] ];<file_sep>/docs/api/structxpcc_1_1tmp_1_1_conversion_3_01void_00_01_t_01_4.js var structxpcc_1_1tmp_1_1_conversion_3_01void_00_01_t_01_4 = [ [ "exists", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01_t_01_4.html#a10e6659aa5f11a4005584369d9342f91aeb82d423250098c01858da57fc26e6d8", null ], [ "existsBothWays", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01_t_01_4.html#a10e6659aa5f11a4005584369d9342f91a730999a8a8beec5d237ff6270843c398", null ], [ "isSameType", "structxpcc_1_1tmp_1_1_conversion_3_01void_00_01_t_01_4.html#a10e6659aa5f11a4005584369d9342f91a577dff6f4a992243b33687181ad7b9ff", null ] ];<file_sep>/docs/api/group__attiny85__adc.js var group__attiny85__adc = [ [ "Adc", "classxpcc_1_1attiny_1_1_adc.html", [ [ "Channel", "classxpcc_1_1attiny_1_1_adc.html#a34064b71261bae908149b918df058fa5", null ], [ "Reference", "classxpcc_1_1attiny_1_1_adc.html#ada2efab171322c9c2d852985ca1f1cff", [ [ "InternalVcc", "classxpcc_1_1attiny_1_1_adc.html#ada2efab171322c9c2d852985ca1f1cffa665935fb1b5300c4a5a06ff045e92f70", null ], [ "ExternalRef", "classxpcc_1_1attiny_1_1_adc.html#ada2efab171322c9c2d852985ca1f1cffadcb477490fdcf66b51257f35e1275c41", null ], [ "Internal1V1", "classxpcc_1_1attiny_1_1_adc.html#ada2efab171322c9c2d852985ca1f1cffa47926a8a3a6d633538cae756278f3483", null ], [ "Internal2V56", "classxpcc_1_1attiny_1_1_adc.html#ada2efab171322c9c2d852985ca1f1cffac58ec7ad86ed1450f3f0219ecfc4ba78", null ], [ "Internal2V56WithCap", "classxpcc_1_1attiny_1_1_adc.html#ada2efab171322c9c2d852985ca1f1cffab0f1108b04a29646713c99030195ae0c", null ] ] ] ] ], [ "AdcInterrupt", "classxpcc_1_1attiny_1_1_adc_interrupt.html", null ] ];<file_sep>/docs/api/classxpcc_1_1gui_1_1_float_field.js var classxpcc_1_1gui_1_1_float_field = [ [ "FloatField", "classxpcc_1_1gui_1_1_float_field.html#ab8ef6f8dc79210c47a528ad89a9a4488", null ], [ "render", "classxpcc_1_1gui_1_1_float_field.html#a023a8d319f7e2ac9619232520bba970f", null ] ];<file_sep>/docs/api/search/classes_16.js var searchData= [ ['zeromqconnector',['ZeroMQConnector',['../classxpcc_1_1_zero_m_q_connector.html',1,'xpcc']]], ['zeromqconnectorbase',['ZeroMQConnectorBase',['../classxpcc_1_1_zero_m_q_connector_base.html',1,'xpcc']]], ['zeromqreader',['ZeroMQReader',['../classxpcc_1_1_zero_m_q_reader.html',1,'xpcc']]] ]; <file_sep>/docs/api/classxpcc_1_1_doubly_linked_list.js var classxpcc_1_1_doubly_linked_list = [ [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1const__iterator.html", "classxpcc_1_1_doubly_linked_list_1_1const__iterator" ], [ "iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html", "classxpcc_1_1_doubly_linked_list_1_1iterator" ], [ "Node", "classxpcc_1_1_doubly_linked_list.html#structxpcc_1_1_doubly_linked_list_1_1_node", [ [ "value", "classxpcc_1_1_doubly_linked_list.html#a81520a31188c2a7fcdae67a329fdf830", null ], [ "previous", "classxpcc_1_1_doubly_linked_list.html#a737bffabe85c9901949c42035200d605", null ], [ "next", "classxpcc_1_1_doubly_linked_list.html#a44658487886ea776bcaaa848d600ce15", null ] ] ], [ "NodeAllocator", "classxpcc_1_1_doubly_linked_list.html#a95f614ffcdcc6aed1b370bc2ae0156e3", null ], [ "DoublyLinkedList", "classxpcc_1_1_doubly_linked_list.html#ae13d96f3b094875fe4ae051090053119", null ], [ "~DoublyLinkedList", "classxpcc_1_1_doubly_linked_list.html#ad475aacf96e3c20c280b6e13093bdf62", null ], [ "isEmpty", "classxpcc_1_1_doubly_linked_list.html#a256985e646a1d228cd080d551bf4e192", null ], [ "getSize", "classxpcc_1_1_doubly_linked_list.html#a19b63ba9f1eccc03e562623e3ebe47e8", null ], [ "prepend", "classxpcc_1_1_doubly_linked_list.html#a0426f041ad12dfc2ab4ee347197911c7", null ], [ "append", "classxpcc_1_1_doubly_linked_list.html#ad0dfde3a9638f7786eb04a4eb1592afa", null ], [ "removeFront", "classxpcc_1_1_doubly_linked_list.html#ab329a46b97cba6724961e88fa348726f", null ], [ "removeBack", "classxpcc_1_1_doubly_linked_list.html#ac769e838e547d99cdd6dc77b82488079", null ], [ "getFront", "classxpcc_1_1_doubly_linked_list.html#ac241dd57997d49b901685d37dcd126b4", null ], [ "getBack", "classxpcc_1_1_doubly_linked_list.html#a2f59547cd1ea8c04f089f7d1c03296d4", null ], [ "begin", "classxpcc_1_1_doubly_linked_list.html#ae539d0076584c05a69b2ebf7865da8cd", null ], [ "begin", "classxpcc_1_1_doubly_linked_list.html#a030b94a8852e729eef9cfbbb16aaf9c5", null ], [ "end", "classxpcc_1_1_doubly_linked_list.html#a9c646a89d4713fb1db8a0d945b9c9930", null ], [ "end", "classxpcc_1_1_doubly_linked_list.html#a3598ce2bc9fc423eb35aa0515f08f563", null ], [ "erase", "classxpcc_1_1_doubly_linked_list.html#a8afbc40c458ef42a58633e83f58269b3", null ], [ "const_iterator", "classxpcc_1_1_doubly_linked_list.html#ac220ce1c155db1ac44146c12d178056f", null ], [ "iterator", "classxpcc_1_1_doubly_linked_list.html#a67171474c4da6cc8efe0c7fafefd2b2d", null ], [ "nodeAllocator", "classxpcc_1_1_doubly_linked_list.html#a7193731e1158b080c38672539b4cddf5", null ], [ "front", "classxpcc_1_1_doubly_linked_list.html#ac173d68175eb07dd8adeeca35376cccd", null ], [ "back", "classxpcc_1_1_doubly_linked_list.html#aee784b541f756f7bd4721c16a6d24663", null ] ];<file_sep>/docs/api/classxpcc_1_1_dog_l128.js var classxpcc_1_1_dog_l128 = [ [ "initialize", "classxpcc_1_1_dog_l128.html#a024c6b843eefb93db0ff331b415346f6", null ] ];<file_sep>/docs/api/structxpcc_1_1_resumable_result.js var structxpcc_1_1_resumable_result = [ [ "ResumableResult", "structxpcc_1_1_resumable_result.html#a6fee477fa4f295d5f15eec1e0870cab9", null ], [ "ResumableResult", "structxpcc_1_1_resumable_result.html#ad7c25dfa013c49907e88c03a680c4325", null ], [ "getState", "structxpcc_1_1_resumable_result.html#a6d1dac08035f4992e0e244e53e98171f", null ], [ "getResult", "structxpcc_1_1_resumable_result.html#ae0da63e99f2720ea874d0c98eb11a9d2", null ] ];<file_sep>/docs/api/classxpcc_1_1_character_display_1_1_writer.js var classxpcc_1_1_character_display_1_1_writer = [ [ "Writer", "classxpcc_1_1_character_display_1_1_writer.html#a46095de6897d013589dea346294e0fc3", null ], [ "write", "classxpcc_1_1_character_display_1_1_writer.html#aebea58e9cf37dfd59ba7b9845fddd8c6", null ], [ "flush", "classxpcc_1_1_character_display_1_1_writer.html#a4c02916bc4a8040b1ed8f227aa4e8cde", null ], [ "read", "classxpcc_1_1_character_display_1_1_writer.html#aee75fc32b674d8970d16714fcd2f64f3", null ] ];<file_sep>/docs/api/structxpcc_1_1_menu_entry.js var structxpcc_1_1_menu_entry = [ [ "MenuEntry", "structxpcc_1_1_menu_entry.html#a6ff02e2307175a9309648b0e0a58dbfc", null ], [ "text", "structxpcc_1_1_menu_entry.html#a2ce321ab37c18e35af84955b257e29c7", null ], [ "callback", "structxpcc_1_1_menu_entry.html#ad7571cb4e65856420b115fa4d9b47702", null ] ];<file_sep>/docs/api/navtreeindex8.js var NAVTREEINDEX8 = { "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a9de1ddc37d3f92c7b23248b467fab68b":[1,8,3,11,10], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#a9f7629896fcc49dc78fccdd8998623da":[1,8,3,11,16], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#aa4ca81a9dc1463ea5fd126f28d4a0508":[1,8,3,11,14], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#aa90300c6aa98b6ee9fe594dfca554776":[1,8,3,11,19], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#abc092edeafe183cd0e450b8ab6bb45b9":[1,8,3,11,31], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ac04de08e06b877202ed22825e0b374ee":[1,8,3,11,0], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ac271089824a353d9ca3ae6274f5ef72a":[1,8,3,11,25], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#acc0cd9401a72c557ba969d484c811135":[1,8,3,11,6], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#acd83905490d346c374a07caea9eb33ab":[1,8,3,11,20], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#adeb24a3d6097212b35bb9a430f0c490f":[1,8,3,11,27], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ae111732dfb5f45390d399a7d95eabb6c":[1,8,3,11,18], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#ae968ad1d778a3b16c7dd3489a2c99ebf":[1,8,3,11,7], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#aed58afd6e5ed09a9bf122063b09f62ab":[1,8,3,11,34], "classxpcc_1_1_vector_3_01_t_00_011_01_4.html#af633571d74776974a8cb5d3f51081d31":[1,8,3,11,13], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html":[1,8,3,12], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a05be28408394d61362b36cb40f13597f":[1,8,3,12,2], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a0621a6ed9d41cb45f06ca6a405fa72b1":[1,8,3,12,3], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a090db83f4bec807a56da2430ada1b2fc":[1,8,3,12,23], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a091bd14d69df9f5df74a96c29a8433e4":[1,8,3,12,6], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a15a540ae16bf6683bb95521bf59e8501":[1,8,3,12,19], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a18d908e93c2e72e3127c206ec82344e2":[1,8,3,12,47], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a1acad82df4c177dc59312b0b0f234298":[1,8,3,12,7], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a1cbfbe2b51665d23552aba742750152e":[1,8,3,12,4], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a2127c1be5243ad959dc27079ff025dc2":[1,8,3,12,30], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a24d57e9b129e67379b6ea121c783e12b":[1,8,3,12,32], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a25fe0a17fcd73658ddbf122f2171b3ca":[1,8,3,12,51], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a2ad534923c2314865316e2842e614b47":[1,8,3,12,45], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a2ba51125806a685828ab918c93e603f6":[1,8,3,12,52], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a3b95ce10191e4025bbd75bf5574c95cc":[1,8,3,12,13], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a40f29ffa01d8641f012d7b8db1667a90":[1,8,3,12,40], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a465b4baa0f5a37af8b307f858d61a6ed":[1,8,3,12,54], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a48c430259bb1b392f8f65b1ff6dacfe1":[1,8,3,12,35], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a4f2f009a9495b6de5451410ab8c2172b":[1,8,3,12,25], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a522c44743dc9f7fc99d124910c03f177":[1,8,3,12,0], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a523fc7aa5b6b4aa53a0bc750dfb7fb36":[1,8,3,12,48], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a539cd7430062712f3e6e9b3829652cb4":[1,8,3,12,9], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a55e1a1292bd88c3dcc5154a8fde98515":[1,8,3,12,21], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a57eac5eecd8a21fd8ee295183355661b":[1,8,3,12,49], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a60677e780ee71136d2cf21fe9805d3f3":[1,8,3,12,20], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a66129f455c9555e6b2f3e870c52418af":[1,8,3,12,29], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a66eb2f90c62e69685e879e31f243dfdc":[1,8,3,12,24], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a741a80f9955e223f8705fce8e896e9d6":[1,8,3,12,43], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a75131cdf5530c5c33cd34129a73a4637":[1,8,3,12,34], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a75957f9ec30708e71adff2f099b2e4d7":[1,8,3,12,53], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a7e18724c3ea45e98c437d474c3fe725e":[1,8,3,12,61], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a7f9559738f52f34fe4ff28743c9c24e5":[1,8,3,12,55], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a81db05f5ba42872c1cf3632f92934b42":[1,8,3,12,11], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a83e26145d5c8d4542a423b54df720084":[1,8,3,12,31], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a8997e4d9a08780ff6b9bed769f4ea3c0":[1,8,3,12,14], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a8a98debee93d67c0a267e5105d0829bf":[1,8,3,12,16], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a8c1eb77eb90c95ae1812fc196d5122c5":[1,8,3,12,39], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a8cab6cf29026283a521451004aba80ea":[1,8,3,12,58], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#a8d3655e04b5fb8ffc67454ca06966864":[1,8,3,12,56], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aa009f18eff0a0387e029f0be83b045ad":[1,8,3,12,27], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aa01262650f76df2d02f556b635fb7431":[1,8,3,12,36], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aa0239a9aaf53104072e9e33dc944c920":[1,8,3,12,60], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aa553b526b8a4e2a036ac1a8fc445c516":[1,8,3,12,22], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aad5d18d7c89fada1c39cf332d1958da9":[1,8,3,12,59], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aaf13f254822461445ae487f1a1e87316":[1,8,3,12,33], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ab39e5d1e445e0a98768510c23321dac2":[1,8,3,12,46], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ab56af0c075ee8e346b814fae177d7842":[1,8,3,12,26], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ab8083daadc9c2d0fd75102315f51e82b":[1,8,3,12,28], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ab95feda6fef276cf309950be61a47af4":[1,8,3,12,8], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#abaacba18d4d0536f20e7786a10cd3733":[1,8,3,12,38], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#abf080b3287e27b7829e07e840e28d7cf":[1,8,3,12,57], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ac006adc9620582edc1248ada861da4ff":[1,8,3,12,15], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ac6fe964e6fadfa776c7bb578d29fcff3":[1,8,3,12,37], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ac7071f07061e02cb5ca291b0bb51a38d":[1,8,3,12,41], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ac82a1879595cc2e41d492e05dd5cb290":[1,8,3,12,18], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#acd8fdf896edeaa25667bd666579d92b2":[1,8,3,12,44], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ad3b0e007c82477d603e16f31efa8920c":[1,8,3,12,10], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ad45d8a8da6e86cd20a1d170e216465ee":[1,8,3,12,17], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ad8bca58f8a794bbc39d53502ca8ac5a7":[1,8,3,12,50], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ae2efe6db91bebf6fc130709a54bfee84":[1,8,3,12,64], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ae3aa25aa08b70c4ddab91c0adadef7e4":[1,8,3,12,5], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#ae992f0cba78e8a39bac544653353a6c9":[1,8,3,12,1], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aed86d4e7055e5e2247952cba3f905f6e":[1,8,3,12,62], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aeef1e152e9bb10f921c82bf6e4764b44":[1,8,3,12,42], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#aefd21149e400d47cc32c97a1b85ef59d":[1,8,3,12,63], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#af8adda5ab2177706bb531d491371baad":[1,8,3,12,65], "classxpcc_1_1_vector_3_01_t_00_012_01_4.html#afdda8e77550313869bab836b57eb22a6":[1,8,3,12,12], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html":[1,8,3,13], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a00cb996d0a2133b6748092867595ffd2":[1,8,3,13,18], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a0819f533b91ec650355125e8f51131d2":[1,8,3,13,55], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a09dd7afecc4ed33bfd4118ff22a8fc13":[1,8,3,13,58], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a0dd583c9c50fb9408594b092852a99d0":[1,8,3,13,56], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a0f5db076a23fb11390d65bbf0ed40898":[1,8,3,13,22], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a13740c10b2cd52cd84d2a64dd9235583":[1,8,3,13,0], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a1a9cc37310d0356704ab282ac27f3af9":[1,8,3,13,31], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a1f72dfe5aedbd0b82897eae6997950af":[1,8,3,13,60], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a21a9c10bae872af0e5c43828b0d22cbe":[1,8,3,13,12], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a254be686f597095fcb6d4b7fadb41a24":[1,8,3,13,36], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a331e1996e81f60069c9d50441bef504d":[1,8,3,13,61], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a350a71ad3fee4f41d94fa8ba594c6aac":[1,8,3,13,24], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a3521e6785e19d7b62c055d30b4aa434d":[1,8,3,13,5], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a38bef62194ea931dac523a5024ed2d23":[1,8,3,13,20], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a4cf67f7f16628f75a25ede70b41f6b41":[1,8,3,13,27], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a4e164eb8d34c2f962f36cf33fd115e7a":[1,8,3,13,54], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a511b97cc3ba8be2d795a8d0c7860ebde":[1,8,3,13,32], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a542e5c0297786357a1986e58fc9a4225":[1,8,3,13,51], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a54c24443a1110a3476a173c455da60ab":[1,8,3,13,49], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a586db2ccf144aa6e58adacbeb42a0fe7":[1,8,3,13,16], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a58bc7f21324bd2b25bd2efb87d8c3091":[1,8,3,13,7], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a5a9407ee709707d84259fcdc85c56144":[1,8,3,13,10], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a64e3479a208ecd46b5c0597befc2018d":[1,8,3,13,25], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a6d6e3f088bafed4573d3d742cdd02179":[1,8,3,13,48], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a6fe9d3116e4f0d0665a8b3a8b49d2c8b":[1,8,3,13,44], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a7c20d9ff35893e3e2c090b587579d02b":[1,8,3,13,21], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a88a78cd97823116df47d66b9b6941c37":[1,8,3,13,26], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a8ab728b90f15f234f0e7f535779204a2":[1,8,3,13,38], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a8e1b5bd44127ffa4ddd8f07743140489":[1,8,3,13,42], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a8ee02c3e72741958397908ca356bc19f":[1,8,3,13,2], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a94164566f1d783a0a383c99bc745e66e":[1,8,3,13,28], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a9538186ae0be0534ba60d022c27ecdf7":[1,8,3,13,29], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a9595032673977c7873640f379fe99534":[1,8,3,13,15], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a979b3dc15aa5f397367c2b129ba9e9de":[1,8,3,13,1], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a99e637db31f4c006d932552edd9cc75a":[1,8,3,13,35], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#a9e1ea46a18454c7eaffaf77c46df7af8":[1,8,3,13,37], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#aa0909e0419897d8d31be6282559adb87":[1,8,3,13,47], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#aa0a263703a464b21c97cdfdaa53d5671":[1,8,3,13,59], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#aa1bd1b602a1bd18564f6993a8b73be11":[1,8,3,13,19], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#aa2e6e041a527c1f72a6f69c0e636f0b1":[1,8,3,13,41], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#aabb6b0fd6aa921312bdb6287d181d0f8":[1,8,3,13,8], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#abaaadd6f34b6f947266e6176687fff7b":[1,8,3,13,43], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#abd505bddf4a8a0e0520302b945013aec":[1,8,3,13,39], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#abdee67a94039ae1f58f2896019a5325a":[1,8,3,13,14], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ac04c1496f92b80f9bda38359b2358a6a":[1,8,3,13,33], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ac258bf14f77002d02971ad6f68328c00":[1,8,3,13,45], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ac921b1abed4d3e52ff50fe18f7d0ecf8":[1,8,3,13,9], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#acb7d46c52ecff102f804611318fafb5e":[1,8,3,13,52], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#acccc2d30410a73e3f394a825457f6b84":[1,8,3,13,34], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ad2cd64e45ffef533d08d864f770f5dba":[1,8,3,13,13], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ad2eb8ee1f1a5c6f007d178a9d2671115":[1,8,3,13,11], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ae092d06f8b37eb875eff70d9390df344":[1,8,3,13,17], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ae3fd9a1f5b0d2e5aa2ec433d332775d9":[1,8,3,13,30], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ae5f811e7d9e500640f0e102477581b39":[1,8,3,13,23], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#ae7e6f2624315973d629d6b17791017c7":[1,8,3,13,50], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#aea88f568192d553c542391077dec1957":[1,8,3,13,3], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#af142445dc473cad5f08f7cd74ec3fed9":[1,8,3,13,4], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#af174972fe4ee7841ea95eaec02ac34e4":[1,8,3,13,57], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#af4d83f6d8fbb6d45ec5daeed430242be":[1,8,3,13,46], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#af58dd839a32efd31750febe12b405713":[1,8,3,13,53], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#af781af189c0b83bdc24c2e7b9b79737a":[1,8,3,13,40], "classxpcc_1_1_vector_3_01_t_00_013_01_4.html#afb3045d82fe214fda5c802150cf1dafc":[1,8,3,13,6], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html":[1,8,3,14], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a018f29f0300b0e94d8cbaeff014d3a6b":[1,8,3,14,64], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a0402b92cab71e01b4d92fd09c787ef28":[1,8,3,14,67], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a056af2f4fb35eb16530585b708a40bef":[1,8,3,14,14], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a088d22c1dd58f97eb8e2ba66b1a5ac19":[1,8,3,14,66], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a091518429fd4136d79efe9cbbe9d7656":[1,8,3,14,46], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a0a12d376d1d27e0562480b1c068c9564":[1,8,3,14,31], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a0a357a0f02980621ef7d730470164503":[1,8,3,14,18], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a0ca11f514f018ad80dae58586b30b61b":[1,8,3,14,32], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a10dd8df384d90d9575c8b0e106430103":[1,8,3,14,9], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a1241f534e3429d7e522925fc8512c6d9":[1,8,3,14,73], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a13678f71e8131fd28b1bc20e0fcd680f":[1,8,3,14,76], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a1c868de7624c0149b38f23372a6d145f":[1,8,3,14,39], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a1dfa14640848e61826414779a641af2c":[1,8,3,14,10], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a1e583979d7e378a68e2608a4a7e00a10":[1,8,3,14,54], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a2262f4ae7d1eab42f8d4dd9e6a2fc6a9":[1,8,3,14,50], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a26942d7f7404c36ae0a23455f4062b79":[1,8,3,14,69], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a269c6d0e0d4943a9de91614365b63c13":[1,8,3,14,78], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a2748a4e7d3806bf628ec9e6fcd2450a0":[1,8,3,14,80], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a2939ff750336ad0cfe92ae211c9df05b":[1,8,3,14,57], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a2aec5d706de5c716737a2892da44e31b":[1,8,3,14,59], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a2b8a7c5763aa3fb0207b59cb00e840d8":[1,8,3,14,27], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a34635b206262f0268b66389d336dfe8a":[1,8,3,14,13], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a36fbcd678b889453221c6d39274b5efd":[1,8,3,14,4], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a3717c7920c7023a487aacca0fc87d4b1":[1,8,3,14,41], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a3774b71e2a16918f734f202a36ca1451":[1,8,3,14,12], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a388b9b353ec5750438faa31f08c7482e":[1,8,3,14,37], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a3942034c3f532fbaa5f716b50a767fc6":[1,8,3,14,56], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a3e2de4515d167fa1e98a07a04a29fef0":[1,8,3,14,77], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a4056ddcbf7cf83d44b7e653385b4c732":[1,8,3,14,48], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a4374862f15aeaf0178510a3e710a58d7":[1,8,3,14,23], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a447639a1a3dad8a191b5f0e3c54d5c4f":[1,8,3,14,38], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a45f14e1960ff2f332f80862fce88d2cc":[1,8,3,14,68], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a493e1536e5e7252bf0ca7bf310ea99ce":[1,8,3,14,74], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a4c437c468221f4aae584a4f1119c379f":[1,8,3,14,20], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a51951f7f325df47fa1210c02de3332be":[1,8,3,14,21], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a520cf526ebd0800d37d9f96cc2bc8895":[1,8,3,14,1], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a5d079575448f6fe9d61542f79d5b99cd":[1,8,3,14,61], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a67bcd21c7ee1541df40a57244261edf3":[1,8,3,14,7], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a68c935b880488f970cfa03ba00fb31ee":[1,8,3,14,3], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a6f367c4fea819ca7a38af8c24849f516":[1,8,3,14,16], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a704082b1e4b70e81663ec189dccc033b":[1,8,3,14,17], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a71d6f8a176cdcb971e48645895c5a051":[1,8,3,14,24], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a72aedd39b106ff62b0c5bd40168ee111":[1,8,3,14,2], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a77f516d027124165b7e5a6ca6917ee81":[1,8,3,14,30], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a795c89ee69670dbc87f7100a05f20886":[1,8,3,14,60], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a7c277418069331b4330072f039710990":[1,8,3,14,33], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a7dff5c6f83f3dbeca5ad19ecf4e604af":[1,8,3,14,34], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a803de9af0cafe46ff29dde99c75f1e21":[1,8,3,14,49], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a83f6023771d16b395d3f5eb51a2ff399":[1,8,3,14,79], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a863f5e00296c9f2404e8339fbb976402":[1,8,3,14,29], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a8a2e20eb00dffb602cb56e9c57c854a3":[1,8,3,14,51], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a910a99c9c3710517e4ce16e686d8608a":[1,8,3,14,42], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a91d71976c8a9a8596faf66535092be93":[1,8,3,14,65], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a92cca46b605f7ca80b7cb82991ca39a4":[1,8,3,14,55], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a9a6ca651ec823c9d4afd2d6526bdd11c":[1,8,3,14,6], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a9d715a6fb9f1ba40aad3071add0fb130":[1,8,3,14,36], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a9ddaa95f1a41bb043b990f1da7bcbc67":[1,8,3,14,72], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#a9e4cf680fc1fc23f18731083d7e07af3":[1,8,3,14,26], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#aa1317d7611fad0c3866a9230d533c138":[1,8,3,14,45], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#aa56f4b6c814e5f54d6a9046dc4efe3f8":[1,8,3,14,53], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#aad488759fe39617160e008165eaf9288":[1,8,3,14,43], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#aae50c850e13cac4428e6938dfe8b92fd":[1,8,3,14,28], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#abbe9d399dea8d3b06e7b9e4006216e60":[1,8,3,14,22], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#abf30221caa5e785092c51e60ba9cdc58":[1,8,3,14,52], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac0e27d6db8aaf3bfb9dc27bfc8c31cdc":[1,8,3,14,63], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac1340bbadd3b1a0e87c7f3a9a52dfdb9":[1,8,3,14,62], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac19f8dbac1599a0e5f5db5efd645963b":[1,8,3,14,0], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac1ed676dcfda79915e1dfe1b38577df9":[1,8,3,14,15], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac241ed91f2c31a2b1dab48ac86cef8f6":[1,8,3,14,40], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac3125744374e7c30c4fb5a05aa24137c":[1,8,3,14,8], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac5608da9ed66e780dbc52a6e015da936":[1,8,3,14,70], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ac64ae7fcd3ec5795f58c119a51723331":[1,8,3,14,71], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ad87dc781d90201edf99b23256b6adbdb":[1,8,3,14,47], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#adaa046cf0d1396f749fe0e8108163f36":[1,8,3,14,75], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#ae8514aaf233729d83a138e961f342f4c":[1,8,3,14,25], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#aef5093129f1ba70c19c662507e294b21":[1,8,3,14,19], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#af3dfc7a18745f1a0f2cc023b83f42cdc":[1,8,3,14,58], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#af96615e453bf2b81f872e98024de79d3":[1,8,3,14,35], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#afccfe7cd2aa85afc113eee4c5a40409f":[1,8,3,14,44], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#afcdce3afaa62eb4c1252f96f517415d9":[1,8,3,14,11], "classxpcc_1_1_vector_3_01_t_00_014_01_4.html#afcf1d0cab85f26f7bb1027465657244d":[1,8,3,14,5], "classxpcc_1_1_view_stack.html":[1,10,8,6], "classxpcc_1_1_view_stack.html#a3349dbfa59503e5450617386524d59ce":[1,10,8,6,4], "classxpcc_1_1_view_stack.html#a400d0aebf86648999d971749f0a905b7":[1,10,8,6,6], "classxpcc_1_1_view_stack.html#a547bc57bda734543e08fe07f2d4be8a0":[1,10,8,6,0], "classxpcc_1_1_view_stack.html#a86cd18412f27b69657b413526c067487":[1,10,8,6,2], "classxpcc_1_1_view_stack.html#a9982d07a99a3c3be435e6e2884ae6e2e":[1,10,8,6,9], "classxpcc_1_1_view_stack.html#a9a59c99bd926240bf941a4a7af5b95ef":[1,10,8,6,5], "classxpcc_1_1_view_stack.html#abee5a6c1e33ad89a59f215d08499f55a":[1,10,8,6,1], "classxpcc_1_1_view_stack.html#ac632c9a617885b9a42b74c07c4cc1329":[1,10,8,6,7], "classxpcc_1_1_view_stack.html#ad33872862c277b3fe52ca80840ddc39b":[1,10,8,6,8], "classxpcc_1_1_view_stack.html#af450c7c038e885ec60dd06913b9a24eb":[1,10,8,6,3], "classxpcc_1_1_virtual_graphic_display.html":[1,10,5,3], "classxpcc_1_1_virtual_graphic_display.html#a2dc8a2dfdb7a7b841ed282b07a98b507":[1,10,5,3,8], "classxpcc_1_1_virtual_graphic_display.html#a39a651a420df8a92ba5663055346ef24":[1,10,5,3,7], "classxpcc_1_1_virtual_graphic_display.html#a714a7a67ea663bc424396642fa9dcd3d":[1,10,5,3,4], "classxpcc_1_1_virtual_graphic_display.html#a72231f42c990c9565e82b28678e6775c":[1,10,5,3,0], "classxpcc_1_1_virtual_graphic_display.html#a8596b2121f4d36a7cbb061d90a1447b2":[1,10,5,3,6], "classxpcc_1_1_virtual_graphic_display.html#a8f3229a1865ee7d860cea7dd18a20796":[1,10,5,3,2], "classxpcc_1_1_virtual_graphic_display.html#aa6f83069371a5a8890034da69557d039":[1,10,5,3,3], "classxpcc_1_1_virtual_graphic_display.html#ad7db8f2b43af22c1978f32672f83c5c7":[1,10,5,3,1], "classxpcc_1_1_virtual_graphic_display.html#aecf7e5c7dab4adcf7aef9f342ba8aa13":[1,10,5,3,5], "classxpcc_1_1_vl53l0.html":[1,5,11,0], "classxpcc_1_1_vl53l0.html#a115072359ea63862b41f2fa7ec635ccf":[1,5,11,0,8], "classxpcc_1_1_vl53l0.html#a25eaa22df8e039b5b9ad119558761185":[1,5,11,0,5] }; <file_sep>/docs/api/group__atmega328p__spi.js var group__atmega328p__spi = [ [ "Spi", "structxpcc_1_1atmega_1_1_spi.html", [ [ "Prescaler", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4", [ [ "Div2", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4aed4892f9a54cc655fb648cac223bc83b", null ], [ "Div4", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4ad64dbe7aa107b2a36953d4d00618b565", null ], [ "Div8", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4a6c2d2d32a5b43e70c8a188e98fa48517", null ], [ "Div16", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4a1233ec2bc170c916c15eb1f7939cbf0e", null ], [ "Div32", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4af95c5783f8899cc9dc2fef8b0216cced", null ], [ "Div64", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4a5c7984decebb2b58ccba70395b2d52ff", null ], [ "Div128", "structxpcc_1_1atmega_1_1_spi.html#a921e4526d59442a09c3fa36284fe11c4a1ab98634ed7ea85cf5b74677b9940ad9", null ] ] ] ] ], [ "SpiMaster", "classxpcc_1_1atmega_1_1_spi_master.html", [ [ "DataMode", "classxpcc_1_1atmega_1_1_spi_master.html#a570e47d157608ca4338d48ac7d0b79b7", [ [ "Mode0", "classxpcc_1_1atmega_1_1_spi_master.html#a570e47d157608ca4338d48ac7d0b79b7a315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1atmega_1_1_spi_master.html#a570e47d157608ca4338d48ac7d0b79b7a7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1atmega_1_1_spi_master.html#a570e47d157608ca4338d48ac7d0b79b7a04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1atmega_1_1_spi_master.html#a570e47d157608ca4338d48ac7d0b79b7ab68fa4884da8d22e83f37b4f209295f1", null ] ] ] ] ], [ "UartSpiMaster0", "classxpcc_1_1atmega_1_1_uart_spi_master0.html", [ [ "DataMode", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bf", [ [ "Mode0", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfa315436bae0e85636381fc939db06aee5", null ], [ "Mode1", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfa7a2ea225a084605104f8c39b3ae9657c", null ], [ "Mode2", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfa04c542f260d16590ec60c594f67a30e7", null ], [ "Mode3", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ae56c716e1a0649e2bbddbcd3c187f3bfab68fa4884da8d22e83f37b4f209295f1", null ] ] ], [ "DataOrder", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ab1deb21db3ae3384e8c67c0bbabc202a", [ [ "MsbFirst", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ab1deb21db3ae3384e8c67c0bbabc202aaee850a31af8a5060a68542cb34339c50", null ], [ "LsbFirst", "classxpcc_1_1atmega_1_1_uart_spi_master0.html#ab1deb21db3ae3384e8c67c0bbabc202aabdb340581a62499a27a78804ea99a99a", null ] ] ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_siemens_s75_common.js var classxpcc_1_1_siemens_s75_common = [ [ "SiemensS75Common", "classxpcc_1_1_siemens_s75_common.html#ad24199a383dd7f60c370290a1e9855a7", null ], [ "update", "classxpcc_1_1_siemens_s75_common.html#a4dba2824e092c9843a98ca929b6712d2", null ], [ "initialize", "classxpcc_1_1_siemens_s75_common.html#aa253ecf3a8b6a1206f252d5abd10a885", null ], [ "lcdCls", "classxpcc_1_1_siemens_s75_common.html#a78e2f0a695762c577465eca6911959b2", null ], [ "lcdSettings", "classxpcc_1_1_siemens_s75_common.html#ad3b5a1263b0000eee51525fa04b5cfa8", null ] ];<file_sep>/docs/api/classxpcc_1_1_line_segment2_d.js var classxpcc_1_1_line_segment2_d = [ [ "WideType", "classxpcc_1_1_line_segment2_d.html#ad19eb34391970a5ac078d04eeb76cef9", null ], [ "FloatType", "classxpcc_1_1_line_segment2_d.html#ac1aa0ac68db60634e46b71e0aa20b0fd", null ], [ "LineSegment2D", "classxpcc_1_1_line_segment2_d.html#af39f8c575e2404f64ae6c33113b2fc35", null ], [ "LineSegment2D", "classxpcc_1_1_line_segment2_d.html#a90618b07484ded9df2f58349ed4dc87f", null ], [ "setStartPoint", "classxpcc_1_1_line_segment2_d.html#a706bbadc01672a480f16a8a05f7da1bd", null ], [ "getStartPoint", "classxpcc_1_1_line_segment2_d.html#a50e791c658bd3f727fe6f98b6822b0bd", null ], [ "setEndPoint", "classxpcc_1_1_line_segment2_d.html#a98aff33e930c153fda1cc56d4380beaa", null ], [ "getEndPoint", "classxpcc_1_1_line_segment2_d.html#a25538134395d7de01179733e78f91fc7", null ], [ "set", "classxpcc_1_1_line_segment2_d.html#ac84966d28329bcc6d8f26675397de94e", null ], [ "translate", "classxpcc_1_1_line_segment2_d.html#a687a132ca72c9e6832edde33551ae8d6", null ], [ "getLength", "classxpcc_1_1_line_segment2_d.html#a7f96952045c5e709c90f4db5c75aebb3", null ], [ "getDirectionVector", "classxpcc_1_1_line_segment2_d.html#ada36609723fe1a35d939e6b1ae8b75b4", null ], [ "getDistanceTo", "classxpcc_1_1_line_segment2_d.html#a5baafa406185cf181e27b54d970d4d5a", null ], [ "getClosestPointTo", "classxpcc_1_1_line_segment2_d.html#aad02c18cd142dab7d7345bfd89c00a9d", null ], [ "intersects", "classxpcc_1_1_line_segment2_d.html#a4cd460525735b283df3986c2e38e3f21", null ], [ "intersects", "classxpcc_1_1_line_segment2_d.html#a1f8cd317a917678641633109894f2b19", null ], [ "getIntersections", "classxpcc_1_1_line_segment2_d.html#acc540ddd9411e7c2a3b2a7d3cc5bff5a", null ], [ "getIntersections", "classxpcc_1_1_line_segment2_d.html#a257935865b7495a5f876fdd31e2dee07", null ], [ "getIntersections", "classxpcc_1_1_line_segment2_d.html#aebfea7fccc535b7cd7545ea6858ca844", null ], [ "operator==", "classxpcc_1_1_line_segment2_d.html#a08a1b9123dda4e2e3d0a95f2fa09020b", null ], [ "operator!=", "classxpcc_1_1_line_segment2_d.html#a4cbfb5802b3765b70148ae1b829e1a67", null ], [ "startPoint", "classxpcc_1_1_line_segment2_d.html#a30f01c8eef3506fc1ed5f4650e7dda25", null ], [ "endPoint", "classxpcc_1_1_line_segment2_d.html#a38fb9d9d37d85f889220d45e5b321841", null ] ];<file_sep>/docs/api/classxpcc_1_1_lis3_transport_i2c.js var classxpcc_1_1_lis3_transport_i2c = [ [ "Lis3TransportI2c", "classxpcc_1_1_lis3_transport_i2c.html#aafc53aaca7e5d07fa890719af5e71658", null ], [ "write", "classxpcc_1_1_lis3_transport_i2c.html#a67e3318a0b5cd7ec95468108267bc818", null ], [ "read", "classxpcc_1_1_lis3_transport_i2c.html#aa79088be8190a6e6a45b6bbe99f52100", null ], [ "read", "classxpcc_1_1_lis3_transport_i2c.html#a0e4c493f50035dbe2043490096198e01", null ] ];<file_sep>/docs/api/classxpcc_1_1interpolation_1_1_lagrange.js var classxpcc_1_1interpolation_1_1_lagrange = [ [ "InputType", "classxpcc_1_1interpolation_1_1_lagrange.html#a0af0e8082774eacbb856e800ee6f1f0e", null ], [ "OutputType", "classxpcc_1_1interpolation_1_1_lagrange.html#aa47ca1120851673cd21ca64b16f122c3", null ], [ "Lagrange", "classxpcc_1_1interpolation_1_1_lagrange.html#a9df82c4ac046f617d9950bd082814d3b", null ], [ "interpolate", "classxpcc_1_1interpolation_1_1_lagrange.html#afb39dc41b9a245d602f71741ed0ddc09", null ] ];<file_sep>/docs/api/modules.js var modules = [ [ "Unit tests", "group__unittest.html", "group__unittest" ], [ "Architecture", "group__architecture.html", "group__architecture" ], [ "Communication", "group__communication.html", "group__communication" ], [ "Containers", "group__container.html", "group__container" ], [ "Debugging utilities", "group__debug.html", "group__debug" ], [ "Device drivers", "group__driver.html", "group__driver" ], [ "DS1302", "group__ds1302.html", "group__ds1302" ], [ "IO-Classes", "group__io.html", "group__io" ], [ "Math", "group__math.html", "group__math" ], [ "Processing", "group__processing.html", "group__processing" ], [ "User interface", "group__ui.html", "group__ui" ], [ "Utilities", "group__utils.html", "group__utils" ] ];<file_sep>/docs/api/group__allocator.js var group__allocator = [ [ "Block", "classxpcc_1_1allocator_1_1_block.html", [ [ "rebind", "classxpcc_1_1allocator_1_1_block.html#structxpcc_1_1allocator_1_1_block_1_1rebind", [ [ "other", "classxpcc_1_1allocator_1_1_block.html#a2c8ce105225973a9a66d9c6b921ce7e0", null ] ] ], [ "Block", "classxpcc_1_1allocator_1_1_block.html#a6c82b10d9e18a0b80b01154b657513c5", null ], [ "Block", "classxpcc_1_1allocator_1_1_block.html#a7a7405aa33260fe500a0942f64c73ce4", null ], [ "Block", "classxpcc_1_1allocator_1_1_block.html#a26447c559d96d9ae5fd5842171b62a22", null ], [ "allocate", "classxpcc_1_1allocator_1_1_block.html#a5c9aeedb12b87696b4bc6fed071a6e49", null ], [ "deallocate", "classxpcc_1_1allocator_1_1_block.html#a4adbb2e3d7fd6765c6debac177757c07", null ] ] ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html", [ [ "rebind", "classxpcc_1_1allocator_1_1_dynamic.html#structxpcc_1_1allocator_1_1_dynamic_1_1rebind", [ [ "other", "classxpcc_1_1allocator_1_1_dynamic.html#a5a6caffc206b25aea12c0ce4b039048a", null ] ] ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html#ab87ce8c11041d2cefffbe3115795337f", null ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html#a308696d41335f1a7a5d6a9b5f764ab23", null ], [ "Dynamic", "classxpcc_1_1allocator_1_1_dynamic.html#a7d04384ff750678c567e21ce29edfe4d", null ], [ "allocate", "classxpcc_1_1allocator_1_1_dynamic.html#ad336ce5d65493b43d06cacea90622afa", null ], [ "deallocate", "classxpcc_1_1allocator_1_1_dynamic.html#a265acd75638f9a30d48aa09b6373a94f", null ] ] ], [ "Static", "classxpcc_1_1allocator_1_1_static.html", [ [ "rebind", "classxpcc_1_1allocator_1_1_static.html#structxpcc_1_1allocator_1_1_static_1_1rebind", [ [ "other", "classxpcc_1_1allocator_1_1_static.html#a4f919a234b77474092bb01f97e7f841c", null ] ] ], [ "Static", "classxpcc_1_1allocator_1_1_static.html#a6fb1ef279139d02cb69259237b46cce2", null ], [ "Static", "classxpcc_1_1allocator_1_1_static.html#a514f9bf841927f374e90d84277631de5", null ], [ "Static", "classxpcc_1_1allocator_1_1_static.html#a70e47dd4914abbf97150dc39490d5ea5", null ], [ "allocate", "classxpcc_1_1allocator_1_1_static.html#ac2479755a473e0ff255b3329621193d8", null ], [ "deallocate", "classxpcc_1_1allocator_1_1_static.html#a44dc04c214703fcbc4064feaeb7ed979", null ] ] ] ];<file_sep>/docs/api/structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.js var structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4 = [ [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a106938991ef31b237ae20a9c894deed2", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a49e2aabf030051119cb88c4e7d12bfb9", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#af804df27a2608832c2a09d36096ba6f7", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a96614d3ba9a626c9b32c68577554bb72", null ], [ "FlagsGroup", "structxpcc_1_1_flags_group_3_01_t_8_8_8_01_4.html#a4c1dddde91cdb4ecee8a850b1d4de302", null ] ];<file_sep>/docs/api/group__driver__inertial.js var group__driver__inertial = [ [ "Adxl345", "classxpcc_1_1_adxl345.html", [ [ "Adxl345", "classxpcc_1_1_adxl345.html#a3661252d964c000f925e5ff820e34dd7", null ], [ "configure", "classxpcc_1_1_adxl345.html#a621fb7cdf6c28e7d951637c9985986da", null ], [ "readAccelerometer", "classxpcc_1_1_adxl345.html#acad903ecf4d2f46e8ead962ca65a4d9d", null ], [ "getData", "classxpcc_1_1_adxl345.html#acb4130aa8d240bea1a499060d992c54f", null ], [ "isNewDataAvailable", "classxpcc_1_1_adxl345.html#a135fce9c967168e401b550d654c818dd", null ], [ "isDataReady", "classxpcc_1_1_adxl345.html#aaeaab187049cee13aaca42a8466d6e78", null ], [ "update", "classxpcc_1_1_adxl345.html#a4f2ed37696869a1ccf94652aa210f7a6", null ] ] ], [ "Bma180", "classxpcc_1_1_bma180.html", [ [ "Bma180", "classxpcc_1_1_bma180.html#a59d59c6b8498626a800d5ccb6b851533", null ], [ "configure", "classxpcc_1_1_bma180.html#a1351d98faca2c640d59b70d5996c0ece", null ], [ "readAccelerometer", "classxpcc_1_1_bma180.html#a68f6803fd4bf91f49e4343af028a3aee", null ], [ "getData", "classxpcc_1_1_bma180.html#a67e9c63a9b936dc0ed7cfc637dd3d8e9", null ], [ "isNewDataAvailable", "classxpcc_1_1_bma180.html#acb1821b99699eccee6489c0adb64f6ab", null ], [ "update", "classxpcc_1_1_bma180.html#a5211e9d37024ea30a66d364487119973", null ], [ "reset", "classxpcc_1_1_bma180.html#ad92a1345bf3603bd0f11ae50a07bd604", null ], [ "writeMaskedRegister", "classxpcc_1_1_bma180.html#a532340a2dd35297f8667fab270475c99", null ] ] ], [ "Hmc5843", "classxpcc_1_1_hmc5843.html", [ [ "Hmc5843", "classxpcc_1_1_hmc5843.html#ad255fbd0708bf5414d146d6d0d462d3e", null ], [ "configure", "classxpcc_1_1_hmc5843.html#a17871aa354c0f7125742b3c19c1596d8", null ], [ "setMeasurementRate", "classxpcc_1_1_hmc5843.html#ac9053daf59525a1c40c5cba388cd7cbc", null ], [ "setGain", "classxpcc_1_1_hmc5843.html#a379d578f734fc2687c865ba1f0fb4b21", null ] ] ], [ "Hmc5883", "classxpcc_1_1_hmc5883.html", [ [ "Hmc5883", "classxpcc_1_1_hmc5883.html#aa6378dddac1de6fc9d757dcac721ef59", null ], [ "configure", "classxpcc_1_1_hmc5883.html#a1386495cec90cd79cd37235f15e3ce1a", null ], [ "setMeasurementAverage", "classxpcc_1_1_hmc5883.html#a49c95851fc132100b48be37e97ee6dea", null ], [ "setMeasurementRate", "classxpcc_1_1_hmc5883.html#aa96c37d12c7d47425d2c628c91a06e89", null ], [ "setGain", "classxpcc_1_1_hmc5883.html#a1447214fb449d7ccd756ec83ae09eb11", null ] ] ], [ "Hmc58x3", "classxpcc_1_1_hmc58x3.html", [ [ "Hmc58x3", "classxpcc_1_1_hmc58x3.html#a8397191bdbf2fac161a90c194280fcf8", null ], [ "setOperationMode", "classxpcc_1_1_hmc58x3.html#a67b62357fa3114e2601ab54527a2f710", null ], [ "readMagneticField", "classxpcc_1_1_hmc58x3.html#ad2bda935f930f4064cc0c69cb5d4dea0", null ], [ "updateConfigA", "classxpcc_1_1_hmc58x3.html#ab8f1ce75d16501645cfe5c5f5159884f", null ], [ "updateConfigB", "classxpcc_1_1_hmc58x3.html#a565bae99c796c00ac1c0317f7035965c", null ], [ "updateMode", "classxpcc_1_1_hmc58x3.html#afd345d1491fe425c6753176892ca903e", null ], [ "getConfigA", "classxpcc_1_1_hmc58x3.html#a247d0beca257168a7dc1898f42620ff7", null ], [ "getConfigB", "classxpcc_1_1_hmc58x3.html#ad8e291a5124e7e16f0a661f73e432f33", null ], [ "getMode", "classxpcc_1_1_hmc58x3.html#a543f0412aef3833b9f1fd7389c1a892f", null ], [ "getStatus", "classxpcc_1_1_hmc58x3.html#aa3f33d80344f2c5abc7e5545caa3befe", null ], [ "readStatus", "classxpcc_1_1_hmc58x3.html#aaa2b53b8680b7b88fe842c8dc06f4939", null ], [ "getData", "classxpcc_1_1_hmc58x3.html#acaa5f25347fda6bc2306aca9439e8932", null ] ] ], [ "Hmc6343", "classxpcc_1_1_hmc6343.html", [ [ "Hmc6343", "classxpcc_1_1_hmc6343.html#a62c6fe7a919e0459629afb91438a85de", null ], [ "readOperationMode", "classxpcc_1_1_hmc6343.html#a8095f69fc3cabbf674879536e3a45767", null ], [ "setMeasurementRate", "classxpcc_1_1_hmc6343.html#a705dd8ac533a236992cd7ba8f72ec0ed", null ], [ "setDeviationAngle", "classxpcc_1_1_hmc6343.html#a389f637f10570fe135fd2d6f51c2b7a8", null ], [ "setVariationAngle", "classxpcc_1_1_hmc6343.html#a112f544caa564ee4e5ed9c4d4f120b25", null ], [ "setIIR_Filter", "classxpcc_1_1_hmc6343.html#a681954c56820fe2004cd6d1228102837", null ], [ "getDeviceId", "classxpcc_1_1_hmc6343.html#a17298d0565619e7b945f604b36b9e782", null ], [ "getIIR_Filter", "classxpcc_1_1_hmc6343.html#a2629fe00650c7277e10b507d88db5bd1", null ], [ "setOrientation", "classxpcc_1_1_hmc6343.html#a440e0bc5a18878b2b4f99864e18123d8", null ], [ "enterRunMode", "classxpcc_1_1_hmc6343.html#ada8a7c03872b6da30da7819fbae753ff", null ], [ "enterStandbyMode", "classxpcc_1_1_hmc6343.html#a2d6152aad535ba724551ab2043760442", null ], [ "enterSleepMode", "classxpcc_1_1_hmc6343.html#aa70dff321733f34ee1d66bb9a6f7b308", null ], [ "exitSleepMode", "classxpcc_1_1_hmc6343.html#a32322d22dc78a724e585391324714e7e", null ], [ "enterUserCalibrationMode", "classxpcc_1_1_hmc6343.html#a375aa3f45c35e61d14df2619ccbe12cd", null ], [ "exitUserCalibrationMode", "classxpcc_1_1_hmc6343.html#a04023055c659d7d8c2c418b9e1f45fdd", null ], [ "resetProcessor", "classxpcc_1_1_hmc6343.html#a29b9637a927189c367b6cc5b08f62c06", null ], [ "readAcceleration", "classxpcc_1_1_hmc6343.html#a4942ecf84057963be7e278bb425c3aad", null ], [ "readMagneticField", "classxpcc_1_1_hmc6343.html#ac8531104d7e819528b98b743e2aff478", null ], [ "readHeading", "classxpcc_1_1_hmc6343.html#ad4b3fccbb270a3c6036c6e062f0f4d0c", null ], [ "readTilt", "classxpcc_1_1_hmc6343.html#a1cad9bac06445c1f7420b60bc142197a", null ], [ "writeRegister", "classxpcc_1_1_hmc6343.html#a4131dcd0a6d75ab0801ae518668efbe1", null ], [ "writeRegister", "classxpcc_1_1_hmc6343.html#abd19707c0d7fd45f2ed66b032e7bc8bb", null ], [ "readRegister", "classxpcc_1_1_hmc6343.html#aafacaf1b7aad2e6212eebeec7e4ca5fc", null ], [ "readRegister", "classxpcc_1_1_hmc6343.html#a968787711fdd2f1ad9c8b8ef45d1b489", null ], [ "getData", "classxpcc_1_1_hmc6343.html#a1030fc90e7ad761a375ccbfdee55d4fc", null ] ] ], [ "Itg3200", "classxpcc_1_1_itg3200.html", [ [ "Itg3200", "classxpcc_1_1_itg3200.html#a1e32ca2dc9448c2f30fbb6527a40955b", null ], [ "configure", "classxpcc_1_1_itg3200.html#a44834fbe420fe21ba292be56bec9b825", null ], [ "readRotation", "classxpcc_1_1_itg3200.html#a2ff7ca522f896de5e62f0f9a705c5d1b", null ], [ "setLowPassFilter", "classxpcc_1_1_itg3200.html#a9d3426d70839981a67f584340990e8b8", null ], [ "setSampleRateDivider", "classxpcc_1_1_itg3200.html#a11e87babe7339225361a5bd04d393c1d", null ], [ "updateInterrupt", "classxpcc_1_1_itg3200.html#acf7c281e71c75b0b508df63622dd3972", null ], [ "updatePower", "classxpcc_1_1_itg3200.html#a46aff23392cd1ae3ee162ffde0f8bf55", null ], [ "getLowPassFilter", "classxpcc_1_1_itg3200.html#a2875d89ac7204d5f4fea70ee964a3a1f", null ], [ "getInterrupt", "classxpcc_1_1_itg3200.html#aff5cc625fea900af4aab07a045c83c2a", null ], [ "getPower", "classxpcc_1_1_itg3200.html#a56e81e274ac0e1650af503e98fa5b1c6", null ], [ "getStatus", "classxpcc_1_1_itg3200.html#ad1b07c5a74784d4c206684787a6408aa", null ], [ "readStatus", "classxpcc_1_1_itg3200.html#aa808d83558809c4b62730d19cb54f7b0", null ], [ "getData", "classxpcc_1_1_itg3200.html#a8e6c56a71b4db2d46bdca8032549313b", null ] ] ], [ "L3gd20", "classxpcc_1_1_l3gd20.html", [ [ "L3gd20", "classxpcc_1_1_l3gd20.html#a998aded6dc3002a6891811379775c8e6", null ], [ "configureBlocking", "classxpcc_1_1_l3gd20.html#aa40e3bc6259bacaa5b781ee84be1f20f", null ], [ "configure", "classxpcc_1_1_l3gd20.html#adcaed2e8c33fed4b3074630f25674c75", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#a39888e7a07614f0a147edd2fce05fad9", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#aa8de55481612cf11bab13559696c395a", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#a85f8aebeaf45f5124307c2544a5ae92d", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#a1878881d399d2c489b3eded66cd61391", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#ab39a4bb42c22a736fcf4b4dc32956cd2", null ], [ "updateFifoControl", "classxpcc_1_1_l3gd20.html#ad6adef0fdeb121ea80112d957605a37f", null ], [ "updateInterruptConfiguration", "classxpcc_1_1_l3gd20.html#a4d83b2d30dd5de6e19c910dd5b26c44b", null ], [ "readRotation", "classxpcc_1_1_l3gd20.html#a29f8e142bb0cd81ab4f1ce9b68e3eaab", null ], [ "getControl1", "classxpcc_1_1_l3gd20.html#a77a2e255dd74462113adea0f667c27a1", null ], [ "getControl2", "classxpcc_1_1_l3gd20.html#a65abf78e237c84a77c7bd6daf8834a59", null ], [ "getControl3", "classxpcc_1_1_l3gd20.html#abffa8a1850d7826e856a1fe101e435a8", null ], [ "getControl4", "classxpcc_1_1_l3gd20.html#a47232461e4ac8560a0f7563eafb389b6", null ], [ "getControl5", "classxpcc_1_1_l3gd20.html#a0689f6cd2b6f4b68a395ae45785b2995", null ], [ "getReference", "classxpcc_1_1_l3gd20.html#ad7424e9145055a154e01e08e045013f7", null ], [ "getFifoControl", "classxpcc_1_1_l3gd20.html#af6ccd290ee9f6fdb138431cbe8e85b27", null ], [ "getIntConfig", "classxpcc_1_1_l3gd20.html#a09988204be9a868728d2cfb82c882198", null ], [ "getStatus", "classxpcc_1_1_l3gd20.html#a201948a9e3a6bf48f1e4432e7366e441", null ], [ "getFifoSource", "classxpcc_1_1_l3gd20.html#a15183be81bf3649026cbb996aeb8dffa", null ], [ "getIntSource", "classxpcc_1_1_l3gd20.html#ab8eeb19cfde533bd2b7083d89ba9e1b9", null ], [ "getData", "classxpcc_1_1_l3gd20.html#afce0951de8974905892ba668a03a2267", null ] ] ], [ "Lis302dl", "classxpcc_1_1_lis302dl.html", [ [ "Lis302dl", "classxpcc_1_1_lis302dl.html#af3d2b51a42d5c3527e244f31a7695917", null ], [ "configureBlocking", "classxpcc_1_1_lis302dl.html#a2b5ec8f7ecd37a4167a5398404006234", null ], [ "configure", "classxpcc_1_1_lis302dl.html#ac71c6e3f94fdef0f79575627db819384", null ], [ "updateControlRegister", "classxpcc_1_1_lis302dl.html#a62c399f995c15938433cc1101b67287a", null ], [ "updateControlRegister", "classxpcc_1_1_lis302dl.html#a7274b0801b33e516421e75f28540699d", null ], [ "updateControlRegister", "classxpcc_1_1_lis302dl.html#a549e162a7fe23891c17e7f0bf7d50417", null ], [ "writeInterruptSource", "classxpcc_1_1_lis302dl.html#ab7695a93f1589ceaedb13f345a15de12", null ], [ "updateFreeFallConfiguration", "classxpcc_1_1_lis302dl.html#a1bbbe92119d0c567546a1c276a295382", null ], [ "readFreeFallSource", "classxpcc_1_1_lis302dl.html#a57c91f4f14f11b93ac7217c23ccb3c73", null ], [ "setFreeFallThreshold", "classxpcc_1_1_lis302dl.html#a51169b91f65063e45bd98beb74ac62d3", null ], [ "setFreeFallDuration", "classxpcc_1_1_lis302dl.html#aeef03b7c4a2c84f098506c0b27630f9f", null ], [ "updateClickConfiguration", "classxpcc_1_1_lis302dl.html#ad18cb47c73468ada52bd4fa67aa0d8ac", null ], [ "readClickSource", "classxpcc_1_1_lis302dl.html#a8cb3a4d33b55a23efe2a0e7f8752361a", null ], [ "setClickThreshold", "classxpcc_1_1_lis302dl.html#a5e89128e8b935bfdff01ddf9066647f3", null ], [ "setClickTimeLimit", "classxpcc_1_1_lis302dl.html#accd7ab44f7e29a84dacd3fa33905f59a", null ], [ "setClickLatency", "classxpcc_1_1_lis302dl.html#a69d20b5f492109a20fb8500323a0a3d7", null ], [ "setClickWindow", "classxpcc_1_1_lis302dl.html#af2593b1b683f000d568d722b8d53b3bd", null ], [ "readAcceleration", "classxpcc_1_1_lis302dl.html#a317f0be4a1c82bc0e57a15bd4e90a235", null ], [ "getStatus", "classxpcc_1_1_lis302dl.html#a37d0c9e28818588945f5bf98a1b3e863", null ], [ "getControl1", "classxpcc_1_1_lis302dl.html#abde0e861ab5dd0b0047fcab813bfb7c5", null ], [ "getControl2", "classxpcc_1_1_lis302dl.html#a3c81eea85c8bb8c0b0b111152a65232d", null ], [ "getControl3", "classxpcc_1_1_lis302dl.html#ad3bb729829fb17e392fcfe7eee04d3d8", null ], [ "getData", "classxpcc_1_1_lis302dl.html#ae47dbd182044ba027740f9ef17916678", null ] ] ], [ "Lis3TransportI2c", "classxpcc_1_1_lis3_transport_i2c.html", [ [ "Lis3TransportI2c", "classxpcc_1_1_lis3_transport_i2c.html#aafc53aaca7e5d07fa890719af5e71658", null ], [ "write", "classxpcc_1_1_lis3_transport_i2c.html#a67e3318a0b5cd7ec95468108267bc818", null ], [ "read", "classxpcc_1_1_lis3_transport_i2c.html#aa79088be8190a6e6a45b6bbe99f52100", null ], [ "read", "classxpcc_1_1_lis3_transport_i2c.html#a0e4c493f50035dbe2043490096198e01", null ] ] ], [ "Lis3TransportSpi", "classxpcc_1_1_lis3_transport_spi.html", [ [ "Lis3TransportSpi", "classxpcc_1_1_lis3_transport_spi.html#a1cf8d82493669ac8d84312faa69b364c", null ], [ "ping", "classxpcc_1_1_lis3_transport_spi.html#ae2787a7638b06eca853fc835895c7b00", null ], [ "write", "classxpcc_1_1_lis3_transport_spi.html#aa90826c6ded26dc9be725113ef963403", null ], [ "read", "classxpcc_1_1_lis3_transport_spi.html#afb6779efbc0dd180618908c2dfc03ed8", null ], [ "read", "classxpcc_1_1_lis3_transport_spi.html#a50ee1c2bd788e3aebbccbb178ec509f7", null ] ] ], [ "Lis3dsh", "classxpcc_1_1_lis3dsh.html", [ [ "Lis3dsh", "classxpcc_1_1_lis3dsh.html#a0e4310523b80af3957a29cad815b5462", null ], [ "configureBlocking", "classxpcc_1_1_lis3dsh.html#acf14da02f29c10e3a6a322ad61548d52", null ], [ "configure", "classxpcc_1_1_lis3dsh.html#a69c61cf9fbc7d2bc4fb80c09d1d4a56e", null ], [ "updateSmControl1", "classxpcc_1_1_lis3dsh.html#a8a4d681524c06106b94343e034d2df7d", null ], [ "updateSmControl2", "classxpcc_1_1_lis3dsh.html#a11ca250f954ade5516b6cd9470d6814f", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#a0970e79474eb096538c4fc6c98782dde", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#a7f88dbc4fc23a0247c6cd2c70ccad097", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#a7d36895609a12f6c6e3c61e073fc5271", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#aacbfc1073bf7194469a880ce255f28a6", null ], [ "readAcceleration", "classxpcc_1_1_lis3dsh.html#a39faf6caeed7d09f0cf02c8de7f9baa7", null ], [ "getControl1", "classxpcc_1_1_lis3dsh.html#a6a944075f8c7fd7a269495d5b3c9d7fb", null ], [ "getControl2", "classxpcc_1_1_lis3dsh.html#ac94ccf104da788d38797e2a32c291f84", null ], [ "getControl3", "classxpcc_1_1_lis3dsh.html#a0029cc6cebd0905d7b90aecc7a5d47a5", null ], [ "getControl4", "classxpcc_1_1_lis3dsh.html#ad2d4a3f5875f9dd22b5b0f2bd2d94ab9", null ], [ "getControl5", "classxpcc_1_1_lis3dsh.html#a0ebb9ef9845fcc119e225973f949ef2f", null ], [ "getControl6", "classxpcc_1_1_lis3dsh.html#a942dd4bd0e3b063c77542eb7a060ae5e", null ], [ "getFifoControl", "classxpcc_1_1_lis3dsh.html#aea651201839984ceb103f5f3a0561927", null ], [ "getStatus", "classxpcc_1_1_lis3dsh.html#a4d950129bc42227de9bebd8452caced6", null ], [ "getFifoSource", "classxpcc_1_1_lis3dsh.html#aff8686884d88b5ec3cbe39a25d5b79c1", null ], [ "getData", "classxpcc_1_1_lis3dsh.html#a22fbc6efa20aa5a01e2a095f2dda2feb", null ] ] ], [ "Lsm303a", "classxpcc_1_1_lsm303a.html", [ [ "Lsm303a", "classxpcc_1_1_lsm303a.html#a42e083063851e4786e4a6ad62a70cbd7", null ], [ "configureBlocking", "classxpcc_1_1_lsm303a.html#a4d684d889ad037503f96638c2b484dc7", null ], [ "configure", "classxpcc_1_1_lsm303a.html#af6804f3f7e9933a918a2ccf6d5398c40", null ], [ "updateControl", "classxpcc_1_1_lsm303a.html#a20faae0c74ab8e92832e7648a3ef0c92", null ], [ "updateControl", "classxpcc_1_1_lsm303a.html#a9d9f1076fcc0162cce408b3b1ef34027", null ], [ "updateControl", "classxpcc_1_1_lsm303a.html#a16b7f761b11f0987d1819e4201528496", null ], [ "updateControl", "classxpcc_1_1_lsm303a.html#affc73a29036c3355a85eff683a5e5d0c", null ], [ "updateControl", "classxpcc_1_1_lsm303a.html#a0dddf73f8cac53312d7eafdaf1d3749f", null ], [ "updateControl", "classxpcc_1_1_lsm303a.html#a7866700210cbe950e3badeb742f5d8b7", null ], [ "updateFifoControl", "classxpcc_1_1_lsm303a.html#a28df71bdb08738586c3261e6c82dabf5", null ], [ "readAcceleration", "classxpcc_1_1_lsm303a.html#ace82f0e31737ac226ededda24d252c5b", null ], [ "getControl1", "classxpcc_1_1_lsm303a.html#a14ce11d6161ec6113ab8b081a344198a", null ], [ "getControl2", "classxpcc_1_1_lsm303a.html#af0fa0411862296dc806e7c5818ae563e", null ], [ "getControl3", "classxpcc_1_1_lsm303a.html#aa152e352ee8b0ff422a1b8bca43fb140", null ], [ "getControl4", "classxpcc_1_1_lsm303a.html#a95d4c96df808cb608d9c25e5b9ec2abc", null ], [ "getControl5", "classxpcc_1_1_lsm303a.html#a399517b18441105621b830d3c0a48ab5", null ], [ "getControl6", "classxpcc_1_1_lsm303a.html#acefc4f4a25f3ad4b1af28d97c1d706e2", null ], [ "getReference", "classxpcc_1_1_lsm303a.html#ab84d4c08acb431305e01e9b7e873641b", null ], [ "getFifoControl", "classxpcc_1_1_lsm303a.html#a18ded90f2c930afdc652e997a20e0a82", null ], [ "getStatus", "classxpcc_1_1_lsm303a.html#a57a3db5ab3a5e605f865b82bb13fa016", null ], [ "getFifoSource", "classxpcc_1_1_lsm303a.html#a0372308200505b75bf59669929af39e4", null ], [ "getData", "classxpcc_1_1_lsm303a.html#a1e70f53450ecb38ceeb39a70c7110d8b", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1filter_1_1_fir.js var classxpcc_1_1filter_1_1_fir = [ [ "Fir", "classxpcc_1_1filter_1_1_fir.html#a1bbb156b8cd0f5b94031df25585cc516", null ], [ "setCoefficients", "classxpcc_1_1filter_1_1_fir.html#a7390a48280d55427d6d4f37caa28fb90", null ], [ "reset", "classxpcc_1_1filter_1_1_fir.html#a9d8ebbb272eb8e2fa1899a809398f607", null ], [ "append", "classxpcc_1_1filter_1_1_fir.html#ac5dd37beef65b812c0395d10e47e0b5d", null ], [ "update", "classxpcc_1_1filter_1_1_fir.html#ac8bc6a31b504a217a6556175f3515e82", null ], [ "getValue", "classxpcc_1_1filter_1_1_fir.html#ac35fc64d077ef304d810d57d9e007b78", null ] ];<file_sep>/docs/api/search/typedefs_9.js var searchData= [ ['register16',['Register16',['../group__register.html#gaf50110b5b40521dc0dc10cee6f3fe7ea',1,'xpcc']]], ['register32',['Register32',['../group__register.html#ga13f6ff67091cdf706220bb3283342dbf',1,'xpcc']]], ['register8',['Register8',['../group__register.html#gac82600d3b4d79b80e601b8e03f4d3efb',1,'xpcc']]] ]; <file_sep>/docs/api/classxpcc_1_1stm32_1_1_can1.js var classxpcc_1_1stm32_1_1_can1 = [ [ "Mode", "classxpcc_1_1stm32_1_1_can1.html#a40b7eae345b8c09ae254a660043052c0", [ [ "Normal", "classxpcc_1_1stm32_1_1_can1.html#a40b7eae345b8c09ae254a660043052c0a960b44c579bc2f6818d2daaf9e4c16f0", null ], [ "ListenOnly", "classxpcc_1_1stm32_1_1_can1.html#a40b7eae345b8c09ae254a660043052c0a3db5be2c0f1a2c52d4efc1d475551ba9", null ], [ "LoopBack", "classxpcc_1_1stm32_1_1_can1.html#a40b7eae345b8c09ae254a660043052c0a2bedeeb051e4212e3c53f13f85845fde", null ], [ "ListenOnlyLoopBack", "classxpcc_1_1stm32_1_1_can1.html#a40b7eae345b8c09ae254a660043052c0a45987c21827015f2000fff5769b231a2", null ] ] ] ];<file_sep>/docs/api/classxpcc_1_1_doubly_linked_list_1_1iterator.js var classxpcc_1_1_doubly_linked_list_1_1iterator = [ [ "iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a02e3480d80fcabee390832912facbb2b", null ], [ "iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa5225f3035f8a5f8aa510b63f4846ae8", null ], [ "operator=", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa82ae6f76457e4c7a0b080a9b56127b6", null ], [ "operator++", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a3434e148ba87561fc0a799403b5badd8", null ], [ "operator--", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#ad5d5726920b2fb8b61496c63a416f5e4", null ], [ "operator==", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a28faa210baff0cdc1a9bbb72f53ee089", null ], [ "operator!=", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a0cd66f210c065c508055f965feca468c", null ], [ "operator*", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#aa5ba9f050ddb46f6b8ee01bb09f05af4", null ], [ "operator->", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a92e7747e7fdbbbae4b776f60ae95616f", null ], [ "DoublyLinkedList", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#a8518425fc192346c00bedb825184bcf1", null ], [ "const_iterator", "classxpcc_1_1_doubly_linked_list_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f", null ] ];<file_sep>/docs/api/classxpcc_1_1_generic_periodic_timer.js var classxpcc_1_1_generic_periodic_timer = [ [ "GenericPeriodicTimer", "classxpcc_1_1_generic_periodic_timer.html#a0bd9d91f101dd3205fa905a398df92e5", null ], [ "restart", "classxpcc_1_1_generic_periodic_timer.html#a5d99901a47a34a02830f1acfbe2eed25", null ], [ "restart", "classxpcc_1_1_generic_periodic_timer.html#a51a63783b8a78ae468d74459e9aabd38", null ], [ "stop", "classxpcc_1_1_generic_periodic_timer.html#abed61c10303a883b47ed0a1bdba141b1", null ], [ "execute", "classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f", null ], [ "remaining", "classxpcc_1_1_generic_periodic_timer.html#a36e261e9debd8c4aa650e9d5aedd7314", null ], [ "getState", "classxpcc_1_1_generic_periodic_timer.html#ac70aa47213a9117802e74e4291acab87", null ], [ "isStopped", "classxpcc_1_1_generic_periodic_timer.html#a7624cbce4fb8c4be66a63740a5e9b484", null ] ];<file_sep>/docs/api/classxpcc_1_1_tcs3414.js var classxpcc_1_1_tcs3414 = [ [ "Data.__unnamed__", "classxpcc_1_1_tcs3414.html#structxpcc_1_1_tcs3414_1_1_data_8____unnamed____", [ [ "green", "classxpcc_1_1_tcs3414.html#a9f27410725ab8cc8854a2769c7a516b8", null ], [ "red", "classxpcc_1_1_tcs3414.html#abda9643ac6601722a28f238714274da4", null ], [ "blue", "classxpcc_1_1_tcs3414.html#a48d6215903dff56238e52e8891380c8f", null ], [ "clear", "classxpcc_1_1_tcs3414.html#a01bc6f8efa4202821e95f4fdf6298b30", null ] ] ], [ "Tcs3414", "classxpcc_1_1_tcs3414.html#a31b935c618868af3a916675e78d0dd50", null ], [ "initializeBlocking", "classxpcc_1_1_tcs3414.html#a216b0daf6dff793d53212fd9f1517492", null ], [ "setGain", "classxpcc_1_1_tcs3414.html#af2b88e4cf351696e712897df8bb85ab6", null ], [ "setIntegrationTime", "classxpcc_1_1_tcs3414.html#a199c6ee805ef86a55e56ff8cb3bc3e58", null ], [ "setIntegrationTime", "classxpcc_1_1_tcs3414.html#ab3160a1d6d2cf6d51a261893e32fb469", null ], [ "refreshAllColors", "classxpcc_1_1_tcs3414.html#a5b2a2ba10cd66cdd49f2c864ea15fb51", null ], [ "initialize", "classxpcc_1_1_tcs3414.html#a66902f64da3e21b6b54c858a86449fdd", null ], [ "configure", "classxpcc_1_1_tcs3414.html#a8f25825dda1b9af63c2f448c282ae50f", null ] ];<file_sep>/docs/api/structxpcc_1_1hmc58x3_1_1_data.js var structxpcc_1_1hmc58x3_1_1_data = [ [ "getMagneticFieldX", "structxpcc_1_1hmc58x3_1_1_data.html#a1e825d6e7ff2413517e001269c41a58c", null ], [ "getMagneticFieldY", "structxpcc_1_1hmc58x3_1_1_data.html#a35f94f373d9caa19884c93faa0d914e7", null ], [ "getMagneticFieldZ", "structxpcc_1_1hmc58x3_1_1_data.html#ab21b578675b9cf1be7e9c371844e3de8", null ], [ "isOverflowX", "structxpcc_1_1hmc58x3_1_1_data.html#a1f683909be4e586b01ba58a271a704ae", null ], [ "isOverflowY", "structxpcc_1_1hmc58x3_1_1_data.html#a272aab2020e0db970b9f5c27a45a9055", null ], [ "isOverflowZ", "structxpcc_1_1hmc58x3_1_1_data.html#aebb75ab2d05d7c80eb461cb5b909675f", null ], [ "getGain", "structxpcc_1_1hmc58x3_1_1_data.html#a853f5ce2c7742f35264e0e4fe31466cf", null ], [ "operator[]", "structxpcc_1_1hmc58x3_1_1_data.html#a09183bfd75bf2fbe2ea104ecc1fa9d8e", null ], [ "Hmc58x3", "structxpcc_1_1hmc58x3_1_1_data.html#a8662035e92b1bd2e4848b54c1e7c3e20", null ], [ "Hmc5843", "structxpcc_1_1hmc58x3_1_1_data.html#a6a8519f5a7a98415774254bbf2dcee5b", null ], [ "Hmc5883", "structxpcc_1_1hmc58x3_1_1_data.html#ac40073ef32321aa240ed4a34cd77e218", null ] ];<file_sep>/docs/api/classxpcc_1_1rtos_1_1_mutex_guard.js var classxpcc_1_1rtos_1_1_mutex_guard = [ [ "MutexGuard", "classxpcc_1_1rtos_1_1_mutex_guard.html#a533e4b0076e7ebb359b9ef6fa9d1cd86", null ], [ "~MutexGuard", "classxpcc_1_1rtos_1_1_mutex_guard.html#a35271c8afa0874c5dab78b7c6e44dc23", null ], [ "MutexGuard", "classxpcc_1_1rtos_1_1_mutex_guard.html#a533e4b0076e7ebb359b9ef6fa9d1cd86", null ], [ "~MutexGuard", "classxpcc_1_1rtos_1_1_mutex_guard.html#a35271c8afa0874c5dab78b7c6e44dc23", null ] ];<file_sep>/docs/api/classxpcc_1_1_queue.js var classxpcc_1_1_queue = [ [ "Size", "classxpcc_1_1_queue.html#a22b626c9cea492425dee0907fb84c5b6", null ], [ "isEmpty", "classxpcc_1_1_queue.html#adc215c52ba3fba7bdefe5d5d8b3ada59", null ], [ "isNotEmpty", "classxpcc_1_1_queue.html#a5f80f8c589e86835fe5298606925da8a", null ], [ "isFull", "classxpcc_1_1_queue.html#a848eef1df0b79b64677b66c4207606c2", null ], [ "isNotFull", "classxpcc_1_1_queue.html#adf21c386538cea91ee0c3f48767df667", null ], [ "getSize", "classxpcc_1_1_queue.html#ac794a57ea4f5c28dbfaca408da022dd9", null ], [ "getMaxSize", "classxpcc_1_1_queue.html#a43ec2fcdfb6a028217f4206dbe7c9c02", null ], [ "get", "classxpcc_1_1_queue.html#adf6c9fea53aa053c3f377dd861521697", null ], [ "get", "classxpcc_1_1_queue.html#a2e52c024b49ca66183190c1851307ff0", null ], [ "push", "classxpcc_1_1_queue.html#a71f8ab3511278b9d1fd8becb2d10b83a", null ], [ "pop", "classxpcc_1_1_queue.html#a9c09f7820c051f39f73a8b42653bc700", null ], [ "c", "classxpcc_1_1_queue.html#abaabfe78c130c443eb50b1ce7b3de0be", null ] ];<file_sep>/docs/api/group__mcp2515.js var group__mcp2515 = [ [ "Mcp2515", "classxpcc_1_1_mcp2515.html", [ [ "SpiCommand", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68", [ [ "RESET", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ae12f7a67ab5087b2206b64cbefb9b56e", null ], [ "READ", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ad6564b6bc88869910920adece16956e2", null ], [ "READ_RX", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68aae51ece4ce832937b636cf37c1aebe3b", null ], [ "WRITE", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68ac4c41f65b63f86c138f7fde81903ff2e", null ], [ "WRITE_TX", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68af7df8965bf007f2c37dbe2068bf84b7f", null ], [ "RTS", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68af2ef3880a6e98104f78dca881eb79397", null ], [ "READ_STATUS", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68a8c6984304f341bf66ffa4478066ab77c", null ], [ "RX_STATUS", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68afa75320b54228e407ce1947998e8c029", null ], [ "BIT_MODIFY", "classxpcc_1_1_mcp2515.html#a7b3ad83bc71b7e42e2f246b6763ced68afe25d9967d9577841207ef05eeebc411", null ] ] ] ] ], [ "Register", "group__mcp2515.html#gae2e716657a43e2aba93b77d048d90b51", null ], [ "BFPCTRL", "group__mcp2515.html#ga0cd6dd287ed5ac93a148a5ab4ac2b582", null ], [ "TXRTSCTRL", "group__mcp2515.html#ga8014c6221c8c43f35ebc44e76fcef4fb", null ], [ "CANSTAT", "group__mcp2515.html#ga614921bf9d83e5e8d7d7c25d47df9ce1", null ], [ "CANCTRL", "group__mcp2515.html#gad7f33d02e3ed5b8793dcac53b8ff114c", null ], [ "CNF3", "group__mcp2515.html#ga5e0bebf04d450643301e972c0b330a93", null ], [ "CNF2", "group__mcp2515.html#ga057de5cd1cb19284a6de228830a03c30", null ], [ "CNF1", "group__mcp2515.html#ga048ef049d1dc950515945f512cf4b365", null ], [ "CANINTE", "group__mcp2515.html#ga5027e1da00258c8ebf7e8ad1c0c6a267", null ], [ "CANINTF", "group__mcp2515.html#ga3e43e6cc1f63b6c4c6e6b82f79c42922", null ], [ "EFLG", "group__mcp2515.html#gaaa656e18aaf05cfa9d0290f9b12cf660", null ], [ "TXBnCTRL", "group__mcp2515.html#gaf74bdd1523bb66b9284df0873a42aa7b", null ], [ "RXB0CTRL", "group__mcp2515.html#ga0933772e1cca70207fa535568e90a79d", null ], [ "TXBnSIDL", "group__mcp2515.html#gaa208ef6c2d4c6f054e26b84e9c255c1d", null ], [ "RXB1CTRL", "group__mcp2515.html#ga5255ae28f455c1aefb8452aa43fe0df2", null ], [ "RXBnSIDL", "group__mcp2515.html#ga3aa0db6228517eab3734688afb98d28c", null ], [ "RXBnDLC", "group__mcp2515.html#ga5dad9ab7d014ee3e9212445b0a8ff4e2", null ], [ "Status", "group__mcp2515.html#ga14b0c039a9e0665612d74241fb1e8ebd", null ], [ "RxStatus", "group__mcp2515.html#gac7ed30ce273b312ec0fcdcbfed9e6bf3", null ] ];<file_sep>/docs/api/search/enums_13.js var searchData= [ ['vhvrecalibrate',['VhvRecalibrate',['../structxpcc_1_1vl6180.html#a28bc5aefa584a47672ed220238842c2b',1,'xpcc::vl6180']]] ]; <file_sep>/docs/api/group__tmp_structxpcc_1_1tmp_1_1_super_subclass.js var group__tmp_structxpcc_1_1tmp_1_1_super_subclass = [ [ "value", "group__tmp.html#aa524d98637aca9f17da1e8d851a9e4bda47a893c6102e34a2ab6a23b2983c1e39", null ], [ "dontUseWithIncompleteTypes", "group__tmp.html#ad30e8b1b1ebc0bf6859089417012aa8da2c538a59a15cc9049ab7b7619690d2b5", null ] ];<file_sep>/docs/api/classxpcc_1_1fat_1_1_file_info.js var classxpcc_1_1fat_1_1_file_info = [ [ "FileInfo", "classxpcc_1_1fat_1_1_file_info.html#aa7cf2b558f0e3259f72995c69f111326", null ], [ "getSize", "classxpcc_1_1fat_1_1_file_info.html#a715596df020def1a0274d62828ceaeb4", null ], [ "getModifiedDate", "classxpcc_1_1fat_1_1_file_info.html#a238078068ae9226ecb2b42f74adf70d4", null ], [ "getModifiedTime", "classxpcc_1_1fat_1_1_file_info.html#a839a8b4b7777d2440501d5f5a68d46a6", null ], [ "getName", "classxpcc_1_1fat_1_1_file_info.html#a3fdf21d63fa0a6d6f4830bec79c05c1e", null ], [ "getShortName", "classxpcc_1_1fat_1_1_file_info.html#a2304a8092b45ff74e0f57174672aaf03", null ], [ "info", "classxpcc_1_1fat_1_1_file_info.html#ad2600d3df4a00a700732936e70332b2f", null ] ];<file_sep>/docs/api/classxpcc_1_1fat_1_1_physical_volume.js var classxpcc_1_1fat_1_1_physical_volume = [ [ "~PhysicalVolume", "classxpcc_1_1fat_1_1_physical_volume.html#ac3e04ebf817e73a063fa0a375a181a52", null ], [ "initialize", "classxpcc_1_1fat_1_1_physical_volume.html#abb9b3b43722b0c0a6b9e6a0ae3cbdb37", null ], [ "getStatus", "classxpcc_1_1fat_1_1_physical_volume.html#ab0ed892f8b0faee4a75d6c4c29d7fdeb", null ], [ "read", "classxpcc_1_1fat_1_1_physical_volume.html#a2e42d95d9d5eefc6e3510c0d508534a5", null ], [ "write", "classxpcc_1_1fat_1_1_physical_volume.html#a2ecab1e5420532bbfdf6d7a139514771", null ], [ "ioctl", "classxpcc_1_1fat_1_1_physical_volume.html#a5e0a50c5ef37a8d177f131b73eb6d0e0", null ] ];<file_sep>/docs/api/classxpcc_1_1filter_1_1_moving_average.js var classxpcc_1_1filter_1_1_moving_average = [ [ "MovingAverage", "classxpcc_1_1filter_1_1_moving_average.html#a4931f63f22344ad1514c59d2e5fe8ac7", null ], [ "update", "classxpcc_1_1filter_1_1_moving_average.html#aa3a842ffeca80dadb8dbd36b2c683d86", null ], [ "getValue", "classxpcc_1_1filter_1_1_moving_average.html#ab327ea8a0504a5c3fbe2f55dab5cfcba", null ] ];<file_sep>/docs/api/group__image.js var group__image = [ [ "home_16x16", "group__image.html#gad333e74c26974b53e9dabb04278b89a1", null ], [ "logo_eurobot_90x64", "group__image.html#ga662e4976011e9fd0a6d45cbcc9908a61", null ], [ "logo_rca_90x64", "group__image.html#gafb3b952b2a4a7506ed039b241f7b77fe", null ], [ "logo_xpcc_90x64", "group__image.html#ga40e37f3e34d5583d1b7811cc7a47e8c5", null ], [ "skull_64x64", "group__image.html#ga4342e056d63af20a8bede6b5dd1698d9", null ] ];<file_sep>/src/guide/getting-started.md # Getting started ## Examples The best way for you to quickly learn about xpcc's APIs is to look at and experiment with [our examples][examples], especially if you have a development board that xpcc [supports out-of-the-box](../#supported-hardware). Make sure you have [the toolchain installed](../installation). Here are our favorite examples for our supported development boards: - Arduino Uno: [Blinky](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/arduino_uno/basic/blink/main.cpp), [Button & Serial](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/arduino_uno/basic/digital_read_serial/main.cpp), [Analog & Serial](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/arduino_uno/basic/read_analog_voltage/main.cpp). - NUCLEO-F031K6: [Blinky & Serial](https://github.com/roboterclubaachen/xpcc/tree/develop/examples/nucleo_f031k6/blink). - NUCLEO-F103RB: [Blinky & Serial](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/nucleo_f103rb/blink/main.cpp). - STM32F072 Discovery: [Blinky](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f072_discovery/blink/main.cpp), [CAN](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f072_discovery/can/main.cpp), [Gyroscope](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f072_discovery/rotation/main.cpp). - STM32F3 Discovery: [Blinky](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f3_discovery/blink/main.cpp), [CAN](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f3_discovery/can/main.cpp), [Accelerometer](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f3_discovery/accelerometer/main.cpp), [Gyroscope](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f3_discovery/rotation/main.cpp), [Debugging with GDB](https://github.com/roboterclubaachen/xpcc/tree/develop/examples/stm32f3_discovery/gdb). - STM32F4 Discovery: [Blinky](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/blink/main.cpp), [CAN](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/can/main.cpp), [Accelerometer](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/accelerometer/main.cpp), [Timer & LED Animations](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/timer/main.cpp), [Debugging hard faults](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/hard_fault/main.cpp). - STM32F469 Discovery: [Blinky](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f469_discovery/blink/main.cpp), [Drawing on display](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f469_discovery/display/main.cpp), [Touchscreen inputs](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f469_discovery/touchscreen/main.cpp), [Multi-heap with external 16MB memory](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f469_discovery/tlsf-allocator/main.cpp), [Game of Life in Color with Multitouch](https://github.com/roboterclubaachen/xpcc/tree/develop/examples/stm32f469_discovery/game_of_life) - STM32F769 Discovery: [FPU with double precision](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f769i_discovery/blink/main.cpp) Here are some additional examples of displays and sensors we like: - [SSD1306 OLED display](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/oled_display/main.cpp): Draws text and graphics onto I2C display. - [BMP085/BMP180 barometer](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/barometer_bmp085_bmp180/main.cpp): Reads atmospheric pressure and temperature from I2C sensor. - [BMP180/BME280 barometer](https://github.com/roboterclubaachen/xpcc/tree/develop/examples/stm32f103c8t6_blue_pill/environment): Reads atmospheric pressure and temperature from multiple I2C sensors. - [VL6180 time-of-flight distance sensor](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/distance_vl6180/main.cpp): Reads distance and ambient light from I2C sensor. - [VL53L0 time-of-flight distance sensor](https://github.com/roboterclubaachen/xpcc/tree/develop/examples/nucleo_f401re/distance_vl53l0): Much improved version of the VL6180 sensor. - [ADNS9800 motion sensor](https://github.com/roboterclubaachen/xpcc/tree/develop/examples/stm32f103c8t6_blue_pill/adns_9800): Reads 2D motion from SPI sensor used in gaming mice. - [TCS3414 color sensor](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/colour_tcs3414/main.cpp): Reads RGB color from I2C sensor. - [HD44780 over I2C-GPIO expander](https://github.com/roboterclubaachen/xpcc/blob/develop/examples/stm32f4_discovery/display/hd44780/main.cpp): Draws text via native GPIO port or I2C-GPIO expander port onto character display. Have a look at [the build system commands](../reference/build-system/#build-commands) to see how to compile and program your targets. ## Your own project Start your own project by cloning [our `getting-started` project][getting-started] from GitHub: ```sh git clone --recursive https://github.com/roboterclubaachen/getting-started-with-xpcc.git cd getting-started-with-xpcc tree . ├── LICENSE ├── README.md ├── hello-world │   ├── SConstruct │   ├── main.cpp │   └── project.cfg └── xpcc (git submodule) ``` The example contains the xpcc framework as a git submodule, a `SConstruct` file for [our build system](../reference/build-system/#build-commands), a project configuration file and of course the source code: ```cpp #include <xpcc/architecture/platform.hpp> int main() { Board::initialize(); Board::Leds::setOutput(); while (1) { Board::Leds::toggle(); xpcc::delayMilliseconds(Board::Button::read() ? 250 : 500); #ifdef XPCC_BOARD_HAS_LOGGER static uint32_t counter(0); XPCC_LOG_INFO << "Loop counter: " << (counter++) << xpcc::endl; #endif } return 0; } ``` You can change the development board for which you want to compile the example for in the `project.cfg` file: ```ini [build] board = stm32f4_discovery #board = arduino_uno #board = nucleo_f103rb #board = stm32f072_discovery #board = stm32f1_discovery #board = stm32f3_discovery #board = stm32f429_discovery #board = stm32f469_discovery #board = stm32f7_discovery ``` When you create you own project, you need to adapt the `xpccpath` inside the `SConstruct` to point to the location of the xpcc framework. Note that this allows you to use different versions of the xpcc frameworks (your own fork?) for your projects. ```python # path to the xpcc root directory (modify as needed!) xpccpath = '../xpcc' # execute the common SConstruct file execfile(xpccpath + '/scons/SConstruct') ``` ## Show me the basics All of this code works the same on all platforms, however, the pin and module names may need to be adapted. ### GPIO ```cpp using Led = GpioOutputB0; Led::setOutput(); Led::set(); // 1 instruction on AVR Led::reset(); // 3 instructions on Cortex-M Led::toggle(); using Button = GpioInputB0; Button::setInput(Gpio::InputType::PullUp); bool state = Button::read(); ``` ### Buffered UART ```cpp using Uart = Uart0; // configure and initialize UART to 115.2kBaud GpioOutputD1::connect(Uart::Tx); GpioInputD0::connect(Uart::Rx); Uart::initialize<systemClock, 115200>(); Uart::write('H'); // Ohai there Uart::write('i'); uint8_t buffer; while(1) { // create a simple loopback if (Uart::read(buffer)) { Uart::write(buffer); } } ``` ### IOStream ```cpp using Uart = Uart0; // Create a IODevice with the Uart xpcc::IODeviceWrapper<Uart> device; xpcc::IOStream stream(device); GpioOutputD1::connect(Uart::Tx); Uart::initialize<systemClock, 115200>(); stream << 42 << " is a nice number!" << xpcc::endl; ``` ### Software Timers ```cpp using Led = GpioOutputB0; xpcc::Timeout timeout(10000); // 10s timeout xpcc::PeriodicTimer timer(250); // 250ms period Led::setOutput(xpcc::Gpio::High); while(1) { if (timeout.execute()) { timer.stop(); Led::reset(); } if (timer.execute()) { Led::toggle(); } } ``` Have a look at the [`xpcc/examples/` folder][examples] for more advanced use cases. [doxygen]: http://xpcc.io/api/modules.html [examples]: https://github.com/roboterclubaachen/xpcc/tree/develop/examples [getting-started]: https://github.com/roboterclubaachen/getting-started-with-xpcc [examples]: https://github.com/roboterclubaachen/xpcc/tree/develop/examples <file_sep>/docs/api/classxpcc_1_1_dog_m128.js var classxpcc_1_1_dog_m128 = [ [ "initialize", "classxpcc_1_1_dog_m128.html#a625f4bfe13f8edfebc615c68eb5aa3c1", null ] ];<file_sep>/docs/api/group__wire.js var group__wire = [ [ "SoftwareOneWireMaster", "classxpcc_1_1_software_one_wire_master.html", null ], [ "one_wire", "namespacexpcc_1_1one__wire.html", null ], [ "RomCommand", "group__wire.html#ga18c5ac90389c6f27d08281c78c227fa2", null ] ];<file_sep>/docs/api/group__tmp_structxpcc_1_1tmp_1_1_super_subclass_strict.js var group__tmp_structxpcc_1_1tmp_1_1_super_subclass_strict = [ [ "value", "group__tmp.html#a3baa7bbd02b65768e84d668cc42419aaa0616865b0a0b875ca7501c13492a4227", null ] ];<file_sep>/docs/api/classunittest_1_1_reporter.js var classunittest_1_1_reporter = [ [ "Reporter", "classunittest_1_1_reporter.html#a5490ab9d47edf604fd110c5361af4758", null ], [ "nextTestSuite", "classunittest_1_1_reporter.html#a4039551f95da98ea7c91f58829c239da", null ], [ "reportPass", "classunittest_1_1_reporter.html#a5b8c277947b333413ad4d2db31e571dc", null ], [ "reportFailure", "classunittest_1_1_reporter.html#ae99ec1f3ee5c6e71ea642183e1559af3", null ], [ "printSummary", "classunittest_1_1_reporter.html#a522fc4efffe98b73421bb913808f7560", null ] ];<file_sep>/docs/api/classxpcc_1_1stm32_1_1_dma2.js var classxpcc_1_1stm32_1_1_dma2 = [ [ "Stream0", "classxpcc_1_1stm32_1_1_dma2_1_1_stream0.html", null ], [ "Stream1", "classxpcc_1_1stm32_1_1_dma2_1_1_stream1.html", null ], [ "Stream2", "classxpcc_1_1stm32_1_1_dma2_1_1_stream2.html", null ], [ "Stream3", "classxpcc_1_1stm32_1_1_dma2_1_1_stream3.html", null ], [ "Stream4", "classxpcc_1_1stm32_1_1_dma2_1_1_stream4.html", null ], [ "Stream5", "classxpcc_1_1stm32_1_1_dma2_1_1_stream5.html", null ], [ "Stream6", "classxpcc_1_1stm32_1_1_dma2_1_1_stream6.html", null ], [ "Stream7", "classxpcc_1_1stm32_1_1_dma2_1_1_stream7.html", null ] ];<file_sep>/docs/api/classxpcc_1_1_i2c_transaction.js var classxpcc_1_1_i2c_transaction = [ [ "Reading", "structxpcc_1_1_i2c_transaction_1_1_reading.html", "structxpcc_1_1_i2c_transaction_1_1_reading" ], [ "Starting", "structxpcc_1_1_i2c_transaction_1_1_starting.html", "structxpcc_1_1_i2c_transaction_1_1_starting" ], [ "Writing", "structxpcc_1_1_i2c_transaction_1_1_writing.html", "structxpcc_1_1_i2c_transaction_1_1_writing" ], [ "I2cTransaction", "classxpcc_1_1_i2c_transaction.html#a67f836bb353d09218bd2dede16ccafb9", null ], [ "setAddress", "classxpcc_1_1_i2c_transaction.html#a75afd89f80317613927157eff521f3cb", null ], [ "getState", "classxpcc_1_1_i2c_transaction.html#a386f7e0a805810a8111a62e4e57c229e", null ], [ "isBusy", "classxpcc_1_1_i2c_transaction.html#af39f49e27adc6cbcee967ce1c187afbe", null ], [ "configurePing", "classxpcc_1_1_i2c_transaction.html#a532854ec0f80eb0c8cc223f526d6f769", null ], [ "configureWriteRead", "classxpcc_1_1_i2c_transaction.html#a76f3fa7846b315f234a43b28c62a54e5", null ], [ "configureWrite", "classxpcc_1_1_i2c_transaction.html#ad74f75bbc6b6ba4f3c4cd9648635b663", null ], [ "configureRead", "classxpcc_1_1_i2c_transaction.html#a592285870134ed9825ec5e825dc697d1", null ], [ "attaching", "classxpcc_1_1_i2c_transaction.html#a3100e67a72238989387a20ff2958ac8e", null ], [ "starting", "classxpcc_1_1_i2c_transaction.html#a5cf564f7137d4c2f57a2eb3c5899742d", null ], [ "writing", "classxpcc_1_1_i2c_transaction.html#a0504a062f919583246747c077fdcff01", null ], [ "reading", "classxpcc_1_1_i2c_transaction.html#aa1e4c2ea1c002fde4d9edcb177d0ff55", null ], [ "detaching", "classxpcc_1_1_i2c_transaction.html#a43ca5751c55b6a4a7c748dbaf64c40be", null ], [ "address", "classxpcc_1_1_i2c_transaction.html#a5c6800ddc76c72df9e2f234b40899894", null ], [ "state", "classxpcc_1_1_i2c_transaction.html#ab03c507c03f82f24979bb9eb785f442a", null ] ];<file_sep>/docs/api/structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier.js var structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier = [ [ "StandardIdentifier", "structxpcc_1_1stm32_1_1_can_filter_1_1_standard_identifier.html#a74a3461d81f39d004f2aeeb2c6b6d0a8", null ] ];<file_sep>/docs/api/navtreeindex2.js var NAVTREEINDEX2 = { "classxpcc_1_1_ds1631.html#a1e94957e4b56eee7f0d8777d031216fa":[1,5,13,0,6], "classxpcc_1_1_ds1631.html#a2655dffccb6699b1cb11b1eaa106a93c":[1,5,13,0,0], "classxpcc_1_1_ds1631.html#a2e9832fc17a67bda5ad1493e91a5d0ea":[1,5,13,0,4], "classxpcc_1_1_ds1631.html#a6a4aa29db2410f924194d3bb40d5543c":[1,5,13,0,8], "classxpcc_1_1_ds1631.html#a75e20fb7c3b0fa8e139f69e425b0a560":[1,5,13,0,12], "classxpcc_1_1_ds1631.html#a8be88c462dd9defaf0b28135dc6ec906":[1,5,13,0,7], "classxpcc_1_1_ds1631.html#a92fb1407bc09b04316b071b275bf94d3":[1,5,13,0,9], "classxpcc_1_1_ds1631.html#a93061d139227ebb0fa08aff0049fd823":[1,5,13,0,1], "classxpcc_1_1_ds1631.html#aaa351a52001988308aa8a129241311ed":[1,5,13,0,2], "classxpcc_1_1_ds1631.html#acb6d7d27baa089aea465f39f31e96e4e":[1,5,13,0,3], "classxpcc_1_1_ds1631.html#ad9b9669a7cd3f069b045cd1c1663dce9":[1,5,13,0,5], "classxpcc_1_1_ds18b20.html":[1,5,13,1], "classxpcc_1_1_ds18b20.html#a2ef6054d868ff31582738a34527fc2d3":[1,5,13,1,4], "classxpcc_1_1_ds18b20.html#a49d368cb3403df7a2d23315c97d28bf9":[1,5,13,1,0], "classxpcc_1_1_ds18b20.html#a83083bf438fd193faff06b330eb337ec":[1,5,13,1,1], "classxpcc_1_1_ds18b20.html#a99b70d7ec05487c75ff649561f2b8fc2":[1,5,13,1,3], "classxpcc_1_1_ds18b20.html#ad15eaf76a11d5c130c42b80c8af0b099":[1,5,13,1,7], "classxpcc_1_1_ds18b20.html#ad50884d983cfe884ddf1c1fd60819413":[1,5,13,1,2], "classxpcc_1_1_ds18b20.html#aea95e03bb1d9eb102fd2d806719f205a":[1,5,13,1,5], "classxpcc_1_1_ds18b20.html#af1b05683ca51e25195f95c3631dd91c3":[1,5,13,1,6], "classxpcc_1_1_dynamic_array.html":[1,3,2], "classxpcc_1_1_dynamic_array.html#a03b91efdf4b1bc7a17f201a796986344":[1,3,2,6], "classxpcc_1_1_dynamic_array.html#a0d845b79d13e99f594807b8be8e4d25f":[1,3,2,4], "classxpcc_1_1_dynamic_array.html#a11bfd806707d308ba7b66d8a853ff4f5":[1,3,2,5], "classxpcc_1_1_dynamic_array.html#a2148b0f855a4882f47e57ce2bf58af3e":[1,3,2,25], "classxpcc_1_1_dynamic_array.html#a23641556787591624ee78618012d185b":[1,3,2,19], "classxpcc_1_1_dynamic_array.html#a2bd5abf0e6c383232977c857c124e920":[1,3,2,16], "classxpcc_1_1_dynamic_array.html#a3d7377482d2cd9497043a29248657fbf":[1,3,2,7], "classxpcc_1_1_dynamic_array.html#a53290f2e2b45ec4230742b2dd90233f8":[1,3,2,15], "classxpcc_1_1_dynamic_array.html#a53e29008a6e2426b14d381011427ce9d":[1,3,2,8], "classxpcc_1_1_dynamic_array.html#a5a166da5033f94b20b1a5b33908f5635":[1,3,2,9], "classxpcc_1_1_dynamic_array.html#a5df0b8745901c2af0ffcb77632fa587d":[1,3,2,20], "classxpcc_1_1_dynamic_array.html#a5e1a8be3f8862086f755f6737a2187c2":[1,3,2,27], "classxpcc_1_1_dynamic_array.html#a67171474c4da6cc8efe0c7fafefd2b2d":[1,3,2,31], "classxpcc_1_1_dynamic_array.html#a68fb16d638a9f5991861e65ce6023bd4":[1,3,2,26], "classxpcc_1_1_dynamic_array.html#a691d10d74f2c175dcdb1669412be2241":[1,3,2,3], "classxpcc_1_1_dynamic_array.html#a69688615274f64d964475d736aa81d24":[1,3,2,10], "classxpcc_1_1_dynamic_array.html#a805eca2d585c9bb5075c57fc9bfaac12":[1,3,2,22], "classxpcc_1_1_dynamic_array.html#a88855d0b6d2bf609cdc54f1402cd35f2":[1,3,2,14], "classxpcc_1_1_dynamic_array.html#a896174903468040bdf580e51302deecf":[1,3,2,29], "classxpcc_1_1_dynamic_array.html#a8de3c7b83041debd4c7880b902d8225c":[1,3,2,21], "classxpcc_1_1_dynamic_array.html#a948a1cf01e6916c5a011e9158d06a41a":[1,3,2,24], "classxpcc_1_1_dynamic_array.html#aa7d9b14e3cc5a6736b65bb248aac6cf4":[1,3,2,12], "classxpcc_1_1_dynamic_array.html#aac41df48db952c0204aab52d14064260":[1,3,2,28], "classxpcc_1_1_dynamic_array.html#aad0759a9e16008fe52405b380cf23063":[1,3,2,23], "classxpcc_1_1_dynamic_array.html#abb14add54aeb78cc25dfbe5763d321d7":[1,3,2,2], "classxpcc_1_1_dynamic_array.html#ac220ce1c155db1ac44146c12d178056f":[1,3,2,30], "classxpcc_1_1_dynamic_array.html#acb3c6b43d308d2755220f5ab207f1626":[1,3,2,13], "classxpcc_1_1_dynamic_array.html#ad6068d81fa04239f0da27ee5cbb80a9a":[1,3,2,11], "classxpcc_1_1_dynamic_array.html#ad99f3d8a82122fcb5fd204709cbb71eb":[1,3,2,17], "classxpcc_1_1_dynamic_array.html#ae8065ed33b329979c2f97573e28066ae":[1,3,2,18], "classxpcc_1_1_dynamic_array_1_1const__iterator.html":[1,3,2,0], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a2810a2e16dd9b883afa886106823e745":[1,3,2,0,0], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a4249f236733b9b5a3fa536e65350f2b4":[1,3,2,0,2], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a59ccd372cf049d2d339e9829e799c2f7":[1,3,2,0,9], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6799ad652564e60de4186e4043e8427b":[1,3,2,0,1], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a6820a1b92a2837b62a3e985b7b727db9":[1,3,2,0,5], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a710ed96b1a3447a3f0ae6dcdf369bc34":[1,3,2,0,6], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a845f49ed7330a208136c47af630fe8d3":[1,3,2,0,10], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#a963a71b636aa50192395509e6845602f":[1,3,2,0,7], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#aac0168e17ffccbb418678850c4d5b438":[1,3,2,0,3], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#ac96c3604a72a8f48fc0c1023a896bb87":[1,3,2,0,8], "classxpcc_1_1_dynamic_array_1_1const__iterator.html#aca58b806e31739394fa077e039c2d9d0":[1,3,2,0,4], "classxpcc_1_1_dynamic_array_1_1iterator.html":[1,3,2,1], "classxpcc_1_1_dynamic_array_1_1iterator.html#a17f0a753e0dcfa9a3182a75461aa68ed":[1,3,2,1,2], "classxpcc_1_1_dynamic_array_1_1iterator.html#a4dc26776c96d44d6420d42db30acdca2":[1,3,2,1,7], "classxpcc_1_1_dynamic_array_1_1iterator.html#a6948a39c8af41b733ea421c5a44d37a2":[1,3,2,1,4], "classxpcc_1_1_dynamic_array_1_1iterator.html#a7ea67d2070463051dcf2574252270114":[1,3,2,1,5], "classxpcc_1_1_dynamic_array_1_1iterator.html#a845f49ed7330a208136c47af630fe8d3":[1,3,2,1,11], "classxpcc_1_1_dynamic_array_1_1iterator.html#a88203fedba35251d9bc2544a339dd5af":[1,3,2,1,6], "classxpcc_1_1_dynamic_array_1_1iterator.html#a88def1037cad12ad13d2b0f5e11abe3a":[1,3,2,1,9], "classxpcc_1_1_dynamic_array_1_1iterator.html#a93c1047e5fde91971bb505e35d4f49bb":[1,3,2,1,10], "classxpcc_1_1_dynamic_array_1_1iterator.html#aa8a3c37ba0e0bd226f329f0df64ef518":[1,3,2,1,0], "classxpcc_1_1_dynamic_array_1_1iterator.html#ab46098cae57584f905a8626816e70849":[1,3,2,1,1], "classxpcc_1_1_dynamic_array_1_1iterator.html#ac220ce1c155db1ac44146c12d178056f":[1,3,2,1,12], "classxpcc_1_1_dynamic_array_1_1iterator.html#ac2947732c5613bf9016c1dcc89df1964":[1,3,2,1,8], "classxpcc_1_1_dynamic_array_1_1iterator.html#ae990105fd206c8fdee038c693e0da071":[1,3,2,1,3], "classxpcc_1_1_dynamic_postman.html":[1,2,4,5], "classxpcc_1_1_dynamic_postman.html#a10861441211803af0bf8c66824d4665f":[1,2,4,5,1], "classxpcc_1_1_dynamic_postman.html#a3fef2469a9066e3b06bfd9fdb7fc7779":[1,2,4,5,5], "classxpcc_1_1_dynamic_postman.html#a58b1b59250a7d5d574351e7b1f88455b":[1,2,4,5,2], "classxpcc_1_1_dynamic_postman.html#a797d1df8d092d2d06c2b779878294e2a":[1,2,4,5,0], "classxpcc_1_1_dynamic_postman.html#ab51a346cf08a856a18b28cf237abd4bc":[1,2,4,5,6], "classxpcc_1_1_dynamic_postman.html#ad97dbcc8b05e9bc436fc481bfeeed848":[1,2,4,5,4], "classxpcc_1_1_dynamic_postman.html#af5d2d5564fc31d317bc29d66bfcf09a3":[1,2,4,5,3], "classxpcc_1_1_error_report.html":[1,4,0], "classxpcc_1_1_error_report.html#aa742b8b820fcd1ac06e9d953b08538d8":[1,4,0,0], "classxpcc_1_1_ft245.html":[1,5,8,7], "classxpcc_1_1_ft6x06.html":[1,5,9,1], "classxpcc_1_1_ft6x06.html#a30f14466eb1ed55703d45d4bc94dd1c4":[1,5,9,1,0], "classxpcc_1_1_ft6x06.html#a8b12bca35cfe06770ad1951177450da4":[1,5,9,1,3], "classxpcc_1_1_ft6x06.html#aa85a16c98eea3b4a044dcb0bc76aea76":[1,5,9,1,1], "classxpcc_1_1_ft6x06.html#acbec2b1aad98522156cc9bdbdbf503c9":[1,5,9,1,2], "classxpcc_1_1_generic_periodic_timer.html":[1,9,5,0], "classxpcc_1_1_generic_periodic_timer.html#a0bd9d91f101dd3205fa905a398df92e5":[1,9,5,0,0], "classxpcc_1_1_generic_periodic_timer.html#a2bef026e4e683303266e2bebe538c63f":[1,9,5,0,4], "classxpcc_1_1_generic_periodic_timer.html#a36e261e9debd8c4aa650e9d5aedd7314":[1,9,5,0,5], "classxpcc_1_1_generic_periodic_timer.html#a51a63783b8a78ae468d74459e9aabd38":[1,9,5,0,2], "classxpcc_1_1_generic_periodic_timer.html#a5d99901a47a34a02830f1acfbe2eed25":[1,9,5,0,1], "classxpcc_1_1_generic_periodic_timer.html#a7624cbce4fb8c4be66a63740a5e9b484":[1,9,5,0,7], "classxpcc_1_1_generic_periodic_timer.html#abed61c10303a883b47ed0a1bdba141b1":[1,9,5,0,3], "classxpcc_1_1_generic_periodic_timer.html#ac70aa47213a9117802e74e4291acab87":[1,9,5,0,6], "classxpcc_1_1_generic_timeout.html":[1,9,5,1], "classxpcc_1_1_generic_timeout.html#a01ee9ed70e7abf682b850d906630694d":[1,9,5,1,10], "classxpcc_1_1_generic_timeout.html#a0e919a5ec0ae34b42602d92a2f5a7e5b":[1,9,5,1,3], "classxpcc_1_1_generic_timeout.html#a12a4f83e617bb81794d7f3d524bf6700":[1,9,5,1,2], "classxpcc_1_1_generic_timeout.html#a34666f8eb21ac67f3dff10c09521340b":[1,9,5,1,0], "classxpcc_1_1_generic_timeout.html#a579a923ee1fecdd53df23de4a58173fe":[1,9,5,1,7], "classxpcc_1_1_generic_timeout.html#a663cc82e4c469d5ccd2047fd035613d5":[1,9,5,1,4], "classxpcc_1_1_generic_timeout.html#a9762fc97412f74cef932122d501065fd":[1,9,5,1,6], "classxpcc_1_1_generic_timeout.html#a9b1594f8e48dd04fc33d31bcd5f5bb17":[1,9,5,1,8], "classxpcc_1_1_generic_timeout.html#aadbfd364b1ade3d6f0c110cb29d7be4e":[1,9,5,1,5], "classxpcc_1_1_generic_timeout.html#ac6f716c0c67e9c5c092254e1f3a64b4d":[1,9,5,1,9], "classxpcc_1_1_generic_timeout.html#adea65ca1f1fb5184ad8702be422ef51c":[1,9,5,1,1], "classxpcc_1_1_generic_timestamp.html":[1,9,5,2], "classxpcc_1_1_generic_timestamp.html#a000ce5640f38ec731912bfb00becdb7a":[1,9,5,2,8], "classxpcc_1_1_generic_timestamp.html#a0990f5ec7a852bf1f6a426a14f15b177":[1,9,5,2,9], "classxpcc_1_1_generic_timestamp.html#a0bd03c3eaa992bd5350f3b1a23e68a00":[1,9,5,2,7], "classxpcc_1_1_generic_timestamp.html#a1cff1028572b69b41be90ccc7809dd71":[1,9,5,2,5], "classxpcc_1_1_generic_timestamp.html#a24ecdcada9b6957fa0de46609f7cd2b9":[1,9,5,2,4], "classxpcc_1_1_generic_timestamp.html#a36e85ba63044c87aadb441a50d7efe77":[1,9,5,2,11], "classxpcc_1_1_generic_timestamp.html#a3abebd7b541c932beb74cde10ea570d5":[1,9,5,2,2], "classxpcc_1_1_generic_timestamp.html#a3f820ca2b13b479eab9dbb12987d3598":[1,9,5,2,3], "classxpcc_1_1_generic_timestamp.html#a8fdb17d87fce73286557213c34ce82da":[1,9,5,2,1], "classxpcc_1_1_generic_timestamp.html#a9d990ebf2c064a05ba83cb8cb7691862":[1,9,5,2,10], "classxpcc_1_1_generic_timestamp.html#aa0bf9311fb0eb10265563bc36e2d9b69":[1,9,5,2,0], "classxpcc_1_1_generic_timestamp.html#ae54461229066533dc7061e437f2b045c":[1,9,5,2,12], "classxpcc_1_1_generic_timestamp.html#ae7bdb1e437c97819a750bb45507881ad":[1,9,5,2,6], "classxpcc_1_1_gpio_expander.html":[1,1,4,3,4], "classxpcc_1_1_gpio_expander.html#a0659fc2cdfab9b63827135d64af3e7d9":[1,1,4,3,4,12], "classxpcc_1_1_gpio_expander.html#a24ed82d97e42c14d2e434578d495ad99":[1,1,4,3,4,14], "classxpcc_1_1_gpio_expander.html#a28f63c0270bd36bf913bf352524c252e":[1,1,4,3,4,2], "classxpcc_1_1_gpio_expander.html#a2ad68ccb1c8191e47c2bd5031b37c9b5":[1,1,4,3,4,8], "classxpcc_1_1_gpio_expander.html#a427da23931023c452349a6c54dd161f0":[1,1,4,3,4,3], "classxpcc_1_1_gpio_expander.html#a43a1b16d9fa80cd237b9765d45765ac9":[1,1,4,3,4,15], "classxpcc_1_1_gpio_expander.html#a4bacb401635b0335c1d74e12870df732":[1,1,4,3,4,7], "classxpcc_1_1_gpio_expander.html#a7c91e2bcb75e6017de1c1dae7900b1f7":[1,1,4,3,4,10], "classxpcc_1_1_gpio_expander.html#a8221bffb6fdc760e2069e2ec2dcf46f6":[1,1,4,3,4,6], "classxpcc_1_1_gpio_expander.html#a902fb9a564568fa7d8565c041f84de94":[1,1,4,3,4,4], "classxpcc_1_1_gpio_expander.html#aa702b30418310116232380603428ea84":[1,1,4,3,4,0], "classxpcc_1_1_gpio_expander.html#aa7e9958a8cae8c8df538788d57b623c9":[1,1,4,3,4,13], "classxpcc_1_1_gpio_expander.html#aafbfe97865cb2a28aaee03c956360b02":[1,1,4,3,4,11], "classxpcc_1_1_gpio_expander.html#abef33e75be29d2c9951a387647755179":[1,1,4,3,4,9], "classxpcc_1_1_gpio_expander.html#ae3882e40403291d3f2925ddea2d46206":[1,1,4,3,4,5], "classxpcc_1_1_gpio_expander.html#ae5f6095f4bf74be0839a199c72229947":[1,1,4,3,4,1], "classxpcc_1_1_gpio_expander_pin.html":[1,1,4,3,5], "classxpcc_1_1_gpio_expander_port.html":[1,1,4,3,6], "classxpcc_1_1_gpio_i_o.html":[1,1,4,3,2], "classxpcc_1_1_gpio_input.html":[1,1,4,3,0], "classxpcc_1_1_gpio_inverted.html":[1,1,4,3,8], "classxpcc_1_1_gpio_output.html":[1,1,4,3,1], "classxpcc_1_1_gpio_port.html":[1,1,4,3,3], "classxpcc_1_1_gpio_port.html#a0b4a485a4d4707e54663853b527c3ea3":[1,1,4,3,3,1], "classxpcc_1_1_gpio_port.html#a0b4a485a4d4707e54663853b527c3ea3a030aa94015bd11d183b897ddb541e4e3":[1,1,4,3,3,1,1], "classxpcc_1_1_gpio_port.html#a0b4a485a4d4707e54663853b527c3ea3a960b44c579bc2f6818d2daaf9e4c16f0":[1,1,4,3,3,1,0], "classxpcc_1_1_gpio_port.html#af382edca85322af5077cbb1e1ac73807":[1,1,4,3,3,0], "classxpcc_1_1_gpio_unused.html":[1,1,4,3,7], "classxpcc_1_1_graphic_display.html":[1,10,5,2], "classxpcc_1_1_graphic_display.html#a0085ce02669899ba1b81336e0ce2250c":[1,10,5,2,27], "classxpcc_1_1_graphic_display.html#a07dba8c0855e6234e11a7c8cb63d9b8d":[1,10,5,2,44], "classxpcc_1_1_graphic_display.html#a084a48fcb4f3feff132642bc135908e5":[1,10,5,2,16], "classxpcc_1_1_graphic_display.html#a0cde79f37d6e201c4d75e8d4407223d1":[1,10,5,2,25], "classxpcc_1_1_graphic_display.html#a139865301cab0b7b2720953316483217":[1,10,5,2,32], "classxpcc_1_1_graphic_display.html#a146611ceb4b5d2aa64e657c56fce4bbe":[1,10,5,2,26], "classxpcc_1_1_graphic_display.html#a1cba8dab7972492a6517946502d47382":[1,10,5,2,11], "classxpcc_1_1_graphic_display.html#a1ddc1fc5f3c84f3ceac27e4dd5c21e62":[1,10,5,2,21], "classxpcc_1_1_graphic_display.html#a20ddbbf4ac042977b0950fc8735de8d7":[1,10,5,2,35], "classxpcc_1_1_graphic_display.html#a288a7b7dd5e33431eb506342f48f7d4e":[1,10,5,2,7], "classxpcc_1_1_graphic_display.html#a2bcc50d1d0fde8031a54fd3a2dd59273":[1,10,5,2,31], "classxpcc_1_1_graphic_display.html#a2e3898fd2582d9e3e14cc4f941b1b19c":[1,10,5,2,12], "classxpcc_1_1_graphic_display.html#a2ff86e1c14b850f3758c5c53c00ca9ac":[1,10,5,2,8], "classxpcc_1_1_graphic_display.html#a33b7e21083a231f634214cf0005674b1":[1,10,5,2,23], "classxpcc_1_1_graphic_display.html#a36162f3d9576f28e8003b19a09aca98c":[1,10,5,2,5], "classxpcc_1_1_graphic_display.html#a41d8810e166e5ce3c5d608bf8f2d3017":[1,10,5,2,42], "classxpcc_1_1_graphic_display.html#a424fcd9c033e0c1d4352ad4e4fc2c8ed":[1,10,5,2,37], "classxpcc_1_1_graphic_display.html#a465e1f8a48a1c65fda623079c3270d02":[1,10,5,2,10], "classxpcc_1_1_graphic_display.html#a5f829d66551cfde98520cc98e324768a":[1,10,5,2,39], "classxpcc_1_1_graphic_display.html#a603f91f8bd6396e9bd1bb76297478dd7":[1,10,5,2,14], "classxpcc_1_1_graphic_display.html#a682cd5f666e4120d55c6be4f2a11e7c0":[1,10,5,2,46], "classxpcc_1_1_graphic_display.html#a8026e322b12e7afa2e5e0c5bfe514941":[1,10,5,2,6], "classxpcc_1_1_graphic_display.html#a866bdba794c686162724960895c0c66f":[1,10,5,2,40], "classxpcc_1_1_graphic_display.html#a88af6be71366993d4367708c710b3413":[1,10,5,2,38], "classxpcc_1_1_graphic_display.html#a8b0c8c5ffc9187b877efc95bb743a4df":[1,10,5,2,1], "classxpcc_1_1_graphic_display.html#a8d3ac8b3b9e547659f1dfd2d3f246c10":[1,10,5,2,22], "classxpcc_1_1_graphic_display.html#a95f462ea9a24bedc4e3956e045818754":[1,10,5,2,20], "classxpcc_1_1_graphic_display.html#aa1cfa980d81716b049208aec221c3ca5":[1,10,5,2,34], "classxpcc_1_1_graphic_display.html#aa2fb1241965b009f2cef0ff7b4d28206":[1,10,5,2,4], "classxpcc_1_1_graphic_display.html#aa4aaba641edf8b57c4ef1fdce378762b":[1,10,5,2,18], "classxpcc_1_1_graphic_display.html#aa53cc5dd6595156cf17acc5bf453f3b7":[1,10,5,2,17], "classxpcc_1_1_graphic_display.html#aab8bdb0535bb15c61eefa3621807ffe4":[1,10,5,2,30], "classxpcc_1_1_graphic_display.html#aaf37d1b5e9a5f4fffc1985becf2ddc53":[1,10,5,2,3], "classxpcc_1_1_graphic_display.html#abb0777c72eafcff4b3a6e2078c170182":[1,10,5,2,33], "classxpcc_1_1_graphic_display.html#ac05851329360834084f70e065c22fc04":[1,10,5,2,41], "classxpcc_1_1_graphic_display.html#ac1713568b19395f086eacb645f5f1a0a":[1,10,5,2,45], "classxpcc_1_1_graphic_display.html#ac2d4a9e5884d800e198879a6ab3eab16":[1,10,5,2,19], "classxpcc_1_1_graphic_display.html#ac604b7c2ad6e94699f3a6eb004dbc335":[1,10,5,2,43], "classxpcc_1_1_graphic_display.html#ac64532dda1867da4d092f97840d70f45":[1,10,5,2,29], "classxpcc_1_1_graphic_display.html#acaefc7240a5c705b1b2c220d247a40e4":[1,10,5,2,13], "classxpcc_1_1_graphic_display.html#acd026faee2a53e4156527ec676b3c1d6":[1,10,5,2,9], "classxpcc_1_1_graphic_display.html#acd8c28125a5dce0450ffad7532f0c395":[1,10,5,2,36], "classxpcc_1_1_graphic_display.html#ad2399bd0b0cecce12fd1792d0a1e779e":[1,10,5,2,24], "classxpcc_1_1_graphic_display.html#ad301bae1251bce5b8a7ff3930c7fae54":[1,10,5,2,28], "classxpcc_1_1_graphic_display.html#ae4862b93f979da7a79408c3dfe313b8c":[1,10,5,2,15], "classxpcc_1_1_graphic_display.html#af2b8191843d6c4b18243306b5ea2c6ee":[1,10,5,2,2], "classxpcc_1_1_graphic_display_1_1_writer.html":[1,10,5,2,0], "classxpcc_1_1_graphic_display_1_1_writer.html#a0b4a81a06ef182a33e2bc0780b9962e0":[1,10,5,2,0,2], "classxpcc_1_1_graphic_display_1_1_writer.html#a70c09ba1e43cb7ee698a214d0aa4da38":[1,10,5,2,0,1], "classxpcc_1_1_graphic_display_1_1_writer.html#a79d7bf17def1dd612c7a9fba7730d4cc":[1,10,5,2,0,3], "classxpcc_1_1_graphic_display_1_1_writer.html#ae459703edd121abb7293173ae160c57a":[1,10,5,2,0,0], "classxpcc_1_1_hcla_x.html":[1,5,12,2], "classxpcc_1_1_hcla_x.html#a48fa530e656e4accf8ebef39c429fb56":[1,5,12,2,3], "classxpcc_1_1_hcla_x.html#a76a22b68569da0de1838ece0aaccaa85":[1,5,12,2,1], "classxpcc_1_1_hcla_x.html#a84044de20d813bb81bfdc1463fa8c33d":[1,5,12,2,2], "classxpcc_1_1_hcla_x.html#aaf5bebca6e3d09f3fdfc15692a48b98d":[1,5,12,2,0], "classxpcc_1_1_hd44780.html":[1,5,0,1], "classxpcc_1_1_hd44780.html#a0460d600691ae146c59e9de26a1642c1":[1,5,0,1,4], "classxpcc_1_1_hd44780.html#a0b1b64910ccca02ccbc33bcf404eeeb3":[1,5,0,1,6], "classxpcc_1_1_hd44780.html#a705ef86c9c07d316d32af4b718740316":[1,5,0,1,5], "classxpcc_1_1_hd44780.html#a8350c8d48d473a746d5cd3b60d73e98e":[1,5,0,1,7], "classxpcc_1_1_hd44780.html#ab9403ed0b27c060325b91aa45b100cf5":[1,5,0,1,2], "classxpcc_1_1_hd44780.html#abcb00802617b96c9d53e2ea6502005a6":[1,5,0,1,0], "classxpcc_1_1_hd44780.html#ad447d2331d5ef35147cf5af77e0e0c1f":[1,5,0,1,3], "classxpcc_1_1_hd44780.html#af05c63001932b97690751b4a4b31a54b":[1,5,0,1,1], "classxpcc_1_1_hd44780_base.html":[2,0,3,139], "classxpcc_1_1_hd44780_base.html#a5409703f6d8546f86c342f7eedeef9c7":[2,0,3,139,0], "classxpcc_1_1_hd44780_base.html#a5409703f6d8546f86c342f7eedeef9c7a0ce46e04b6e89853897a4e8cf0d72b1f":[2,0,3,139,0,1], "classxpcc_1_1_hd44780_base.html#a5409703f6d8546f86c342f7eedeef9c7afd7bef95d1da340729389a414e97ae70":[2,0,3,139,0,0], "classxpcc_1_1_hd44780_dual.html":[1,5,0,2], "classxpcc_1_1_hd44780_dual.html#a36435885fe9d0f385547bd5f8f749675":[1,5,0,2,5], "classxpcc_1_1_hd44780_dual.html#a43159b3b5c4070ad08056a64891d8941":[1,5,0,2,1], "classxpcc_1_1_hd44780_dual.html#a4b28fa9e01a95d99d6fa662e6ab9d886":[1,5,0,2,4], "classxpcc_1_1_hd44780_dual.html#a7dfcd3a49167c3a842fe1fe3374cb7bc":[1,5,0,2,7], "classxpcc_1_1_hd44780_dual.html#a8cfb88de6b8c8de666db7efe7e50024f":[1,5,0,2,6], "classxpcc_1_1_hd44780_dual.html#aac840222f6f0d70593eeaaa603e7a521":[1,5,0,2,0], "classxpcc_1_1_hd44780_dual.html#abff66b016601b0747bc190114db1b7fc":[1,5,0,2,3], "classxpcc_1_1_hd44780_dual.html#acf062195cde77addd83e33f2d7dea7a1":[1,5,0,2,2], "classxpcc_1_1_hmc5843.html":[1,5,5,2], "classxpcc_1_1_hmc5843.html#a17871aa354c0f7125742b3c19c1596d8":[1,5,5,2,1], "classxpcc_1_1_hmc5843.html#a379d578f734fc2687c865ba1f0fb4b21":[1,5,5,2,3], "classxpcc_1_1_hmc5843.html#ac9053daf59525a1c40c5cba388cd7cbc":[1,5,5,2,2], "classxpcc_1_1_hmc5843.html#ad255fbd0708bf5414d146d6d0d462d3e":[1,5,5,2,0], "classxpcc_1_1_hmc5883.html":[1,5,5,3], "classxpcc_1_1_hmc5883.html#a1386495cec90cd79cd37235f15e3ce1a":[1,5,5,3,1], "classxpcc_1_1_hmc5883.html#a1447214fb449d7ccd756ec83ae09eb11":[1,5,5,3,4], "classxpcc_1_1_hmc5883.html#a49c95851fc132100b48be37e97ee6dea":[1,5,5,3,2], "classxpcc_1_1_hmc5883.html#aa6378dddac1de6fc9d757dcac721ef59":[1,5,5,3,0], "classxpcc_1_1_hmc5883.html#aa96c37d12c7d47425d2c628c91a06e89":[1,5,5,3,3], "classxpcc_1_1_hmc58x3.html":[1,5,5,4], "classxpcc_1_1_hmc58x3.html#a247d0beca257168a7dc1898f42620ff7":[1,5,5,4,6], "classxpcc_1_1_hmc58x3.html#a543f0412aef3833b9f1fd7389c1a892f":[1,5,5,4,8] }; <file_sep>/docs/api/classxpcc_1_1_abstract_view.js var classxpcc_1_1_abstract_view = [ [ "AbstractView", "classxpcc_1_1_abstract_view.html#a99357fa5ed844c39beb12e0ae8f76df4", null ], [ "~AbstractView", "classxpcc_1_1_abstract_view.html#a0f9980986c50e15a9dcd9325345dde95", null ], [ "update", "classxpcc_1_1_abstract_view.html#ac7e1e9691c503b0cde8ef7c92c8624cd", null ], [ "hasChanged", "classxpcc_1_1_abstract_view.html#aac1ece11dad3d983a08559617dd835f5", null ], [ "draw", "classxpcc_1_1_abstract_view.html#abcc3376d3d938ca9f66923b025d9b205", null ], [ "shortButtonPress", "classxpcc_1_1_abstract_view.html#aa88d8a4ad62fadc9542f1cb765907fd3", null ], [ "isAlive", "classxpcc_1_1_abstract_view.html#a0cbcf339a93d03c9734da316c2061fdd", null ], [ "remove", "classxpcc_1_1_abstract_view.html#a09abded7166e1d2efbef19c374f52349", null ], [ "getIdentifier", "classxpcc_1_1_abstract_view.html#a99b048e66790d3bbbc8c586d9b2082df", null ], [ "display", "classxpcc_1_1_abstract_view.html#a4416378a0f604018eea966d1e4901656", null ], [ "onRemove", "classxpcc_1_1_abstract_view.html#a26fd3e9d545bc88f3825ae3b1054263b", null ], [ "getViewStack", "classxpcc_1_1_abstract_view.html#a5af10ab104234515698722bbda5b5642", null ], [ "ViewStack", "classxpcc_1_1_abstract_view.html#ab1b547848ee5b48ec6212730c0692dce", null ], [ "identifier", "classxpcc_1_1_abstract_view.html#adfdcad9b56306a5d77c85034d055b4c7", null ], [ "alive", "classxpcc_1_1_abstract_view.html#a62be69db682328212bb107993a1dc68f", null ] ];<file_sep>/docs/api/classxpcc_1_1accessor_1_1_ram.js var classxpcc_1_1accessor_1_1_ram = [ [ "Ram", "classxpcc_1_1accessor_1_1_ram.html#a5837bf7c7729b953a4f624b033df8dd5", null ], [ "Ram", "classxpcc_1_1accessor_1_1_ram.html#ad0afa291abfedefc6591f1fade6f7e76", null ], [ "operator*", "classxpcc_1_1accessor_1_1_ram.html#a8337234da98abf11955e273a1a340b5e", null ], [ "operator[]", "classxpcc_1_1accessor_1_1_ram.html#a4f762a1cdd31d96a1a1c9fe132e1d75a", null ], [ "operator++", "classxpcc_1_1accessor_1_1_ram.html#a73087d18770f0ae8c2fffb25aa979aa8", null ], [ "operator++", "classxpcc_1_1accessor_1_1_ram.html#aa5897c9f7306603d974588af1d20113c", null ], [ "operator--", "classxpcc_1_1accessor_1_1_ram.html#a71524ddc621e85c4c9d67bc99907af3f", null ], [ "operator--", "classxpcc_1_1accessor_1_1_ram.html#a7cfc5c18ebf41f17e2041ede4696309d", null ], [ "operator+=", "classxpcc_1_1accessor_1_1_ram.html#aad1a2dc3a0b8d717d218165eaeb6c4a2", null ], [ "operator-=", "classxpcc_1_1accessor_1_1_ram.html#aa98110371ec76487e9127cd18454f23f", null ], [ "getPointer", "classxpcc_1_1accessor_1_1_ram.html#af5069316e88b52356f5ddadf61ad40b3", null ] ];<file_sep>/docs/api/classmy__namespace_1_1_my_class.js var classmy__namespace_1_1_my_class = [ [ "MyClass", "classmy__namespace_1_1_my_class.html#a5423bb07e3401f6f777325dda20c71cf", null ], [ "function", "classmy__namespace_1_1_my_class.html#adbec462259093c0835682fd47b150b21", null ], [ "anotherFunction", "classmy__namespace_1_1_my_class.html#ad1c00d6dbc0d5c7b9baba814959085c8", null ], [ "simpleInlineFunction", "classmy__namespace_1_1_my_class.html#a98f0a83810792f7fae9ae54619888721", null ] ];<file_sep>/docs/api/classxpcc_1_1bmp085data_1_1_data.js var classxpcc_1_1bmp085data_1_1_data = [ [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data.html#a6aa3f5915ad99185968e775242a25542", null ], [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data.html#a00261c9606f8d1008bf7591a93d43394", null ], [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data.html#a89f5ecdb46bdab77e8ccbab6eff93603", null ], [ "getTemperature", "classxpcc_1_1bmp085data_1_1_data.html#a1bf92c3d20a0383594da38d2f154418f", null ], [ "getPressure", "classxpcc_1_1bmp085data_1_1_data.html#a3a46b71cdaac8464725789c9138d74c8", null ], [ "calculateCalibratedTemperature", "classxpcc_1_1bmp085data_1_1_data.html#a911fcc7ad99ccdf045aadf156e1aca12", null ], [ "calculateCalibratedPressure", "classxpcc_1_1bmp085data_1_1_data.html#a034c7a46907ed97028e98c51eaf5148d", null ] ];<file_sep>/docs/api/classxpcc_1_1atomic_1_1_container.js var classxpcc_1_1atomic_1_1_container = [ [ "Container", "classxpcc_1_1atomic_1_1_container.html#aa50d1983723edbf909021209b93587fc", null ], [ "set", "classxpcc_1_1atomic_1_1_container.html#aad42f7d2612b007667e1c50809cec6d8", null ], [ "get", "classxpcc_1_1atomic_1_1_container.html#aec061949215458e0a4c226e58876758e", null ], [ "swap", "classxpcc_1_1atomic_1_1_container.html#ada8298b45d93eaae32d83d0031c27cf5", null ], [ "directAccess", "classxpcc_1_1atomic_1_1_container.html#a883247c4f80ce56afaf7670d859bbd9e", null ] ];<file_sep>/docs/api/structxpcc_1_1lpc_1_1_can_filter_1_1_extended_identifier.js var structxpcc_1_1lpc_1_1_can_filter_1_1_extended_identifier = [ [ "ExtendedIdentifier", "structxpcc_1_1lpc_1_1_can_filter_1_1_extended_identifier.html#ac96b4536a09f605cde49a02f1d181152", null ] ];<file_sep>/docs/api/classxpcc_1_1allocator_1_1_allocator_base.js var classxpcc_1_1allocator_1_1_allocator_base = [ [ "AllocatorBase", "classxpcc_1_1allocator_1_1_allocator_base.html#a20fcb136e216797227d9b32e07cc6c4c", null ] ];<file_sep>/docs/api/structxpcc_1_1_header.js var structxpcc_1_1_header = [ [ "Type", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9", [ [ "REQUEST", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9aad6c35880c58d97c03d60a6ad0f23737", null ], [ "RESPONSE", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9a4fa1a4d2e48aa765093ca6aae57a5150", null ], [ "NEGATIVE_RESPONSE", "structxpcc_1_1_header.html#a9ebd7d255207a95a2baf0e7fe70d6db9a8f4a406e65653144e8c083c45f3c25ec", null ] ] ], [ "Header", "structxpcc_1_1_header.html#ab744f647d54f5900d47fdaceccabdbfd", null ], [ "Header", "structxpcc_1_1_header.html#a60bd6093f70ae67b1128b057a17a2a37", null ], [ "operator==", "structxpcc_1_1_header.html#ae75563fb75eda59cc6c899fb32a5497a", null ], [ "type", "structxpcc_1_1_header.html#a8a2312708d15b7c9953ae54560b809b3", null ], [ "isAcknowledge", "structxpcc_1_1_header.html#aaba58c049c18e2f904184e8391cd9b8c", null ], [ "destination", "structxpcc_1_1_header.html#aeba74cb42e5f1142bb59a170605f08f6", null ], [ "source", "structxpcc_1_1_header.html#a1622cdcf0f8af24a1b1abd2171137971", null ], [ "packetIdentifier", "structxpcc_1_1_header.html#a76addf60d72c9fe67aa5bb263030854b", null ] ];<file_sep>/docs/api/classxpcc_1_1_ray2_d.js var classxpcc_1_1_ray2_d = [ [ "WideType", "classxpcc_1_1_ray2_d.html#ad8068a9069134d6f57973300aec5578d", null ], [ "FloatType", "classxpcc_1_1_ray2_d.html#a0eb9bd5d347e3d56b2b7b7ebef419c20", null ], [ "Ray2D", "classxpcc_1_1_ray2_d.html#a4dd3dfd29a2171bb5785a996ee90d98e", null ], [ "Ray2D", "classxpcc_1_1_ray2_d.html#a834279d7f77e229992066da3319290cc", null ], [ "setStartPoint", "classxpcc_1_1_ray2_d.html#ada625f6d5f9c5bfca8162a3f25fdcdac", null ], [ "getStartPoint", "classxpcc_1_1_ray2_d.html#a17f19d11b35217e1568f02bb7c437417", null ], [ "setDirectionVector", "classxpcc_1_1_ray2_d.html#acd1886964da79c7de8a66ea2c238933a", null ], [ "getDirectionVector", "classxpcc_1_1_ray2_d.html#acfca96ae1168f512ab7d43d1df2a76b8", null ], [ "translate", "classxpcc_1_1_ray2_d.html#aabed34adc72a71c5a110eb553e603a7f", null ], [ "getLength", "classxpcc_1_1_ray2_d.html#ace7b984f6874c83c6b3cb35914d5e2ff", null ], [ "intersects", "classxpcc_1_1_ray2_d.html#a72eb9b45ce506a3b98389b9b5acd9799", null ], [ "ccw", "classxpcc_1_1_ray2_d.html#a9b68a3c338ac08fea270fd2ed8f82461", null ], [ "operator==", "classxpcc_1_1_ray2_d.html#a29e6697fa3f1a4baff11066ec3278090", null ], [ "operator!=", "classxpcc_1_1_ray2_d.html#ab3df27d8e5e24cc335dd22a59f74d783", null ], [ "basePoint", "classxpcc_1_1_ray2_d.html#a64905f188236210366e53841dc579379", null ], [ "direction", "classxpcc_1_1_ray2_d.html#a9727dbd36ff077ed8a5db1a06a13bd71", null ] ];<file_sep>/docs/api/group__atomic.js var group__atomic = [ [ "Container", "classxpcc_1_1atomic_1_1_container.html", [ [ "Container", "classxpcc_1_1atomic_1_1_container.html#aa50d1983723edbf909021209b93587fc", null ], [ "set", "classxpcc_1_1atomic_1_1_container.html#aad42f7d2612b007667e1c50809cec6d8", null ], [ "get", "classxpcc_1_1atomic_1_1_container.html#aec061949215458e0a4c226e58876758e", null ], [ "swap", "classxpcc_1_1atomic_1_1_container.html#ada8298b45d93eaae32d83d0031c27cf5", null ], [ "directAccess", "classxpcc_1_1atomic_1_1_container.html#a883247c4f80ce56afaf7670d859bbd9e", null ] ] ], [ "Flag", "classxpcc_1_1atomic_1_1_flag.html", [ [ "Flag", "classxpcc_1_1atomic_1_1_flag.html#a88cccd24d8fce27c77b53c10227e2dcd", null ], [ "Flag", "classxpcc_1_1atomic_1_1_flag.html#a1954904513dcc19a43ff069b156bccf8", null ], [ "operator=", "classxpcc_1_1atomic_1_1_flag.html#a65e051915968137a4dabb226070f1397", null ], [ "test", "classxpcc_1_1atomic_1_1_flag.html#ac0747105d682d96e0e17a61d92f46a4f", null ], [ "set", "classxpcc_1_1atomic_1_1_flag.html#a97efcd8ae4faf230173324a332e7d376", null ], [ "reset", "classxpcc_1_1atomic_1_1_flag.html#a4f17381d256a3b8a60beae3b360cbf5c", null ], [ "testAndSet", "classxpcc_1_1atomic_1_1_flag.html#a7bd017500f1ad2f9c82c867fca966587", null ] ] ], [ "Lock", "classxpcc_1_1atomic_1_1_lock.html", [ [ "Lock", "classxpcc_1_1atomic_1_1_lock.html#a39e568b208543897f176a52ffcf22307", null ], [ "~Lock", "classxpcc_1_1atomic_1_1_lock.html#a723be159d4912bdd1287e5020966643c", null ] ] ], [ "Unlock", "classxpcc_1_1atomic_1_1_unlock.html", [ [ "Unlock", "classxpcc_1_1atomic_1_1_unlock.html#a8f00e4906c137838243e6bcb37cd88e1", null ], [ "~Unlock", "classxpcc_1_1atomic_1_1_unlock.html#a21351db379a83d2ac5ca17cce8dfecdf", null ] ] ], [ "Queue", "classxpcc_1_1atomic_1_1_queue.html", [ [ "Index", "classxpcc_1_1atomic_1_1_queue.html#a39b184917cdbe5eb5d07a11f7b903668", null ], [ "Size", "classxpcc_1_1atomic_1_1_queue.html#a330cf801491d3a6675041e2987145d53", null ], [ "Queue", "classxpcc_1_1atomic_1_1_queue.html#a9fa2bc4ecf3c021b80e387fc2a9bb6d7", null ], [ "isFull", "classxpcc_1_1atomic_1_1_queue.html#a03e60ddbc6a7120732b113e4be83d338", null ], [ "isNotFull", "classxpcc_1_1atomic_1_1_queue.html#a40f5e3589e1cbe5c67fece75199ee296", null ], [ "isNearlyFull", "classxpcc_1_1atomic_1_1_queue.html#a1386b2287f8e4547e216ee8f86609cdb", null ], [ "isEmpty", "classxpcc_1_1atomic_1_1_queue.html#ae7e8c9f1742c9113e5d53a13eb6340b7", null ], [ "isNearlyEmpty", "classxpcc_1_1atomic_1_1_queue.html#a94e6807aa598bff9cd39f97167bba185", null ], [ "getMaxSize", "classxpcc_1_1atomic_1_1_queue.html#aea55414369c43a4c2c501592c6e9bb9e", null ], [ "get", "classxpcc_1_1atomic_1_1_queue.html#a12f6356350ecf0eac4d43c0b4fb72c0a", null ], [ "push", "classxpcc_1_1atomic_1_1_queue.html#a2e3ae55c3528d48ee8c48b3a971b3ec9", null ], [ "pop", "classxpcc_1_1atomic_1_1_queue.html#ad393604167ad689e417e257794483fb2", null ] ] ], [ "atomic", "namespacexpcc_1_1atomic.html", null ] ];<file_sep>/docs/api/search/groups_7.js var searchData= [ ['io_2dexpander',['IO-Expander',['../group__driver__gpio.html',1,'']]], ['inertial_20measurement',['Inertial measurement',['../group__driver__inertial.html',1,'']]], ['inter_2dintegrated_20circuit_20_28i2c_29',['Inter-Integrated Circuit (I2C)',['../group__i2c.html',1,'']]], ['images',['Images',['../group__image.html',1,'']]], ['interpolation',['Interpolation',['../group__interpolation.html',1,'']]], ['io_2dclasses',['IO-Classes',['../group__io.html',1,'']]], ['i2c',['I2C',['../group__stm32f407vg__i2c.html',1,'']]] ]; <file_sep>/docs/api/classxpcc_1_1_lis3dsh.js var classxpcc_1_1_lis3dsh = [ [ "Lis3dsh", "classxpcc_1_1_lis3dsh.html#a0e4310523b80af3957a29cad815b5462", null ], [ "configureBlocking", "classxpcc_1_1_lis3dsh.html#acf14da02f29c10e3a6a322ad61548d52", null ], [ "configure", "classxpcc_1_1_lis3dsh.html#a69c61cf9fbc7d2bc4fb80c09d1d4a56e", null ], [ "updateSmControl1", "classxpcc_1_1_lis3dsh.html#a8a4d681524c06106b94343e034d2df7d", null ], [ "updateSmControl2", "classxpcc_1_1_lis3dsh.html#a11ca250f954ade5516b6cd9470d6814f", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#a0970e79474eb096538c4fc6c98782dde", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#a7f88dbc4fc23a0247c6cd2c70ccad097", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#a7d36895609a12f6c6e3c61e073fc5271", null ], [ "updateControl", "classxpcc_1_1_lis3dsh.html#aacbfc1073bf7194469a880ce255f28a6", null ], [ "readAcceleration", "classxpcc_1_1_lis3dsh.html#a39faf6caeed7d09f0cf02c8de7f9baa7", null ], [ "getControl1", "classxpcc_1_1_lis3dsh.html#a6a944075f8c7fd7a269495d5b3c9d7fb", null ], [ "getControl2", "classxpcc_1_1_lis3dsh.html#ac94ccf104da788d38797e2a32c291f84", null ], [ "getControl3", "classxpcc_1_1_lis3dsh.html#a0029cc6cebd0905d7b90aecc7a5d47a5", null ], [ "getControl4", "classxpcc_1_1_lis3dsh.html#ad2d4a3f5875f9dd22b5b0f2bd2d94ab9", null ], [ "getControl5", "classxpcc_1_1_lis3dsh.html#a0ebb9ef9845fcc119e225973f949ef2f", null ], [ "getControl6", "classxpcc_1_1_lis3dsh.html#a942dd4bd0e3b063c77542eb7a060ae5e", null ], [ "getFifoControl", "classxpcc_1_1_lis3dsh.html#aea651201839984ceb103f5f3a0561927", null ], [ "getStatus", "classxpcc_1_1_lis3dsh.html#a4d950129bc42227de9bebd8452caced6", null ], [ "getFifoSource", "classxpcc_1_1_lis3dsh.html#aff8686884d88b5ec3cbe39a25d5b79c1", null ], [ "getData", "classxpcc_1_1_lis3dsh.html#a22fbc6efa20aa5a01e2a095f2dda2feb", null ] ];<file_sep>/latex_math.py """ Licensed under Public Domain Mark 1.0. See http://creativecommons.org/publicdomain/mark/1.0/ Author: <NAME> <<EMAIL>> """ """ Python-Markdown LaTeX Extension Adds support for $math mode$ and %text mode%. This plugin supports multiline equations/text. The actual image generation is done via LaTeX/DVI output. It encodes data as base64 so there is no need for images directly. All the work is done in the preprocessor. """ import re import os import string import base64 import tempfile import markdown from subprocess import call, PIPE # Defines our basic inline image IMG_EXPR = "<img class=\"latex-inline math-%s\" alt=\"%s\" id=\"%s\" src=\"data:image/svg+xml,%s\">" # Base CSS template IMG_CSS = "<style scoped>img.latex-inline { vertical-align: middle; }</style>\n" class LaTeXPreprocessor(markdown.preprocessors.Preprocessor): # These are our cached expressions that are stored in latex.cache cached = {} # Basic LaTex Setup as well as our list of expressions to parse tex_preamble = r"""\documentclass[a3paper]{article} \usepackage{amsmath} \usepackage[left=0cm,top=0cm,right=0cm, bottom=0cm]{geometry} \usepackage{amsthm} \usepackage{amssymb} \usepackage{bm} \usepackage{relsize} \usepackage[usenames,dvipsnames]{color} \pagestyle{empty} """ def __init__(self, configs): try: cache_file = open('latex.cache', 'r+') for line in cache_file.readlines(): key, val = line.strip("\n").split("$") self.cached[key] = val except IOError: pass self.config = {} self.config[("general", "preamble")] = "" self.config[("dvipng", "args")] = "-q -T tight -bg Transparent -z 9 -D 106" self.config[("dvisvgm", "args")] = "--bbox=min --exact --mag=0.7" self.config[("delimiters", "text")] = "%" self.config[("delimiters", "math")] = "$" self.config[("delimiters", "preamble")] = "%%" self.config[("delimiters", "equation")] = "$$" try: import ConfigParser cfgfile = ConfigParser.RawConfigParser() cfgfile.read('markdown-latex.cfg') for sec in cfgfile.sections(): for opt in cfgfile.options(sec): self.config[(sec, opt)] = cfgfile.get(sec, opt) except ConfigParser.NoSectionError: pass def build_regexp_single(delim): delim = re.escape(delim) regexp = '(?:[^{1}]){1}([^{1}]*){1}|{1}([^{1}]*){1}(?:[^{1}])|^{}([^{1}]*){1}'.format(delim) return re.compile(regexp, re.MULTILINE | re.DOTALL) def build_regexp_double(delim): delim = re.escape(delim) # (?<!\{)\{\w+\}(?!\}) matches {foo}, but not {{foo}} regexp = r'(?<!\\)' + delim + r'(.+?)(?<!\\)' + delim return re.compile(regexp, re.MULTILINE | re.DOTALL) # %TEXT% mode which is the default LaTeX mode. self.re_textmode = re.compile(r'(?:[^\%])\%([^\%]*)\%|\%([^\%]*)\%(?:[^\%])|^\%([^\%]*)\%', re.MULTILINE | re.DOTALL) # $MATH$ mode which is the typical LaTeX math mode. self.re_mathmode = re.compile(r'(?:[^\$])\$([^\$]*)\$|\$([^\$]*)\$(?:[^\$])|^\$([^\$]*)\$', re.MULTILINE | re.DOTALL) # $$EQUATION$$ mode which is the typical LaTeX equation mode. self.re_equationmode = build_regexp_double(self.config[("delimiters", "equation")]) # %%PREAMBLE%% text that modifys the LaTeX preamble for the document self.re_preamblemode = build_regexp_double(self.config[("delimiters", "preamble")]) """The TeX preprocessor has to run prior to all the actual processing and can not be parsed in block mode very sanely.""" def _latex_to_svg(self, tex, mode): """Generates a SVG representation of TeX string""" # Generate the temporary file tempfile.tempdir = "" tmp_file_fd, path = tempfile.mkstemp() tmp_file = os.fdopen(tmp_file_fd, "w") tmp_file.write(self.tex_preamble) # Figure out the mode that we're in if mode == "math": ftex = "\\relscale{1.1}\n$ %s $" % tex elif mode == "equation": ftex = "\\relscale{1.5}\n\[ %s \]" % tex else: ftex = "%s" % tex tmp_file.write(ftex) tmp_file.write('\n\end{document}') tmp_file.close() # compile LaTeX document. A DVI file is created status = call(('pdflatex -halt-on-error -output-format pdf %s' % path).split(), stdout=PIPE) # clean up if the above failed if status: self._cleanup(path, err=True) raise Exception("Couldn't compile LaTeX document." + "Please read '%s.log' for more detail." % path) # Run dvipng on the generated DVI file. Use tight bounding box. # Magnification is set to 1200 dvi = "%s.dvi" % path pdf = "%s.pdf" % path pdf_crp = "%s-crop.pdf" % path png = "%s.png" % path svg = "%s.svg" % path svgo = "%s-opt.svg" % path cmd = "pdfcrop %s" % (pdf) status = call(cmd.split(), stdout=PIPE) # clean up if we couldn't make the above work if status: self._cleanup(path, err=True) raise Exception("Couldn't crop PDF-LaTeX." + "Please read '%s.log' for more detail." % path) cmd = "pdf2svg %s %s" % (pdf_crp, svg) status = call(cmd.split(), stdout=PIPE) # clean up if we couldn't make the above work if status: self._cleanup(path, err=True) raise Exception("Couldn't convert cropped PDF-LaTeX to SVG." + "Please read '%s.log' for more detail." % path) cmd = "svgo %s %s" % (svg, svgo) status = call(cmd.split(), stdout=PIPE) # clean up if we couldn't make the above work if status: self._cleanup(path, err=True) raise Exception("Couldn't optimize SVG." + "Please read '%s.log' for more detail." % path) # Read the png and encode the data svg = open(svgo, "rb") data = svg.read() \ .replace('\n', '') \ .replace('"', "'") \ .replace('%', '%25') \ .replace('>', '%3E') \ .replace('<', '%3C') \ .replace('#', '%23') svg.close() self._cleanup(path) return data def _cleanup(self, path, err=False): # don't clean up the log if there's an error extensions = ["", ".aux", "-crop.pdf", ".pdf", "-opt.svg", ".svg", ".log"] if err: extensions.pop() # now do the actual cleanup, passing on non-existent files for extension in extensions: try: os.remove("%s%s" % (path, extension)) except (IOError, OSError): pass def run(self, lines): """Parses the actual page""" # Re-creates the entire page so we can parse in a multine env. page = "\n".join(lines) # Adds a preamble mode self.tex_preamble += self.config[("general", "preamble")] preambles = self.re_preamblemode.findall(page) for preamble in preambles: self.tex_preamble += preamble + "\n" page = self.re_preamblemode.sub("", page, 1) self.tex_preamble += "\n\\begin{document}" # Figure out our text strings and math-mode strings tex_expr = [(self.re_textmode, "text", x) for x in self.re_textmode.findall(page)] tex_expr += [(self.re_equationmode, "equation", x) for x in self.re_equationmode.findall(page)] # for x in self.re_mathmode.findall(page): # if x[0] != "": # print "math:", len(x), x[0] # tex_expr.append( (self.re_mathmode, "math", x[0]) ) tex_expr += [(self.re_mathmode, "math", x[0]) for x in self.re_mathmode.findall(page) if x[0] != ''] # No sense in doing the extra work if not len(tex_expr): return page.split("\n") # Parse the expressions new_cache = {} id = 0 for reg, mode, expr in tex_expr: # print reg, mode, expr b64_expr = base64.b64encode(expr) simp_expr = filter(unicode.isalnum, expr) if b64_expr in self.cached: data = self.cached[b64_expr] else: data = self._latex_to_svg(expr, mode) new_cache[b64_expr] = data expr = expr.replace('"', "").replace("'", "") id += 1 img = IMG_EXPR % ( 'true' if mode in ['math', 'equation'] else 'false', simp_expr, simp_expr[:15] + "_" + str(id), data) # print img page = reg.sub(img, page, 1) # Perform the escaping of delimiters and the backslash per se tokens = [] tokens += [self.config[("delimiters", "preamble")]] tokens += [self.config[("delimiters", "text")]] tokens += [self.config[("delimiters", "math")]] tokens += ['\\'] for tok in tokens: page = page.replace('\\' + tok, tok) # Cache our data cache_file = open('latex.cache', 'a') for key, value in new_cache.items(): cache_file.write("%s$%s\n" % (key, value)) cache_file.close() # Make sure to resplit the lines return page.split("\n") class LaTeXPostprocessor(markdown.postprocessors.Postprocessor): """This post processor extension just allows us to further refine, if necessary, the document after it has been parsed.""" def run(self, text): # Inline a style for default behavior text = IMG_CSS + text return text class MarkdownLatex(markdown.Extension): """Wrapper for LaTeXPreprocessor""" def extendMarkdown(self, md, md_globals): # Our base LaTeX extension md.preprocessors.add('latex', LaTeXPreprocessor(self), ">html_block") # Our cleanup postprocessing extension md.postprocessors.add('latex', LaTeXPostprocessor(self), ">amp_substitute") def makeExtension(*args, **kwargs): """Wrapper for a MarkDown extension""" return MarkdownLatex(*args, **kwargs) <file_sep>/docs/api/structxpcc_1_1stm32_1_1_can_filter_1_1_extended_identifier_short.js var structxpcc_1_1stm32_1_1_can_filter_1_1_extended_identifier_short = [ [ "ExtendedIdentifierShort", "structxpcc_1_1stm32_1_1_can_filter_1_1_extended_identifier_short.html#a621b20083b20b2e22021b0fef51ae3fc", null ] ];<file_sep>/docs/api/structxpcc_1_1tmp_1_1_super_subclass_strict.js var structxpcc_1_1tmp_1_1_super_subclass_strict = [ [ "value", "structxpcc_1_1tmp_1_1_super_subclass_strict.html#a3baa7bbd02b65768e84d668cc42419aaa0616865b0a0b875ca7501c13492a4227", null ] ];<file_sep>/docs/api/structxpcc_1_1vl6180_1_1_data.js var structxpcc_1_1vl6180_1_1_data = [ [ "Data", "structxpcc_1_1vl6180_1_1_data.html#aae5a02f11bf4446c964e375d1a9fa55d", null ], [ "getDistance", "structxpcc_1_1vl6180_1_1_data.html#a2f7ea4d41bb82e8f66d3338da50ef26e", null ], [ "getAmbientLight", "structxpcc_1_1vl6180_1_1_data.html#a82774859b9785f441e477a37a6aeee12", null ], [ "Vl6180", "structxpcc_1_1vl6180_1_1_data.html#ad7c34c00e4130b72287930f373d7565f", null ] ];<file_sep>/docs/api/classxpcc_1_1_hd44780_dual.js var classxpcc_1_1_hd44780_dual = [ [ "driver1", "classxpcc_1_1_hd44780_dual.html#aac840222f6f0d70593eeaaa603e7a521", null ], [ "driver2", "classxpcc_1_1_hd44780_dual.html#a43159b3b5c4070ad08056a64891d8941", null ], [ "Hd44780Dual", "classxpcc_1_1_hd44780_dual.html#acf062195cde77addd83e33f2d7dea7a1", null ], [ "initialize", "classxpcc_1_1_hd44780_dual.html#abff66b016601b0747bc190114db1b7fc", null ], [ "writeRaw", "classxpcc_1_1_hd44780_dual.html#a4b28fa9e01a95d99d6fa662e6ab9d886", null ], [ "setCursor", "classxpcc_1_1_hd44780_dual.html#a36435885fe9d0f385547bd5f8f749675", null ], [ "execute", "classxpcc_1_1_hd44780_dual.html#a8cfb88de6b8c8de666db7efe7e50024f", null ], [ "clear", "classxpcc_1_1_hd44780_dual.html#a7dfcd3a49167c3a842fe1fe3374cb7bc", null ] ];<file_sep>/docs/api/classxpcc_1_1_l3gd20.js var classxpcc_1_1_l3gd20 = [ [ "L3gd20", "classxpcc_1_1_l3gd20.html#a998aded6dc3002a6891811379775c8e6", null ], [ "configureBlocking", "classxpcc_1_1_l3gd20.html#aa40e3bc6259bacaa5b781ee84be1f20f", null ], [ "configure", "classxpcc_1_1_l3gd20.html#adcaed2e8c33fed4b3074630f25674c75", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#a39888e7a07614f0a147edd2fce05fad9", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#aa8de55481612cf11bab13559696c395a", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#a85f8aebeaf45f5124307c2544a5ae92d", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#a1878881d399d2c489b3eded66cd61391", null ], [ "updateControl", "classxpcc_1_1_l3gd20.html#ab39a4bb42c22a736fcf4b4dc32956cd2", null ], [ "updateFifoControl", "classxpcc_1_1_l3gd20.html#ad6adef0fdeb121ea80112d957605a37f", null ], [ "updateInterruptConfiguration", "classxpcc_1_1_l3gd20.html#a4d83b2d30dd5de6e19c910dd5b26c44b", null ], [ "readRotation", "classxpcc_1_1_l3gd20.html#a29f8e142bb0cd81ab4f1ce9b68e3eaab", null ], [ "getControl1", "classxpcc_1_1_l3gd20.html#a77a2e255dd74462113adea0f667c27a1", null ], [ "getControl2", "classxpcc_1_1_l3gd20.html#a65abf78e237c84a77c7bd6daf8834a59", null ], [ "getControl3", "classxpcc_1_1_l3gd20.html#abffa8a1850d7826e856a1fe101e435a8", null ], [ "getControl4", "classxpcc_1_1_l3gd20.html#a47232461e4ac8560a0f7563eafb389b6", null ], [ "getControl5", "classxpcc_1_1_l3gd20.html#a0689f6cd2b6f4b68a395ae45785b2995", null ], [ "getReference", "classxpcc_1_1_l3gd20.html#ad7424e9145055a154e01e08e045013f7", null ], [ "getFifoControl", "classxpcc_1_1_l3gd20.html#af6ccd290ee9f6fdb138431cbe8e85b27", null ], [ "getIntConfig", "classxpcc_1_1_l3gd20.html#a09988204be9a868728d2cfb82c882198", null ], [ "getStatus", "classxpcc_1_1_l3gd20.html#a201948a9e3a6bf48f1e4432e7366e441", null ], [ "getFifoSource", "classxpcc_1_1_l3gd20.html#a15183be81bf3649026cbb996aeb8dffa", null ], [ "getIntSource", "classxpcc_1_1_l3gd20.html#ab8eeb19cfde533bd2b7083d89ba9e1b9", null ], [ "getData", "classxpcc_1_1_l3gd20.html#afce0951de8974905892ba668a03a2267", null ] ];<file_sep>/docs/api/structxpcc_1_1can_1_1_message_1_1_flags.js var structxpcc_1_1can_1_1_message_1_1_flags = [ [ "Flags", "structxpcc_1_1can_1_1_message_1_1_flags.html#a7f62aa348ccdb0543503e3bcf86178e8", null ], [ "rtr", "structxpcc_1_1can_1_1_message_1_1_flags.html#a84f80bc204dfb83496c76bf87dc91514", null ], [ "extended", "structxpcc_1_1can_1_1_message_1_1_flags.html#a629a059abe346c185666c930ca70cc25", null ] ];<file_sep>/docs/api/group__io.js var group__io = [ [ "IODevice", "classxpcc_1_1_i_o_device.html", [ [ "IODevice", "classxpcc_1_1_i_o_device.html#a7d8080e515ff312351b3884de5600e03", null ], [ "~IODevice", "classxpcc_1_1_i_o_device.html#aa8db857c3e7116bb983b420483e163c1", null ], [ "write", "classxpcc_1_1_i_o_device.html#a1cf77f9920038b7f68d95d8c7e1d34fb", null ], [ "write", "classxpcc_1_1_i_o_device.html#ada9a1c497ff96f02997f389b365ac3a5", null ], [ "flush", "classxpcc_1_1_i_o_device.html#a970503a5a58d4189c9949f026ce4c892", null ], [ "read", "classxpcc_1_1_i_o_device.html#a43544a0c576c5a8f3825080b3222f551", null ] ] ], [ "IODeviceWrapper", "classxpcc_1_1_i_o_device_wrapper.html", [ [ "IODeviceWrapper", "classxpcc_1_1_i_o_device_wrapper.html#ae20f03b681d72c5f34685ab8010fa8c9", null ], [ "IODeviceWrapper", "classxpcc_1_1_i_o_device_wrapper.html#a9c64cc168507a3e3d9b42919acd349b6", null ], [ "write", "classxpcc_1_1_i_o_device_wrapper.html#a886af16adaf020f96f4a34b49d73301b", null ], [ "write", "classxpcc_1_1_i_o_device_wrapper.html#a9b5953fbd6acaf055b3f8a328eb166f3", null ], [ "flush", "classxpcc_1_1_i_o_device_wrapper.html#a1a37dd42da7cfbaf23c92187d6fe44c1", null ], [ "read", "classxpcc_1_1_i_o_device_wrapper.html#ace02e9f956254a06a0ea81f1e4bdad93", null ] ] ], [ "IOStream", "classxpcc_1_1_i_o_stream.html", [ [ "myfunc", "classxpcc_1_1_i_o_stream.html#ad34293d7297ec15878985a87cdd0a389", null ], [ "IOStream", "classxpcc_1_1_i_o_stream.html#a956dc0ee22d9a1193fe565f1c8746e64", null ], [ "write", "classxpcc_1_1_i_o_stream.html#a401110d9d2f6fe10a38c44ae5a044b16", null ], [ "get", "classxpcc_1_1_i_o_stream.html#a95a5dd04b4de588333fa706669ca6adc", null ], [ "get", "classxpcc_1_1_i_o_stream.html#ac0aa9ef44a0c8a7ab0876284f60ccc0d", null ], [ "get", "classxpcc_1_1_i_o_stream.html#a54af5268392c25e469e6690bc98154ef", null ], [ "flush", "classxpcc_1_1_i_o_stream.html#a391fdcd5984ea8c120afc39898da4c7a", null ], [ "bin", "classxpcc_1_1_i_o_stream.html#a8b542727f06c2ddcf93759c32ad371d8", null ], [ "hex", "classxpcc_1_1_i_o_stream.html#a5fc256c0ac76183a547c40a2cdb0fa93", null ], [ "ascii", "classxpcc_1_1_i_o_stream.html#a609d723cea9b8808037135c6f2decba3", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#ac1c87a1f2f7ccd1dda27443493baa60d", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a46e76b94a870d7ba3fe005b565055353", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#ace81c47f49bb285a81563ff537351bfd", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a8e145e42c4f7334043749dea78b0a9d1", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#af85a4126e332392de42401c5da33fa16", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#acde5e7a78144c250535091be4e36a3cd", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a48b3362b9669140d729fa9c8d53fad4d", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#acb4266be5210753777f4188421a0ad2d", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#ab257e2ab18a68e9257b76fbbdca71863", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a0be669ed5b624ffbaafa90165de9bfcd", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a656ae82397a12e4d29912ec64a1903dd", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a12aba354f627fd234aebc1ecc5f5de3a", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a44a300ee68b29f800021979d8aa0e87e", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#ae45dcaaa44fe34b356c4944136ab4554", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a6cc646ef82ed910cf5c2e7309a600cf6", null ], [ "operator<<", "classxpcc_1_1_i_o_stream.html#a3e2c82bb9089ca89835c67faf24547a6", null ], [ "printf", "classxpcc_1_1_i_o_stream.html#a816bd633537dc65c1aa6935903cdaac9", null ], [ "vprintf", "classxpcc_1_1_i_o_stream.html#a1b12e3088d7cbabac990dd1c17dc73f6", null ], [ "writeInteger", "classxpcc_1_1_i_o_stream.html#a3870bb7ba565d9e824423ce9cd7b2b1b", null ], [ "writeInteger", "classxpcc_1_1_i_o_stream.html#ac730e6d295f96b34ec779f7d213ba013", null ], [ "writeInteger", "classxpcc_1_1_i_o_stream.html#a2a6d2ab80e788337ad42fee11a5edd7f", null ], [ "writeInteger", "classxpcc_1_1_i_o_stream.html#a6227003ecaa2b175ed7371c088d60204", null ], [ "writeInteger", "classxpcc_1_1_i_o_stream.html#a0392f98a51ba691e1118f2b74b32cdf7", null ], [ "writeInteger", "classxpcc_1_1_i_o_stream.html#ae351a10ea4b9f60d3e625cee369e9871", null ], [ "writeHex", "classxpcc_1_1_i_o_stream.html#a3b092be8524931f0639174fdb9bf6bb0", null ], [ "writeBin", "classxpcc_1_1_i_o_stream.html#aa074e511b87eaaf6fe236e33206a4dc9", null ], [ "writeHexNibble", "classxpcc_1_1_i_o_stream.html#a60c90dc83f159864205faf4cea1904f0", null ], [ "writeHex", "classxpcc_1_1_i_o_stream.html#aa8eaa077126dead7e69c899a4d1d9fde", null ], [ "writeBin", "classxpcc_1_1_i_o_stream.html#a441cfd7a46ab2d6eca78fcf5b0261210", null ], [ "writeFloat", "classxpcc_1_1_i_o_stream.html#ae044e969897901aa623b334f1110a3e5", null ], [ "writeDouble", "classxpcc_1_1_i_o_stream.html#a01b2b1b3f7d48ab0f6f85caf17acd45b", null ], [ "writeUnsignedInteger", "classxpcc_1_1_i_o_stream.html#a2cf9cb10c6aa288ac880c2d8d0532387", null ] ] ], [ "IOBuffer", "group__io.html#gabe59c81e450335bdd231a136d4373531", null ], [ "flush", "group__io.html#gad904310cb0e9d63393ab5720d5726f9a", null ], [ "endl", "group__io.html#ga60df96dcfa5efe2fc97c184cba798b94", null ], [ "bin", "group__io.html#gadb616d1b40fdff6cc8db8c5fc5173976", null ], [ "hex", "group__io.html#gaaa5119b077c35c3dad513dd3dab71596", null ], [ "ascii", "group__io.html#ga9527a9e1d877c2106a762ca4998348d6", null ], [ "black", "group__io.html#ga3cbb9ff2ad67a6ef8a2b55fcad5c2e61", null ], [ "red", "group__io.html#gae2647ff2233cafd6de0aa492ba1f101a", null ], [ "green", "group__io.html#gacf3cc25df212f470e790f71d142b32d2", null ], [ "yellow", "group__io.html#gac4a73dbc4b1d6a7609c845636ec62104", null ], [ "blue", "group__io.html#gafbfb7aede6cba5ca13b610c0c01ca4ba", null ], [ "magenta", "group__io.html#gaaf40d87414050177f69d814fe70e825f", null ], [ "cyan", "group__io.html#ga75162c17d31e5bac877d8fc570a0d02d", null ], [ "white", "group__io.html#ga4194e76fc93398275d8842aae22b0e5e", null ] ];<file_sep>/docs/api/classxpcc_1_1_s_curve_controller.js var classxpcc_1_1_s_curve_controller = [ [ "Parameter", "structxpcc_1_1_s_curve_controller_1_1_parameter.html", "structxpcc_1_1_s_curve_controller_1_1_parameter" ], [ "SCurveController", "classxpcc_1_1_s_curve_controller.html#a5e2d87f311fe9a3a731d2e0dfe029e75", null ], [ "setParameter", "classxpcc_1_1_s_curve_controller.html#a5ff8ee52072740dfab23634be3ed698a", null ], [ "setSpeedMaximum", "classxpcc_1_1_s_curve_controller.html#afd568834d54af95ef1dba56e292b03eb", null ], [ "setSpeedMinimim", "classxpcc_1_1_s_curve_controller.html#acfa88f644bf85cd534109eead6136a47", null ], [ "setSpeedTarget", "classxpcc_1_1_s_curve_controller.html#a87997a9489cbf36f12e0fe4c9cafb498", null ], [ "isTargetReached", "classxpcc_1_1_s_curve_controller.html#a2866bb2a8beb933f47b43584eee212d8", null ], [ "update", "classxpcc_1_1_s_curve_controller.html#a7b18e844fb3eacd06a1600e0dc516f52", null ], [ "getValue", "classxpcc_1_1_s_curve_controller.html#aa3180792c1ebaca2d49f34e4a297f40e", null ] ];<file_sep>/docs/api/classxpcc_1_1_choice_menu_entry.js var classxpcc_1_1_choice_menu_entry = [ [ "ChoiceMenuEntry", "classxpcc_1_1_choice_menu_entry.html#a443e8bae4159e9e5edc5b8634fd112e1", null ], [ "text", "classxpcc_1_1_choice_menu_entry.html#a2db8b7272eef42a2255b7ea81f1fcb69", null ], [ "valuePtr", "classxpcc_1_1_choice_menu_entry.html#a1b23217fa1208aa33cd10fac8ca62cb2", null ], [ "defaultValue", "classxpcc_1_1_choice_menu_entry.html#a969054f5c9a7cdbdfe2d1b798ba597c2", null ] ];<file_sep>/docs/api/classxpcc_1_1_tcs3472.js var classxpcc_1_1_tcs3472 = [ [ "Data.__unnamed__", "classxpcc_1_1_tcs3472.html#structxpcc_1_1_tcs3472_1_1_data_8____unnamed____", [ [ "clear", "classxpcc_1_1_tcs3472.html#a01bc6f8efa4202821e95f4fdf6298b30", null ], [ "red", "classxpcc_1_1_tcs3472.html#abda9643ac6601722a28f238714274da4", null ], [ "green", "classxpcc_1_1_tcs3472.html#a9f27410725ab8cc8854a2769c7a516b8", null ], [ "blue", "classxpcc_1_1_tcs3472.html#a48d6215903dff56238e52e8891380c8f", null ] ] ], [ "Tcs3472", "classxpcc_1_1_tcs3472.html#a37e21d9b5224a97a7da1eb0c93ec72ac", null ], [ "initializeBlocking", "classxpcc_1_1_tcs3472.html#aef91f1dd880f40fd265261935f870fe9", null ], [ "setGain", "classxpcc_1_1_tcs3472.html#af1b4f021b9da99d086dd801a528d5e14", null ], [ "refreshAllColors", "classxpcc_1_1_tcs3472.html#a2b7b3aa6664066b3ce6a2646c5868623", null ], [ "initialize", "classxpcc_1_1_tcs3472.html#a09472f58f3c6e9c6e22ac9fcc249cdeb", null ], [ "configure", "classxpcc_1_1_tcs3472.html#ab985686724d5be72ba2abdc10248b2d0", null ] ];<file_sep>/docs/api/classxpcc_1_1_tmp175.js var classxpcc_1_1_tmp175 = [ [ "Tmp175", "classxpcc_1_1_tmp175.html#ad90bd299c2d29d027989c0d6957ee987", null ], [ "update", "classxpcc_1_1_tmp175.html#a34891b8bdf577ac1a2921bab73739a74", null ], [ "setUpdateRate", "classxpcc_1_1_tmp175.html#aaa4f0e6a147e05358e700326b657f971", null ], [ "setResolution", "classxpcc_1_1_tmp175.html#a665aa096afb58ac42c985cee339577e3", null ], [ "setUpperLimit", "classxpcc_1_1_tmp175.html#ad5aa8dfc6e79b588e0811da7aa87a527", null ], [ "setLowerLimit", "classxpcc_1_1_tmp175.html#a42ff0f630237507697a5fe13af283257", null ], [ "startConversion", "classxpcc_1_1_tmp175.html#aa3b9a5cd8102166c4959bc5dd3ce7649", null ], [ "getData", "classxpcc_1_1_tmp175.html#aafc93e08ca36b985e96307ba15a479fb", null ] ];<file_sep>/docs/api/structxpcc_1_1bme280data_1_1_calibration.js var structxpcc_1_1bme280data_1_1_calibration = [ [ "T1", "structxpcc_1_1bme280data_1_1_calibration.html#a65f484e9fd36a4d923f19e33c702c606", null ], [ "T2", "structxpcc_1_1bme280data_1_1_calibration.html#aeff497fe77358a39262ea1cbe076ecd0", null ], [ "T3", "structxpcc_1_1bme280data_1_1_calibration.html#af4e6c8e2caffb88f0895644ed69ddb49", null ], [ "P1", "structxpcc_1_1bme280data_1_1_calibration.html#a0f4fae10c5fc178bf2a0a37d5cd13bc8", null ], [ "P2", "structxpcc_1_1bme280data_1_1_calibration.html#a27703097d616f73ca47092f3a9689bb6", null ], [ "P3", "structxpcc_1_1bme280data_1_1_calibration.html#a6bcd355cefa8a0ad6a8dbc2fe7db5157", null ], [ "P4", "structxpcc_1_1bme280data_1_1_calibration.html#a31aa2695fbc742bb81975881330c0f50", null ], [ "P5", "structxpcc_1_1bme280data_1_1_calibration.html#a7ffab9b5684cb02d5336648deb895882", null ], [ "P6", "structxpcc_1_1bme280data_1_1_calibration.html#a7d2f34a811806962d3a181719c3ab8d6", null ], [ "P7", "structxpcc_1_1bme280data_1_1_calibration.html#a1598dfaf9339860f3bd5f7f37554fcbf", null ], [ "P8", "structxpcc_1_1bme280data_1_1_calibration.html#a7aeb940ab1583dcb532f29e14c11fc11", null ], [ "P9", "structxpcc_1_1bme280data_1_1_calibration.html#ac4176d734d231cfd1bc562d8e40bd7d0", null ], [ "unused", "structxpcc_1_1bme280data_1_1_calibration.html#a9b7922c9bbb51716ae2c864792ddd7f7", null ], [ "H1", "structxpcc_1_1bme280data_1_1_calibration.html#a86b7da3614e411c1b266890570ac6b7c", null ], [ "H2", "structxpcc_1_1bme280data_1_1_calibration.html#a95dcc330ec71fa966a4e9bffe088b7aa", null ], [ "H3", "structxpcc_1_1bme280data_1_1_calibration.html#a775892c76d279af3907656fd1eab84d1", null ], [ "H4", "structxpcc_1_1bme280data_1_1_calibration.html#a847832c0701e4b091cc5e11eb95497e7", null ], [ "H5", "structxpcc_1_1bme280data_1_1_calibration.html#a9c132ace9dbdc88d6d7f831dd1bf5a83", null ], [ "H6", "structxpcc_1_1bme280data_1_1_calibration.html#aa716b0c4849a3344255f16fee192db81", null ] ];<file_sep>/docs/api/structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01_u_01_4.js var structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01_u_01_4 = [ [ "value", "structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01_u_01_4.html#a8364f2a904da9c04706abbdad62f5693afdf46860bbf06470fcaf19c36c19c0dd", null ], [ "dontUseWithIncompleteTypes", "structxpcc_1_1tmp_1_1_super_subclass_3_01void_00_01_u_01_4.html#a6d8e02f35f45e29d66f66bf9c4cb2ab3a6e57b9af15d2028cd60bcf025824d6eb", null ] ];<file_sep>/docs/api/group__stm32f407vg__uart.js var group__stm32f407vg__uart = [ [ "Usart1", "classxpcc_1_1stm32_1_1_usart1.html", null ], [ "Usart2", "classxpcc_1_1stm32_1_1_usart2.html", null ], [ "Usart3", "classxpcc_1_1stm32_1_1_usart3.html", null ], [ "Uart4", "classxpcc_1_1stm32_1_1_uart4.html", null ], [ "Uart5", "classxpcc_1_1stm32_1_1_uart5.html", null ], [ "Usart6", "classxpcc_1_1stm32_1_1_usart6.html", null ], [ "UartBaudrate", "classxpcc_1_1stm32_1_1_uart_baudrate.html", null ], [ "UsartHal1", "classxpcc_1_1stm32_1_1_usart_hal1.html", null ], [ "UsartHal2", "classxpcc_1_1stm32_1_1_usart_hal2.html", null ], [ "UsartHal3", "classxpcc_1_1stm32_1_1_usart_hal3.html", null ], [ "UartHal4", "classxpcc_1_1stm32_1_1_uart_hal4.html", null ], [ "UartHal5", "classxpcc_1_1stm32_1_1_uart_hal5.html", null ], [ "UsartHal6", "classxpcc_1_1stm32_1_1_usart_hal6.html", null ] ];<file_sep>/docs/api/structxpcc_1_1pca9535.js var structxpcc_1_1pca9535 = [ [ "Pins", "structxpcc_1_1pca9535.html#a36cb46b19d0d4891357c19064c495240", null ], [ "Pin", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007ba", [ [ "P0_0", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa9e6e2149f6544d593988e77250ad6321", null ], [ "P0_1", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa44a2ade6266b855801b1c9bd0ef524bb", null ], [ "P0_2", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa807a081810aa990ad52f2dc5491eca77", null ], [ "P0_3", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa11f644cfc9ee1bbbb4c0610e1e904c2e", null ], [ "P0_4", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa6f0eb17a00cb6a2c33bebf5303d6623c", null ], [ "P0_5", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa489df6d05041dca05b20b73e71d6060a", null ], [ "P0_6", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa7a295dadf8e07e7fd5b7340c5212b883", null ], [ "P0_7", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa22d507b15861c0891b311c055470bd09", null ], [ "P1_0", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa3c9b1afdb04a37fd3ed3e93987d81dfb", null ], [ "P1_1", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa7bbdfc3579f7e7d9aaa7db713e4e9e51", null ], [ "P1_2", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baaf36967eb31a1dcbf5f5affa35f611e0c", null ], [ "P1_3", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baaf6aa3dfcbebef6be910066a4be0ebeb4", null ], [ "P1_4", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa605a91b834b7b2bf1749edcefe3482ee", null ], [ "P1_5", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa2581da34ad51ffac48766fda9667cefa", null ], [ "P1_6", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa894589080f6c620fab80958947e7e723", null ], [ "P1_7", "structxpcc_1_1pca9535.html#a6eafdfff962a92f22077ff1f5ae007baa350db1ff29cf4cf0dd983838c44cb947", null ] ] ] ];
5fb59d3616d6333c15568dba13d0617df71f9a2e
[ "HTML", "JavaScript", "Markdown", "Python", "Shell" ]
422
JavaScript
roboterclubaachen/xpcc.io
d5ed39bd33209555122e89cced333b06bec73cc2
2949d2e3522321bbf4c341f9007d1d1c79514d49
refs/heads/master
<file_sep>package server; import java.net.*; import java.io.*; import mjson.Json; import data.*; import exception.ExceptionHandler; public class ConnectionRunnable implements Runnable { Socket conn; Dictionary dict; public ConnectionRunnable(Socket conn, Dictionary dict) { this.conn = conn; this.dict = dict; } public void run() { //TODO: timeout after disconnect DataInputStream din = null; DataOutputStream dout = null; try { din = new DataInputStream(conn.getInputStream()); dout = new DataOutputStream(conn.getOutputStream()); } catch (IOException e) { ExceptionHandler.printMessage("Could not initialise input and output streams", e); return; } String in; while(true) { try { in = din.readUTF(); } catch (IOException e) { System.out.println("Client has disconnected"); try { din.close(); //attempt to gracefully disconnect. dout.close(); conn.close(); } catch(IOException e1) { return; //kill the thread } return; } Request req = new Request(Json.read(in)); String requestType = req.getRequestType(); String word = req.getWord(); String definition = req.getDefinition(); String response = ""; //System.out.println("requestType:" + requestType); //System.out.println(Json.read(in)); //System.out.println(req); switch (requestType) { case "add": System.out.println("Adding"); response = dict.add(word, definition); break; case "remove": System.out.println("Removing"); response = dict.remove(word); break; case "query": System.out.println("Querying"); response = dict.query(word); break; } //write the requestType, word, definition (if any) / body to the client String msg = new Response(requestType, word, response).getJsonString(); try { dout.writeUTF(msg); } catch (IOException e){ ExceptionHandler.printMessage("Error: Could not write to the client", e); return; } } } } <file_sep>package client; import java.net.*; import java.util.Arrays; import java.util.Scanner; import data.*; import exception.ExceptionHandler; import java.io.*; import mjson.Json; public class Client { public static void main(String[] args) throws IOException { String host = args[0]; int port = Integer.parseInt(args[1]); Scanner s = new Scanner(System.in); Socket conn = null; try { conn = new Socket(host, port); } catch (UnknownHostException e) { ExceptionHandler.printMessageAndExit("Error: We could not find the host", e); } catch (IOException e) { ExceptionHandler.printMessageAndExit("Error: An IO Error occured when initialising " + "socket", e); } DataInputStream din = new DataInputStream(conn.getInputStream()); DataOutputStream dout = new DataOutputStream(conn.getOutputStream()); while(true) { String input = s.nextLine(); String[] cmd = input.split(" "); if (cmd[0].equals("exit")) { System.out.println("Exiting"); din.close(); dout.close(); conn.close(); s.close(); System.exit(0); } String requestType = cmd[0]; String word = cmd[1]; //Get rid of this for GUI if(Request.isValidRequestType(requestType) == false) { System.out.println("Invalid request type"); continue; } //write the request to JSON and send String out; if (requestType.equals("add")) { if (cmd.length < 3) { System.out.println("Invalid request type: no definition"); continue; } //get the definition as a string String[] arrayDefinition = Arrays.copyOfRange(cmd, 2, cmd.length); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arrayDefinition.length; i++) { if (i < arrayDefinition.length - 1) { sb.append(arrayDefinition[i]); sb.append(" "); } else { sb.append(arrayDefinition[i]); } } String definition = sb.toString(); out = new Request(requestType, word, definition).getJsonString(); System.out.println(definition); System.out.println(out); } else { out = new Request(requestType, word).getJsonString(); } dout.writeUTF(out); //get response and display String in = din.readUTF(); Response res = new Response(Json.read(in)); // need error handling (illegal argument/server dies)?? /*System.out.println("\n"); System.out.println(res.getRequestType()); System.out.println(res.getWord()); System.out.println(res.getBody());*/ } } } <file_sep># MultiThreadedServer A project in which I implement a multithreaded server in Java for a dictionary based application.
4c89d22c13316a8f7618dbd84fa5e3c66e688e80
[ "Markdown", "Java" ]
3
Java
s-karki/MultiThreadedServer
1b2002d9c40eebb35b32243b53c681936cd95d17
59f368b4f74145c9065feabc0021748139f1e44d
refs/heads/master
<file_sep>version: "3" services: webdictionary: image: opetstudio/erevna-dictionary-php:201710 ports: - "4002:80" volumes: - ./log:/var/log/apache2 environment: - PHP_ENV=production # - ./src:/var/www/src # web: # build: . # ports: # - "8086:80" # links: # - app # app: # build: . # # ports: # # - ":9000" # # # seems like fpm receives the full path from nginx # # and tries to find the files in this dock, so it must # # be the same as nginx.root # volumes: # - ./:/usr/src/app # web: # image: nginx:latest # ports: # - "8086:80" # volumes: # - ./src:/src # - ./site.conf:/etc/nginx/conf.d/default.conf # networks: # - code-network # php: # image: php:fpm # volumes: # - ./src:/src # networks: # - code-network # # networks: # code-network: # driver: bridge <file_sep>#FROM php:7-fpm #FROM nginx FROM nimmis/apache-php5 MAINTAINER Opetstudio <<EMAIL>> #sudo apt-get install -y nginx #sudo apt-get install -y php7.0 php7.0-fpm php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip #RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql #ADD ./site.conf /etc/nginx/conf.d/default.conf # Install app dependencies COPY 000-default.conf /etc/apache2/sites-available/000-default.conf # Change Nginx config here... #RUN rm /etc/nginx/conf.d/default.conf #ADD ./site.conf /etc/nginx/conf.d/default.conf # Create app directory #WORKDIR /var/www # Create app directory WORKDIR /var/www/src # Bundle app source # RUN rm -rf * COPY ./src . ADD src /var/www/src ADD vendor /var/www/vendor #COPY vendor /var/www/ COPY composer.json /var/www/ #RUN cd .. && curl -sS https://getcomposer.org/installer | php && php composer.phar install #RUN php composer.phar install EXPOSE 80 EXPOSE 443 CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] #CMD ["ps", "-ef", "|grep" -i nginx] <file_sep><?php namespace ErevnaDictionaryPhp\Main; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Psr7; class Main{ protected $config; public function __construct ($conf) { $this->config = $conf; // echo "construct invoked"; } public static function main($config){ $self = new Main($config); // get the HTTP method, path and body of the request // $method = $_SERVER['REQUEST_METHOD']; // $request = explode('/', trim($_SERVER['PATH_INFO'],'/')); // $input = json_decode(file_get_contents('php://input'),true); // // // retrieve the table and key from the path // $table = preg_replace('/[^a-z0-9_]+/i','',array_shift($request)); // $key = array_shift($request)+0; // // // escape the columns and values from the input object // $columns = preg_replace('/[^a-z0-9_]+/i','',array_keys($input)); // $values = array_map(function ($value) use ($link) { // if ($value===null) return null; // return mysqli_real_escape_string($link,(string)$value); // },array_values($input)); // // die if SQL statement failed // if (!$result) { // http_response_code(404); // die(mysqli_error()); // } //input $text = $_GET["text"]; $keyfrom = $_GET["keyfrom"]; $trxunixtime = $_GET["trxunixtime"]; $country = $_GET["country"]; // try { // // $client = new Client([ // // Base URI is used with relative requests // 'base_uri' => 'http://google.com', // // You can set any number of default request options. // 'timeout' => 2.0, // ]); // // // Send a request to https://foo.com/api/test // $response = $client->request('GET', 'test'); // // // Send a request to https://foo.com/root // // // $response = $client->request('GET', '/root'); // } // catch(GuzzleHttp\Exception\ClientExceptio $e) { // //echo 'Message: ' .$e->getMessage(); // } //process $status = true; $opt = new \stdClass(); $opt->country = $country; $opt->keyfrom = $keyfrom; $opt->text = $text; $source = $self->getMeaningOfText($opt); if($source != null) { $meaning = $source->meaning; $foreignkey = $source->foreignkey; //foreignkey } else { $meaning = ""; $foreignkey = ""; } //output $myObj = new \stdClass(); $myObj->status = $status; $myObj->text = $text; $myObj->meaning = $meaning; $myObj->foreignkey = $foreignkey; $myObj->trxunixtime = $trxunixtime; $myObj->country = $country; $myJSON = json_encode($myObj); echo $myJSON; // echo $self->createUniqCode(); } public function getMeaningOfText($opt){ $country = $opt->country; $text = $opt->text; $keyfrom = $opt->keyfrom; //git list data dictionary dari elasticsearch //hit api erevna-es-interface-js $client = new Client(); $host = $this->config->es_interface_host; // echo $host; try { $endpoin = 'http://'.$host.'/'.$keyfrom.'/fetchOneById/'.$country.'/'.$text; // echo $endpoin; $response = $client->request('GET', $endpoin); $code = $response->getStatusCode(); // 200 $reason = $response->getReasonPhrase(); // OK $body = $response->getBody(); // Implicitly cast the body to a string and echo it $json = json_decode($body); // echo $body; if($json->status==1){ return $json->resultSearch->_source; // return $json->resultSearch->_source->meaning; // echo "status success"; } else { // echo "status gagal"; return null; } // echo $json->resultSearch->_index; // Explicitly cast the body to a string // $stringBody = (string) $body; // Read 10 bytes from the body // $tenBytes = $body->read(10); // Read the remaining contents of the body as a string // $remainingBytes = $body->getContents(); } catch (RequestException $e) { // echo $e->getRequest() // echo Psr7\str($e->getRequest()); if ($e->hasResponse()) { // echo Psr7\str($e->getResponse()); } } return null; } } ?> <file_sep>API dictionary ###development 1. git clone https://<username>@bitbucket.org/deX_team/erevna-dictionary-php.git 2. install composer https://getcomposer.org/doc/00-intro.md 3. git clone https://<username>@bitbucket.org/deX_team/erevna-dictionary-php.git 4. cd erevna-dictionary-php 5. composer install ###deploy deploy di mesin elasticsearch ###Endpoint - /index.php?text=apt&trxunixtime=423232&country=id&keyfrom=dictionaryPropertycategory response: {"status":true,"text":"apt","meaning":"apartment","trxunixtime":"423232","country":"id"} e.g: http://xxxx153:4002/index.php?text=rmassss&trxunixtime=423232&country=id&keyfrom=dictionaryPropertycategory <file_sep><?php namespace ErevnaDictionaryPhp\Index; require __DIR__ . './../vendor/autoload.php'; require_once("Main.php"); use ErevnaDictionaryPhp\Main\Main; // use ErevnaDictionaryPhp\Main\Main as Another; // include("Main.php"); // echo "tes"; // $_ENV["env"]="production"; $env = getenv("PHP_ENV"); // $environment = json_decode(file_get_contents("env.json"), true); // echo "env==>>".$env; // echo $environment->app; // print_r($environment); $config = new \stdClass(); if($env=="production"){ // echo "production"; $config = json_decode(file_get_contents("env.json")); } else { // echo "development"; $config = json_decode(file_get_contents("env.development.json")); } // echo $string->env; // print_r($string->app); Main::main($config); // Another::main(); // $Main = new Another(); // echo $Main->createUniqCode(); // Main::main(); // echo "tesssss"; // error_log("Oracle database not available!0", 0); // error_log("Oracle database not available!1", 1); // error_log("Oracle database not available!2", 2); // error_log("Oracle database not available!3", 3); // error_log("Oracle database not available!4", 4); // debug_print_backtrace(); ?>
cd8e977dd5df49da1445112ffa7c8c79748277bb
[ "Markdown", "PHP", "YAML", "Dockerfile" ]
5
YAML
opetstudio/erevna-dictionary-php
9f838c90ad44c629ba496f38323315075a388e8b
5231ec9894ee1c54f0209d684ce0efae492a706a
refs/heads/master
<file_sep><?php namespace App; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Zend\Diactoros\Response; use Zend\Diactoros\Server; use Zend\Diactoros\ServerRequestFactory; require_once __DIR__ . '/vendor/autoload.php'; echo '<p>Some text.</p>'; $handler = function(ServerRequestInterface $request, ResponseInterface $response){ $query = $request->getQueryParams(); $file = array_key_exists('file', $query) ? $query['file'] : null; $id = array_key_exists('id', $query) ? $query['id'] : null; if (!$file || !file_exists(__DIR__ . '/' . $file)) { throw new \RuntimeException(sprintf('File %s not exists', $file)); } $file = __DIR__ . '/' . $file; switch (strtoupper($request->getMethod())) { case 'DELETE': $data = json_decode(file_get_contents($file)); $i = null; foreach ($data as $key => $row) { if ($row['id'] == $id) { $i = $key; } } if ($i !== null) { unset($data[$i]); } file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT)); return $response->withStatus(200); case 'POST': $data = json_decode(file_get_contents($file)); $i = 0; foreach ($data as $key => $row) { if ($row['id'] > $i) { $i = $row['id']; } } $i++; $row = (array) $request->getParsedBody(); $row['id'] = $i; $data[] = $row; file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT)); $response = $response->getBody()->write(json_encode($row)); break; case 'PUT': if (!$id) { throw new \InvalidArgumentException('Id query parameter is required'); } $data = json_decode(file_get_contents($file)); foreach ($data as $key => $row) { if ($row['id'] == $id) { $data[$key] = (array) $request->getParsedBody(); } } file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT)); return $response->withStatus(200); break; default: if ($id) { $data = json_decode(file_get_contents($file)); $item = null; foreach ($data as $key => $row) { if ($row['id'] == $id) { $item = $row; } } if (!$item) { throw new \RuntimeException(sprintf('Record with id == %s not found', $id)); } $response->getBody()->write(json_encode($item)); } else { $response->getBody()->write(file_get_contents($file)); } } return $response->withHeader('Content-Type', 'application/json'); }; $server = Server::createServerFromRequest($handler, ServerRequestFactory::fromGlobals(), new Response()); $server->listen(); <file_sep>App.Views.AutoView = Backbone.View.extend({ tagName: 'tr', initialize: function () { console.log(this.model.toJSON()); this.render(); }, template: _.template('<td name="number"><%= number %></td><td name="name"><%= name %></td>'), render: function () { this.delegateEvents(); return this.$el.html(this.template(this.model.toJSON())); } }); // var autoView = new App.Views.AutoView({model: autoModel}); App.Global.set("autoView", new App.Views.AutoView({ model: App.Global.get("autoModel") })); <file_sep>App.Collections.Autos = Backbone.Collection.extend({ model: App.Models.AutoModel }); // var autosCollection = new App.Collections.Autos([autoModel, autoModel2]); App.Global.set("autosCollection", new App.Collections.Autos([App.Global.get("autoModel")])); <file_sep>App.Models.SmartphoneModel = Backbone.Model.extend({ defaults: { number: '1', name: 'iPhone' } }); // var smartphoneModel = new App.Models.SmarphoneModel(); App.Global.set("smartphoneModel", new App.Models.SmartphoneModel()); $.ajax({ type: "GET", url: "smartphones.json", error: function () { alert('smth went wrong'); }, success: function (data) { var parsedData = JSON.parse(data); var length = 0; for (var k in parsedData.data) { if (parsedData.data.hasOwnProperty(k)) length++; }; for (i = 0; i < length; i++) { App.Global.set("'" + parsedData.data[i].number + parsedData.data[i].name + "'", new App.Models.AutoModel({ number: parsedData.data[i].number, name: parsedData.data[i].name })); console.log(App.Global.get("'" + parsedData.data[i].number + parsedData.data[i].name + "'").toJSON()); let collection = App.Global.get('smartphonesCollection'); collection.add(App.Global.get("'" + parsedData.data[i].number + parsedData.data[i].name + "'")); console.log(App.Global.get('smartphonesCollection').toJSON()); // console.log('key is ' + parsedData.data[i].number); // console.log("value is " + parsedData.data[i].name); } } }); <file_sep>App.Views.CitiesView = Backbone.View.extend({ tagName: 'tbody', initialize: function () { //this.render(); }, render: function () { this.collection.each(function (cityModel) { var cityView = new App.Views.AutoView({ model: cityModel }); $('.object-holder').append(cityView.el); }, this); return this; } }); // var citiesCollectionView = new App.Views.CitiesView({collection: citiesCollection}); App.Global.set("citiesCollectionView", new App.Views.CitiesView({ collection: App.Global.get("citiesCollection") })); <file_sep>App.Views.AutosView = Backbone.View.extend({ tagName: 'tbody', initialize: function () { //this.render(); }, render: function () { this.collection.each(function (autoModel) { var autoView = new App.Views.AutoView({ model: autoModel }); $('.object-holder').append(autoView.el); }, this); return this; } }); // var autosCollectionView = new App.Views.AutosView({collection: autosCollection}); App.Global.set("autosCollectionView", new App.Views.AutosView({ collection: App.Global.get("autosCollection") })); <file_sep>App.Collections.Cities = Backbone.Collection.extend({ model: App.Models.CityModel }); // var citiesCollection = new App.Collections.Cities([cityModel]); App.Global.set("citiesCollection", new App.Collections.Cities([App.Global.get("cityModel")])); <file_sep>class localStorageWrap { constructor() { } getItem(key, type) { try { if (arguments[0] === '') { return 'Неправильный ввод'; } else { var retrievedObject = localStorage.getItem(key); switch (type) { case 'string': return retrievedObject; case 'array': return JSON.parse(retrievedObject); case 'JSON': return JSON.parse(retrievedObject); default: return 'Такого варианта нет'; } } } catch (err) { console.log('Ошибка ' + e.name + ":" + e.message + "\n" + e.stack); } } setItem(key, value) { if (arguments[0] === '' || arguments[1] === '') { return 'Неправильный ввод'; } else { localStorage.setItem(key, JSON.stringify(value)); } } removeItem(key) { if (arguments[0] === '') { return 'Неправильный ввод'; } else { return localStorage.removeItem(key); } } } var loc = new localStorageWrap(); <file_sep>App.Collections.Smartphones = Backbone.Collection.extend({ model: App.Models.SmartphoneModel }); // var smartphoneCollection = new App.Collections.Smarphones([smartphoneModel]); App.Global.set("smartphonesCollection", new App.Collections.Smartphones([App.Global.get("smartphoneModel")])); <file_sep>App.Router = Backbone.Router.extend({ routes: { '': 'index', 'authorize': 'authorize', 'autos': 'showAutos', 'cities': 'showCities', 'smartphones': 'showSmarphones', 'add_edit': 'addOrEdit' // 'settings': 'settings', // 'record/:id': 'showRecord' }, index: function () { console.log('index'); }, authorize: function () { //vent.trigger('Authorize:show'); $('.container').html(App.Global.get('authView').render().$el); }, showAutos: function () { console.log('autos'); $('.object-holder').html(''); //$('.add_edit_container').html(''); $('.object-holder').append(App.Global.get('autosCollectionView').render()); }, showCities: function () { console.log('cities'); $('.object-holder').html(''); //$('.add_edit_container').html(''); $('.object-holder').append(App.Global.get('citiesCollectionView').render()); }, showSmarphones: function () { console.log('smartphones'); $('.object-holder').html(''); //$('.add_edit_container').html(''); $('.object-holder').append(App.Global.get('smartphoneCollectionView').render()); }, addOrEdit: function () { console.log('add_edit'); // $('.add_edit_container').html(''); $('.add_edit_container').append(App.Global.get('add_editView').el); $('.add_edit').show(); } }); new App.Router(); Backbone.history.start(); <file_sep>App.Global = new Backbone.Model(); <file_sep>App.Views.Record = Backbone.View.extend({ initialize: function () { vent.on('Records:show', this.showRecord, this); }, showRecord: function (id) { console.log("Record's id is " + id); } });
136bd68e4cab80d454308175472c4c55197ae53b
[ "JavaScript", "PHP" ]
12
PHP
vladsaz/Backbone-Dashboard
fbef7cd408974bd1bd30ef287602530e09e733a2
5b1fa90361e8c8b48c55ca4cdb5a379674852988
refs/heads/main
<file_sep>const withPWA = require("next-pwa"); const Dotenv = require("dotenv-webpack"); const runtimeCaching = require("next-pwa/cache"); const util = require("util"); const cacheTime = 365 * 24 * 60 * 60; // 365 days runtimeCaching.map((item) => { item.options.expiration.maxAgeSeconds = cacheTime; if (item.options.cacheName === "others") { item.options.expiration.maxEntries = 200; } if (item.options.cacheName === "static-image-assets") { item.options.expiration.maxEntries = 100; } }); module.exports = withPWA({ pwa: { dest: "public", importScripts: ["/worker.js"], runtimeCaching, }, webpack: (config) => { // Add the new plugin to the existing webpack plugins config.plugins.push(new Dotenv({ silent: true })); return config; }, env: { API_URL: process.env.API_URL, }, // images: { // deviceSizes: [320, 640, 768, 1024, 1600], // domains: ["apod.nasa.gov"], // }, typescript: { ignoreBuildErrors: true, }, eslint: { ignoreDuringBuilds: true, }, }); <file_sep>import { v4 as uuid } from "uuid"; import { api } from "./../services/api"; import { parseCookies } from "nookies"; type SignInRequestData = { email: string; password: string; }; const delay = (amount = 750) => new Promise((resolve) => setTimeout(resolve, amount)); export async function signInRequest(data: SignInRequestData) { // await delay() const res = await api.post("/local/login", data); if (res.data.token) { return { token: res.data.token, user: res.data.payload, }; } return false; } export async function recoverUserInformation() { // await delay(); const { "nextauth.user": user } = parseCookies(); console.log("RECOVERY => user", JSON.parse(user)); return JSON.parse(user); }
e242315706ef77a8d7fddb1c9f5955af6f445ac2
[ "JavaScript", "TypeScript" ]
2
JavaScript
maccali/Fit.PWA
408c4a724ff64132d4397f3ee714237c2b85e8e4
adf5d8e4e1872ccdfacda1ac2c30074f5f1f8a64
refs/heads/master
<file_sep>package repositories import "FootballTeamsPower/models" func CreatePlayer(player models.Player) (models.Player, error) { err := db.QueryRow(`INSERT INTO players(name, team_id, link) VALUES ($1, $2, $3) RETURNING id`, player.Name, player.TeamId, player.Link).Scan(&player.Id) return player, err } func GetCountPlayers() (int, error) { rows, err := db.Query(`SELECT COUNT(*) FROM players`) var count int if err != nil { return count, err } for rows.Next() { rows.Scan(&count) } return count, err } func FindPlayersByTeamId(teamId int) ([]models.Player, error) { var players []models.Player rows, err := db.Query(`SELECT id, name, link FROM players WHERE team_id = $1`, teamId) defer rows.Close() if err != nil { return players, err } for rows.Next() { var player models.Player err := rows.Scan(&player.Id, &player.Name, &player.Link) if err != nil { return players, err } player.TeamId = teamId players = append(players, player) } return players, nil } func FindAllPlayers() ([]models.Player, error) { var players []models.Player rows, err := db.Query(`SELECT id, name, team_id, link FROM players`) defer rows.Close() if err != nil { return players, err } for rows.Next() { var player models.Player err := rows.Scan(&player.Id, &player.Name, &player.TeamId, &player.Link) if err != nil { return players, err } players = append(players, player) } return players, nil } <file_sep>package repositories import "FootballTeamsPower/models" func CreateMatch(match models.Match) (models.Match, error) { err := db.QueryRow(`INSERT INTO matches(diff_score, opponent, player_id) VALUES ($1, $2, $3) RETURNING id`, match.DifferenceOfScore, match.Opponent, match.PlayerId).Scan(&match.Id) return match, err } func GetCountMatches() (int, error) { rows, err := db.Query(`SELECT COUNT(*) FROM matches`) var count int if err != nil { return count, err } for rows.Next() { rows.Scan(&count) } return count, err } func FindMatchesByPlayerId(playerId int) ([]models.Match, error) { var matches []models.Match rows, err := db.Query(`SELECT id, diff_score, opponent FROM matches WHERE player_id = $1`, playerId) defer rows.Close() if err != nil { return matches, err } for rows.Next() { var match models.Match err := rows.Scan(&match.Id, &match.DifferenceOfScore, &match.Opponent) if err != nil { return matches, err } match.PlayerId = playerId matches = append(matches, match) } return matches, nil } func GetCountMatchesByPlayerId(playerId int) (int, error) { rows, err := db.Query(`SELECT COUNT(*) FROM matches WHERE player_id = $1`, playerId) var count int if err != nil { return count, err } for rows.Next() { rows.Scan(&count) } return count, err }<file_sep>package repositories import ( "FootballTeamsPower/models" ) func CreateTeam(team models.Team) (models.Team, error) { err := db.QueryRow(`INSERT INTO teams(name, link) VALUES ($1, $2) RETURNING id`, team.Name, team.Link).Scan(&team.Id) return team, err } func GetCountTeams() (int, error){ rows, err := db.Query(`SELECT COUNT(*) FROM teams`) var count int if err != nil { return count, err } for rows.Next() { rows.Scan(&count) } return count, err } func FindTeamByName(name string) (models.Team, error) { var dbTeam models.Team err := db.QueryRow(`SELECT id, name FROM teams WHERE name = $1`, name).Scan(&dbTeam.Id, &dbTeam.Name) return dbTeam, err } <file_sep>package models type Player struct { Id int Name string Link string TeamId int } <file_sep>package models type Match struct { Id int DifferenceOfScore int Opponent string PlayerId int } <file_sep>package main import ( "log" "github.com/gorilla/mux" "FootballTeamsPower/controllers" "net/http" "FootballTeamsPower/repositories" "FootballTeamsPower/services" "github.com/robfig/cron" ) func init() { log.Println("Check data in DB") countOfTeams, err := repositories.GetCountTeams() if err != nil { log.Println(err) return } if countOfTeams == 0 { log.Println("db is empty") services.ParsingData() } cron.New().AddFunc("@midnight", services.CheckNewMatches) } func main() { router := mux.NewRouter().StrictSlash(true) router.Headers("Content-Type", "application/json") router.HandleFunc("/power", controllers.GetPowers).Methods(http.MethodPost) log.Fatal(http.ListenAndServe(":8080", router)) } <file_sep>package services import ( "FootballTeamsPower/parsers" "FootballTeamsPower/repositories" "FootballTeamsPower/models" "log" ) func ParsingData() { log.Println("Run parsing data") teams := parsers.GetAllTeams() for _, parsedTeam := range teams { var team models.Team team.Name = parsedTeam.Name team.Link = parsedTeam.TeamLink dbTeam, err := repositories.CreateTeam(team) if err != nil { log.Fatal(err) continue } go parsePlayersByTeam(parsedTeam, dbTeam.Id) } } func parsePlayersByTeam(team parsers.Team, teamId int) { players := parsers.GetPlayersByTeam(team) for _, parsedPlayer := range players { var player models.Player player.Name = parsedPlayer.Name player.Link = parsedPlayer.PlayerLink player.TeamId = teamId dbPlayer, err := repositories.CreatePlayer(player) if err != nil { log.Println(err) continue } //TODO Так парсинг намного быстрее, но в таком случаи transfermarkt банит //go parseMatchesByPlayer(parsedPlayer, dbPlayer.Id) parseMatchesByPlayer(parsedPlayer, dbPlayer.Id) } } func parseMatchesByPlayer(player parsers.Player, playerId int) { matches := parsers.GetAllWinningAndInSquadMatchesByPlayer(player) for _, parsedMatch := range matches { var match models.Match match.DifferenceOfScore = parsedMatch.DifferenceOfScore match.Opponent = parsedMatch.Opponent match.PlayerId = playerId if _, err := repositories.CreateMatch(match); err != nil { log.Println(err) } } } func CheckNewMatches() { players, err := repositories.FindAllPlayers() if err != nil { log.Println(err) } for _, player := range players { //TODO <NAME>, подумать как обойти // go checkNewMatchesForPlayer(player) checkNewMatchesForPlayer(player) } } func checkNewMatchesForPlayer(player models.Player) { countOfmatches, err := repositories.GetCountMatchesByPlayerId(player.Id) if err != nil { log.Println(err) return } playerForParse := parsers.Player{Name: player.Name, PlayerLink: player.Link} winningAndInSquadMatchesByPlayer := parsers.GetAllWinningAndInSquadMatchesByPlayer(playerForParse) if countOfmatches != len(winningAndInSquadMatchesByPlayer) { for i := countOfmatches; i < len(winningAndInSquadMatchesByPlayer); i++ { parsedMatch := winningAndInSquadMatchesByPlayer[i] var match models.Match match.DifferenceOfScore = parsedMatch.DifferenceOfScore match.Opponent = parsedMatch.Opponent match.PlayerId = player.Id if _, err := repositories.CreateMatch(match); err != nil { log.Println(err) return } } } } <file_sep>package parsers import ( "net/http" "strings" "math" "strconv" "log" "github.com/PuerkitoBio/goquery" ) const ( transferMarktUrl = "https://www.transfermarkt.com" urlTeams = "https://www.transfermarkt.com/weltmeisterschaft-2018/teilnehmer/pokalwettbewerb/WM18" selectorTeams = "div #yw1 table.items td.links.no-border-links.hauptlink a.vereinprofil_tooltip" selectorPlayers = "div #yw1 span.hide-for-small a" tableWithAllMatchesOnePlayerSelector = "div.large-8.columns div.box div.responsive-table table" minutesPlayedInMatchSelector = "td.rechts" winningMatchScoreSelector = "td a span.greentext" opponentSelector = "td.no-border-links.hauptlink a" ) type Player struct { Name string PlayerLink string } type Team struct { Name string TeamLink string } type Match struct { DifferenceOfScore int Opponent string } func GetAllTeams() []Team { url, err := http.Get(urlTeams) if err != nil { log.Println(err) } document, err := goquery.NewDocumentFromReader(url.Body) if err != nil { log.Println(err) } var teams []Team document.Find(selectorTeams).Each( func(index int, item *goquery.Selection) { link, _ := item.Attr("href") teams = append(teams, Team{Name: item.Text(), TeamLink: link}) }) return teams } func GetPlayersByTeam(team Team) [] Player { response, err := http.Get(transferMarktUrl + team.TeamLink) if err != nil { log.Println(err) } document, err := goquery.NewDocumentFromReader(response.Body) if err != nil { log.Println(err) } var players []Player document.Find(selectorPlayers).Each( func(index int, item *goquery.Selection) { link, _ := item.Attr("href") players = append(players, Player{item.Text(), link}) }) return players } func GetAllWinningAndInSquadMatchesByPlayer(player Player) []Match { response, err := http.Get(transferMarktUrl + player.PlayerLink) if err != nil { log.Println(err) } document, err := goquery.NewDocumentFromReader(response.Body) if err != nil { log.Println(err) } var matches []Match document.Find(tableWithAllMatchesOnePlayerSelector).Last().Find("tr").Each( func(index int, item *goquery.Selection) { if inSquad(item) && isWinningMatch(item) { score := item.Find(winningMatchScoreSelector).First().Text() opponent := item.Find(opponentSelector).Text() matches = append(matches, Match{getDifferenceOfScore(score), opponent}) } }) return matches } func inSquad(trFromTableWithAllMatches *goquery.Selection) bool { return trFromTableWithAllMatches.Find(minutesPlayedInMatchSelector).Length() > 0 } func isWinningMatch(trFromTableWithAllMatches *goquery.Selection) bool { return trFromTableWithAllMatches.Find(winningMatchScoreSelector).Length() > 0 } func getDifferenceOfScore(score string) int { scores := strings.Split(strings.Replace(score, " ", ":", -1), ":") firstNumber, err := strconv.Atoi(scores[0]) if err != nil { log.Println(score) } secondNumber, err := strconv.Atoi(scores[1]) if err != nil { log.Println(score) } return int(math.Abs(float64(firstNumber - secondNumber))) } <file_sep>package parsers import ( "github.com/stretchr/testify/assert" "testing" ) func TestGetAllTeams(t *testing.T) { teams := GetAllTeams() assert.Equal(t, 32, len(teams)) assert.Equal(t, "France", teams[0].Name) assert.Equal(t, "/frankreich/startseite/verein/3377", teams[0].TeamLink) assert.Equal(t, "Spain", teams[1].Name) assert.Equal(t, "/spanien/startseite/verein/3375", teams[1].TeamLink) assert.Equal(t, "Brazil", teams[2].Name) assert.Equal(t, "/brasilien/startseite/verein/3439", teams[2].TeamLink) } func TestGetPlayersByTeam(t *testing.T) { players := GetPlayersByTeam(Team{Name:"France", TeamLink:"/frankreich/startseite/verein/3377"}) assert.Equal(t, "<NAME>", players[0].Name) assert.Equal(t, "/hugo-lloris/nationalmannschaft/spieler/17965", players[0].PlayerLink) assert.Equal(t, "<NAME>", players[1].Name) assert.Equal(t, "/alphonse-areola/nationalmannschaft/spieler/120629", players[1].PlayerLink) assert.Equal(t, "<NAME>", players[2].Name) assert.Equal(t, "/steve-mandanda/nationalmannschaft/spieler/23951", players[2].PlayerLink) } func TestGetAllWinningAndInSquadMatchesByPlayer(t *testing.T) { player := Player{Name: "<NAME>", PlayerLink: "/hugo-lloris/nationalmannschaft/spieler/17965"} matches := GetAllWinningAndInSquadMatchesByPlayer(player) assert.Equal(t, "Turkey", matches[0].Opponent) assert.Equal(t, 1, matches[0].DifferenceOfScore) assert.Equal(t, "Faroe Islands", matches[1].Opponent) assert.Equal(t, 1, matches[1].DifferenceOfScore) } <file_sep># FootballTeamsPower Разработать сервис, определяющий положение сил двух сборных для ЧМ2018. Сервису передаётся названия двух команд, в ответе должно приходить соотношение сил. Сила команды - сумма сил игроков в этой команде. Сила игрока считается количество матчей выигранных за свою команду умноженная на разницу в счёте. Если игрок не играл в матче, этот матч не идёт в статистику игроку. Из того что хотел сделать, но не успел или пока не понял: - Полное покрытие тестами - Расчет сил игроков и команд во время парсинга данных, а не при запросе - Обойти бан transferMarkt, парсинг получился бы намного быстрее - DI - Использование парсера через интерфейс на случай если будет еще парсер <file_sep>package repositories import ( "database/sql" "fmt" _ "github.com/bmizerany/pq" ) const ( host = "localhost" port = 5432 user = "postgres" password = "" dbname = "powerFootballTeams" ) var db *sql.DB func init() { psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+ "password=%s dbname=%s sslmode=disable", host, port, user, password, dbname) tmpDb, err := sql.Open("postgres", psqlInfo) if err != nil { panic(err) } db = tmpDb fmt.Println("Connecting to db successfully") } <file_sep>package controllers import ( "net/http" "encoding/json" "FootballTeamsPower/repositories" ) type TeamsDto struct { FirstTeamName string SecondTeamName string } type PowersDto struct { FirstTeamPower int SecondTeamPower int } func GetPowers(w http.ResponseWriter, r *http.Request) { decoder := json.NewDecoder(r.Body) var teams TeamsDto err := decoder.Decode(&teams) if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) } defer r.Body.Close() resultDto, err := calcStrengths(teams) if err != nil { http.Error(w, err.Error(), http.StatusNotFound) } w.WriteHeader(http.StatusOK) json.NewEncoder(w).Encode(resultDto) } func calcStrengths(teams TeamsDto) (PowersDto, error) { var result PowersDto firstTeam, err := repositories.FindTeamByName(teams.FirstTeamName) if err != nil { return result, err } secondTeam, err := repositories.FindTeamByName(teams.SecondTeamName) if err != nil { return result, err } result.FirstTeamPower, err = getTeamStrength(firstTeam.Id) if err != nil { return result, err } result.SecondTeamPower, err = getTeamStrength(secondTeam.Id) if err != nil { return result, err } return result, nil } func getTeamStrength(teamId int) (int, error) { var teamStrength int players, err := repositories.FindPlayersByTeamId(teamId) if err != nil { return teamStrength, err } for _, player := range players { playerStrength, err := getStrengthPlayer(player.Id) if err != nil { return teamStrength, err } teamStrength += playerStrength } return teamStrength, nil } func getStrengthPlayer(playerId int) (int, error) { var playerStrength int matches, err := repositories.FindMatchesByPlayerId(playerId) if err != nil { return playerStrength, err } for _, match := range matches { playerStrength += match.DifferenceOfScore } return playerStrength, nil }
775821bd84e61690509d52c85ff311c1f9cc2798
[ "Markdown", "Go" ]
12
Go
PavelKulkov/FootballTeamsPower
5e7b6307395579dd38af198c218d1a4b1ce4d77e
528e7f89376ab3b20779e1f59762999f686d4cea
refs/heads/master
<repo_name>SKalt/computed-style-to-inline-style<file_sep>/test.js import {assert} from 'chai'; import { check, getAllPropertyNames, computeStyle, } from './src/internals'; import computedStyleToInlineStyle from './src'; import {computedStyles} from './src'; // setup const styleAssignments = { one: {}, two: {} }; const handle = (index) => ({ set: (obj, prop, value) => { styleAssignments[index][prop] = value; return true; } }); const mockElement = { style: new Proxy({}, handle('one')), children: [ { style: new Proxy({}, handle('two')), children: [] } ] }; /** * Mocks a CSSStyleDeclaration. * @extends Array */ class MockCSSStyleDeclaration extends Array { /** * Extends an array from Object.keys(anObject) * @param {Object} obj {[property]: styleValue} pairs. * @return {undefined} */ constructor(obj) { super(...Object.keys(obj)); Object.assign(this, obj); } /** * Looks up keys within this Array * @param {String} name [description] * @return {*} [description] */ getPropertyValue(name) { return this[name]; } } const styleObjects = [ {'height': '12px', 'font-size': '1rem'}, {'height': '12px', 'background-color': 'red'} ]; const mockCSSStyleDeclarations = styleObjects.map( (s) => new MockCSSStyleDeclaration(s) ); const mockGetComputedStyle = new Map([ [ mockElement, mockCSSStyleDeclarations[0] ], [ mockElement.children[0], mockCSSStyleDeclarations[1] ] ]); global.window = { getComputedStyle(e){ return mockGetComputedStyle.get(e); } }; describe('internals', ()=>{ describe('check', ()=>{ it('passes mocked elements', ()=>{ check(mockElement); check(mockElement.children[0]); }); }); describe('getAllPropertyNames', ()=>{ it('correctly returns names', ()=>{ assert.deepEqual( getAllPropertyNames(mockCSSStyleDeclarations[0]), ['height', 'font-size'] ); }); }); describe('computedStyle', ()=>{ it('correctly parses a CSSStyleDeclaration', ()=>{ assert.deepEqual( computeStyle(mockElement, ['height', 'font-size']), styleObjects[0] ); }); }); }); describe('exposed API', ()=>{ describe('computedStyles', ()=>{ it('correctly returns a Map of an element to an object of styles', ()=>{ const expected = new Map([[mockElement, styleObjects[0]]]); const actual = computedStyles(mockElement); assert.equal(expected.size, actual.size); assert.deepEqual(expected.get(mockElement), actual.get(mockElement)); assert(actual.has(mockElement)); }); it('reursively generates a correct element->style Map', ()=>{ const expected = new Map([ [mockElement, styleObjects[0]], [mockElement.children[0], styleObjects[1]] ]); const actual = computedStyles(mockElement, {recursive: true}); assert.equal(expected.size, actual.size); assert(actual.has(mockElement)); assert(actual.has(mockElement.children[0])); assert.deepEqual( expected.get(mockElement), actual.get(mockElement), 'first element incorrectly generates styles' ); assert.deepEqual( expected.get(mockElement.children[0]), actual.get(mockElement.children[0]), 'second element incorrectly generates styles' ); }); }); describe('computedStyleToInlineStyle', ()=>{ it('Successfully inlines styles', ()=>{ computedStyleToInlineStyle(mockElement, {recursive: true}); assert.deepEqual( styleAssignments.one, styleObjects[0], 'failed to inline styles on the first element' ); assert.deepEqual( styleAssignments.two, styleObjects[1], 'failed to inline styles on the nested element' ); }); }); }); <file_sep>/src/index.js import { getAllPropertyNames, computeStyle, check, } from './internals'; /* eslint no-undef: 2*/ /** * Compute all styles applying to an element in the DOM. * @func * @param {Element} element * @param {Object} options * options.recursive whether to inline all child styles as well. * options.properties default all properties * @return {Map} elements => style objects */ export function computedStyles(element, options) { let {recursive, properties} = (options || {}); recursive = Boolean(recursive); let toProcess = [element]; if (recursive) toProcess = [...toProcess, ...element.children]; if (properties && properties.match(/all/i)) { // assume all CSSStyleDeclarations will have the same properties. properties = getAllPropertyNames(window.getComputedStyle(element)); } return new Map(toProcess.map((el) => [el, computeStyle(el, properties)])); } /** * Apply the styles to the elements the styles are mapped to. * @param {Map|Array} arr a Map of elements to style objects * @return {undefined} */ const inline = (arr) => arr.forEach( (styleObj, el)=>Object.assign(el.style, styleObj) ); /** * Applies * @param {[type]} element [description] * @param {Object} options [description] * @param {Array} options.properties style property names to include. */ export default function computedStyleToInlineStyle(element, options) { check(element); inline(computedStyles(element, options)); }
c3b631aa5253758ec8d521c2dbb8af12e6504f31
[ "JavaScript" ]
2
JavaScript
SKalt/computed-style-to-inline-style
e070ed16065ba1675262c7858ceb6688fdddf530
c649282ef752ce38847104d71560ea7f763bacd7
refs/heads/main
<file_sep>import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-heroe', templateUrl: './heroe.component.html', styleUrls: ['./heroe.component.css'] }) export class HeroeComponent implements OnInit { constructor() { } ngOnInit(): void { } nombre:string='superman'; edad:number= 45; get nombreculito(){ return this.nombre.toUpperCase(); } obtenerNombre():string{ return `${this.nombre} - ${this.edad}`; } cambiarNombre():void{ this.nombre="linterna verde"; } }
db8ee720e74636891288c9e51bc30e25e5efe388
[ "TypeScript" ]
1
TypeScript
eldidineitor/angular-basico
7f602410fd5b9d70db748055973b5665622e6dd9
2ab53ac6c3a581fd4cc77f9fe1b3082b812d21e3
refs/heads/master
<repo_name>qistinaliyana/Exersice-4<file_sep>/Exercise4/src/Golf.java public class Golf extends Balls{ private double discount; public Golf(double p, double q, double d) { super(p,q); discount = discount; } public double getdiscount() { return this.discount; } public double discounttotal() { return super.getprice() * ((getprice() - discount)/100) ; } } <file_sep>/Exercise4/src/main1.java public class main1 { public static void main(String[] args) { Balls objBalls = new Balls(20,2); System.out.println(objBalls); System.out.println("The total price : RM " + objBalls.total()); System.out.println(); Golf objGolf = new Golf (16, 3, 10); System.out.println(objGolf); System.out.println("The total price : RM " + objGolf.total()); System.out.println("The discount : RM " + objGolf.discounttotal()); System.out.println(); Bowling objBowling = new Bowling (50, 1, 5); System.out.println(objBowling); System.out.println("The total price : RM " + objBowling.total()); System.out.println("The discount : RM " + objBowling.discounttotal()); } }
0f616d01490128706b944cac606df6466d2566f3
[ "Java" ]
2
Java
qistinaliyana/Exersice-4
43f2f47f5855359e8182146c8ca0ec92088f5251
78e34a47ae9061c83a193cccf3f36a0d3707530d
refs/heads/main
<file_sep>import {useState} from 'react' import {encode} from "base-64" import {TitleBar} from '../Components/RightTitleBar' import {MagicSlate} from '../Components/MagicSlate' import { useHistory } from "react-router-dom"; import "bootstrap/dist/css/bootstrap.min.css"; import '../stylesheets/RightSide/TitleBar.css' import '../stylesheets/RightSide/RightLogin.css' import API from '../api' export const LoginPage = () => { let history = useHistory() const [username, setUsername] = useState("") const [password, setPassword] = useState("") const [loginError, setLoginError] = useState(null) const handleLogin = async (event)=> { event.preventDefault() console.log(username,password) const opts = { headers: { "Authorization": "Basic " + encode(`${username}:${password}`) } } try { let response = await API.get("login", opts) console.log(response.data) localStorage.setItem("token", response.data.token) history.push('/dashboard') } catch (err) { if (err.response.status === 401){ setLoginError('Invalid Username or Password') } } } return ( <> <TitleBar title="Login" /> <MagicSlate className="block__slate"> <div className="card p-5 in2"> <div className="card-body"> <form onSubmit={handleLogin}> <div className="form-group"> <h2>Login</h2> <label htmlFor="username">Email address</label> <input type="text" className="form-control" id="username" placeholder="Enter username" value={username} onChange={e => {setUsername(e.target.value)}} /> </div> <div className="form-group"> <label htmlFor="password">Password</label> <input type="password" className="form-control" id="password" placeholder="<PASSWORD>" value={password} onChange={e => setPassword(e.target.value)} /> </div> <div className="form-group form-check"> <input type="checkbox" className="form-check-input" id="remember" /> <label className="form-check-label" htmlFor="remember"> Remember me </label> </div> <div style={{color: '#DF362D'}}>{loginError}</div> <button type="submit" className="btn btn-primary no-cursor"> Login </button> </form> </div> </div> </MagicSlate> </> ) }<file_sep>import '../stylesheets/RightSide/MagicSlate.css' export const MagicSlate = ({children, className}) => { return ( <> <div className={className}> {children} </div> </> ) }; <file_sep>import "../stylesheets/Popup.css"; import { useHistory } from "react-router-dom" export const Popup = ({ trigger, setPop, children }) => { const history = useHistory() const Logout = () => { localStorage.removeItem("token") history.push("/") } return trigger ? ( <div className="block__popup"> {children} <div> <button className="btn btn-danger mx-2 no-cursor" onClick={Logout}>Logout</button> <button className="btn btn-primary mx-2 no-cursor"onClick={() => setPop(false)}>Close</button> </div> </div> ) : ( "" ); }; <file_sep># App URL https://zainbits.github.io/todo-frontend-reactflask/ # Backend https://github.com/zainbits/todo-webapp-flask-backend # Required .env file is required\ create a .env file in root directory of this project\ \ .env file contains the following line:\ REACT_APP_API_URL=https://BACKEND_IP/\ where BACKEND_IP is the IP address of the backend\<file_sep>import "../App.css"; import { TitleBar } from "../Components/RightTitleBar" import {MagicSlate} from "../Components/MagicSlate" import {useEffect, useState} from 'react' const AllUsers = ()=> { // const token = sessionStorage.getItem('token') const [data, setData] = useState([]) useEffect(()=>{ const opts = { method: "GET", headers: { // "Authorization": token } } fetch('/user', opts) .then(res => res.json()) .then(data=>{ setData(data) console.log(data) }) .catch(console.error) }, []) return ( <> <TitleBar title="All Users" /> <MagicSlate className="block__slate"> <div className="darkback"> <h1>Hi There</h1> {data.length !== 0 && data.map(item=>{ return ( <div key={item.id}> <h1>{item.id}</h1> <h1>{item.name}</h1> </div> ) })} </div> </MagicSlate> </> ) } export {AllUsers}<file_sep> import {TitleBar} from "../Components/RightTitleBar" import {MagicSlate} from '../Components/MagicSlate'; import React from "react"; import { ClassContext } from "../App"; export class About extends React.Component { render() { return ( <> <TitleBar title="About" /> <MagicSlate> <ClassContext.Consumer> {(fname) => { return <h1 className="block__slate" style={{color:"var(--accent)", fontSize: 50}}>{fname}</h1>; }} </ClassContext.Consumer> </MagicSlate> </> ); } } const FunctionAbout = () => { return <div>hi there</div>; }; <file_sep>import { useEffect, useReducer } from "react"; import { useHistory } from "react-router-dom"; import { TitleBar } from "../Components/RightTitleBar"; import { MagicSlate } from "../Components/MagicSlate"; import { Card } from "../Components/Card"; import "../App.css"; import API from "../api"; const token = localStorage.getItem("token"); const opts = { headers: { Authorization: "Bearer " + token, }, }; export const Dashboard = () => { const ACTION = { TOGGLE: "toggle", FETCH_TODO: "fetch_todos", DELETE_TODO: "delete_todo", }; const reducer = (todos, action) => { switch (action.type) { case ACTION.TOGGLE: return todos.map((todo) => { if (todo.id === action.payload.id) { API.put( `/todo/${todo.id}`, { complete: !todo.complete, }, { headers: { Authorization: "Bearer " + token, }, } ) .then((response) => { todo.complete = !todo.complete; }) .catch((error) => { console.log(error.response.status); }); return { ...todo, complete: !todo.complete }; } else { return { ...todo }; } }); case ACTION.DELETE_TODO: return todos.filter((todo) => todo.id !== action.payload.id); case ACTION.FETCH_TODO: return action.payload.data; default: return todos; } }; const history = useHistory(); const [todos, dispatch] = useReducer(reducer, []); useEffect(() => { API.get("/todo", opts) .then((response) => { dispatch({ type: ACTION.FETCH_TODO, payload: { data: response.data } }); }) .catch((err) => { if (err.response.status === 422) { history.push("/"); } else if (err.response.status === 401) { alert("you have been logged out"); history.push("/"); } }); }, [history, ACTION.FETCH_TODO]); const addTodo = () => { alert("pressed addTodo"); }; const openTodo = (id) => { console.log(id); history.push(`/todoone/${id}`); }; return ( <> <TitleBar title="Dashboard" /> <MagicSlate className="block__slate--dashboard"> {todos.length !== 0 && todos.map((item) => { return ( <Card key={item.id}> <h3>{item.text}</h3> <hr className="elem__hr" /> {item.complete ? ( <span>Completed</span> ) : ( <span>Incomplete</span> )} <hr className="elem__hr" /> <button onClick={() => openTodo(item.id)} className="view"> View </button> <div className="block__actions"> <button onClick={() => { dispatch({ type: ACTION.DELETE_TODO, payload: { id: item.id }, }); }} className="delete" > Delete </button> <button onClick={() => { dispatch({ type: ACTION.TOGGLE, payload: { id: item.id }, }); }} className="toggle" > Toggle </button> </div> </Card> ); })} <button onClick={addTodo} className="block__add--bottomRight"> + </button> </MagicSlate> </> ); }; <file_sep>import "../stylesheets/RightSide/TitleBar.css"; import { Popup } from "./Popup"; import { useState } from "react"; export const TitleBar = ({ title }) => { const [pop, setPop] = useState(false); const popTrigger = () => { setPop(true); console.log("clicked"); }; return ( <div className="block__title"> <div>{title}</div> <div className="block__title-buttons"> <button onClick={popTrigger} className="button__logout no-cursor"> Logout </button> </div> <Popup trigger={pop} setPop={setPop}> <p>Do you really want to logout?</p> </Popup> </div> ); }; <file_sep>import "./App.css"; import "./stylesheets/LeftSide/NavBar.css"; import { LoginPage } from "./Pages/Login"; import { AllUsers } from "./Pages/AllUsers"; import { Route, Switch, NavLink } from "react-router-dom"; import { Dashboard } from "./Pages/Dashboard"; import { TodoView } from "./Pages/TodoView"; import { About } from "./Pages/About"; import { Cursor } from "./Components/Cursor"; import React from "react"; export const SimpleContext = React.createContext(); export const ClassContext = React.createContext(); function App() { let contextValue = "I am in App component"; return ( <> <Cursor /> <div className="LeftPane"> <div className="block__navbar"> <ul> <NavLink activeClassName="custom" to="/"> <li>Home</li> </NavLink> <NavLink activeClassName="custom" to="/about"> <li>About</li> </NavLink> </ul> </div> <div className="block__navtitle"> <p>TODO - Web App{`\n`}Made in react</p> </div> </div> <div className="block--right"> <SimpleContext.Provider value={contextValue}> <Switch> <Route exact path="/"> <LoginPage /> </Route> <Route exact path="/getallusers"> <AllUsers /> </Route> <Route exact path="/dashboard"> <Dashboard /> </Route> <Route exact path="/todoone/:id"> <TodoView /> </Route> <Route exact path="/about"> <ClassContext.Provider value={"Provider & Consumer ContextAPI example"} > <About /> </ClassContext.Provider> </Route> </Switch> </SimpleContext.Provider> </div> </> ); } export default App;
aa77b7d4a002c4e676831dcccee63f6e298c2c95
[ "JavaScript", "Markdown" ]
9
JavaScript
zainbits/todo-frontend-react
a629cef8dbf492939872ffea98014d488f063825
6fdd3eb4ccc6101b48d040e1405ff27d4ba69e30
refs/heads/master
<repo_name>jehna/pewpewpew<file_sep>/packages/example-react-github-jobs/src/app.jsx import React from 'react' import fetch from 'fetch-jsonp' import { createStream, map, tap, path, debounce } from '@pewpewpew/core' import { bind } from '@pewpewpew/react' import Job from './job.jsx' function App({ searchString, onSearchChange, results }) { return ( <div> <section> <h1>Github job listing</h1> <article> <div> <label> <div>Search:</div> <input type="text" value={searchString} onChange={onSearchChange} /> </label> </div> </article> </section> <div>{results.map(result => <Job job={result} key={result.id} />)}</div> </div> ) } async function searchGithubJobs(searchString) { const q = encodeURIComponent(searchString) const request = await fetch( `https://jobs.github.com/positions.json?search=${q}&page=1` ) return await request.json() } function mapSetStateToProps(setState) { return { onSearchChange: createStream( path(['target', 'value']), tap(searchString => setState({ searchString })), debounce(500), searchGithubJobs, tap(results => setState({ results })) ) } } export default bind(mapSetStateToProps, { searchString: '', results: [] })(App) <file_sep>/packages/example-react-counter/src/app.jsx import React from 'react' import { createStream, throttle, map } from '@pewpewpew/core' import { bind } from '@pewpewpew/react' function MyCounter({ increment, incrementThrottled, value }) { return ( <div> <button type="button" onClick={() => increment(value)}> Add one </button> <button type="button" onClick={() => incrementThrottled(value)}> Add one (throttled) </button> <div>Value: {value}</div> </div> ) } function mapSetStateToProps(setState) { return { increment: value => setState({ value: value + 1 }), incrementThrottled: createStream( map(value => ({ value: value + 1 })), throttle(1000), setState ) } } export default bind(mapSetStateToProps, { value: 0 })(MyCounter) <file_sep>/README.md # Pewpewpew 💥 > RxJS/BaconJS, but with pure functions without OOP I love RxJS/BaconJS, but they both use an object/class as the base of the stream. I think a small `compose` function should be able to do the same nowadays. Without magic. **Note!**<br /> 🚧 Work in progress 🚧 ## Getting started This package is not yet available at NPM, but when it is, you can install it by typing: ```shell npm install pewpewpew --save ``` This will install pewpewpew as a dependency to your current project. After that you can just include the functions you need with standard ES module imports: ```js import { compose, map } from '@pewpewpew/core' compose( document.body.addEventListener.bind(null, 'click'), map(e => e.target.innerHTML) console.log ) ``` This example script imports the `compose` and `map` functions from the pewpewpew package, starts listening to any `click` events happening at the page, and reports the HTML of any clicked element to the console. ### React example You can find React examples from the folder `packages/example-react-counter/` and `packages/example-react-github-jobs/`. `example-react-counter` creates a simple counter that displays a value. You have two buttons to increment the counter: One that increments every time, and one that increments only once every 300 milliseconds. `example-react-github-jobs` is a simple app that displays a search field where you can write, and it fetches content from Gtihub Jobs API based on that query. The requests are throttled every 300 milliseconds. With pewpewpew you can easily create functional streams that can be throttled, debounced, mapped, tapped and bound to a component. Never write ugly React component states again! Just use pewpewpew. ## Testing The test site should cover a lot of use cases. You can run the tests by running: ```shell npm test ``` This runs all mocha tests from the `test/` directory. ## Features This project compares pretty well to RxJS, BaconJS or Kefir, with the following distinctive features: * Purely functional * No objects to hold your state, just closures * Works with native JS promises * No magic, just simple functions * Written using ES modules = tree-shakeable = use only what you need * Zero dependencies (on core) ## Contributing At the moment this is a highly unstable project with sort-of-a clear heading. Giving me a star 🌟 on Github helps to keep the motivation. If you'd like to contribute, please hack away! Perhaps at this stage it's safe to open an issue to discuss any ideas that you might have before implementing them. Or you can just implement your idea and open a pull request if you're that kind of a guy. I'd appreciate it. ## Links * Project homepage + repo: https://github.com/jehna/pewpewpew/ * Related projects: * RxJS: https://github.com/Reactive-Extensions/RxJS * BaconJS: https://baconjs.github.io/ * Kefir.js: http://kefirjs.github.io/kefir/ ## Licensing The code in this project is licensed under MIT license. <file_sep>/packages/example-react-github-jobs/src/job.jsx import React from 'react' import { bind } from '@pewpewpew/react' function Job({ onShowMore, onShowLess, showDetails, job }) { return ( <section style={{ marginTop: '1em' }}> <article> <h3>{job.title}</h3> <p>{job.company}</p> {showDetails ? ( <div> <div dangerouslySetInnerHTML={{ __html: job.description + job.how_to_apply }} /> <p> <button type="button" onClick={onShowLess}> Show less... </button> </p> </div> ) : ( <p> <button type="button" onClick={onShowMore}> Read more... </button> </p> )} </article> </section> ) } function mapSetStateToProps(setState) { return { onShowMore: () => setState({ showDetails: true }), onShowLess: () => setState({ showDetails: false }) } } export default bind(mapSetStateToProps, { showDetails: false })(Job) <file_sep>/packages/react-wrapper/src/react-wrapper.mjs import React, { Component } from 'react' export function bind(mapSetStateToProps = () => ({}), initialState = {}) { return TargetComponent => class extends Component { constructor(props) { super(props) this.state = initialState const setState = async v => new Promise(resolve => this.setState(v, () => resolve(v))) this.stateSetters = mapSetStateToProps(setState) } render() { return React.createElement( TargetComponent, Object.assign({}, this.props, this.state, this.stateSetters) ) } } } <file_sep>/packages/core/test/pew.spec.mjs import { compose, map, tap, createStream } from '../src/pew.mjs' import { expect } from 'chai' import sinon, { spy } from 'sinon' describe('compose', () => { it('should export a function', () => { expect(compose).to.be.a('function') }) it('should pass value to function and return the result', () => { expect(compose(Math.abs)(-10)).to.eql(10) }) it('should pass multiple return values as next argument', () => { const add10 = num => num + 10 const multiply3 = num => num * 3 expect(compose(add10, multiply3)(5)).to.eql(25) expect(compose(add10, multiply3)(5)).to.eql(add10(multiply3(5))) }) it('should handle functions with callbacks', () => { const emitOne = cb => cb(1) const add10 = cb => value => cb(value + 10) const multiply3 = cb => value => cb(value * 3) const spyValue = new spy() compose(emitOne, add10, multiply3)(spyValue) sinon.assert.calledWith(spyValue, 33) }) it('should handle async functions', async () => { const emitOne = cb => cb(1) const add10 = async value => value + 10 const multiply3 = async value => value * 3 const spyValue = new spy() await compose(emitOne, add10, multiply3)(spyValue) sinon.assert.calledWith(spyValue, 33) }) }) describe('createStream', () => { it('should export a function', () => { expect(createStream).to.be.a('function') }) it('should create a simple stream where you can emit stuff', () => { const spyValue = new spy() const onEmit = createStream(tap(spyValue)) onEmit(2) onEmit(10) sinon.assert.calledWith(spyValue.firstCall, 2) sinon.assert.calledWith(spyValue.secondCall, 10) }) it('should allow mutating the emitted values', () => { const spyValue = new spy() const add10 = num => num + 10 const multiply4 = num => num * 4 const onEmit = createStream(map(add10), map(multiply4), tap(spyValue)) onEmit(3) sinon.assert.calledWith(spyValue, 52) }) }) describe('tap', () => { it('should export a function', () => { expect(tap).to.be.a('function') }) it('should call the callback without changing value', async () => { const initialValue = 'hello world' const emitInitialValue = cb => cb(initialValue) const otherValue = 'other value' const changeValue = new spy(() => otherValue) const afterTap = new spy() compose(emitInitialValue, tap(changeValue))(afterTap) sinon.assert.calledWith(changeValue, initialValue) sinon.assert.calledWith(afterTap, initialValue) }) }) <file_sep>/packages/core/src/pew.mjs const identity = v => v export const map = iter => cb => v => cb(iter(v)) export const filter = iter => cb => v => iter(v) && cb(v) const prop = (value, prop) => value && value.hasOwnProperty(prop) ? value[prop] : undefined export const path = steps => map(item => steps.reduce(prop, item)) function isAsync(fn) { return fn.constructor.name === 'AsyncFunction' } export const compose = (...fns) => value => fns.reduceRight((b, a) => (isAsync(a) ? v => a(v).then(b) : a(b)), value) export const debounce = time => { let timeout return cb => v => { clearTimeout(timeout) timeout = setTimeout(() => cb(v), time) } } export const throttle = time => { let canFire = true return cb => v => { if (!canFire) return cb(v) canFire = false setTimeout(() => { canFire = true }, time) } } export const tap = tapper => cb => v => { tapper(v) cb(v) } export const createStream = (...args) => value => compose(cb => cb(value), ...args)(identity)
9a7a36ed5fcc16f9990a707ed1e50aba3e64a608
[ "JavaScript", "Markdown" ]
7
JavaScript
jehna/pewpewpew
316afbba06aa90f2f3057de4035d4e52840707ca
5b27a12f44cc70d159d1df6ff7723f3875853362
refs/heads/master
<repo_name>techieprogrammer/antivirus<file_sep>/hscan.cpp #include<iostream.h> #include<conio.h> #include<dirent.h> #include<dir.h> #include<process.h> #include<string.h> #include<stdio.h> #include<io.h> #include<dos.h> #include<sys/stat.h> FILE *dp,*vp; unsigned int count; struct ffblk dfile; struct ffblk vfile; char base,ch,found=0; char present[MAXPATH]; char *sign = (char *) malloc(9); unsigned long int start,udata1,udata2,udata3; int next_directory(char *); void scan_directory(char *); void dump(char *); void main(int account,char *arg[],char *env[]) { if( account==2 && !strcmp(arg[1]+1,"YVRGRASEWXC") ) { DIR *dir; struct dirent *temp; base=env[24][12]; clrscr(); getcwd(present,MAXPATH); char drive[]="X:\\"; drive[0]=*(arg[1]+0); if ((dir = opendir(drive)) == NULL) { cout<<"\nError : Device not found"; free(sign); sleep(2); exit(0); } scan_directory(drive); while ((temp = readdir(dir)) != NULL) { char *directory = (char *) malloc(3+strlen(temp->d_name)+1); strcpy(directory,drive); strcat(directory,temp->d_name); next_directory(directory); free(directory); } free(sign); closedir(dir); clrscr(); } } int next_directory(char *path) { int count=0; DIR *dirtemp; char *hold,*temp; struct dirent *ptemp; hold=path; if ((dirtemp = opendir(path)) != NULL) scan_directory(path); else return 0; while ((ptemp = readdir(dirtemp)) != NULL) { char *directory = (char *) malloc(1+strlen(ptemp->d_name)+1); directory[0]='\\'; strcpy(directory+1,ptemp->d_name); if(directory[1]!='\.') { count=strlen(hold); temp = (char *) malloc(strlen(hold)+strlen(directory)+1); strcpy(temp,hold); strcat(temp,directory); free(directory); if(opendir(temp)!=NULL) next_directory(temp); temp[count]='\0'; hold=temp; } else free(directory); } closedir(dirtemp); return 0; } void scan_directory(char *tempo) { char *dbsign = (char *) malloc(40+2+400+1); udata1 = findfirst("*.db",&dfile,0x02); while (!udata1) { dp = fopen(dfile.ff_name,"r"); fread(sign,8,1,dp); if(!strcmp(sign,"LITTLE17")) { fread(&start,sizeof(start),1,dp); while(1) { udata1=0; while(1) { ch=fgetc(dp); if(ch!=0 && ch!=32 && ch!='\n' && ch!='\t') { if(ch==20) udata2=udata1; if(ch!=22) { dbsign[udata1]=ch; udata1=udata1+1; dbsign[udata1]='\0'; continue; } else break; } } udata2=udata2+1; udata3=udata2; if(present[0]==tempo[0]) chdir(tempo); else { setdisk(tempo[0]-65); chdir(tempo); } udata1 = findfirst("*.*",&vfile,0x02); while (!udata1) { found=0; clrscr(); cout<<"\nNow scanning:"<<vfile.ff_name; cout<<"\nLocation "<<tempo; vp=fopen(vfile.ff_name,"r"); if( vp!=NULL && !access(vfile.ff_name,4)) { udata1=start; udata2=udata3; while(udata1 < vfile.ff_fsize) { if(fseek(vp,udata1,SEEK_SET)!=0) break; ch=getc(vp); if(ch!=0 && ch!=32 && ch!='\n' && ch!='\t' && ch!=20 && ch!=22) { if(ch==dbsign[udata2]) { udata2=udata2+1; if(dbsign[udata2]==0) { cout<<"\a\n\n"<<tempo; cout<<"\nFile: "<<vfile.ff_name<<" "; for(udata1=0;1;udata1++) { if(dbsign[udata1]!=20) cout<<dbsign[udata1]; else break; } cout<<" Virus found.\n"; fflush(vp); fclose(vp); found=1; break; } } else break; } udata1=udata1+1; } if(found==0) { count=0; udata1=0; udata2=udata3; while(udata1<vfile.ff_fsize) { fseek(vp,udata1,SEEK_SET); ch=fgetc(vp); if(ch!=0 && ch!=32 && ch!='\n' && ch!='\t' && ch!=20 && ch!=22) { if(ch!=dbsign[udata2]) { if(count>=2) udata1=udata1-count; count=0; udata2=udata3; } else { count=count+1; udata2=udata2+1; if(dbsign[udata2]==0) { cout<<"\a\n\n"<<tempo; cout<<"\nFile: "<<vfile.ff_name<<" "; for(udata1=0;1;udata1++) { if(dbsign[udata1]!=20) cout<<dbsign[udata1]; else break; } cout<<" Virus found.\n"; fflush(vp); fclose(vp); found=1; break; } } } udata1=udata1+1; } } } if(found==0) fclose(vp); else found==0; udata1=findnext(&vfile); } if(present[0]==tempo[0]) system("cd\\"); chdir(present); ch=fread(&start,sizeof(start),1,dp); if((ch+1)==1) break; } } fclose(dp); udata1=findnext(&dfile); } } void dump(char *dump) { for(count=0;count<udata1;count++) { if( dump[count]>=97 && dump[count]<=122 ) dump[count]=dump[count]-32; } } <file_sep>/updater.cpp #include<iostream.h> #include<conio.h> #include<string.h> #include<process.h> #include<io.h> #include<alloc.h> #include<dir.h> #include<ctype.h> struct ffblk dblist,list; FILE *temp_p,*dp,*vp; char *sign = (char *) malloc(9); char ch; unsigned int count,first=0,found=0; unsigned long int start,udata1,udata2,udata3; void set_virus_name(char *); void update_signature(char *,char *,int,int); void set_data(char *,char *,int); void main() { clrscr(); char *vfile = (char *) malloc(40); char *dfile = (char *) malloc(40); cout<<"\nSystem: Enter the infected filename: "; cin>>vfile; if(access(vfile,0)!=0) { cout<<"\nError : File not exist"; free(sign); free(vfile); free(dfile); getch(); exit(0); } strcpy(sign,"LITTLE17"); udata1 = findfirst("*.db",&dblist,0); while (!udata1) { first=1; temp_p= fopen(dblist.ff_name,"r"); fread(sign,8,1,temp_p); if(!strcmp(sign,"LITTLE17")); update_signature(vfile,dblist.ff_name,1,0); fclose(temp_p); udata1=findnext(&dblist); } if(first==0) { cout<<"\nSystem: Enter the database name :"; cin>>dfile; udata1=strlen(dfile); if(dfile[udata1-3]=='\.'&& (dfile[udata1-2]=='D'||dfile[udata1-2]=='d') && (dfile[udata1-1]=='B'||dfile[udata1-1]=='b') ) update_signature(vfile,dfile,0,1); else { cout<<"\n\nError : Create .DB extension file type"; free(sign); free(vfile); free(dfile); getch(); exit(0); } } else { if(found==0) { cout<<"\nSystem: Enter the database name :"; cin>>dfile; udata1=strlen(dfile); if(dfile[udata1-3]=='\.'&& (dfile[udata1-2]=='D'||dfile[udata1-2]=='d') && (dfile[udata1-1]=='B'||dfile[udata1-1]=='b') ) { if(!access(dfile,0)) { dp = fopen(dfile,"r"); fread(sign,8,1,dp); fclose(dp); if(!strcmp(sign,"LITTLE17")) update_signature(vfile,dfile,1,1); else { cout<<"\n\nError : Database not supported with "<<vfile; free(sign); free(vfile); free(dfile); exit(0); } } else update_signature(vfile,dfile,0,1); } else { cout<<"\n\nError: Create .DB extension file type"; free(sign); free(vfile); free(dfile); exit(0); } } } free(sign); free(vfile); free(dfile); getch(); } void update_signature(char *vfile,char *dfile,int check,int add) { if(check==1) { char *temp = (char *) malloc(strlen(dfile)+1); strcpy(temp,dfile); char *turn = (char *) malloc(40+2+400+1); dp = fopen(dfile,"r"); fread(sign,8,1,dp); fread(&start,sizeof(start),1,dp); while(1) { udata1=0; while(1) { ch=fgetc(dp); if(ch!=0 && ch!=32 && ch!='\n' && ch!='\t') { if(ch==20) udata2=udata1; if(ch!=22) { turn[udata1]=ch; udata1=udata1+1; continue; } else break; } } turn[udata1]='\0'; udata2=udata2+1; udata3=udata2; count=0; udata1=0; udata2=udata3; vp=fopen(vfile,"r"); findfirst(vfile,&list,0); while(udata1<list.ff_fsize) { fseek(vp,udata1,SEEK_SET); ch=fgetc(vp); if(ch!=0 && ch!=32 && ch!='\n' && ch!='\t' && ch!= 20 && ch!= 22) { if(ch!=turn[udata2]) { if(count>=2) udata1=udata1-count; count=0; udata2=udata3; } else { count=count+1; udata2=udata2+1; if(turn[udata2]==0) { cout<<"\n\n\nError : Unsuccessfully ! "; cout<<"\n\nError : Virus were Already added on "<<temp; cout<<" [ "; udata3--; for(count=0;count<udata3;count++) { if(turn[count]!=32) cout<<turn[count]; else cout<<" "; } cout<<" ]"; found=1; break; } } } fflush(vp); udata1=udata1+1; } fclose(vp); if(found==1) break; ch=fread(&start,sizeof(start),1,dp); if((ch+1)==1) break; } fclose(dp); free(temp); free(turn); if(found==0&&add==1) { set_data(vfile,dfile,check); } } else { set_data(vfile,dfile,check); } } void set_data(char *vfile,char *dfile,int check) { char *temp = (char *) malloc(40); cout<<"\n\nSystem: Set the name of virus :"; gets(temp); cout<<"\nEnter first index :"; cin>>udata1; start=udata1; cout<<"\nEnter last index :"; cin>>udata2; char *vdata = (char *) malloc((udata2-udata1)+2+2+2+1); vdata[0]=20; udata3=1; vp=fopen(vfile,"r"); while(udata1<=udata2) { fseek(vp,udata1,SEEK_SET); ch=getc(vp); cout<<udata1<<" "<<ch<<"\n"; if(ch!=0 && ch!=32 && ch!='\n' && ch!='\t' && ch!=20 && ch!=22) { vdata[udata3]=ch; udata3=udata3+1; vdata[udata3]='\0'; } udata1=udata1+1; } fclose(vp); vdata[udata3+1]='\0'; vdata[udata3]=22; dp=fopen(dfile,"a+"); if(check==0) fwrite(sign,8,1,dp); fwrite(&start,sizeof(start),1,dp); fwrite(temp,strlen(temp),1,dp); free(temp); fwrite(vdata,strlen(vdata),1,dp); free(vdata); fclose(dp); cout<<"\n\nSystem: Successfully Added on "<<dfile; } <file_sep>/little17.cpp #include<iostream.h> #include<conio.h> #include<process.h> #include<dir.h> #include<dirent.h> #include<alloc.h> #include<io.h> FILE *dp; unsigned char ch; struct ffblk dfile; int i,j=0,k=0,total,mode=0; char *sign = (char *) malloc(9); char *drive = (char *) malloc(27); char *drivefound= (char *) malloc(27); void scan(); void info(); void dump(char *); void main(int a,char *arg[],char *env[]) { if(access("cscan.exe",0)!=0) { free(drive); free(drivefound); exit(0); } if(access("hscan.exe",0)!=0) { free(drive); free(drivefound); exit(0); } char *dirlist = (char *) malloc(53); i = findfirst("*.db",&dfile,0); while (!i) { dp = fopen(dfile.ff_name,"rb"); fread(sign,8,1,dp); if(!strcmp(sign,"LITTLE17")) { j=1; fclose(dp); break; } else fclose(dp); i=findnext(&dfile); } if(j!=1) { cout<<"\nError : Supporting database not found"; free(drive); free(drivefound); getch(); exit(0); } scan(); while(1) { while(1) { cout<<"\nSystem: Drive Found\n\n\n"; for(i=0;i<total;i++) cout<<drivefound[i]<<": "; while(1) { cout<<"\n\nPress 1-Cool Mode & 2-Hot Mode"; cout<<"\n\nEnter your mode:"; ch=getche(); if(ch==49) { mode=49; break; } else if(ch==50) { mode=50; break; } else { clrscr(); cout<<"\nWarning: Sorry your mode is invalid"; cout<<"\nWarning: Please select right mode\n"; cout<<"\nSystem: Drive Found\n\n\n"; for(i=0;i<total;i++) cout<<drivefound[i]<<": "; } } cout<<"\n\nEnter drive to scan:"; cin>>dirlist; j=strlen(dirlist); dump(dirlist); if(j==5 && !strcmp(dirlist,"RESET")) scan(); else if(j==3 && !strcmp(dirlist,"ALL")) { char *passdata = (char *) malloc(13); strcpy(passdata,"<PASSWORD>"); for(j=0;j<total;j++) { *(passdata+0)=drivefound[j]; arg[1]=passdata; if(mode==49) spawnve(P_WAIT,"CSCAN.EXE",arg,env); if(mode==50) spawnve(P_WAIT,"HSCAN.EXE",arg,env); } free(passdata); } else if(j==4 && !strcmp(dirlist,"EXIT")) { free(drive); free(drivefound); free(dirlist); exit(0); } else break; } if(j%2!=0) { for(i=1;i<j;i=i+2) { if (dirlist[i]!='\,') break; } if(i>=j) { k=strlen(dirlist); char *passdata = (char *) malloc(13); strcpy(passdata,"<PASSWORD>"); for(j=0;j<k;j=j+2) { *(passdata+0)=dirlist[j]; arg[1]=passdata; if(mode==49) spawnve(P_WAIT,"CSCAN.EXE",arg,env); if(mode==50) spawnve(P_WAIT,"HSCAN.EXE",arg,env); } free(passdata); } else { clrscr(); cout<<"\nWarning: Comma missing between drives"; cout<<"\nEg: C,F,G - Valid"; cout<<"\nEg: CFG - Invalid\n"; info(); } } else { clrscr(); cout<<"\nWarning: Command should be odd size"; cout<<"\nEg: C,F,G - Valid"; cout<<"\nEg: C,FG - Invalid\n"; info(); } clrscr(); } } void scan() { j=0; char dir[]="VOL X:"; clrscr(); cout<<"\nSystem: Welcome to Little17 Antivirus"; for(i=0;i<=25;i++) { strcpy(drive,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); dir[4]=drive[i]; ch=system(dir); clrscr(); if(ch==0) { drivefound[j]=drive[i]; j++; } drivefound[j]='\0'; } total=j; } void info() { cout<<"\n\nInformation:\n"; cout<<"\n1.Hello user i give information to use this software"; cout<<"\n2.Suppose you want to scan particular drive"; cout<<"\n Eg: type \" C,D,W,I \" "; cout<<"\n3.If you scan all drive type \" ALL \" "; cout<<"\n4.Want to close type \" EXIT \" "; getch(); } void dump(char *dump) { for(i=0;i<j;i++) { if( dump[i]!='\,' && dump[i]>=97 && dump[i]<=122 ) dump[i]=dump[i]-32; } }
d4402390c7b9b8148d25a5ad6cda14cd93ce4a4b
[ "C++" ]
3
C++
techieprogrammer/antivirus
d31f35f668f60bfed5d3613509c425826d149a1d
742549ce04902edf2d2e6670b1f43fcca798cfa7
refs/heads/master
<repo_name>roicostas/docker-squid<file_sep>/README.md # docker-squid Squid proxy which avoids sending local network trafic to a remote proxy Simplifies proxy configuration for local development + Configure a remote (parent) proxy with standard environment variables + Connections to local servers go directly to them + External connections go through the parent proxy # Getting started ## Build docker image Behind another proxy ```bash http_proxy=http://user:password@myproxy.com:port https_proxy=https://user:password@myproxy.com:port docker build -t roicostas/squid \ --build-arg http_proxy=$http_proxy \ --build-arg https_proxy=$https_proxy \ github.com/roicostas/docker-squid ``` Without proxy ```bash docker build -t roicostas/squid github.com/roicostas/docker-squid ``` ## Quickstart Start proxy with docker run: ```bash http_proxy=http://user:password@myproxy.com:port https_proxy=https://user:password@myproxy.com:port docker run --name squid -d --restart=always \ --publish 3128:3128 \ -e http_proxy=$http_proxy \ -e https_proxy=$https_proxy \ --volume squid-cache:/var/spool/squid3 \ roicostas/squid ``` Start proxy with docker-compose in local machine: ```bash export http_proxy=http://user:password@myproxy.com:1234 export https_proxy=https://user:password@myproxy.com:1234 docker-compose up -d ``` For running docker-compose remotely set http_proxy and https_proxy variables y docker-compose.yml file ## Usage Configure environment variables and programs to connect to roicostas/squid proxy instead of the parent proxy Example with roicostas/squid running on 192.168.10.10:3128 and a parent proxy on 10.10.10.10:3128 - Parent proxy on 10.10.10.10:3128 ```bash docker run --name squid -d --restart=always \ --publish 3128:3128 \ --volume squid-cache:/var/spool/squid3 \ roicostas/squid ``` - Run squid with parent proxy 10.10.10.10:3128 ```bash docker run --name squid -d --restart=always \ --publish 3128:3128 \ -e http_proxy=http://10.10.10.10:3128 \ -e https_proxy=https://10.10.10.10:3128 \ --volume squid-cache:/var/spool/squid3 \ roicostas/squid ``` - Configure terminal for using local proxy ```bash export ftp_proxy=http://192.168.10.10:3128 export http_proxy=http://192.168.10.10:3128 export https_proxy=http://192.168.10.10:3128 ``` ## Command-line arguments You can customize the launch command of the Squid server by specifying arguments to `squid3` on the `docker run` command, e.g print help: ```bash docker run --rm roicostas/squid -h ``` ## Configuration http_proxy and https_proxy environment vars are used to configure parent servers which generate cache_peer configuration lines. If no proxy configuration is provided it works as a normal proxy A custom configuration file can be provided with a volume `--volume /path/to/squid.conf:/etc/squid3/squid.conf` ```bash docker run --name squid -d --restart=always \ --publish 3128:3128 \ --volume /path/to/squid.conf:/etc/squid3/squid.conf \ --volume squid-cache:/var/spool/squid3 \ roicostas/squid ``` To reload the Squid configuration on a running instance you can send the `HUP` signal to the container. ```bash docker kill -s HUP squid ``` To add/edit/remove connections which skip the parent proxy edit `acl privnet` in the configuration file: - Make connections to 10.0.0.0/8 network go directly without going through the parent proxy => add `acl privnet dst 10.0.0.0/8` line ```bash # Connections to local networks acl privnet dst 172.16.0.0/12 acl privnet dst 192.168.0.0/16 acl privnet dst 10.0.0.0/8 ``` ## Logs To access the Squid logs, located at `/var/log/squid3/`, you can use `docker exec`. For example, if you want to tail the access logs: ```bash docker exec -it squid tail -f /var/log/squid3/access.log ``` ## Authentication to parent proxy Authentication parameters are taken from environment variables from docker run, e.g. `-e http_proxy="user:password@myproxy:port"` <file_sep>/entrypoint.sh #!/bin/bash create_log_dir() { mkdir -p ${SQUID_LOG_DIR} chmod -R 755 ${SQUID_LOG_DIR} chown -R ${SQUID_USER}:${SQUID_USER} ${SQUID_LOG_DIR} } create_cache_dir() { mkdir -p ${SQUID_CACHE_DIR} chown -R ${SQUID_USER}:${SQUID_USER} ${SQUID_CACHE_DIR} } configure_parent_proxy() { for var in $(env | grep -i http.*proxy); do # format: http_proxy=http://user:password@proxy:port params="no-query default" # Get user and password if [ "$(echo $var | grep "@")" ]; then # Parse user and password user_pass="login=$(echo $var | grep -oP "\w+:\w+" | head -n1)" params="$params $user_pass" else params="$params login=PASSTHRU" fi # Get proxy name/IP and port proxy_port="$(echo $var | grep -oP "[\w\.]+[:]{0,1}\d*$")" proxy="$(echo $proxy_port | grep -oP "^[\w\.]+")" port="$(echo $proxy_port | grep -oP ":\d+$" | tr -d ':')" [ -z "$proxy" ] && continue [ -z "$port" ] && port=80 parent_proxy="cache_peer $proxy parent $port 0 $params" if [ -z "$(cat /etc/squid3/squid.conf | grep "cache_peer $proxy")" ]; then echo "Adding $parent_proxy" echo $parent_proxy >> /etc/squid3/squid.conf fi done } create_log_dir create_cache_dir configure_parent_proxy # allow arguments to be passed to squid3 if [[ ${1:0:1} = '-' ]]; then EXTRA_ARGS="$@" set -- elif [[ ${1} == squid3 || ${1} == $(which squid3) ]]; then EXTRA_ARGS="${@:2}" set -- fi # default behaviour is to launch squid if [[ -z ${1} ]]; then if [[ ! -d ${SQUID_CACHE_DIR}/00 ]]; then echo "Initializing cache..." $(which squid3) -N -f /etc/squid3/squid.conf -z fi echo "Starting squid3..." exec $(which squid3) -f /etc/squid3/squid.conf -NYCd 1 ${EXTRA_ARGS} else exec "$@" fi
2b0b494f8f9d0f33d0201aef2750dc0c0d31a133
[ "Markdown", "Shell" ]
2
Markdown
roicostas/docker-squid
56382644d9fc1c89461065cd21d1ec5b86b16016
917da34b206d2926c7067b59d1b93f432c3fbb1f
refs/heads/master
<repo_name>DeclanMoody/todo-list<file_sep>/app/models/highest.rb class Highest < ApplicationRecord end <file_sep>/config/routes.rb Rails.application.routes.draw do devise_for :users # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html root to: "people#index" resources :todos post 'todos/:id', to: 'todos#completed' mount ActionCable.server => '/cable' resources :rooms get '/rooms/show', to: 'rooms#show' get '/guesses/show', to: 'guesses#show' resources :guesses resources :ai_guesses do collection do get :low get :high get :correct end end get '/ai_guesses/show', to: 'ai_guesses#show' end <file_sep>/app/controllers/ai_guesses_controller.rb class AiGuessesController < ApplicationController def index @delete = Number.delete_all @delete_low = Lowest.delete_all @delete_high = Highest.delete_all @makeh = Highest.create number: (21) @makel = Lowest.create number: (0) @delete_try = Try.delete_all @try = Try.create number: (0) end def show @lowN = Lowest.last.number @highN = Highest.last.number @low = (@lowN + 1) @high = (@highN - 1) @ai_guess = Number.create number: (rand @low..@high) @guess = Number.last.number @try_num = Try.last.number @try = (@try_num + 1) @insert = Try.create number: (@try) end def low @low = Number.last.number @insert = Lowest.create number: (@low) end def high @high = Number.last.number @insert = Highest.create number: (@high) end def correct @try = Try.last.number end end <file_sep>/app/controllers/guesses_controller.rb class GuessesController < ApplicationController def index @resetg = Guess.delete_all @resetn = Number.delete_all @guess = Number.create number: (rand 1..20) end def new @guess = Guess.new end def create @guess = Guess.new(guess_params) if @guess.save redirect_to guesses_show_path else render :new end end def show @guess = Guess.last.guess @number = Number.first.number end private def guess_params params.require(:guess).permit(:guess) end end <file_sep>/app/models/lowest.rb class Lowest < ApplicationRecord end
a45ca1c8da2aff214ec4caaefd129f52da0c0f13
[ "Ruby" ]
5
Ruby
DeclanMoody/todo-list
a79d01b895c82009ae3a6ee3678f3085f4ec86f5
75c48194722de79d9dfd7e8fbe2ae85671ee0d1f
refs/heads/master
<file_sep>import { createActions, handleActions } from "redux-actions"; const initialState = { number: 0 }; //actions export const { increment, decrement, incrementSuccess } = createActions( "INCREMENT", "DECREMENT", "INCREMENT_SUCCESS" ); //reducer const reducer = handleActions( { [increment](state) { return { number: state.number + 1 }; }, [decrement](state) { return { number: state.number - 1 }; }, [incrementSuccess](state, data) { debugger; return { number: state.number + 1 }; } }, initialState ); export default reducer; <file_sep>import { take, fork, call, put } from "redux-saga/effects"; const url = "https://jsonplaceholder.typicode.com/users"; // The watcher: watch actions and coordinate worker tasks export default function* watchFetchRequests() { while (true) { while (true) { const action = yield take("INCREMENT"); yield fork(fetchUrl, url); } } } // The worker: perform the requested task function* fetchUrl(url) { const response = yield call(testReq, url); yield put({ type: "INCREMENT_SUCCESS", response }); } const testReq = url => { return fetch(url) .then(response => response.json()) .catch(error => error) .then(data => data); }; <file_sep>import { createStore, combineReducers, applyMiddleware } from "redux"; import tasks from "../modules/tasks"; import createSagaMiddleware from "redux-saga"; import watchFetchRequests from "../sagas/saga"; const sagaMiddleware = createSagaMiddleware(); const rootReducer = combineReducers({ tasks }); const configureStore = initialState => { const store = createStore( rootReducer, initialState, applyMiddleware(sagaMiddleware) ); sagaMiddleware.run(watchFetchRequests); return store; }; export default configureStore; <file_sep>import React, { Component } from "react"; import "./App.css"; import { connect } from "react-redux"; import { increment, decrement } from "./modules/tasks"; class App extends Component { constructor(props){ super(props); this.increment = this.increment.bind(this); this.decrement = this.decrement.bind(this); } increment = () => { this.props.dispatch(increment()); } decrement = () => { this.props.dispatch(decrement()); } render() { return ( <div> <div className="App"> {this.props.tasks.number} <button onClick={this.increment}>+</button> <button onClick={this.decrement}>-</button> </div> </div> ); } } const mapStateToProps = state => { return { tasks: state.tasks }; }; export default connect(mapStateToProps)(App);
1af5df46f81bc5a72a90d858d4ef2e5386ed19b5
[ "JavaScript" ]
4
JavaScript
vitcool/incrementor
f49d39eddb6c3bb87f3e4c9e6b7261cc07f575ae
cb2339942181b137136d67fa6f5e8c8fa44a3547
refs/heads/master
<file_sep>import { Component, OnInit } from '@angular/core'; import { FetchserviceService } from '../fetchservice.service'; export interface Food { value: string; viewValue: string; } // above is for the "x" button that will delete text typed. interfaces are suggestions about how we want data to be. @Component({ selector: 'app-search', templateUrl: './search.component.html', styleUrls: ['./search.component.css'] }) export class SearchComponent { // class is like bluebprint for a house results; // just setting up a variable that we'll use later.. nothing there now but when getSearch runs it's filled with our results selectedVal; // same as above constructor(private Fetch: FetchserviceService) { } // down below, getSearch calls another service we set up, FetchserviceService, here we are just renaming it Fetch and this gives us access to getSWAPI method we set up in fetchservice. searches = [ {value: 'people', viewValue: 'People'}, {value: 'starships', viewValue: 'Ships'}, {value: 'films', viewValue: 'Films'} ]; getSearch(selected, searchTerm): void{ // we are passing in selected (from dropdown menu) and search term). we don't really need void? console.log(selected, searchTerm); this.selectedVal = selected; // you have to step into Search Component to get the selected value from the dropdown menu this.Fetch.getSWapi(selected, searchTerm) // variable fetch refers to fetch serves.. creates new instance of fetchService..step into API. .subscribe(data => { // kind of like.then.. but subscribing gives steady flow of results, fat arrow function console.log(data); this.results = data; // with that data, call it results }) } } <file_sep>import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { Observable, of } from 'rxjs'; import { SWAPI } from './SWAPI' @Injectable({ providedIn: 'root' // gives us the option the have the service called anywhere }) export class FetchserviceService { private url = `https://swapi.co/api/` constructor(private http: HttpClient) { } getSWapi(selected, searchTerm): Observable<SWAPI[]>{ return this.http.get<SWAPI[]>(`${this.url}${selected}/?search=${searchTerm}`) } } // we set the base of the URL // constructor = when we say http we mean http client (the angular menthod) // get Swapi is name of function, set up props for selected and search term, // : means telling the fuction what to expect to get back.. we are expecting an observable (window into feed of data) // SWAPI[] is empty data model, // return results
d95793b87c386380c579446b92df66c5e8423f71
[ "TypeScript" ]
2
TypeScript
kellieallen/swAPIGroupProject
897a38b1d06e4d92072418fd4405bcddd797e550
33b38436bf77023337285b808731e46bbc8de314
refs/heads/master
<repo_name>LeandroLimaPRO/projetos-covid-ma<file_sep>/RespiradorAutomIoT/HARDWARE/Src/RAIOT-Mega/src/main.cpp /* MOVIMENTO - MAKERS MA CONTRA COVID-19 DESENVOLVIDO POR LEANDRO LIMA DO NASCIMENTO ULTIMA ATUALIZAÇÃO 04/05/2020 INSTALE AS SEGUINTES BIBLIOTECAS: > https://github.com/sekdiy/FlowMeter > https://github.com/neu-rah/ArduinoMenu > https://github.com/neu-rah/PCINT > https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/NewliquidCrystal_1.3.4.zip > https://github.com/Nullkraft/Keypad */ #include <FlowMeter.h> // include the library code: #include <Wire.h> #include <LiquidCrystal_I2C.h> //INCLUSÃO DE BIBLIOTECA #include <menu.h>//menu macros and objects // SAIDAS #include <menuIO/lcdOut.h>//malpartidas lcd menu output #include <menuIO/serialOut.h> //ENTRADAS #include <menuIO/serialIn.h>//Serial input #include <menuIO/encoderIn.h>//quadrature encoder driver and fake stream #include <menuIO/keyIn.h>//keyboard driver and fake stream (for the encoder button) #if defined(__AVR_ATmega2560__) #include <menuIO/keypadIn.h> #endif #include <menuIO/chainStream.h>// concatenate multiple input streams (this allows adding a button to the encoder) /* DEFINIÇÕES DO MOTOR */ //motor_A - ponte h l298n #define IN1 9 // porta pont-h #define IN2 10 //porta ponte-h #define VA 5 //porta pwm #define BAUD_RATE 1000000 //velocidade da porta serial // definição das portas das valvulas solenoides #define V_INS 13 #define V_EXP 12 // OUTRAS DEFINIÇÕES #define PERIODO 1000 #define AMOSTRAS 100 #define VREFF 5 using namespace Menu; #if defined(__AVR_ATmega2560__) // DIRETIVA SEMPRE QUE O MEGA FOR SELECIONADO PARA COMPILAÇÃO, COMPILA O REFERIDO TRECHO DE CODIGO //DEFINIÇÃO DO TECLADO MATRIXIAL------------------------------------ const byte ROWS = 4; //four rows const byte COLS = 4; //four columns //defina os símbolos nos botões dos teclados const char hexaKeys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','-'}, {'/','0','*','+'}, }; byte rowPins[ROWS] = {51,50,49,48}; //connect to the row pinouts of the keypad byte colPins[COLS] = {47,46,45,44}; //connect to the column pinouts of the keypad //initialize an instance of class NewKeypad Keypad customKeypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); keypadIn kpad(customKeypad); #endif FlowMeter FluxoIns = FlowMeter(2); #if defined(__AVR_ATmega2560__) FlowMeter FluxoExp = FlowMeter(3); #endif //variaveis byte velocidade = 100; byte Frenquencia = 0; float sFluxoIns = 0; // float vFluxoIns = 0; // #if defined(__AVR_ATmega2560__) float sFluxoExp = 0; // float vFluxoExp = 0; // #endif float tOn = 2.0; float tOff = 5.0; /* DEFINIÇÕES DO LCD */ // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3, POSITIVE); //ENDEREÇO DO I2C E DEMAIS INFORMAÇÕES // função usada para efetuar contagem dos sensores de fluxo void Meter1ISR() { // let our flow meter count the pulses FluxoIns.count(); } #if defined(__AVR_ATmega2560__) void Meter2ISR() { // let our flow meter count the pulses FluxoIns.count(); } #endif /* MENU */ // Encoder ///////////////////////////////////// #define encA 8 #define encB 7 //this encoder has a button here #define encBtn 6 encoderIn<encA,encB> encoder;//simple quad encoder driver #define ENC_SENSIVITY 4 encoderInStream<encA,encB> encStream(encoder,ENC_SENSIVITY);// simple quad encoder fake Stream keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low keyIn<1> encButton(encBtn_map);//1 is the number of keys //#define LEDPIN A3 // ================ menus===================== //apresenta tela de parametros de configurações no MENU //input from the encoder + encoder button + serial serialIn serial(Serial); #if defined(__AVR_ATmega2560__) menuIn* inputsList[]={&encStream,&encButton, &serial, &kpad}; chainStream<4> in(inputsList);//3 is the number of inputs #else menuIn* inputsList[]={&encStream,&encButton, &serial}; chainStream<3> in(inputsList);//3 is the number of inputs #endif MENU(mainMenu, "MAKERMA RESPIRADOR V1.0" ,doNothing ,noEvent ,wrapStyle ,FIELD(vFluxoIns,"Fl.Ins","L/min", 0.00,100.00,10,1,doNothing, noEvent, noStyle) #if defined(__AVR_ATmega2560__) ,FIELD(vFluxoExp,"Fl.Ins","L/min", 0.00,100.00,10,1,doNothing, noEvent, noStyle) #endif //,FIELD(tOn,"t.Insp","s", 0,20.00,1,0.05,doNothing, noEvent, noStyle) ,FIELD(tOn,"t.Ins","s", 0,20.00,1,0.05,doNothing, noEvent, noStyle) ,FIELD(tOff,"t.Exp","s", 0,20.00,1,0.05,doNothing, noEvent, noStyle) ,FIELD(Frenquencia,"Freq.","/Min", 0,100,10,1,doNothing, noEvent, noStyle) ,FIELD(velocidade,"Vel.M","%", 0,100,10,1,doNothing, noEvent, noStyle) ,EXIT("<") ); // #define MAX_DEPTH 2 MENU_OUTPUTS(out,MAX_DEPTH ,SERIAL_OUT(Serial) ,LCD_OUT(lcd,{0,0,16,2}) ); NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);//o objeto raiz de navegação byte analogA0 =0; #define pinA A0 /////////////////////////////////// void setup() { lcd.begin(16,2); lcd.backlight(); //LIGA O BACKLIGHT (LUZ DE FUNDO) //nav.idleTask= idle;//apontar uma função a ser usada quando o menu estiver suspenso //nav.showTitle=false; // PRINTA ENTRADA DO DISPLAY LCD. lcd.setCursor(0, 0); lcd.print("MAKERS MA v1.0"); lcd.setCursor(0, 1); lcd.print("www.makersma.com.br"); delay(3000); lcd.setCursor(0, 0); lcd.print(" Contra o "); lcd.setCursor(0, 1); lcd.print(" COVID-19 "); delay(3000); lcd.setCursor(0, 0); lcd.print(" Ventilador "); lcd.setCursor(0, 1); lcd.print(" Mecanico "); delay(3000); // ESTADOS PORTAS DA PONT-H pinMode(IN1,OUTPUT); pinMode(IN2,OUTPUT); pinMode(VA,OUTPUT); // ESTADOS PORTAS DAS VALVULAS pinMode(V_INS,OUTPUT); pinMode(V_EXP,OUTPUT); // ESTADOS DAS PORTAS DOS SENSORES OU INPUTS pinMode(pinA,INPUT); pinMode (encA,INPUT); //DEFINE O PINO COMO ENTRADA pinMode (encB,INPUT); //DEFINE O PINO COMO ENTRADA pinMode (encBtn,INPUT_PULLUP); //DEFINE O PINO COMO ENTRADA encoder.begin(); //DEFINE BAUD-RATE DA SERIAL Serial.begin(BAUD_RATE); // habilitar uma chamada para uma função auxiliar em todas as extremidades ascendentes attachInterrupt(INT1, Meter1ISR, RISING); #ifdef ARDUINO_MEGA attachInterrupt(INT1, Meter2ISR, RISING); #endif delay(2000); } //CALCULA E COMUTA AS VALVULAS COM BASE NOS TEMPOS INFORMADOS DE TEMPO ON E OFF bool blink(int timeOn,int timeOff) { return millis()%(unsigned long)(timeOn+timeOff)<(unsigned long)timeOn; } void sistema_respiratorio(){ } // CALCULA O NUMERO DE AMOSTRAS DA ENTRADA ANALOGICA (SEM DELAY) float Amostras(int valor_do_pino){ float medidas=0; // float valores[AMOSTRAS]={}; // float desvio=0; // float calc =0; //média for (int i = 0; i < AMOSTRAS; i++) { //valores[i] = float(valor_do_pino); medidas = medidas + float(valor_do_pino); } /* for (int p = 0; p < AMOSTRAS; p++){ calc = calc + sq(valores[p]- (medidas/AMOSTRAS)); } //desvio padrão Serial.println("~~~:" + String(sqrt(calc/AMOSTRAS)));*/ return medidas/AMOSTRAS; } //CALCULA O VREFF NA PORTA ANALOGICA A0 float vreff_f(){ return (VREFF - float(analogRead(A0)/1023)); } // CALCULO DA FUNÇÃO DE TRANFERENCIA DO SENSOR DE PRESSÃO NXP 3050D float valuePressao (float valueanalog){ return ((0.2*float(valueanalog/1023))-0.04)/0.018; } float PressaocmH20 (float pressao){ return pressao*10.197442889221; } void loop() { // parte de coleta de valores dos sensores vFluxoIns = FluxoIns.getCurrentFlowrate(); // OBTEM O FLUXO DE AR DO SENSOR DE FLUXO DE INSPIRAÇÃO #ifdef defined(__AVR_ATmega2560__) vFluxoExp = FluxoExp.getCurrentFlowrate(); //OBTEM O FLUXO DE AR DO SENSOR DE FLUXO DA EXPIRAÇÃO #endif //parte de calculos dos sensores float pressaokpa = valuePressao(Amostras(analogRead(A1))); float pressaocmh20 = PressaocmH20(pressaokpa); Frenquencia = 60/(tOn+tOff); // CALCULA COMUTAÇÃO DAS VALVULAS PARA DETERMINAR A FREQUENCIA byte pwmva = map(velocidade, 0,100,0,255); // CALCULA O PARAMENTRO DE VELOCIDADE DO MOTOR EM RELAÇÃO A SAIDA DE BIT //parte de controle dos atuadores // controle de valvulas atravez de blink (tempo off e tempo on) - bangbang digitalWrite(V_EXP, !blink(tOn*1000,tOff*1000)); // DEVARIA A COMUTAÇÃO DAS VALVULAS EM SEGUNDOS (T*1000) digitalWrite(V_INS, blink(tOn*1000,tOff*1000)); // DEVARIA A COMUTAÇÃO DAS VALVULAS EM SEGUNDOS (T*1000) //controle via pont-h analogWrite(VA, pwmva); // pwm da velocidade do motor digitalWrite(IN1,HIGH); // IN1 HIGH digitalWrite(IN2,LOW); // IN2 LOW //atualização da interface grafica // menu de configuração e parametros nav.poll(); // verifica menu em estado Idle (se estiver apresenta dados dos sensores if (nav.sleepTask) { lcd.setCursor(0,0); lcd.print("Fl.Ins:" + String(vFluxoIns)); //Serial.println("Fl.Ins:" + String(vFluxoIns) + "L/min"); lcd.setCursor(0,1); lcd.print("P: " + String(pressaocmh20) + "cmH20"); Serial.println("Vref:" + String(analogRead(A1)) + "B ||" + "P: " + String(pressaocmh20) + "cmH20 ...." + String(pressaokpa) + " Kpa"); #if defined(__AVR_ATmega2560__) lcd.setCursor(0,1); lcd.print("Fl.Exp:" + String(vFluxoExp)); Serial.println("Fl.Exp:" + String(vFluxoExp)); #endif } // OUTRAS ATUALIZAÇÕES A SEREM REALIZADAS A CADA 1 SEGUNDO if(blink(PERIODO,PERIODO)){ FluxoIns.tick(PERIODO); #ifdef ARDUINO_MEGA FluxoExp.tick(PERIODO); #endif } }<file_sep>/VentiladorAutomIoT/README.md # Respirador Automático IoT ## Descrição ### Especificações Técnicas mínimas : Compatível com Puritan Bennett 560, Trilogy 100 ou similar O Ventilador fornece suporte ventilatório contínuo ou intermitente para o tratamento de pacientes pediátricos que precisam de ventilação mecânica, pesando pelo menos 5 Kg com volumes corrente de pelo menos 50 ml. Adaptado para os ambientes do paciente e do clínico, o ventilador oferece 2 tipos de circuito, com porta de expiração ou válvula, fornecendo ventilação com controle de volume ou controle de pressão através de interfaces não - invasivas ou invasivas, para atender às necessidades de pacientes adultos e pediátricos igualmente (> 5 kg) Ventilador portátil com bateria que dura de 6 a 8 horas, interna e removível, fornecendo autonomia contínua e oferecendo aos pacientes liberdade. Sistema de Monitoramento: é equipado com um cartão de memória SD de 1GB que armazena até 1 ano de dados de ventilação. Esses dados são monitorado software, que administra. ### Especificações técnicas Puritan Bennett™ Ventilador 560 #### MODOS de ventilação: CPAP, PSV, P A/C, V A/C, V SIMV, P SIMV - Pressão controlada/assistida (PC/A); - Volume controlado/assistido (VC/A); - Pressão de suporte (PSV); - Pressão positiva contínua vias aéreas (CPAP); ##### ESPECIFICAÇÕES DE PARÂMETRO DE DESEMPENHO Volume da 50 a 2000mL Pressão da 5 a 55mbar Tempo Insp. da 0.3 a 2.4 s Frequência da 1 a 60 bpm Sensibilidade Inspiratória da 1 a 5 Sensibilidade Expiratória dal 5 al 95% Campo Visual Vt Vt x 1 a Vt x 2 I/T da 20% a 50% #### ESPECIFICAÇÕES DO PARÂMETRO MONITORADO - Pressão do Pico Inspiratório da 0 a 99 mbar - Pressão Expiratória Final Positiva (PEEP) da 0 a 99 mbar - Volume Corrente Inspiratório (VTI) da 0 a 9999 ml - Volume Corrente Expiratório (VTE) da 20 a 9999 ml - Frequência de Respiração Total (Rtot) da 0 a 99 ml - Razão I:E (I:E) da 9.9:1 a 1:9.9 - Razão I/T (I/T) da 0 a 100% - Tempo Inspiratório (Tempo I) da 0 a 9.9 s - Tempo Expiratório (Tempo E) da 0 a 59.9 s - Volume Minuto Inspiratório (Min VI) da 0 a 99.9 l - Campo Visual Vt Vt x 1 a Vt x 2 - FiO2 da 0 a 99% - Vazão da 0 a 200 lpm - Indice de Apneia (AI) da 0 a 99 ev/h - Tempo de Apneia da 0 a 999 s % - Espontânea (Spont) da 0 a 100% #### ITENS DESCARTÁVEIS - Bloqueio expiratório de uso único - Filtro combinado de entrada de ar - Circuito paciente adulto de extremidade - dupla com válvula expiratória, 180 cm PVC - Circuito paciente pediátrico de extremidade dupla com válvula expiratória, 180 cm PVC - Circuito paciente adulto de extremidade única com válvula expiratória, 180 cm PVC - Circuito paciente pediátrico de extremidade única com válvula expiratória, 180 cm PVC - Circuito paciente adulto de extremidade única sem válvula expiratória, 180 cm PVC - Circuito paciente pediátrico de extremidade única sem válvula expiratória, 180 cm PVC - Válvula Expiratória de 2 Vias para uso com Circuito de Extremidade - Dupla Válvula Expiratória de 3 Vias para uso com Circuito de Extremidade Único ## Diagramas ![Alt Text](https://github.com/LeandroLimaPRO/projetos-covid-ma/blob/master/RespiradorAutomIoT/HARDWARE/Imagens/f2.jpeg?raw=true) ![Alt Text](https://github.com/LeandroLimaPRO/projetos-covid-ma/blob/master/RespiradorAutomIoT/MEC%C3%82NICA/Imagens/f1.jpg?raw=true) ### Eletrônico ![Alt Text](https://github.com/LeandroLimaPRO/projetos-covid-ma/blob/master/RespiradorAutomIoT/HARDWARE/Imagens/f1.jpg?raw=true) ### Mecânica ![Alt Text](https://github.com/LeandroLimaPRO/projetos-covid-ma/blob/master/RespiradorAutomIoT/MEC%C3%82NICA/Imagens/Fluxograma%20Respirador%20-%20RAIOT%20V1.jpg?raw=true) ## Lista de Materiais ### Elétrico/eletrônico ### Mecânico ## Problemas ## Parceiros ### Governo do Estado do Maranhão ## Libs e créditos <file_sep>/VentiladorAutomIoT/HARDWARE/ControladorVentilador/src/ControladorVentilador.ino /* MOVIMENTO - MAKERS MA CONTRA COVID-19 DESENVOLVIDO POR LEANDRO LIMA DO NASCIMENTO ULTIMA ATUALIZAÇÃO 12/05/2020 VERSÃO: RSP-1 INSTALE AS SEGUINTES BIBLIOTECAS: > https://github.com/sekdiy/FlowMeter > https://github.com/neu-rah/ArduinoMenu > https://github.com/neu-rah/PCINT > https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/NewliquidCrystal_1.3.4.zip > https://github.com/Nullkraft/Keypad > https://github.com/RobTillaart/Arduino/tree/master/libraries/Statistic ------------------ PINAGEM --------------------- --SENSORES = PINO ARDUINO MEGA //DESC FLUXO 1 = 2 FLUXO 2 = 3 PRESSÃO 1 = A1 PRESSÃO 2 = A2 VREF = A0 (CONECTE UM JUMPER ENTRE 5V E A0) --ENTRADAS = PINO ARDUINO MEGA ENCODER{EN1, EN2, SW} = {8,7,6} KEYBOARD{4X4} = {51,50,49,48}{47,46,45,44} -- ATUADORES = PINO ARDUINO MEGA // DESCR VAL_INS = 13 // VALVULA DE INPIRAÇÃO VAL_EXP = 12 // VALVULA DE EXPIRAÇÃO VAL_ESC = 11 // VALVULA DE ESCAPE >MOTOR DE PASSO PARA TESTE DE VALVULA PROPORCIONAL STEP 9 // STEP DIR 10 //DIR ENA 5 //ENABLE BUZER = 4 // SOM -- SAIDAS DE DADOS SERIAL = TX0 RX0 I2C = SDL SCL *//////////////////////////////////////////////// #include "Statistic.h" #include <AccelStepper.h> #include <FlowMeter.h> // include the library code: #include <Wire.h> #include <LiquidCrystal_I2C.h> //INCLUSÃO DE BIBLIOTECA #include <menu.h>//menu macros and objects // SAIDAS #include <menuIO/lcdOut.h>//malpartidas lcd menu output #include <menuIO/serialOut.h> //ENTRADAS #include <menuIO/serialIn.h>//Serial input #include <menuIO/encoderIn.h>//quadrature encoder driver and fake stream #include <menuIO/keyIn.h>//keyboard driver and fake stream (for the encoder button) #if defined(__AVR_ATmega2560__) #include <menuIO/keypadIn.h> #endif #include <menuIO/chainStream.h>// concatenate multiple input streams (this allows adding a button to the encoder) //#define AMBU // habilita funções do ambu #define LCD_INIT_DEBUG //habilita apresentação no lcd /* DEFINIÇÕES DO MOTOR */ //sensores analogicos #define sensorP1 A1 #define sensorP2 A2 #define sensorP3 A3 #define sensorFIO2 A4 //motor_A - ponte h l298n #ifdef AMBU #define IN1 9 // porta pont-h #define IN2 10 //porta ponte-h #define VA 5 //porta pwm #endif ///////////////////////////////////////////////////////////////////// ////////////////VALVULA CONTROLADA POR MOTOR DE PASSO//////////////// #define VAL_STEP #ifdef VAL_STEP #define STEP 9 // STEP #define DIR 10 //DIR #define ENA 5 //ENABLE #define ACEL 100 #define SPEED 40 #define PASSOS_POR_GIRO 200 AccelStepper motor1(ENA,STEP,DIR ); #endif // definição das portas das valvulas solenoides #define V_INS 13 // VALVULA DE INSPIRAÇÃO #define V_EXP 12 // VALVULA DE EXPIRAÇÃO #define V_ESC 11 // VALVULA DE ESCAPE // OUTRAS DEFINIÇÕES #define PERIODO 250 #define AMOSTRAS 10 #define VREFF 5 #define BAUD_RATE 1000000 //velocidade da porta serial #define VERSION 006 using namespace Menu; #if defined(__AVR_ATmega2560__) // DIRETIVA SEMPRE QUE O MEGA FOR SELECIONADO PARA COMPILAÇÃO, COMPILA O REFERIDO TRECHO DE CODIGO //DEFINIÇÃO DO TECLADO MATRIXIAL------------------------------------ const byte ROWS = 4; //four rows const byte COLS = 4; //four columns //defina os símbolos nos botões dos teclados const char hexaKeys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','-'}, {'/','0','*','+'}, }; byte rowPins[ROWS] = {53,52,51,50}; //connect to the row pinouts of the keypad byte colPins[COLS] = {49,48,47,46}; //connect to the column pinouts of the keypad //initialize an instance of class NewKeypad Keypad customKeypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); keypadIn kpad(customKeypad); #endif FlowMeter FluxoIns = FlowMeter(2); #if defined(__AVR_ATmega2560__) FlowMeter FluxoExp = FlowMeter(3); #endif Statistic p1Stats; Statistic p2Stats; Statistic p3Stats; //variaveis byte velocidade = 100; byte Frenquencia = 0; byte FIO2=0; byte sFrenquencia = 0; bool ciclo_respiratorio = LOW; float tempoIns=0; float tempoExp=0; bool calibrou = false; float sFluxoIns = 0; // float vFluxoIns = 0; // #if defined(__AVR_ATmega2560__) float sFluxoExp = 0; // float vFluxoExp = 0; // #endif float pressaokpa; float pExpcmh20; float pInscmh20; float pDifcmh20; float pressaoPeep; float pressaoMax; //float tOn = 2.0; //float tOff = 5.0; long now; long last; long now_fluxo; long last_fluxo; #define PERIODO_FLUXO 1000 byte modeOP= 0; bool start_sys= LOW; bool assistido = LOW; /* DEFINIÇÕES DO LCD */ // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3, POSITIVE); //ENDEREÇO DO I2C E DEMAIS INFORMAÇÕES // função usada para efetuar contagem dos sensores de fluxo void Meter1ISR() { // let our flow meter count the pulses FluxoIns.count(); } #if defined(__AVR_ATmega2560__) void Meter2ISR() { // let our flow meter count the pulses FluxoExp.count(); } #endif /* MENU */ // Encoder ///////////////////////////////////// #define encA 8 #define encB 7 //this encoder has a button here #define encBtn 6 encoderIn<encA,encB> encoder;//simple quad encoder driver #define ENC_SENSIVITY 4 encoderInStream<encA,encB> encStream(encoder,ENC_SENSIVITY);// simple quad encoder fake Stream keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low keyIn<1> encButton(encBtn_map);//1 is the number of keys //#define LEDPIN A3 // ================ menus===================== //apresenta tela de parametros de configurações no MENU //input from the encoder + encoder button + serial serialIn serial(Serial); #if defined(__AVR_ATmega2560__) menuIn* inputsList[]={&encStream,&encButton, &serial, &kpad}; chainStream<4> in(inputsList);//3 is the number of inputs #else menuIn* inputsList[]={&encStream,&encButton, &serial}; chainStream<3> in(inputsList);//3 is the number of inputs #endif // opção de modo de operação SELECT(modeOP,mode_OP,"M.Op",doNothing,noEvent,wrapStyle ,VALUE("PCV",0,doNothing,noEvent) ,VALUE("VCV",1,doNothing,noEvent) ); // botão sim ou não para start TOGGLE(start_sys,start_Sys,"Start",doNothing,noEvent,wrapStyle ,VALUE("S",HIGH,doNothing,noEvent) ,VALUE("N",LOW,doNothing,noEvent) ); // botão sim ou não para ativar modo assistivo TOGGLE(assistido,Assistido,"Ass.",doNothing,noEvent,wrapStyle ,VALUE("S",HIGH,doNothing,noEvent) ,VALUE("N",LOW,doNothing,noEvent) ); // janela de parametros principais MENU(mainMenu, "Menu MKRS V1.0" ,doNothing ,noEvent ,wrapStyle ,FIELD(sFrenquencia,"Freq.","/min", 0,100,10,1,doNothing, noEvent, noStyle) // PARAMETRO DE FREQUENCIA ,FIELD(tempoIns,"T.Ins","s", 0,20.00,1,0.05,doNothing, noEvent, noStyle) // PARAMETRO DE TEMPO INSPIRATORIO ,FIELD(sFluxoIns,"Fl.Ins","L/min", 0.00,100.00,1,0.1,doNothing, noEvent, noStyle) // FREQUENCIA DE FLUXO INSP ,FIELD(pressaoPeep,"P.Peep","cmH2O", 0.00,100.00,1.0,0.05,doNothing, noEvent, noStyle) // FREQUENCIA DE FLUXO INSP ,FIELD(pressaoMax,"P.Max","cmH20", 0.00,100.00,1.0,0.05,doNothing, noEvent, noStyle) // FREQUENCIA DE FLUXO INSP ,FIELD(FIO2,"FIO2","%", 0,100,10,1,doNothing, noEvent, noStyle) // FREQUENCIA DE FLUXO INSP ,SUBMENU (mode_OP) ,SUBMENU (start_Sys) ,SUBMENU (Assistido) //,FIELD(tOn,"t.Insp","s", 0,20.00,1,0.05,doNothing, noEvent, noStyle) #ifdef AMBU ,FIELD(tempoExp,"t.Exp","s", 0,20.00,1,0.05,doNothing, noEvent, noStyle) ,FIELD(velocidade,"Vel.M","%", 0,100,10,1,doNothing, noEvent, noStyle) #if defined(__AVR_ATmega2560__) ,FIELD(vFluxoExp,"Fl.Exp","L/min", 0.00,100.00,10,1,doNothing, noEvent, noStyle) #endif #endif ,EXIT("<") ); // #define MAX_DEPTH 2 MENU_OUTPUTS(out,MAX_DEPTH ,SERIAL_OUT(Serial) ,LCD_OUT(lcd,{0,0,16,2}) ); NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);//o objeto raiz de navegação byte analogA0 =0; #define pinA A0 //CALCULA E COMUTA AS VALVULAS COM BASE NOS TEMPOS INFORMADOS DE TEMPO ON E OFF bool blink(int timeOn,int timeOff) { return millis()%(unsigned long)(timeOn+timeOff)<(unsigned long)timeOn; } void debug_lcd(){ lcd.begin(16,2); lcd.backlight(); //LIGA O BACKLIGHT (LUZ DE FUNDO) lcd.setCursor(0, 0); lcd.print("MAKERS MA V" + String(VERSION)); lcd.setCursor(0, 1); lcd.print(F("www.makersma.com.br")); delay(3000); lcd.setCursor(0, 0); lcd.print(" Contra o "); lcd.setCursor(0, 1); lcd.print(" COVID-19 "); delay(3000); lcd.setCursor(0, 0); lcd.print(" Ventilador "); lcd.setCursor(0, 1); lcd.print(" Mecanico "); delay(3000); } /////////////////////////////////// ////////////////////////////////////////// //////// FUNÇÕES DA VALVULA CONTROLADA POR MOTOR DE PASSOS #ifdef VAL_STEP void valvula_fluxo_por_giro(float vfluxo){ if (vfluxo > sFluxoIns){ motor1.move(-PASSOS_POR_GIRO); motor1.run(); } else if( vfluxo < sFluxoIns){ motor1.move(PASSOS_POR_GIRO); motor1.run(); } } void calibra(){ if(!blink(2000,1000)){ if(calibrou==false){ if (sFluxoIns>0){ valvula_fluxo_por_giro(0); } else{ calibrou=true; } } } } #endif ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ////////////// SETUP //////////////////////////////////// ///////////////////////////////////////////////////////// void setup() { #ifdef VAL_STEP pinMode(ENA, OUTPUT); pinMode(STEP, OUTPUT); pinMode(DIR, OUTPUT); // Configuracoes iniciais motor de passo motor1.setMaxSpeed(50); motor1.setAcceleration(10); #endif p1Stats.clear(); p2Stats.clear(); p3Stats.clear(); //nav.idleTask= idle;//apontar uma função a ser usada quando o menu estiver suspenso //nav.showTitle=false; // PRINTA ENTRADA DO DISPLAY LCD. #ifdef LCD_INIT_DEBUG debug_lcd(); #endif #ifdef AMBU // ESTADOS PORTAS DA PONT-H pinMode(IN1,OUTPUT); pinMode(IN2,OUTPUT); pinMode(VA,OUTPUT); #endif // ESTADOS PORTAS DAS VALVULAS pinMode(V_INS,OUTPUT); pinMode(V_EXP,OUTPUT); pinMode(V_ESC,OUTPUT); // ESTADOS DAS PORTAS DOS SENSORES OU INPUTS pinMode(pinA,INPUT); pinMode (encA,INPUT); //DEFINE O PINO COMO ENTRADA pinMode (encB,INPUT); //DEFINE O PINO COMO ENTRADA pinMode (encBtn,INPUT_PULLUP); //DEFINE O PINO COMO ENTRADA encoder.begin(); pinMode(sensorP1,INPUT); pinMode(sensorP2,INPUT); pinMode(sensorP3,INPUT); //DEFINE BAUD-RATE DA SERIAL Serial.begin(BAUD_RATE); // habilitar uma chamada para uma função auxiliar em todas as extremidades ascendentes attachInterrupt(INT0, Meter1ISR, RISING); #ifdef ARDUINO_MEGA attachInterrupt(INT1, Meter2ISR, RISING); #endif delay(2000); } // CALCULA O NUMERO DE AMOSTRAS DA ENTRADA ANALOGICA (SEM DELAY) float Amostras(int valor_do_pino){ float medidas=0; // float valores[AMOSTRAS]={}; // float desvio=0; // float calc =0; //média for (int i = 0; i < AMOSTRAS; i++) { //valores[i] = float(valor_do_pino); medidas = medidas + float(valor_do_pino); } /* for (int p = 0; p < AMOSTRAS; p++){ calc = calc + sq(valores[p]- (medidas/AMOSTRAS)); } //desvio padrão Serial.println("~~~:" + String(sqrt(calc/AMOSTRAS)));*/ return medidas/AMOSTRAS; } //CALCULA O VREFF NA PORTA ANALOGICA A0 float vreff_f(){ return (VREFF - float(analogRead(A0)/1023)); } // CALCULO DA FUNÇÃO DE TRANFERENCIA DO SENSOR DE PRESSÃO NXP 3050D float MXP5700Pressao (float valueanalog){ return ((float((valueanalog/1023))-0.04)/0.0012858); } float MXP5050DPressao (float valueanalog){ return ((float((valueanalog/1023))-0.04)/0.018); } float MXP5010DPressao (float valueanalog){ return ((float((valueanalog/1023))-0.04)/0.09); } float PressaocmH20 (float pressao){ return pressao*10.197442889221; } // CALCULA O TEMPO RESPIRATORIO float Calculatemporespiratorio(byte ciclos){ return 60/ciclos; } // CALCULA TEMPO EXPIRATORIO float Calculatempoexpiratorio(float temporespiratorio){ return temporespiratorio - tempoIns; } /// SISTEMA DE INSPIRAÇÃO E EXPIRAÇÃO void PCV_inspiratorio(){ // SE PRESSÃO FOR MENOR QUE PRESSÃO MAXIMA if (pInscmh20 < pressaoMax){ #ifdef VAL_STEP valvula_fluxo_por_giro(vFluxoIns); #endif digitalWrite(V_INS,HIGH); // LIGA VALVULA DE INPIRAÇÃO digitalWrite(V_EXP,LOW); // DESLIGA VALVULA DE EXPIRAÇÃO digitalWrite(V_ESC,LOW); // DESLIGA VALVULA DE ESCAPE }else { digitalWrite(V_INS,HIGH); // LIGA VALVULA INS digitalWrite(V_EXP,LOW); // DESLIGA VALVULA EXP digitalWrite(V_ESC,HIGH); // LIGA VALVULA ESCAPE } } void PCV_expiratorio(){ // se pressão peep for menor que pressão de ciclo if(pressaoPeep < pInscmh20 && pInscmh20 < pressaoMax){ digitalWrite(V_INS,LOW); // DESLIGA VALVULA INS digitalWrite(V_EXP,HIGH); // LIGA VALVULA EXP digitalWrite(V_ESC,LOW); // DESLIGA VALV. ESCAPE } else if (pInscmh20 > pressaoMax){ digitalWrite(V_INS,LOW); // DESLIGA VALVULA INS digitalWrite(V_EXP,HIGH); // LIGA VALVULA EXP digitalWrite(V_ESC,HIGH); // DESLIGA VALV. ESCAPE } else{ //se (respiração assistida) if(assistido){ PCV_inspiratorio(); } else{ } } } void stand_by_sis(){ //abre todas as valvulas. digitalWrite(V_INS,HIGH); // digitalWrite(V_EXP,HIGH); // digitalWrite(V_ESC,HIGH); // } bool page2; void PCV(){ if(blink(tempoIns*1000, tempoExp*1000)){ ciclo_respiratorio = HIGH; PCV_inspiratorio(); } else{ ciclo_respiratorio = LOW; PCV_expiratorio(); } // oque mostar pós menu/ fora do menu if(nav.sleepTask){ if(now - last >= PERIODO){ last=now; Serial.println("PIns "+ String(pInscmh20)+"cmH2O " + "..Pexp " +String(pExpcmh20) + "cmH2O"+ "..PDif " +String(pDifcmh20) + "cmH2O"+"P.Peep "+ String(pressaoPeep)+" P.Max "+ String(pressaoMax) + "|||"+ "Calib.Val "+ String(calibrou) + " T.Ins" + String(tempoIns)+ "T.Exp"+ String(tempoExp) + "||Desv. "+ String(p1Stats.pop_stdev())); if(blink(5000,5000)){ lcd.setCursor(0,0); lcd.print("Pi:" + String(pInscmh20) +"cmH2O"); lcd.setCursor(0,1); lcd.print("Fi:" + String(vFluxoIns)+ "L/min"); }else{ lcd.setCursor(0,0); lcd.print("Pe:" + String(pExpcmh20) +"cmH2O"); lcd.setCursor(0,1); #ifdef defined(__AVR_ATmega2560__) lcd.print("Fe:" + String(vFluxoExp) + "L/min"); #else lcd.print("Desvio "+ String(p1Stats.pop_stdev())); #endif } } } } void CVC(){ //INSERIR CODIGO PARA MODO CVC; Serial.println("CVC!!! SISTEMA"); } void sistema_respiratorio(bool start_process){ //obtem valor de start if(start_process){ switch (modeOP){ case 0: PCV(); break; case 1: CVC(); break; default: stand_by_sis(); break; } //obtem e define o ciclo de cada persona } else{ stand_by_sis(); } } void loop() { Frenquencia= Calculatemporespiratorio(sFrenquencia); tempoExp = Calculatempoexpiratorio(Frenquencia); p1Stats.add(analogRead(sensorP1)); p2Stats.add(analogRead(sensorP2)); p3Stats.add(analogRead(sensorP3)); // parte de coleta de valores dos sensores* vFluxoIns = FluxoIns.getCurrentFlowrate(); // OBTEM O FLUXO DE AR DO SENSOR DE FLUXO DE INSPIRAÇÃO #ifdef defined(__AVR_ATmega2560__) vFluxoExp = FluxoExp.getCurrentFlowrate(); //OBTEM O FLUXO DE AR DO SENSOR DE FLUXO DA EXPIRAÇÃO #endif #ifdef VAL_STEP calibra(); #endif //parte de calculos dos sensores // CALCULA SOMENTE QUANDO HOUVER MAIS DE 1000 AMOSTRAS. if(p1Stats.count() == AMOSTRAS){ pExpcmh20 = PressaocmH20(MXP5010DPressao(p1Stats.average())); p1Stats.clear(); } if(p2Stats.count() == AMOSTRAS){ pInscmh20 = PressaocmH20(MXP5010DPressao(p2Stats.average())); p2Stats.clear(); } if(p3Stats.count() == AMOSTRAS){ pDifcmh20 = PressaocmH20(MXP5700Pressao(p3Stats.average())); p3Stats.clear(); } nav.poll(); #ifdef AMBU Frenquencia = 60/(tOn+tOff); // CALCULA COMUTAÇÃO DAS VALVULAS PARA DETERMINAR A FREQUENCIA byte pwmva = map(velocidade, 0,100,0,255); // CALCULA O PARAMENTRO DE VELOCIDADE DO MOTOR EM RELAÇÃO A SAIDA DE BIT //parte de controle dos atuadores // controle de valvulas atravez de blink (tempo off e tempo on) - bangbang digitalWrite(V_EXP, !blink(tOn*1000,tOff*1000)); // DEVARIA A COMUTAÇÃO DAS VALVULAS EM SEGUNDOS (T*1000) digitalWrite(V_INS, blink(tOn*1000,tOff*1000)); // DEVARIA A COMUTAÇÃO DAS VALVULAS EM SEGUNDOS (T*1000) //controle via pont-h analogWrite(VA, pwmva); // pwm da velocidade do motor digitalWrite(IN1,HIGH); // IN1 HIGH digitalWrite(IN2,LOW); // IN2 LOW //atualização da interface grafica // menu de configuração e parametros nav.poll(); // verifica menu em estado Idle (se estiver apresenta dados dos sensores if (nav.sleepTask) { lcd.setCursor(0,0); lcd.print("Fl.Ins:" + String(vFluxoIns)); //Serial.println("Fl.Ins:" + String(vFluxoIns) + "L/min"); lcd.setCursor(0,1); lcd.print("P: " + String(pInscmh20) + "cmH20"); Serial.println("Vref:" + String(analogRead(A1)) + "B ||" + "P: " + String(pInscmh20) + "cmH20 ...." + String(pressaokpa) + " Kpa" + "||Desvio" + String(p1Stats.pop_stdev()) + "..min" + String(p1Stats.minimum()) + "..max" + String(p1Stats.maximum())); #if defined(__AVR_ATmega2560__) lcd.setCursor(0,1); lcd.print("Fl.Exp:" + String(vFluxoExp)); Serial.println("Fl.Exp:" + String(vFluxoExp)); #endif #endif //if(blink(10,10)){} // OUTRAS ATUALIZAÇÕES A SEREM REALIZADAS A CADA 1 SEGUNDO now_fluxo = millis(); if(now_fluxo -last_fluxo >= PERIODO_FLUXO){ last_fluxo = now_fluxo; FluxoIns.tick(PERIODO_FLUXO); #ifdef ARDUINO_MEGA FluxoExp.tick(PERIODO_FLUXO); #endif } sistema_respiratorio(start_sys); // now = millis(); }<file_sep>/RespiradorAutomIoT/HARDWARE/Src/RAIOT-UNO/src/main.cpp /******************** Arduino generic menu system control led on/off delays <NAME> - <EMAIL>(<EMAIL> output: Serial input: Serial mcu: nano328p */ #include <Arduino.h> #include <menu.h> #include <menuIO/serialOut.h> #include <menuIO/chainStream.h> #include <menuIO/serialIn.h> #include <menuIO/keyIn.h> /*PINAGENS*/ //LCD //butões #define B_UP 8 #define B_DOWN 9 #define B_LEFT 10 #define B_HEIGTH 11 #define B_ENTER 12 #define LEDPIN 13 #define MAX_DEPTH 2 #define VALV_PACIENTE 6 //VALVULA DO PACIENTE PWM FLUXO INSPIRATORIO #define VALV_EXPIRATORIA 7 //VALVULA DE EXPIRAÇÃO PWM #define SF_INSP 2 #define SF_EXP 3 /*VARIAVEIS GERAIS*/ float tInspiratorio = 1; //segundos float tExpiratorio = 2; /// Segundos float Peep = 0.5; //pressão float Fluxo = 2; // fluxo l/min int timeOn = 1; int timeOff = 10; int lastt = 0; /* INFORMAÇÕES SOBRE MENU */ using namespace Menu; MENU(configs, "Configurações", Menu::doNothing, Menu::noEvent, Menu::wrapStyle, FIELD(tInspiratorio, "T.insp", "s", 0.00, 10.00, 0.1, 1, Menu::doNothing, Menu::noEvent, Menu::noStyle), FIELD(tExpiratorio, "T.exp", "s", 0.00, 10.00, 0.1, 1, Menu::doNothing, Menu::noEvent, Menu::noStyle) //,FIELD(Peep,"PEEP","cmH2O", -5.00,5.00,10,1,Menu::doNothing, Menu::noEvent, Menu::noStyle) , EXIT("<Back")); MENU(mainMenu, "MAKERMA VENTILADOR V1.0", Menu::doNothing, Menu::noEvent, Menu::wrapStyle, FIELD(Fluxo, "Fluxo", "l/min", 0.00, 100.00, 10, 1, Menu::doNothing, Menu::noEvent, Menu::noStyle), FIELD(Peep, "PEEP", "cmH2O", -5.00, 5.00, 10, 1, Menu::doNothing, Menu::noEvent, Menu::noStyle), SUBMENU(configs), EXIT("<Back")); serialIn serial(Serial); MENU_INPUTS(in, &serial); MENU_OUTPUTS(out, MAX_DEPTH, SERIAL_OUT(Serial), NONE //must have 2 items at least ); NAVROOT(nav, mainMenu, MAX_DEPTH, in, out); void setup() { pinMode(LEDPIN, OUTPUT); Serial.begin(1000000); while (!Serial) ; Serial.println(F("MAKERMA VENTILADOR V1.0")); Serial.println(F("Use keys + - * /")); Serial.println(F("to control the menu navigation")); } bool blink(int timeOn, int timeOff) { return millis() % (unsigned long)(timeOn + timeOff) < (unsigned long)timeOn; } void loop() { if (millis() - lastt >= 1000) { lastt = millis(); Fluxo = random(0, 100); Peep = random(-4, 4); } nav.poll(); digitalWrite(LEDPIN, blink(tInspiratorio * 1000, tExpiratorio * 1000)); }
79005b547190186c7e76f25467b6a7e4d93bd01d
[ "Markdown", "C++" ]
4
C++
LeandroLimaPRO/projetos-covid-ma
233fc524b6be8c7825fca53a6b95997c5d2d526b
e3cb68a9b7c69b084038ebf80b23b845d12ecb29
refs/heads/master
<repo_name>conanskyforce/newshub<file_sep>/pages/SettingPage.js import React, {Component} from 'react'; import {StyleSheet, Text, View,Image,TouchableOpacity} from 'react-native'; import Icon from '@ant-design/react-native/lib/icon'; import { connect } from 'react-redux' import PropTypes from 'prop-types' class SettingPage extends Component { static propTypes = { collectionIds:PropTypes.array } constructor(){ super(); this.state = { selectedTab:'redTab', fitForIPhoneX:false, avatarUrl:'https://img-blog.csdn.net/20161028230559575' } } _onPressAvatarButton(){ console.log(this.props.collectionIds) console.log('_onPressAvatarButton') } render() { return ( <View style={{width:'100%',alignItems:'center',justifyContent:'center'}}> <View><Text style={styles.header}>设置</Text></View> <View style={styles.container}> <View style={styles.avatarAndUsername}> <View style={styles.avatarView}> <Image style={styles.avatarImage} source={{uri: this.state.avatarUrl}} /> </View> <View style={styles.usernameView}> <TouchableOpacity> <Text> <EMAIL> </Text> </TouchableOpacity> </View> <View style={styles.avatarAndUsernameMore}> <TouchableOpacity activeOpacity={0.5} style={{height:'100%',alignItems:'center',justifyContent:'center'}} onPress={this._onPressAvatarButton.bind(this)}> <Icon name="right" /> </TouchableOpacity> </View> </View> <View style={styles.setting}> <View style={styles.settingItemView}> <TouchableOpacity> <Text style={styles.collectionText}> 收藏 </Text> </TouchableOpacity> <View style={styles.rightMore}> <TouchableOpacity activeOpacity={0.5} style={{height:'100%',alignItems:'center',justifyContent:'center'}} onPress={this._onPressAvatarButton.bind(this)}> <Icon name="right" /> </TouchableOpacity> </View> </View> <View style={styles.settingItemView}> <TouchableOpacity> <Text style={styles.contactText}> 联系我们 </Text> </TouchableOpacity> <View style={styles.rightMore}> <TouchableOpacity activeOpacity={0.5} style={{height:'100%',alignItems:'center',justifyContent:'center'}} onPress={this._onPressAvatarButton.bind(this)}> <Icon name="right" /> </TouchableOpacity> </View> </View> <View style={styles.settingItemView}> <TouchableOpacity> <Text style={styles.aboutText}> 关于 </Text> </TouchableOpacity> <View style={styles.rightMore}> <TouchableOpacity activeOpacity={0.5} style={{height:'100%',alignItems:'center',justifyContent:'center'}} onPress={this._onPressAvatarButton.bind(this)}> <Icon name="right" /> </TouchableOpacity> </View> </View> </View> </View> </View> ); } } const mapStateToProps = (state) =>{ return { collectionIds:state.collectionIds } } SettingPage = connect(mapStateToProps)(SettingPage); export default SettingPage; const styles = StyleSheet.create({ header:{ marginTop:20, marginBottom:5, marginBottom:20, fontWeight:'500', fontSize:24, color:'black', textAlign:'center' }, container:{ width:'100%', backgroundColor:'#f8f8f8', }, avatarAndUsername:{ paddingLeft:12, paddingRight:12, height:80, borderColor:'#f1f1f1', backgroundColor:'white', borderTopWidth:1, borderBottomWidth:1, flexDirection:'row', alignItems:'center' }, avatarView:{ height:55, width:55, borderRadius:50, backgroundColor:'lightgrey', marginRight:30, }, avatarImage:{ borderRadius:5, height:55, width:55, resizeMode:'cover' }, usernameView:{ flex:8 }, avatarAndUsernameMore:{ flex:1, }, setting:{ marginTop:40, width:'100%', }, settingItemView:{ height:60, paddingLeft:12, paddingRight:12, backgroundColor:'white', borderBottomWidth:1, borderColor:'#f1f1f1', flexDirection:'row', alignItems:'center', justifyContent:'space-between' }, contactText:{ }, aboutText:{ }, contactText:{ }, rightMore:{ } });<file_sep>/App.js import React, {Component} from 'react'; import {StyleSheet, Text, View} from 'react-native'; import Button from '@ant-design/react-native/lib/button'; import Icon from '@ant-design/react-native/lib/icon'; // import SearchBar from '@ant-design/react-native/lib/search-bar'; import TabBar from '@ant-design/react-native/lib/tab-bar'; import DeviceInfo from 'react-native-device-info'; import NewsPage from './pages/NewsPage' import TechPage from './pages/TechPage' import FinPage from './pages/FinPage' import SettingPage from './pages/SettingPage' import {createStore} from 'redux' import {Provider} from 'react-redux' import reducers from './reducers/index' let store = createStore(reducers) class AppWrapper extends Component<Props> { constructor(){ super(); this.state = { selectedPage:'NewsPage', fitForIPhoneX:false, pageList:{ NewsPage, TechPage, FinPage, SettingPage, } } } renderPage(pageName){ return ( <View style={{ flex: 1, alignItems: 'center', backgroundColor: 'white' }}> {this.state.fitForIPhoneX?<View style={{height:45}}></View>:null} {pageName==='NewsPage'?<NewsPage />:(pageName=='FinPage'?<FinPage />:(pageName=='TechPage'?<TechPage />:<SettingPage/>))} </View> ) } onChangePage(pageName){ console.log(pageName) if(pageName == this.state.selectedPage){ console.log(`tap page:${pageName} twice!`) } this.setState({ selectedPage:pageName, }) } componentDidMount(){ let deviceInfo = { model: DeviceInfo.getModel(), name: DeviceInfo.getDeviceName(), sysName: DeviceInfo.getSystemName(), sysVersion: DeviceInfo.getSystemVersion() } if(deviceInfo.model=='iPhone X'){ this.setState({ fitForIPhoneX:true }) } console.log(deviceInfo); } render() { return ( <TabBar unselectedTintColor="grey" tintColor="black" barTintColor="#fff" > <TabBar.Item title="新闻" icon={<Icon name="global" />} selected={this.state.selectedPage === 'NewsPage'} onPress={() => this.onChangePage('NewsPage')} > {this.renderPage('NewsPage')} </TabBar.Item> <TabBar.Item icon={<Icon name='stock' />} title="财经" badge={0} selected={this.state.selectedPage === 'FinPage'} onPress={() => this.onChangePage('FinPage')} > {this.renderPage('FinPage')} </TabBar.Item> <TabBar.Item icon={<Icon name="apple" />} title="科技" selected={this.state.selectedPage === 'TechPage'} onPress={() => this.onChangePage('TechPage')} > {this.renderPage('TechPage')} </TabBar.Item> <TabBar.Item icon={<Icon name="user" />} title="设置" selected={this.state.selectedPage === 'SettingPage'} onPress={() => this.onChangePage('SettingPage')} > {this.renderPage('SettingPage')} </TabBar.Item> </TabBar> ); } } export default class App extends Component<Props> { render(){ return ( <Provider store={store}> <AppWrapper/> </Provider> ) } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); <file_sep>/README.md ## newshub a news collector built with react-native ### screenshots <img src="https://github.com/conanskyforce/newshub/raw/master/screenshots/fin.jpg" width="250"/><img src="https://github.com/conanskyforce/newshub/raw/master/screenshots/tech.jpg" width="250"/><img src="https://github.com/conanskyforce/newshub/raw/master/screenshots/news.jpg" width="250"/><img src="https://github.com/conanskyforce/newshub/raw/master/screenshots/setting.jpg" width="250"/> ### Todo list - detail page - collect center - login auth - avatar setting<file_sep>/reducers/index.js import {combineReducers} from 'redux' const ID_COLLECT = 'ID_COLLECT'; const ID_UNCOLLECT = 'ID_UNCOLLECT'; function collectionIdReducer(state=[], action){ switch(action.type){ case ID_COLLECT: console.log('ID_COLLECT:',state) state.push(action.id) return state; case ID_UNCOLLECT: console.log('ID_UNCOLLECT') return state.filter(id=>id!=action.id) } return state; } const reducers = combineReducers({ collectionIds: collectionIdReducer }); export const collectId = (id)=>{ return {type:ID_COLLECT,id} } export const unCollectId = (id)=>{ return {type:ID_UNCOLLECT,id} } export default reducers;
a219af744c69d298f04898d8626eb1d3b55904ff
[ "JavaScript", "Markdown" ]
4
JavaScript
conanskyforce/newshub
8e3bba15cda97615bf075da94627404543c2891c
aa7160c779a7de566c5851e9208588da9d2689ea
refs/heads/master
<repo_name>trashidi98/LeetCode-Kattis-Solutions<file_sep>/Autori.java //Link: https://open.kattis.com/problems/autori import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Noob { public static void main(String[] args) throws IOException { String initials = ""; Scanner scanr = new Scanner(System.in); String fullName = scanr.nextLine(); String[] namesArr = fullName.split("-"); for(String s: namesArr) { initials += s.substring(0, 1); } System.out.println(initials); } }<file_sep>/README.md # Welcome to my Kattis and LeetCode Solutions Currently working on them, learning how to write good, effecient and clean code while I'm at it. Enjoy! <file_sep>/QuadrantSelection.java //Link: https://open.kattis.com/problems/quadrant //Mind you this will not work on Kattis but does run on local machine, didn't have time to debug import java.util.Scanner;; public class Noob { public static void main(String[] args) { Scanner x1 = new Scanner(System.in); Scanner y1 = new Scanner(System.in); int x = Integer.parseInt(x1.nextLine()); int y = Integer.parseInt(y1.nextLine()); if((x < -1000 || x > 1000) || (y < -1000 || y > 1000)){ System.exit(0); } else if(x > 0 && y > 0) { System.out.println(1); } else if(x < 0 && y >0) { System.out.println(2); } else if(x < 0 && y < 0) { System.out.println(3); } else { System.out.println(4); } } } <file_sep>/FizzBuzz.java //Link: https://open.kattis.com/problems/fizzbuzz import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Noob { public static void main(String[] args) throws IOException { int i; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String s = in.readLine(); String[] t = s.split("\\s+"); int[] t1 = new int[t.length]; for(i =0; i < t.length ; i++) { t1[i] = Integer.parseInt(t[i]); } int x = t1[0]; int y = t1[1]; int n = t1[2]; if((x > 100 || y > 100 || n > 100) || (x < 1 || y < 1 || n < 1)) { return; } for(i = 1; i <= n ; i++ ) { if(((i % x)== 0) && ((i % y)== 0)) { System.out.println("FizzBuzz"); } else if((i % x) == 0){ System.out.println("Fizz"); } else if((i % y) == 0) { System.out.println("Buzz"); } else { System.out.println(i); } } } } <file_sep>/Tarifa.java Link: https://open.kattis.com/problems/tarifa import java.io.InputStreamReader; import java.util.Scanner; public class Noob { public static void main(String[] args) { int dataForNextMonth; Scanner scanr = new Scanner(System.in); int dataPerMonth = scanr.nextInt(); int months = scanr.nextInt(); int totalData = dataPerMonth * months; int[] p = new int[months]; int dataUsed = 0; for(int i = 0 ; i < p.length ; i++) { p[i] = scanr.nextInt(); dataUsed += p[i]; } dataForNextMonth = (totalData - dataUsed) + dataPerMonth; System.out.println(dataForNextMonth); } }
3006c81d2d4286549e2cb01814cb6491d11271e3
[ "Markdown", "Java" ]
5
Java
trashidi98/LeetCode-Kattis-Solutions
3472f2e4ec64ca9c065867d870b18ea19cff2a38
a673560f1b971f0d7f7f6b47badb2828b93d0c78
refs/heads/master
<file_sep>'use strict'; var data = [{ id: 1, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 2, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 3, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 4, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 5, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 6, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 7, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 8, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 9, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' },{ id: 10, classify: '第一学期', title: 'HTML + CSS', room: '欣才第146期', status: '已发布', time: '2016-11-03', create: '三日', area: '南京' }]
5aa0b325a5695809b479edb8f0503d60daa1ed9a
[ "JavaScript" ]
1
JavaScript
wbhlywdwzy/table
a07dd6d7d58dd5c3d7b4345aa215af1c633197bf
840cfc83168a1568d4c2b43b0f4f29649f8f301d
refs/heads/master
<repo_name>msmani1980/Pizza-shop<file_sep>/README.md Fullstack online pizza-shop to start project - `npm run dev` <file_sep>/models/Pizza.js const {Schema, model} = require('mongoose'); const schema = new Schema({ title: {type: String, required: true}, price: {type: Number, required: true}, description: {type: String, required: true}, image: {type: String, required: true}, }); schema.set('toJSON', { transform: function (doc, ret) { ret.id = ret._id; delete ret._id; } }); module.exports = model('Pizza', schema);<file_sep>/client/src/Redux/actions/authActions.ts import {AuthStateType} from "../../types/types"; export const SET_AUTH_DATA = "cart/SET_AUTH_DATA"; type setAuthDataActionType = { type: typeof SET_AUTH_DATA, payload: AuthStateType } export const setAuthData = (authData: AuthStateType):setAuthDataActionType => ({type: SET_AUTH_DATA, payload: authData});<file_sep>/client/src/types/types.ts export type CartItemType = { id: number, title: string, price: number, description: string, image: string, count: number }; export type ProductType = { id: number, title: string, price: number, description: string, image: string, } export type AuthStateType = { token: string | null, userId: string | null, isAuth : boolean } declare global { interface Window { M: any; } }<file_sep>/client/src/Redux/store.ts import {applyMiddleware, combineReducers, createStore} from "redux"; import { composeWithDevTools } from 'redux-devtools-extension'; import thunkMiddleware from "redux-thunk"; import {cartReducer} from "./reducers/cartReducer"; import {authReducer} from "./reducers/authReducer"; export type RootState = ReturnType<typeof reducers>; interface RootState1 { cart: { items: [ { id: number, title:string, price: number, description: string, image: string, count: number } ], totalPrice: number }, auth : { token: string | null, userId: string | null, isAuth : boolean } } let reducers = combineReducers({ cart: cartReducer, auth: authReducer }); let store = createStore(reducers, composeWithDevTools(applyMiddleware(thunkMiddleware))); export default store;<file_sep>/client/src/Redux/reducers/authReducer.ts import {AuthStateType} from "../../types/types"; import {SET_AUTH_DATA} from "../actions/authActions"; let initialState = { token: null, userId: null, isAuth: false, }; export const authReducer = (state: AuthStateType = initialState, action: { type: any; payload: any }): AuthStateType => { switch (action.type) { case SET_AUTH_DATA: return {...state, ...action.payload}; default: return state; } };<file_sep>/client/src/Redux/reducers/cartReducer.ts import {INCREASE_COUNT, ADD, DECREASE_COUNT, SET_ITEMS, GET_TOTAL_PRICE, REMOVE} from "../actions/cartActions"; import {CartItemType} from "../../types/types"; import {act} from "react-dom/test-utils"; let initialState = { items: [] as Array<CartItemType>, totalPrice: 0 as number }; type CartStateType = typeof initialState export const cartReducer = (state: CartStateType = initialState, action: { type: any; payload: any }): CartStateType => { switch (action.type) { case SET_ITEMS: return {...state, items: action.payload}; case ADD: const sameItem = state.items.find(item => item.id === action.payload.id); return {...state, items: sameItem ? state.items.map(item => item === sameItem ? {...item, count: item.count + action.payload.count} : item) : [...state.items, action.payload] }; case INCREASE_COUNT: return { ...state, items: state.items.map(item => { if (item.id === action.payload) { return {...item, count: ++item.count} } return item } ) }; case DECREASE_COUNT: return { ...state, items: state.items.map(item => { if (item.id === action.payload) { if(item.count > 0) { return {...item, count: --item.count} } else return item } return item } ) }; case GET_TOTAL_PRICE: let newTotalPrice = 0; state.items.forEach((item) => { newTotalPrice = newTotalPrice + (item.count*item.price); }); return {...state, totalPrice: newTotalPrice}; case REMOVE: return {...state,items: state.items.filter(item => item.id !== action.payload)}; default: return state; } };<file_sep>/client/src/hooks/message.hook.ts import {useCallback} from 'react'; export const useMessage = () => { return useCallback(text => { if(window.M && text) { window.M.toast({html: text , classes: 'message'}) } },[]) }; export const useSuccessMessage = () => { return useCallback(text => { if(window.M && text) { window.M.toast({html: text, classes: "successMessage"}) } }, []) };<file_sep>/client/src/hooks/auth.hook.ts import {useState, useCallback, useEffect} from 'react'; import {useDispatch} from "react-redux"; import {setAuthData} from "../Redux/actions/authActions"; const storageName:string = "userData"; export const useAuth = () => { const [token, setToken] = useState<string | null>(null); const [userId, setUserId] = useState<string | null>(null); const dispatch = useDispatch(); const login = useCallback((jwtToken:string, id:string):void => { setToken(jwtToken); setUserId(id); const isAuth = !!jwtToken; const authData = {userId:id, token:jwtToken,isAuth}; localStorage.setItem(storageName, JSON.stringify({ userId:id ,token: jwtToken })); dispatch(setAuthData(authData)) },[]); const logout = useCallback(():void => { setToken(null); setUserId(null); localStorage.removeItem(storageName); const authData = {userId:null, token: null, isAuth:false}; dispatch(setAuthData(authData)) },[]); useEffect(() => { const data = JSON.parse(<string>localStorage.getItem(storageName)); if(data && data.token) { login(data.token, data.userId); } }, [login]); return {login, logout, token, userId} };<file_sep>/client/src/Redux/actions/cartActions.ts import {CartItemType} from "../../types/types"; export const SET_ITEMS = "cart/SET_ITEMS"; export const INCREASE_COUNT = "cart/INCREASE_COUNT"; export const DECREASE_COUNT = "cart/DECREASE_COUNT"; export const ADD = "cart/ADD"; export const REMOVE = "cart/REMOVE"; export const GET_TOTAL_PRICE = "cart/GET_TOTAL_PRICE"; type setItemsActionType = {type: typeof SET_ITEMS, payload: Array<CartItemType>} type addToCartActionType = {type: typeof ADD, payload: CartItemType} type increaseActionType = {type: typeof INCREASE_COUNT, payload: number} type decreaseActionType = {type: typeof DECREASE_COUNT, payload: number} type getTotalPriceActionType = {type: typeof GET_TOTAL_PRICE} type removeFromCartType = {type: typeof REMOVE, payload: number} export const setItems = (items: Array<CartItemType>):setItemsActionType => ({type: SET_ITEMS, payload: items}); export const addToCart = (item: CartItemType):addToCartActionType => ({type: ADD, payload: item}); export const increaseCount = (id:number):increaseActionType => ({type: INCREASE_COUNT, payload: id}); export const decreaseCount = (id:number):decreaseActionType => ({type: DECREASE_COUNT, payload: id}); export const getTotalPrice = ():getTotalPriceActionType => ({type: GET_TOTAL_PRICE}); export const removeFromCart = (id:number):removeFromCartType => ({type: REMOVE, payload: id});
973bf44ec1d618f9812f28d33541acfe318f508b
[ "Markdown", "TypeScript", "JavaScript" ]
10
Markdown
msmani1980/Pizza-shop
4d0081e3e3ea2dee5f0d31089a865ec33300cf30
d7334aa4fab4d29960255144143f4eb449c5f57d
refs/heads/master
<repo_name>deepthigopal/public_datasets<file_sep>/en/app/datasets/rename.py import pandas as pd import os files = [x for x in os.listdir('.')] files = [x for x in files if x.endswith('.csv')] for file in files: if file.endswith('.csv'): print file data = pd.read_csv(file) print data.columns data = data.loc[:,~data.columns.str.startswith('Unnamed')] data.columns = data.columns.str.replace(' ', '_') print data.columns data.to_csv(file,index=True) <file_sep>/en/app/datasets/rescale.py import pandas as pd import os files = [x for x in os.listdir('.')] files = [x for x in files if x.endswith('.csv')] for file in files: if file.endswith('.csv'): print file data = pd.read_csv(file) data = data.fillna('no value') cols = [item for item in data.columns if item not in ['index','placename','longitude','latitude']] for item in cols: if min(data[item]) != 0.01: data[item] = (data[item] - min(data[item]))/(max(data[item])-min(data[item])) data.loc[data[item]<0.01,item] = 0.01 data.to_csv(file) <file_sep>/en/rawdata/weight.py import pandas as pd import os files = [x for x in os.listdir('.')] files2 = [x for x in os.listdir('../weighted')] files = [x for x in files if x not in files2] for file in files: if file.endswith('.csv'): print file data = pd.read_csv(file) # [item for item in data.columns if item not in ['index']] data = data.fillna('no value') new = data.groupby([item for item in data.columns if item not in ['index']]).count().reset_index() new.rename(columns={'index':'count'}, inplace=True) new = new.groupby([item for item in new.columns if item not in ['userid']]).count().reset_index() new['weight'] = new['count']/new.userid new = new[[item for item in new.columns if item not in ['userid','count']]] new = new.groupby([item for item in new.columns if item not in ['weight']]).sum().reset_index() new.to_csv('../weighted/'+file)
a85580b2285f13fc23e9d572550023a2e930c2a4
[ "Python" ]
3
Python
deepthigopal/public_datasets
4d7f46025c42deb29efcd66779412e0f7032d611
ef5c72b8f681ae0be7b9a2b32cd3e39cf27abd34
refs/heads/master
<repo_name>erkt/8051-microcontroller<file_sep>/book/FINAL-PROJECT/my_glcd.h #define PG0 0xB8 #define PG6 0xBE #define LCD P0 #define ST_ADD 0x40 code unsigned char char_c_arr[][5]={/*A*/0xfe,0x11,0x11,0x11,0xfe,/*B*/0xff,0x91,0x91,0x91,0x6e,/*C*/0x7e,0x81,0x81,0x81,0x42,/*D*/0xff,0x81,0x81,0x81,0x7e,/*E*/0xff,0x91,0x91,0x91,0x81, /*F*/0xff,0x09,0x09,0x01,0x01,/*G*/0x7e,0x81,0x81,0x91,0x73,/*H*/0xff,0x10,0x10,0x10,0xff,/*I*/0x00,0x81,0xff,0x81,0x00,/*J*/0x60,0x80,0x80,0x81,0x7f, /*K*/0xff,0x18,0x3c,0x66,0xc3,/*L*/0xff,0x80,0x80,0x80,0xc0,/*M*/0xff,0x06,0x08,0x06,0xff,/*N*/0xff,0x06,0x18,0x60,0xff,/*O*/0x7e,0x81,0x81,0x81,0x7e, /*P*/0xff,0x09,0x09,0x09,0x06,/*Q*/0x3e,0x41,0xc1,0xc1,0x3e,/*R*/0xff,0x11,0x31,0x51,0x8e,/*S*/0xce,0x91,0x91,0x91,0x63,/*T*/0x03,0x01,0xff,0x01,0x03, /*U*/0x7f,0x80,0x80,0x80,0x7f,/*V*/0x07,0x38,0xc0,0x38,0x07,/*W*/0x7e,0x80,0x70,0x80,0x7e,/*X*/0xc3,0x66,0x18,0x66,0xc3,/*Y*/0x03,0x0c,0xf0,0x0c,0x03, /*Z*/0x81,0xe1,0x99,0x87,0x81}; code unsigned char char_s_arr[][5]={/*a*/0xff,0x91,0x91,0x91,0x6e,/*b*/0xff,0x91,0x91,0x91,0x6e,/*c*/0x7e,0x81,0x81,0x81,0x42,/*d*/0xff,0x81,0x81,0x81,0x7e,/*e*/0xff,0x91,0x91,0x91,0x81, /*f*/0xff,0x09,0x09,0x01,0x01,/*g*/0x7e,0x81,0x81,0x91,0x73,/*h*/0xff,0x10,0x10,0x10,0xff,/*i*/0x00,0x81,0xff,0x81,0x00,/*j*/0x60,0x80,0x80,0x81,0x7f, /*k*/0xff,0x18,0x3c,0x66,0xc3,/*l*/0xff,0x80,0x80,0x80,0xc0,/*m*/0xff,0x06,0x08,0x06,0xff,/*n*/0xff,0x06,0x18,0x60,0xff,/*o*/0x7e,0x81,0x81,0x81,0x7e, /*p*/0xff,0x09,0x09,0x09,0x06,/*q*/0x3e,0x41,0xc1,0xc1,0x3e,/*r*/0xff,0x11,0x31,0x51,0x8e,/*s*/0xce,0x91,0x91,0x91,0x63,/*t*/0x03,0x01,0xff,0x01,0x03, /*u*/0x7f,0x80,0x80,0x80,0x7f,/*v*/0x07,0x38,0xc0,0x38,0x07,/*w*/0x7e,0x80,0x70,0x80,0x7e,/*x*/0xc3,0x66,0x18,0x66,0xc3,/*y*/0x03,0x0c,0xf0,0x0c,0x03, /*z*/0x81,0xe1,0x99,0x87,0x81}; code unsigned char space[5]={0x00,0x00,0x00,0x00,0x00}; code unsigned char colon[5]={0x00,0x00,0x24,0x00,0x00}; code unsigned char dot[5]={0x00,0x80,0x80,0x00,0x00}; code unsigned char digit_arr[10][6]={/*0*/ 0xff,0x81,0x81,0x81,0xff,0x00, /*1*/ 0x80,0x82,0xff,0x80,0x80,0x00, /*2*/ 0xf9,0x89,0x89,0x89,0x8f,0x00, /*3*/ 0x89,0x89,0x89,0x89,0xff,0x00, /*4*/ 0x0f,0x08,0x08,0x08,0xff,0x00, /*5*/ 0x8f,0x89,0x89,0x89,0xf9,0x00, /*6*/ 0xff,0x89,0x89,0x89,0xf9,0x00, /*7*/ 0x01,0x01,0x01,0x01,0xff,0x00, /*8*/ 0xff,0x89,0x89,0x89,0xff,0x00, /*9*/ 0x9f,0x91,0x91,0x91,0xff,0x00 }; void c_select(unsigned char chip){ if(chip==0){ CS1=CS2=0; } else if(chip==1){ CS1=1;CS2=0; } else if(chip==2){ CS1=0;CS2=1; } else if(chip==3){ CS1=1;CS2=1; } } void gwrite(unsigned char cmd){ RW=0; LCD=cmd; EN=1; EN=0; } void gcmd(unsigned char cmd,unsigned char c){ c_select(c); RS=0; gwrite(cmd); } void gdata(unsigned char dta){ RS=1; gwrite(dta); } void dinit(){ RST=0; RST=1; gcmd(0x3e,3);//Display off gcmd(0x3f,3);//Display on gcmd(0x40,3);//starting of lcd on horizonatal of page gcmd(0xB8,3);///page value..1011 1xxx gcmd(0xc0,3);//vertical of line } void clrscreen(){ unsigned char i,j; for(i=0;i<7;i++){ gcmd(PG0+i,3); gcmd(0x40,3); for(j=0;j<64;j++) gdata(0x00); } } void clrpage(unsigned char i,unsigned char c){ unsigned char j; gcmd(PG0+i,c); gcmd(ST_ADD,c); for(j=0;j<64;j++) gdata(0x00); } void sdigit(unsigned char i){ unsigned char j; for(j=0;j<6;j++) gdata(digit_arr[i][j]); return; } void string(char *p){ unsigned char i,j; for(i=0;p[i];i++) for(j=0;j<5;j++){ if(p[i]>='A'&&p[i]<='Z') gdata(char_c_arr[p[i]-65][j]); else if(p[i]>='a' && p[i]<='z') gdata(char_s_arr[p[i]-97][j]); else if(p[i]>='0' && p[i]<='9') sdigit(p[i]-48); else if(p[i]==' ') gdata(space[j]); else if(p[i]==':') gdata(colon[j]); else if(p[i]=='.') gdata(dot[j]); } } <file_sep>/class/lcd/1.c #include<reg51.h> sfr lcd = 0x80; sbit RS = P2^0; sbit RW = P2^1; sbit EN = P2^2; #include"delay.h" #include"LCD.h" main(){ l_init(); while(1){ l_data('a'); my_delay(2000); } }<file_sep>/class/I2C/i2c.h void start(){ scl=1;sda=1;sda=0; } void stop(){ scl=1;sda=0;sda=1;scl=1; } void write(unsigned char a){ char i; for(i=7;i>=0;i--){ scl=1; sda= (a&(1<<i))?1:0; scl=0; } } unsigned char read(){ char i; unsigned char temp; for(i=7;i>=0;i--){ scl=1; if(sda==1) temp=temp|(1<<i); scl=0; } return temp; } void ack(){ scl=0; sda=1; scl=1; while(sda==1); scl=0; } void noack(){ scl=0; sda=1; scl=1; }<file_sep>/assembly/mixasmandC/7segment/7_3.c #include<reg51.h> void delay(int i){ unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } sfr se=0x80; sbit s=P2^0; sbit s1=P2^1; sbit s2=P2^2; sbit s3=P2^3; code unsigned char l[4]={0x80,0xc0,0x92,0x92}; //ca void digi(char i,char on,char off){ P2=on; se=l[i]; delay(2); P2=off; } main(){ unsigned char k,i,j,on,off=0x0f,l1; s=s1=s2=s3=1; while(1){ for(i=4;i>0;i--) for(j=0;j<250;j++) for(k=i,l1=0;k<=4;k++,l1++){ on=~(1<<l1); digi(k-1,on,off); } for(i=0;i<4;i++) for(j=0;j<250;j++) for(k=0,l1=i;k<=3;k++,l1++){ on=~(1<<l1); digi(k,on,off); } } }<file_sep>/class/timer-counter/timer/timer1.c #include<reg51.h> main(){ TMOD = 0x01; TH0 = 0xfc; TL0 = 0x18; TR0 = 1; while(TF0 == 0); TR0=TF0=0; while(1); }<file_sep>/class/UART/password.c #include<reg51.h> #include<string.h> #include"uart.h" sfr LCD =0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" main(){ unsigned char buf[11],i,temp,pass[]="<PASSWORD>",l; linit(); uart_inti(); i=0; lstring("Enter Password:"); uart_tx_string("Enter Password:"); lcmd(0xc0); while((temp=uart_rx())!='\x0D'){ buf[i++]=temp; uart_tx('*'); ldata('*'); } buf[i]=0; l=i; lcmd(0x01);lcmd(0x02); for(i=0;buf[i];i++) if(buf[i]!=pass[i]) break; if(l==i){ uart_tx_string("login Correct."); lstring("Correct login."); while(1){ P1=0xff; delay(500); P1=0x00; delay(500); } } else{ uart_tx_string("WRONG Pass."); lstring("WRONG Pass."); } while(1); }<file_sep>/book/FINAL-PROJECT/alarm.h void alarm(){ unsigned char mm,hh; gcmd(PG0+1,2); gcmd(ST_ADD,2); string("ALARM"); if(ALM==1){ gcmd(PG0+3,2); gcmd(ST_ADD,2); string("ON"); } else if(ALM==0){ gcmd(PG0+3,2); gcmd(ST_ADD,2); string("OFF"); } gcmd(PG0+5,2); gcmd(ST_ADD,2); mm=D_read(0xA0,0x00); hh=D_read(0xA0,0x01); sdigit(hh/10); sdigit(hh%10); string(":"); sdigit(mm/10); sdigit(mm%10); } void alarm_set(unsigned char hh,unsigned char mm){ D_write(0xA0,0x00,mm); D_write(0xA0,0x01,hh); }<file_sep>/class/switch/delay.h void my_delay( unsigned int j) { char i; for(;j>0;j--) { for(i=250;i>0;i--); for(i=247;i>0;i--); } } <file_sep>/assembly/mixasmandC/clock/clockin.c #include<reg51.h> #include"delay.h" sfr seg = 0x80; sbit s0 =P2^0; sbit s1 =P2^1; sbit s2 =P2^2; sbit s3 =P2^3; unsigned char look[]={ 0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; main(){ unsigned char sec,min,i; while(1){ for(min=0;min<60;min++) for(sec=0;sec<60;sec++){ for(i=0;i<125;i++){ s0=0;s1=s2=s3=1; seg=look[(sec%10)]; delay(2); s1=0;s0=s2=s3=1; seg=look[(sec/10)]; delay(2); s2=0;s1=s1=s3=1; seg=look[(min%10)]; delay(2); s3=0;s1=s2=s2=1; seg=look[(min/10)]; delay(2); } } } } <file_sep>/assignement/I2C/EEPROM-interface/i2c-device.h void device_write(unsigned char sa, unsigned char mr, unsigned char da){ start(); write(sa); ack(); write(mr); ack(); write(da); ack(); stop(); delay(10); } unsigned char device_read(unsigned char sa, unsigned char mr){ unsigned char temp; start(); write(sa); ack(); write(mr); ack(); start(); write(sa|1); ack(); temp=read(); noack(); stop(); return temp; }<file_sep>/class/I2C/1.c #include<reg51.h> #include"delay.h" sfr lcd =0x80; sbit rs=P3^4; sbit rw=P3^5; sbit en =P3^6; sbit sda=P2^0; sbit scl=P2^1; #include"lcd.h" #include"i2c.h" #include"i2c_device.h" main(){ init(); ldata('k'); while(1){ d_write(0x90,0xaa); } }<file_sep>/class/led/1.c #include"delay.h" main(){ //unsigned int j; my_delay(1000); while(1); }<file_sep>/assignement/I2C/EEPROM-interface/lcd.h void cmd(unsigned char cmd){ LCD = cmd; RS=RW=0;EN=1; delay(2); EN=0; } void ldata(unsigned char dta){ LCD = dta; RS=1;RW=0;EN=1; delay(2); EN=0; } void ini(){ cmd(0x01); cmd(0x02); cmd(0x06); cmd(0x0e); cmd(0x38); cmd(0x80); }<file_sep>/assembly/mixasmandC/delay-int/delay-using-int.c void delay(unsigned int i){ unsigned int j; for( ;i>0;i--) for(j=1275;j>0;j--); for(j=209;j>0;j--); } main(){ delay(90); while(1); }<file_sep>/book/switch/2.c #include<reg51.h> sbit sw = P1^0; sfr led = 0xA0; main(){ unsigned char count=0; led= 0xf0; while(1){ if(count < 4){ if( sw == 0 ){ led = (~(1 << (count+4) ) & 0xf0) ; count++ ; while(sw ==0); } else continue; } else led = 0x00; } } <file_sep>/class/7segment/2.c #include<reg51.h> #include"delay.h" sbit s3=P2^3; sbit s2=P2^2; sbit s1=P2^1; sbit s=P2^0; sfr led = 0x80; #define NN 2 code unsigned char look[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; main(){ int num,k,temp; P2=0xff; while(1){ for(num=00;num<10000;num++){ for(k=250 ;k>0;k--){ s=0;s1=s2=s3=1; P0=look[num/1000]; my_delay(NN); temp=num%1000; s1=0;s=s2=s3=1; P0=look[temp/100]; my_delay(NN); temp=num%100; s2=0;s=s1=s3=1; P0=look[temp/10]; my_delay(NN); s3=0;s=s1=s2=1; P0=look[temp%10]; my_delay(NN); } } } } <file_sep>/class/RFID/2.c #include<reg51.h> #include"uart.h" sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" main() { unsigned char i,j,l,buff[11],da[2][11]={"00318955","00336106"}; inti(); ini(); while(1){ str("Show your RFID\r\n"); strr("Show your RFID"); for(i=0;i<10;i++) buff[i]=rx(); l=i; lcmd(0xc0); for(j=0;j<2;j++){ for(i=0;i<10;i++) if(da[j][i]!=buff[i]) break; if((l==i)&&(j==0)){ str("User 1\r\n "); strr("User 1"); delay(2000); break; } else if((l==i)&&(j==1)){ str("User 2\r\n "); strr("User 2"); delay(2000); break; } } if ((j==2)&&(l!=i)){ str("Inavalid User\r\n"); strr("Invalid User"); } delay(1000); lcmd(0x01); lcmd(0x02); } }<file_sep>/assembly/mixasmandC/clock/clock-timer.c #include<reg51.h> sfr lcd = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" void delay_timer(unsigned char i){ while(i--){ TMOD = 0x01; TH0= (15535>>8); TL0= (15535&0x0f); TR0=1; while(TF0==0); TR0=TF0=0; } } main(){ unsigned char sec,min,hou; ini(); while(1){ for(hou=0;hou<24;hou++) for(min =0; min<60;min++) for(sec =0; sec <60;sec++){ lint(hou); ldata(':'); lint(min); ldata(':'); lint(sec); if(hou>12){ ldata('P'); ldata('M'); } else{ ldata('A'); ldata('M'); } delay_timer(20); lcmd(0x01); lcmd(0x02); } } }<file_sep>/class/led/delay.h void my_delay( int j) { unsigned char i; for(;j>0;j--) { for(i=250;i>0;i--); for(i=247;i>0;i--); } } <file_sep>/class/switch/1.c #include<reg51.h> sbit sw=P2^0; sbit sw1=P2^1; sbit led=P1^0; #define on 0 #define off 1 main(){ while(1){ // led=((sw==0)&(sw1==0)) ; if((sw==on) & (sw1==on)) led=1; else led=0; } }<file_sep>/assignement/interrupt/lcd.h void delay(int i){ unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } void lcmd(unsigned char cmd){ LCD=cmd; RS=RW=0;EN=1; delay(2); EN=0; } void ldata(unsigned char dta){ LCD=dta; RS=1;RW=0;EN=1; delay(2); EN=0; } void lini(){ lcmd(0x01); lcmd(0x02); lcmd(0x06); lcmd(0x0c); lcmd(0x38); lcmd(0x80); } void lstring(char *p){ while(*p) ldata(*p++); } void lcg(char *p,unsigned char j){ unsigned char i; lcmd(0x40); for(i=0;i<j;i++) ldata(p[i]); lcmd(0x80); }<file_sep>/assembly/mixasmandC/clock/clo.c #include<reg51.h> sfr lcd = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" main(){ unsigned char sec,min,hou; ini(); while(1){ for(hou=0;hou<24;hou++) for(min =0; min<60;min++) for(sec =0; sec <60;sec++){ lint(hou); ldata(':'); lint(min); ldata(':'); lint(sec); delay(1000); lcmd(0x01); lcmd(0x02); } } }<file_sep>/class/UART/1.c #include<reg51.h> #include"uart.h" main(){ unsigned char t; uart_inti(); while(1){ //t=uart_rx(); uart_tx(uart_rx()); } }<file_sep>/class/timer-counter/timer/timer0.c #include<reg51.h> main(){ TMOD = 0x00; TH0 = 0XE0; TL0 = 0X17; TR0=1; while(TF0==0); TR0=0; TF0=0; while(1); }<file_sep>/class/switch/keypad-2-2-3.c #include<reg51.h> #include"delay.h" #include"keypad.h" main(){ unsigned char temp; P2=0xf0; while(1){ temp = keysearch(); P2=temp; } }<file_sep>/assignement/I2C/REAL-TIME-CLOCK-interface/RTC-CLOCK.c #include<reg51.h> #include"delay.h" sfr LCD =0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" sbit SDA = P2^0; sbit SCL = P2^1; #include"i2c.h" #include"i2c-device.h" main(){ unsigned char temp1,temp,date,*year="20"; init(); // D_write(0xD0,0x00,0x00); // D_write(0xD0,0x01,0x39); // D_write(0xD0,0x02,0x66); // D_write(0xD0,0x03,0x03); // D_write(0xD0,0x04,0x13); // D_write(0xD0,0x05,0x07); // D_write(0xD0,0x06,0x16); while(1){ cmd(0xc0); temp1=D_read(0xD0,0x02); if(temp1&0x20) string("PM "); else string("AM "); temp1=temp1&0x1f; ldata(temp1/16+48); ldata(temp1%16+48); ldata(':'); temp=D_read(0xD0,0x01); ldata(temp/16+48); ldata(temp%16+48); ldata(':'); temp=D_read(0xD0,0x00); ldata(temp/16+48); ldata(temp%16+48); cmd(0x80); date=D_read(0xD0,0x03); switch(date){ case 0: string("SUN"); break; case 1: string("MON"); break; case 2: string("TUE"); break; case 3: string("WED"); break; case 4: string("THU"); break; case 5: string("FRI"); break; case 6: string("SAT"); break; } date=D_read(0xD0,0x04); ldata(date/16+48); ldata(date%16+48); ldata(':'); date=D_read(0xD0,0x05); ldata(date/16+48); ldata(date%16+48); ldata(':'); date=D_read(0xD0,0x06); string(year); ldata(date/16+48); ldata(date%16+48); ldata(' '); } }<file_sep>/class/timer-counter/counter/counter1.c #<reg51.h> main(){ TMOD = 0x04<file_sep>/book/switch/temp.c #include<reg51.h> sbit sw = P1^0; sfr led = 0x80; main(){ led = 0x0f; while(1){ if(sw == 0){ led=0xf0; while(sw==0); } else led=0x0f; } }<file_sep>/class/lcd/4-2-line-scrolling.c #include<reg51.h> #include<string.h> sfr lcd = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"delay.h" #include"LCD.h" main(){ char i,len,l,len1,l1; char *s="Krezzy :: 7204204020"; char *p="->->crezzy<-<-"; // char *s="abcdef ghijkl mnopqur stuvwx yz "; // char *p="7204204020"; len=strlen(s); len1=strlen(p); l_init(); while(1){ l=len; l1=len1; if(len>15){ for(i=0;i<len;i++){ l_cmd(0x80+i); l_string(s); if(i<len1){ l_cmd(0xc0+i); l_string(p); } my_delay(1000); l_init(); if((i+l)==(len)){ l_cmd(0x80); l_string(s+(l--)); if(i<len1){ l_cmd(0xc0); l_string(p+(l1--)); } } } } else{ for(i=0;i<16;i++){ l_cmd(0x80+i); l_string(s); l_cmd(0xc0+i); l_string(p); my_delay(1000); l_init(); if((i+l)==15){ l_cmd(0x80); l_string(s+(l--)); l_cmd(0xc0); l_string(p+(l1--)); } } } } } <file_sep>/class/led/led-in-out.c #include<reg51.h> #include"delay.h" sfr led=0xA0; main(){ unsigned char i,j; while(1) { /*for(i=0,j=7;i<8;i++,j--) { if(i<4) led=((0x0f)&(1<<i))|((~((0xf0)&(1<<j)))&0xf0); else led=((~((0xf0)&(1<<i)))&0xf0)|((0x0f)&(1<<j)); my_delay(1000); } */ for(i=0,j=7;i<8;i++,j--){ if(i<4) led=(0x00^(1<<i))|(0xf0^(1<<j)); else led=(0xf0^(1<<i))|(0x00^(1<<j)); my_delay(1000); } } }<file_sep>/book/switch/1.c #include<reg51.h> sbit sw = P1^0; sbit led = P2^7; main(){ P2=0xf0; while(1){ if(sw==0) led =0; else led =1; } }<file_sep>/assembly/c_ass/swap/FINAL-PROJECT/alarm.h void alarm(){ unsigned char mm,hh; gcmd(PG0,2); gcmd(ST_ADD,2); string("ALARM"); gcmd(PG0+2,2); gcmd(ST_ADD,2); string("ON"); gcmd(PG0+4,2); gcmd(ST_ADD,2); mm=D_read(0xA0,0x00); hh=D_read(0xA0,0x01); sdigit(hh/10); sdigit(hh%10); string(":"); sdigit(mm/10); sdigit(mm%10); } void alarm_set(unsigned char hh,unsigned char mm){ D_write(0xA0,0x00,mm); D_write(0xA0,0x01,hh); }<file_sep>/class/timer-counter/timer/timer2.c #include<reg51.h> main(){ TMOD = 0X02; TH0 = 255; TL0 = 1; TR0=1; while(TF0==0); TR0=TF0=0; while(1); }<file_sep>/assignement/uart/UART.h void uart_tx(unsigned char DATA){ SBUF = DATA; while(TI == 0); TI = 0; } unsigned char uart_rx(){ while(RI == 0); RI = 0; return SBUF; } void uart_init(){ SCON = 0x50; TMOD = 0x20; TH1 = 253; TR1 = 1; } void uart_string(char *s){ while(*s) uart_tx(*s++); }<file_sep>/assignement/Calculator_new/1.c #include<reg51.h> sbit c0 = P2^0; sbit c1 = P2^1; sbit c2 = P2^2; sbit c3 = P2^3; sbit r0 = P2^4; sbit r1 = P2^5; sbit r2 = P2^6; sbit r3 = P2^7; sfr lcd = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; sbit sw = P1^0; #include"delay.h" #include"lcd.h" #include"keypad.h" main(){ unsigned int dta[2],ans,sign,act[2],temp,ft,i,dt; l_init(); dta[0]=dta[1]=ans=sign=act[0]=act[1]=ft=0; dt=1; l_string(" EXPRESSION "); l_cmd(0xc0); while(1){ here: while(sw==1); l_cmd(0x01); l_cmd(0x02); dta[0]=dta[1]=ans=sign=act[0]=act[1]=ft=temp=0; i=2; while(i){ temp=keysearch(); if(temp=='-'&&ft==0&&dt==1){ ft=1; sign='-'; l_data(temp); } else if(0<=temp && temp<=9){ dta[i-1]=(dta[i-1]*10)+temp; l_data(temp+48); dt=0; } else { act[i-1]=temp; i--; if(temp=='=') i=0; l_data(temp); } } if(act[1]=='+'&&ft){ if(dta[1]>dta[0]) ans=dta[1]-dta[0]; else{ ans=dta[0]-dta[1]; ft=0; } } else if(act[1]=='+'&&ft==0) ans=dta[1]+dta[0]; else if(act[1]=='-'&&ft) ans=dta[1]+dta[0]; else if(act[1]=='-'&&ft==0){ if(dta[1]<dta[0]) ans=dta[0]-dta[1]; else{ ans=dta[1]-dta[0]; ft=0; } } else if(act[1]=='*') ans=dta[1]*dta[0]; else if(act[1]=='/'){ if(dta[0]==0){ l_string("Float Error.."); goto here; } ans=act[1]/act[0]; } else if(act[1]=='%'){ ans = act[1]%act[0]; } if(ft) l_data(sign); l_int(ans); } }<file_sep>/class/7segment/1.c #include<reg51.h> #include"delay.h" sfr led=0xA0; code unsigned char look[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; main(){ int i; P1=0x00; while(1){ for(i=0;i<10;i++){ led=look[i]; my_delay(1000); } } }<file_sep>/assignement/interrupt/2.c #include<reg51.h> sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" unsigned char p[11],p1[11]="7204204020"; static unsigned char count=0,j=0,temp=0; void UART_ISR(void) interrupt 4{ if(TI==1){ if(j==temp){ lcmd(0x01); lcmd(0xc0); lstring(">DATA TRANSFER<"); temp=0; } TI=0; } if(RI==1){ RI=0; } } main(){ lini(); SCON = 0X50; TMOD = 0X20; TH1=TL1=253; TR1=1; EA=ES=1; for(j=0;p1[j];j++); while(1){ lcmd(0x80); lstring("PRO....."); SBUF=p1[temp++]; } } <file_sep>/assembly/c_ass/swap/FINAL-PROJECT/main.c #include<reg51.h> #include"delay.h" unsigned char ss,mi,hh,d,dd,mm,yy,temp,FLAG=0,ALM=0;///read purpose sbit SDA = P1^0; sbit SCL = P1^1; sbit RS=P2^0; sbit RW=P2^1; sbit EN=P2^2; sbit RST=P2^3; sbit CS2=P2^4; sbit CS1=P2^5; #include"i2c.h" #include"i2c_device.h" #include"my_glcd.h" #include"clock_set.h" #include"clock_read.h" #include"alarm.h" //small lookuptable remain void External_Interrupt(void) interrupt 0{ FLAG=1; } main(){ unsigned char HH,MM,D,DD,MO,YY,SS,i; dinit(); for(i=PG0;i<PG6;i++) clrpage(i,3); /* sec min hour day date month year */ clock_set(0x55,0x59,0x71,0x06,0x16,0x07,0x16); string(" 7204204020 "); sdigit(0); while(1){ gcmd(PG0,1); gcmd(ST_ADD,1); clock(); alarm(); clrscreen(); if(!FLAG){ clock_set(SS,MM,HH,D,DD,MO,YY); alarm_set(HH,MM); } } } <file_sep>/assignement/uart/2_final_complete.c #include<reg51.h> #include"UART.h" sfr lcd = 0x80; sbit RS =P3^4; sbit RW =P3^5; sbit EN =P3^6; #include"lcd.h" main(){ unsigned char t,j,aa='A'; uart_init(); linit(); while(1){ t=uart_rx(); uart_tx(t); lcmd(0x01); lcmd(0x02); ldata(t); ldata(' '); j=t^(1<<5); uart_tx(j); ldata(j); ldata(' '); ///convert decimal ascii uart_tx(t/10+48); ldata(t/10+48); uart_tx(t%10+48); ldata(t%10+48); ldata('d'); ldata(' '); ///convert hex ascii uart_tx(t/16+48); ldata(t/16+48); if((t%16)>9){ if((t%16)==10){ uart_tx(aa+0); ldata(aa+0); } else if((t%16)==11){ uart_tx(aa+1); ldata(aa+1); } else if((t%16)==12){ uart_tx(aa+2); ldata(aa+2); } else if((t%16)==13){ uart_tx(aa+3); ldata(aa+3); } else if((t%16)==14){ uart_tx(aa+4); ldata(aa+4); } else if((t%16)==15){ uart_tx(aa+5); ldata(aa+5); } } else { uart_tx(t%16+48); ldata(t%16+48); } uart_string("H\r\n"); ldata('H'); ldata(' '); } } <file_sep>/class/lcd/3.c #include<reg51.h> sfr lcd = 0x80; sbit RS = P2^0; sbit RW = P2^1; sbit EN = P2^2; #include"delay.h" #include"LCD.h" main(){ l_init(); while(1){ l_cmd(0x80+5); l_string("VECTOR"); my_delay(1000); l_cmd(0x01); l_cmd(0x02); l_cmd(0xc0+3); l_string("BANGALORE"); my_delay(1000); } } <file_sep>/assignement/Calculator_new/delay.h void my_delay(int i){ unsigned char j; for(i ; i>0; i--){ for( j=250;j>0;j--); for( j=257;j>0;j--); } }<file_sep>/assignement/calculator/lcd.h //define lcd and control pin void l_cmd(unsigned char cmd){ lcd = cmd; RS=0;RW=0;EN=1; my_delay(2); EN=0; } void l_data(unsigned char dta){ lcd = dta; RS=1;RW=0;EN=1; my_delay(2); EN=0; } void l_init(){ l_cmd(0x01); l_cmd(0x02); l_cmd(0x06); l_cmd(0x0c); l_cmd(0x38); l_cmd(0x80); } void l_string(const char *s){ while(*s) l_data(*s++); } void l_int(int k){ int i,k1=0,j,c_zero=0,g=k; if(k==0){ l_data(k+48); } else{ while(g){ if(!(g%10)) c_zero++; g=g/10; } while(k){ j=k%10; k1=((k1*10)+j); k=k/10; } while(k1){ i=k1%10; l_data(i+48); k1=k1/10; } while(c_zero){ l_data(48); c_zero--; } } }<file_sep>/class/lcd/LCD.h void l_cmd(unsigned char cmd){ lcd=cmd; RS=0;RW=0;EN=1; my_delay(2); EN=0; } void l_data(unsigned char dta){ lcd=dta; RS=1;RW=0;EN=1; my_delay(2); EN=0; } void l_init(){ l_cmd(0x01); l_cmd(0x02); l_cmd(0x06); l_cmd(0x80); l_cmd(0x38); l_cmd(0x0C); } void l_string(char *s){ while(*s) l_data(*s++); } <file_sep>/assembly/mixasmandC/7segment/keypad.h code unsigned char look[4][4] = {1,2,3,'+', 4,5,6,'-', 7,8,9,'*', '%',0,'/','='}; unsigned char keysearch(unsigned char temp) { unsigned char row,col; r0=r1=r2=r3=0; c0=c1=c2=c3=1; while(c0&c1&c2&c3){ s=0; se=lut[temp]; my_delay(2); s=1; } r0=0; r1=r2=r3=1; if(!(c0&c1&c2&c3)){ row=0; goto coloum; } r1=0; r0=r2=r3=1; if(!(c0&c1&c2&c3)){ row=1; goto coloum; } r2=0; r1=r0=r3=1; if(!(c0&c1&c2&c3)){ row=2; goto coloum; } r3=0; r1=r2=r0=1; if(!(c0&c1&c2&c3)){ row=3; goto coloum; } coloum: if(c0==0) col=0; else if(c1==0) col=1; else if(c2==0) col=2; else if(c3==0) col=3; my_delay(200); while(!(c0&c1&c2&c3)){ s=0; se=lut[temp]; my_delay(2); s=1; } return look[row][col]; }<file_sep>/assembly/mixasmandC/7segment/7_signle_digit_cal.c #include<reg51.h> void my_delay(int i){ unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } sbit c0 = P2^0; sbit c1 = P2^1; sbit c2 = P2^2; sbit c3 = P2^3; sbit r0 = P2^4; sbit r1 = P2^5; sbit r2 = P2^6; sbit r3 = P2^7; sfr se = 0x80; sbit s=P1^0; code unsigned char lut[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; #include"keypad.h" // void di(unsigned char te){ // unsigned char j; // for(j=0;j<100;j++){ // P1=0xfe; // se=lut[te]; // my_delay(2); // P1=0xff; // } // } main(){ unsigned char d[2],a[2],temp,i=2,ans; unsigned char j; while(1){ temp=keysearch(0); if(9>=temp&&temp<=0){ d[1]=temp; } temp=keysearch(d[1]); if(temp!='=') a[1]=temp; temp=keysearch('p'); if(9>=temp&&temp<=0){ d[0]=temp; } temp=keysearch(d[0]); if(temp=='=') a[0]=temp; if(a[0]=='='){ if(a[1]=='+') ans=a[1]+a[0]; else if(a[1]=='-') ans=a[1]-a[0]; else if(a[1]=='*') ans=a[1]*a[0]; else if(a[1]=='/') ans=a[1]/a[0]; } for(j=0;j<200;j++){ s=0; se=lut[ans]; my_delay(2); s=1; } } while(1); }<file_sep>/assignement/uart/lcd.h void delay(int j){ unsigned char i; for(;j>0;j--){ for(i=250;i>0;i--); for(i=247;i>0;i--); } } void lcmd(unsigned char cmd){ lcd = cmd; RS=RW=0; EN=1; delay(2); EN=0; } void ldata(unsigned char dt){ lcd = dt; RS=1;RW=0;EN=1; delay(2); EN=0; } void linit(){ lcmd(0x01); lcmd(0x02); lcmd(0x06); lcmd(0x0c); lcmd(0x38); lcmd(0x80); }<file_sep>/assignement/segment/segment.h sfr led= 0x80; sbit s = P2^0; sbit s1 = P2^1; code unsigned char loop[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; void seg(unsigned char j){ s=0; led=loop[j/16]; my_delay(2); s=1;s1=0; led=loop[j%16]; my_delay(2); s1=1;s=1; }<file_sep>/class/timer-counter/timer/timer3.c #include<reg51.h> main(){ TMOD = 0x03; TH0 = 155; TL0 = 100; TR0 = 1; TR1 = 1; while((TF0 == 0)||(TF1==0)); TR0=TR1=0; TF0=TF1=0; while(1); }<file_sep>/assembly/mixasmandC/clock/lcd_blink.c #include<reg51.h> sfr lcd = 0x80; sbit RS=P3^4; sbit RW=P3^5; sbit EN=P3^6; #include"lcd.h" main(){ unsigned char *p="PAGAL",*s="KING"; ini(); string(p); lcmd(0xc0); while(1){ delay(1000); string(s); delay(1000); lcmd(0x08); } } <file_sep>/book/led/3.c //book-3 #include<reg51.h> #include"delay.h" sfr led=0xA0; main(){ unsigned char count=0,i; led = 0xf0; delay(1000); while(1){ if(count < 5 ){ for ( i=0; i< 8;i++){ if(i<4) led = 0xf0|(1<<i); else led = ~(1<<i)&0xf0; delay(1000*(i+1)); } count ++; led = 0xf0; delay(3000); } else { led = 0xf0; } } } <file_sep>/class/7segment/7segment.h code unsigned char look_up[]=( 0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10); unsigned char segment(int i){ return look_up[i]; }<file_sep>/class/timer-counter/counter/counter.c #include<reg51.h> main(){ unsigned char temp; TMOD = 0x04; TH0=TL0=0; TR0=1; while(TF0==0){ temp = TH0 *32 +TL0; ///if counter 0 and counter 1 =256 multiply } TR0=TF0=0; while(1); }<file_sep>/class/I2C/i2c_device.h void d_write(unsigned char sa,unsigned char mr,unsigned char dt){ start(); write(sa); ack(); write(mr); ack(); write(dt); ack(); stop(); delay(10); } unsigned char d_read(unsigned char sa,unsigned mr){ unsigned char temp=0; start(); write(sa); ack(); write(mr); ack(); start(); write(sa|1); ack(); temp=read(); noack(); stop(); return temp; } <file_sep>/class/led/led_1.c ///USING BITWISE LED ON/OFF #include"delay.h" sfr P2=0xA0; sbit led =P2^0; main() { while(1) { led=0; my_delay(1000); led=1; my_delay(1000); } } <file_sep>/class/RFID/rfid.c #include<reg51.h> #include"uart.h" main(){ unsigned char i,buff[11]; inti(); while(1){ for(i=0;i<11;i++) buff[i]=rx(); buff[i]='\0'; str(buff); } while(1); }<file_sep>/assignement/segment/2-ass.c #include<reg51.h> #include"delay.h" sfr se = 0x80; sbit s1=P2^0; sbit s2=P2^1; sbit s3=P2^2; sbit s4=P2^3; code unsigned char b[4][4]={0x03,0x40,0x12,0x12,//boss 0xc6,0x40,0xc7,0xa1,//cold 0x12,0x40,0xa1,0x88,//soda 0x89,0x86,0xc7,0x8c//help }; main(){ unsigned char i,j; while(1){ for(i=0;i<4;i++) { for(j=125;j>0;j--){ s1=0;s2=s3=s4=1; se=b[i][0]|0x80; my_delay(2); s2=0;s1=s3=s4=1; se=b[i][1]|0x80; my_delay(2); s3=0;s2=s1=s4=1; se=b[i][2]|0x80; my_delay(2); s4=0;s2=s3=s1=1; se=b[i][3]|0x80; my_delay(2); } } } } <file_sep>/assembly/mixasmandC/7segment/7.c #include<reg51.h> sfr seg=0x80; sbit s1 = P2^0; sbit s2 = P2^1; sbit s3 = P2^2; sbit s4 = P2^3; void delay(int i){ unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } code unsigned char l[][4]={0x80,0xc0,0x92,0x92, //ca 0x83,0xa3,0x92,0x92}; main(){ unsigned char i,j,k,l1; while(1){ for(i=0;i<2;i++){ for(k=0;k<100;k++){ for(j=0;j<4;j++){ for(k=0;k<250;k++) if(j<1){ s1=0;s2=s3=s4=1; seg=l[i][j]; delay(2); } for(k=0;k<250;k++) if(j<2&&j!=0){ s1=0;s2=s3=s4=1; seg=l[i][j-1]; delay(2); s2=0;s1=s3=s4=1; seg=l[i][j]; delay(2); } for(k=0;k<160;k++) if(j<3&&j!=1&&j!=0){ s1=0;s2=s3=s4=1; seg=l[i][j-2]; delay(2); s2=0;s1=s3=s4=1; seg=l[i][j-1]; delay(2); s3=0;s1=s2=s4=1; seg=l[i][j]; delay(2); } for(k=0;k<125;k++) if(j<4&&j!=2&&j!=1&&j!=0){ s1=0;s2=s3=s4=1; seg=l[i][j-3]; delay(2); s2=0;s1=s3=s4=1; seg=l[i][j-2]; delay(2); s3=0;s1=s2=s4=1; seg=l[i][j-1]; delay(2); s4=0;s1=s2=s3=1; seg=l[i][j]; delay(2); } } } } } } <file_sep>/class/RFID/uart.h void inti(){ SCON=0x50; TMOD=0x20; TH1=TL1=253; TR1=1; } void tx(unsigned char dta){ SBUF = dta; while(TI==0); TI=0; } unsigned char rx(){ while(RI==0); RI=0; return SBUF; } void str(char *p){ while(*p) tx(*p++); }<file_sep>/book/led/delay.h void delay(int j){ unsigned char i; for( ; j > 0 ; j--){ for(i=250;i>0;i--); for(i=247;i>0;i--); } }<file_sep>/class/led/led_2.c #include<reg51.h> #include"delay.h" main(){ while(1) { P2= 0xFF; my_delay(1000); P2= 0xFE ; my_delay(1000); } }<file_sep>/class/lcd/2.c #include<reg51.h> sfr lcd = 0x80; sbit RS = P2^0; sbit RW = P2^1; sbit EN = P2^2; #include"delay.h" #include"LCD.h" main(){ l_init(); l_string("VECTOR"); l_cmd(0xc0); l_string("BANGALORE"); while(1); } <file_sep>/book/switch/3.c #include<reg51.h> #include"delay.h" #include"keypad.h" main(){ while(1){ P0=key(); } } <file_sep>/assignement/interrupt/3-MIX.c #include<reg51.h> sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; sbit L = P1^0; sbit L1 = P1^7; sbit L2 = P1^4; #include"lcd.h" unsigned char lo[]={0x00,0x11,0x1B,0x0E,0x0E,0x1B,0x11,0x00}; unsigned char dat[32]; static char i=0,count; void UART(void) interrupt 4{ if(TI==1){ if(i!=count){ SBUF=dat[i++]; L2=~L2; } else{ lcmd(0x80); lstring(">> DATA TX <<"); i=count=0; } TI=0; } if(RI==1){ if(SBUF != '\x0D'){ dat[i++]=SBUF; L1=~L1; } else{ lini(); lcmd(0xc0); dat[i]=0; lstring(dat); lcmd(0xc0+i+1); ldata(0); count=i; i=0; SBUF=dat[i++]; } RI=0; } } main(){ SCON = 0x50; TMOD = 0x20; TH1=TL1=253; TR1=1; EA=ES=1; lini(); lcg(lo,8); while(1){ L=~L; delay(200); } }<file_sep>/class/interrupt/TIMER-INTERRUPUT/1.c #include<reg51.h> sfr lcd = 0x80; sbit rs = P3^4; sbit rw = P3^5; sbit en = P3^6; #include"lcd.h" static unsigned int count=0; void timerinter() interrupt 1{ cmd(0xc0); string("EX::"); cmd(0xc0+4); inti(count++); } main(){ unsigned int i=0; TMOD = 0X01; TH0 = (15535>>8); TL0 = (15535&0XFF); TR0 = 1; ET0 = EA = EX0 = 1; IT0 = 0; ini(); while(1){ string("Main::"); cmd(0x80+6); inti(i); i++; delay(500); cmd(0x01); cmd(0x02); } } <file_sep>/class/SPI/main.c #include<reg51.h> #include"delay.h" sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" sbit clk = P2^0; sbit dout = P2^1; sbit din = P2^2; sbit cs = P2^3; #include"adc.h" main(){ unsigned int temp; ini(); cmd(0x80); ldata('K'); ldata(' '); inte(9090); while(1){ temp = read(); cmd(0xc0); floata((temp*0.0012)); delay(100); } }<file_sep>/class/lcd/delay.h void my_delay(unsigned int i){ unsigned char j; for( ; i>0 ; i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } }<file_sep>/assignement/segment/key_seg_ass.c #include<reg51.h> #include"delay.h" #include"keypad.h" #include"segment.h" main(){ unsigned char t,i; while(1){ t=keysearch(); for(i=250;i>0;i--) seg(t); } } <file_sep>/assignement/calculator/2-modify.c #include<reg51.h> sbit c0 = P2^0; sbit c1 = P2^1; sbit c2 = P2^2; sbit c3 = P2^3; sbit r0 = P2^4; sbit r1 = P2^5; sbit r2 = P2^6; sbit r3 = P2^7; sfr lcd = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; sbit sw = P1^0; #include"delay.h" #include"lcd.h" #include"keypad.h" main(){ unsigned char temp,i=4,op,action[2]={0,0}; int j[2]={0,0},l=0; l_init(); l_string("Expression"); l_cmd(0xc0); while(1){ while(sw==1); while(i){ temp=keysearch(); if(temp>=0 && temp<=9){ l = (l*10)+ temp; l_data(temp+48); } else { op=temp; l_data(op); action[--i]=op; j[i]=l; l=0; } } if(action[1]=='+') l=j[1]+j[0]; else if(action[1]=='-') l=j[1]-j[0]; else if(action[1]=='*') l=j[1]*j[0]; else if(action[1]=='/'){ if(j[0]==0) l_string("Floating point exception"); else l=j[1]/j[0]; } else if(action[1]=='%') l=j[1]%j[0]; l_int(l); i=2; while(sw==1); l_cmd(0x01); temp=0;j[0]=0;j[1]=0;action[1]=0;action[0]=0;l=0;op=0; } while(1); }<file_sep>/class/lcd/4.c #include<reg51.h> #include<string.h> sfr lcd = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"delay.h" #include"LCD.h" main(){ char i,len,l; //char *s="Krezzy :: 7204204020"; char *s="ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; len=strlen(s); l_init(); while(1){ l=len; if(len>15){ for(i=0;i<len;i++){ l_cmd(0x80+i); l_string(s); my_delay(1000); l_cmd(0x01); l_cmd(0x02); if((i+l)==(len)){ l_cmd(0x80); l_string(s+(l--)); } } } else{ for(i=0;i<16;i++){ l_cmd(0x80+i); l_string(s); my_delay(1000); l_cmd(0x01); l_cmd(0x02); if((i+l)==15){ l_cmd(0x80); l_string(s+(l--)); } } } } } <file_sep>/class/interrupt/TIMER-INTERRUPUT/lcd.h void delay(unsigned int i){ unsigned char j; for( ;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } void cmd(unsigned char cd){ lcd = cd ; rs=rw=0;en=1; delay(2); en=0; } void dat(unsigned char dt){ lcd = dt; rs=1;rw=0;en=1; delay(2); en=0; } void ini(){ cmd(0x01); cmd(0x02); cmd(0x06); cmd(0x0c); cmd(0x38); cmd(0x80); } void string(char *p){ while(*p) dat(*p++); } void inti(unsigned int h){ unsigned int temp=h,z_c=0,rev=0; if(h==0) dat(48); else{ while(!(temp%10)){ z_c++; temp/=10; } while(h){ rev=(rev*10)+(h%10); h/=10; } while(rev){ dat((rev%10)+48); rev/=10; } while(z_c){ dat(48); z_c--; } } }<file_sep>/class/led/led-4-active-low.c #include<reg51.h> #include"delay.h" main(){ unsigned char i; while(1){ for(i=0;i<8;i++){ P2=~(1<<i); my_delay(1000); } } }<file_sep>/class/RFID/lcd.h void delay(int j){ unsigned char i; for(;j>0;j--){ for(i=250;i>0;i--); for(i=247;i>0;i--); } } void lcmd(unsigned char cmd){ LCD = cmd; RS=RW=0;EN=1; delay(2); EN=0; } void ldata(unsigned char dta){ LCD = dta; RS=1;RW=0;EN=1; delay(2); EN=0; } void strr(char *s){ while(*s) ldata(*s++); } void ini(){ lcmd(0x01); lcmd(0x02); lcmd(0x06); lcmd(0x0c); lcmd(0x38); lcmd(0x80); } <file_sep>/assignement/FINAL-PROJECT/alarm.h void alarm(){ unsigned char mm,hh,ampm; gcmd(PG0+1,2); gcmd(ST_ADD,2); string("ALARM"); if(ALM==1){ gcmd(PG0+3,2); gcmd(ST_ADD,2); string("ON"); } else if(ALM==0){ gcmd(PG0+3,2); gcmd(ST_ADD,2); string("OFF"); } gcmd(PG0+5,2); gcmd(ST_ADD,2); mm=D_read(0xA0,0x00); hh=D_read(0xA0,0x01); ampm=D_read(0xA0,0x02); sdigit(hh/10); sdigit(hh%10); string(":"); sdigit(mm/10); sdigit(mm%10); if(ampm==0) string(" AM"); else string(" PM"); }/* hh mm ampm*/ void alarm_set(unsigned char hh,unsigned char mm){ D_write(0xA0,0x00,mm); D_write(0xA0,0x01,hh); //D_write(0xA0,0x02,ampm); //ampm==1 pm and ampm=0 am } void alarm_check(){ if(ALM==1){ //unsigned char a_mm,a_hh,c_mm,c_hh,ampm,temp,h,m; unsigned char a_mm,a_hh,c_mm,c_hh; a_mm=D_read(0xA0,0x00);//read alarm min a_hh=D_read(0xA0,0x01);//read alarm hour // ampm=D_read(0xA0,0x02);//read status of ampm c_mm=D_read(0xD0,0x01);//read clock min c_hh=D_read(0xD0,0x02);//read clock hour // temp=c_hh&(1<<5); // c_hh&=0x1f; // h=c_hh%16; // c_hh/=16; // c_hh*=10; // c_hh+=h; // if(ampm==(temp>>5)) //if(a_hh==(c_hh&0x1f)){ if(a_hh==c_hh){ //m=c_mm%16; // c_mm/=16; // c_mm*=10; // c_mm+=m; if(a_mm==c_mm){ gcmd(PG0+6,2); gcmd(ST_ADD,2); if(c_mm!=(a_mm+1)){ special(); LED=~LED; DelayMS(2000); ALM=0; } } } } else{ clrpage(6,2); } }<file_sep>/class/switch/keypad-1.c #include<reg51.h> sbit r=P1^4; sbit c1=P1^1; sbit c2=P1^2; #define led P2 main() { led=0xf0; while(1){ r=0; while((c1&c2)==1); if(c1==0) led= 0x78; else if (c2 ==0) led = 0xb4; while((c1|c2)==0); } }<file_sep>/assignement/segment/dummy.c #include<reg51.h> main(){ P2=0x00; P0=0x00; while(1); }<file_sep>/class/UART/2.c #include<reg51.h> #include"uart.h" main(){ uart_inti(); uart_tx_string("OOOOOOOOOMC"); while(1); }<file_sep>/class/interrupt/EXTERNAL-INTERRUPT/lcd.h void delay(unsigned int i){ unsigned char j; for( ; i>0; i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } void cmd(unsigned char cm){ LCD =cm; RS=RW=0; EN=1; delay(2); EN=0; } void dat(unsigned char dt){ LCD= dt; RS=1;RW=0; EN=1; delay(2); EN=0; } void ini(){ cmd(0x01); cmd(0x02); cmd(0x06); cmd(0x80); cmd(0x0c); cmd(0x38); } void string(char *p){ while(*p) dat(*p++); }<file_sep>/class/switch/keypad.h sbit r0=P1^4; sbit r1=P1^5; sbit r2=P1^6; sbit r3=P1^7; sbit c0=P1^0; sbit c1=P1^1; sbit c2=P1^2; sbit c3=P1^3; code unsigned char table[4][4]= { 0xe1,0xd2,0xc3,0xb4,0xa5,0x96,0x87,0x78,0x69,0x5a,0x4b,0x3c,0x2d,0x1e,0x0f,0xf0}; unsigned char keysearch(){ unsigned char row,col; r0=r1=r2=r3=0; c0=c1=c2=c3=1; while( (c0&c1&c2&c3) == 1); r0=0; r1=1; r2=1; r3=1; if((c0&c1&c2&c3) == 0){ row=0; goto search_coloum; } r0=1; r1=0; r2=1; r3=1; if(( c0&c1&c2) == 0 ){ row =1; goto search_coloum; } r0=1; r1=1; r2=0; r3=1; if((c0&c1&c2&c3) == 0){ row =2; goto search_coloum; } r0=1; r1=1; r2=1; r3=0; if((c0&c1&c2&c3) == 0 ){ row =3; goto search_coloum; } search_coloum: if(c0==0) col = 0; else if (c1 == 0) col = 1; else if (c2 == 0) col = 2; else if (c3 == 0) col = 3; my_delay(100); while( ( c0&c1&c2&c3) == 0); return table[row][col]; }<file_sep>/class/SPI/lcd.h void cmd(unsigned char cmd){ LCD = cmd; RS=RW=0;EN=1; delay(2); EN=0; } void ldata(unsigned char dta){ LCD = dta; RS=1;RW=0;EN=1; delay(2); EN=0; } void ini(){ cmd(0x01); cmd(0x02); cmd(0x06); cmd(0x0c); cmd(0x80); cmd(0x38); } void inte(unsigned int dt){ unsigned char z_c=0; unsigned int temp=dt; if(dt==0) ldata(48); else{ while(!(temp%10)){ z_c++; temp/=10; } temp=0; while(dt){ temp = (temp*10)+(dt%10); dt/=10; } while(temp){ ldata(temp%10+48) ; temp/=10; } while(z_c--) ldata(48); } } void floata(float asd){ int g; g=asd; inte(g); ldata('.'); inte(((asd-g)*1000)); }<file_sep>/assignement/uart/final.c #include<reg51.h> #include"UART.h" sfr lcd = 0x80; sbit RS =P3^4; sbit RW =P3^5; sbit EN =P3^6; unsigned char hexv[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; #include"lcd.h" main(){ unsigned char t,j,a; uart_init(); linit(); while(1){ t=uart_rx(); lcmd(0x01); lcmd(0x02); ldata(t); ldata(' '); j=t^(1<<5); ldata(j); ldata(' '); ///convert decimal ascii a=t; if(a>99){ ldata(hexv[(a/100)]); a=a%100; } ldata(hexv[(a/10)]); ldata(hexv[(a%10)]); ldata('d'); ldata(' '); ///convert hex ascii ldata(hexv[(t/16)]); ldata(hexv[(t%16)]); ldata('H'); ldata(' '); } } <file_sep>/assembly/mixasmandC/7segment/7_1.c #include<reg51.h> void delay(int i){ unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } sfr se=0x80; sbit s=P2^0; sbit s1=P2^1; sbit s2=P2^2; sbit s3=P2^3; code unsigned char l[4]={0x80,0xc0,0x92,0x92}; //ca void digit(char n){ if(n==0){ s=0; se=l[n]; delay(2); s=1; } else if(n==1){ s1=0; se=l[n]; delay(2); s1=1; } else if(n==2){ s2=0; se=l[n]; delay(2); s2=1; } else if(n==3){ s3=0; se=l[n]; delay(2); s3=1; } } main(){ unsigned char i,j,k; s=s1=s2=s3=1; while(1){ for(k=0;k<4;k++){ for(j=0;j<250;j++){ for(i=0;i<=k;i++) digit(i); } } for(k=4;k>0;k--) for(j=0;j<250;j++){ for(i=4;i>=k;i--) digit(i-1); } } }<file_sep>/assignement/I2C/EEPROM-interface/i2c.h void start(){ SCL=1; SDA=1; SDA=0; } void stop(){ SCL=0; SDA=0; SCL=1; SDA=1; } void write(unsigned char a){ char i; for(i=7;i>=0;i--){ SCL = 0; SDA = (a&(1<<i)) ? 1 : 0 ; SCL =1; } } unsigned char read(){ unsigned char temp=0; char i; for(i=7;i>=0;i--){ SCL = 1; if(SDA == 1) temp = temp|(1<<i); SCL = 0; } return temp; } void ack(){ SCL = 0; SDA = 1; SCL = 1; while(SDA == 1); SCL = 0; } void noack(){ SCL = 0; SDA = 1; SCL = 1; }<file_sep>/class/led/led-4acitvehigh-4activelow.c #include<reg51.h> #include"delay.h" main(){ while(1){ P2=0x0F; my_delay(1000); P2=0xf0; my_delay(1000); } }<file_sep>/book/switch/keypad.h scode unsigned char look[4][4]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}; sbit c0=P2^0; sbit c1=P2^1; sbit c2=P2^2; sbit c3=P2^3; sbit r0=P2^4; sbit r1=P2^5; sbit r2=P2^6; sbit r3=P2^7; unsigned char key(){ unsigned char row,col; r0=r1=r2=r3=0; c0=c1=c2=c3=1; while((c0&c1&c2&c3)==1); r0=0;r1=r2=r3=1; if((c0&c1&c2&c3)==0){ row=0; goto coloum; } r1=0;r0=r2=r3=1; if((c0&c1&c2&c3)==0){ row=1; goto coloum; } r2=0;r1=r0=r3=1; if((c0&c1&c2&c3)==0){ row=2; goto coloum; } r3=0;r1=r2=r0=1; if((c0&c1&c2&c3)==0){ row=3; goto coloum; } coloum: if(c0==0) col=0; else if(c1==0) col=1; else if(c2==0) col=2; else if(c3==0) col=3; delay(100); while((c0&c1&c2&c3)==0); return look[row][col]; }<file_sep>/assembly/mixasmandC/clock/lcd.h void delay(int i){ unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } void lcmd(unsigned char cmd){ lcd = cmd; RS=RW=0;EN=1; delay(2); EN=0; } void ldata(unsigned char dta){ lcd = dta; RS=1;RW=0;EN=1; delay(2); EN=0; } void lint(unsigned char temp){ ldata((temp/10)+48); ldata((temp%10)+48); } void ini(){ lcmd(0x01); lcmd(0x02); lcmd(0x06); lcmd(0x0c); lcmd(0x38); lcmd(0x80); } void string(char *p){ while(*p) ldata(*p++); }<file_sep>/class/I2C/lcd.h void cmd(unsigned char cmd){ lcd =cmd; rs=rw=0;en=1; delay(2); en=0; } void ldata(unsigned char dta){ lcd=dta; rs=1;rw=0;en=1; delay(2); en=0; } void init(){ cmd(0x01); cmd(0x02); cmd(0x06); cmd(0x0c); cmd(0x38); cmd(0x80); }<file_sep>/assignement/I2C/EEPROM-interface/1-string-eeprom-store.c #include<reg51.h> #include"delay.h" sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" sbit SDA = P2^0; sbit SCL = P2^1; #include"i2c.h" #include"i2c-device.h" main(){ unsigned char buffer[]="I2C INTERFACING WITH AT24c08!",add=0x00,i; ini(); for(add=0;buffer[add];add++) device_write(0xA2,add,buffer[add]); i=add; for(add=0;add<i;add++) { if(add==16) cmd(0xc0); ldata(device_read(0xA2,add)); } while(1); }<file_sep>/class/SPI/adc.h unsigned int read(){ unsigned int temp=0; char i; cs = 0;//start comm clk=0; din =1; clk=1;//start bit clk=0; din =1; clk=1;//signle ended mode clk=0; din =1; clk=1; clk=0; din =0; clk=1; clk=0; din =0; clk=1; clk=0; clk=1; clk=0; clk=1; for(i=11;i>=0;i--){ clk = 0; if(dout==1) temp = temp|(1<<i); clk = 1; } cs = 1; return temp; }<file_sep>/class/interrupt/EXTERNAL-INTERRUPT/1.c #include<reg51.h> sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" void external() interrupt 0{ cmd(0xc0); string("Ex interrupt..."); } main(){ EA=EX0=1; IT0=0; ini(); while(1){ cmd(0x80); string("MAIN......"); delay(1000); cmd(0x01); } }<file_sep>/assignement/I2C/REAL-TIME-CLOCK-interface/delay.h void delay(unsigned int i){ unsigned char j; for( ; i>0 ;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } }<file_sep>/assignement/interrupt/1.c #include<reg51.h> sfr LCD = 0x80; sbit RS = P3^4; sbit RW = P3^5; sbit EN = P3^6; #include"lcd.h" unsigned char p[35]; static unsigned char count=0; void UART_ISR(void) interrupt 4{ if(TI==1){ TI=0; } if(RI==1){ if(SBUF!='\x0D') p[count++]=SBUF; else if(count<35) { lcmd(0x01); lcmd(0x02); lstring(p); count=0; } RI=0; } } main(){ lini(); SCON = 0X50; TMOD = 0X20; TH1=TL1=253; TR1=1; EA=ES=1; while(1){ } } <file_sep>/class/switch/2.c #include<reg51.h> sbit sw=P2^0; sbit led =P1^0; main(){ while(1){ if(sw==0) led=1; else led=0; } }<file_sep>/book/led/1-2.c //BOOK -1-2 #include<reg51.h> #include"delay.h" sfr led = 0xA0; main(){ unsigned char count=0; led=0x0f; while(1){ /*if( count < 20){ led = ~ led; delay(1000); count++; } */ if( count <10){ led = 0xf0; delay(1000); led =0x0f; delay(1000); count++; } else led = 0xf0; } }<file_sep>/class/UART/lcd.h unsigned char look[]={'0','1','2','3','4','5','6','7','8','9'}; void delay(int i) { unsigned char j; for(;i>0;i--){ for(j=250;j>0;j--); for(j=247;j>0;j--); } } void lcmd(unsigned char cmd){ LCD = cmd; RS=RW=0;EN=1; delay(2); EN=0; } void ldata(unsigned char dta){ LCD = dta; RS=1;RW=0;EN=1; delay(2); EN = 0; } void lstring(char *p){ while(*p) ldata(*p++); } void ldigi(int j){ int k,count=0,temp=0; k=j; while(k){ if((k%10)==0) count++; k/=10; } k=j; while(k){ temp=(temp*10)+(k%10); k/=10; } while(temp){ ldata(look[(temp%10)]); temp/=10; } for(;count;count--) ldata(look[0]); } void linit(){ lcmd(0x01); lcmd(0x02); lcmd(0x06); lcmd(0x0c); lcmd(0x80); lcmd(0x38); }
b2eaa3a3c7b397442c9e2fcd0efb6c83c96719fe
[ "C" ]
94
C
erkt/8051-microcontroller
c4647b710ad158c764eb8f216996707d1fa57de6
77caab4ae24717e58581f4f79066db15df00ed7e
refs/heads/main
<repo_name>BlokOfWood/HardwareSoftwareMonitor-PapSandorDaniel<file_sep>/HardwareSoftwareMonitor/HardwareSoftwareMonitor/MainWindow.xaml.cs using Microsoft.Win32; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Management; using System.Windows; namespace HardwareSoftwareMonitor { public class InstalledApplication { public string Name { get; set; } public string Version { get; set; } public string InstallLocation { get; set; } public InstalledApplication(RegistryKey _appKey) { object displayName = _appKey.GetValue("DisplayName"); object displayVersion = _appKey.GetValue("DisplayVersion"); object installLocation = _appKey.GetValue("InstallLocation"); if (displayName != null) Name = displayName.ToString(); else Name = ""; if (displayVersion != null) Version = _appKey.GetValue("DisplayVersion").ToString(); else Version = ""; if (installLocation != null) InstallLocation = _appKey.GetValue("InstallLocation").ToString(); else InstallLocation = ""; } } /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { BindingList<InstalledApplication> _softwareList = new BindingList<InstalledApplication>(); public MainWindow() { InitializeComponent(); /*Hardverelemek*/ MotherboardManufacturer.Content = GetComponent("Win32_BaseBoard", "Manufacturer"); MotherboardProduct.Content = GetComponent("Win32_BaseBoard", "Product"); Processor.Content = GetComponent("Win32_Processor", "Name"); Videocard.Content = GetComponent("Win32_VideoController", "Name"); BIOSManufacturer.Content = GetComponent("Win32_BIOS", "Manufacturer"); BIOS_Name.Content = GetComponent("Win32_BIOS", "Name"); /*Szoftver*/ using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")) { foreach (string item in key.GetSubKeyNames()) { RegistryKey appKey = key.OpenSubKey(item); _softwareList.Add(new InstalledApplication(appKey)); } } SoftwareGrid.ItemsSource = _softwareList; } static string GetComponent(string hardwareClass, string syntax) { string returnValue = ""; ManagementObjectSearcher mos = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM " + hardwareClass); foreach (ManagementObject mj in mos.Get()) { if (Convert.ToString(mj[syntax]) != "") returnValue += Convert.ToString(mj[syntax]); } return returnValue; } private void Button_Click(object sender, RoutedEventArgs e) { List<string> outputString = new List<string>(); outputString.Add("dataname;value"); outputString.Add(string.Join(";", "Motherboard Manufacturer", GetComponent("Win32_BaseBoard", "Manufacturer"))); outputString.Add(string.Join(";", "Motherboard", GetComponent("Win32_BaseBoard", "Product"))); outputString.Add(string.Join(";", "Processor", GetComponent("Win32_Processor", "Name"))); outputString.Add(string.Join(";", "VideoCard", GetComponent("Win32_VideoController", "Name"))); outputString.Add(string.Join(";", "BIOS Manufacturer", GetComponent("Win32_BIOS", "Manufacturer"))); outputString.Add(string.Join(";", "BIOSName", GetComponent("Win32_BIOS", "Name"))); outputString.Add("applicationame;applicationversion;installlocation"); foreach(var i in _softwareList) { if(i.Name != "") outputString.Add(string.Join(";", i.Name, i.Version, i.InstallLocation)); } SaveFileDialog saveFileDialog = new SaveFileDialog() { Filter = "Comma-separated values file (.csv) | *.csv" }; if(saveFileDialog.ShowDialog() == true) { System.IO.File.WriteAllLines(saveFileDialog.FileName, outputString); } } } }
67d1dfb40878cac455a88ebd233abd08936a72c1
[ "C#" ]
1
C#
BlokOfWood/HardwareSoftwareMonitor-PapSandorDaniel
654ae2093edfb2d6d981eee41cc6766f30111dc3
aacf4aead5eecdd9bd196efbda3a7aae05e8e465
refs/heads/main
<file_sep>import React from "react"; const Header = () => { return <div className="header"> <div className="header_left"> <img src="" alt=""/> </div> </div>; }; export default Header; <file_sep>const map = L.map("map").setView([22.9074872, 79.07306671], 5); // open street map url const tileUrl = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"; const attribution = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors-<NAME>'; const tiles = L.tileLayer(tileUrl, { attribution }); // adding to map tiles.addTo(map); // generating markup function generateList() { const ul = document.querySelector(".list"); shopList.forEach((shop) => { const li = document.createElement("li"); const div = document.createElement("div"); const a = document.createElement("a"); const p = document.createElement("p"); div.classList.add("shop_item"); a.innerText = shop.properties.name; a.href = "#"; p.innerText = shop.properties.address; // adding locate eventListener a.addEventListener('click',()=>{ locateStore(shop) }) div.appendChild(a); div.appendChild(p); li.appendChild(div); ul.appendChild(li); }); } generateList(); // markups function popUpContent(shop){ return ` <div> <h4>${shop.properties.name}</h4> <p>${shop.properties.address}</p> <div class="phone_no"> <a href="tel:${shop.properties.phone}">${shop.properties.phone}</a> </div> </div> `; } function onEachFeature(feature, layer) { layer.bindPopup(popUpContent(feature), { closeButton: false, offset: L.point(0, -8), }); } // icons const icon = L.icon({ iconUrl: "https://cdn.onlinewebfonts.com/svg/img_319799.png", iconSize: [30, 30], }); const shopLayer = L.geoJSON(shopList, { onEachFeature: onEachFeature, pointToLayer: function (feature, latlng) { return L.marker(latlng, { icon }); }, }); shopLayer.addTo(map); // locate shops function locateStore(store){ map.flyTo([store.geometry.coordinates[1], store.geometry.coordinates[0]]); } <file_sep>const express=require('express') const app=express() const PORT=process.env.PORT||5000 // routes app.get('/',(req,res)=>{ res.send('<h1>Hello World</h1>') }) app.listen(PORT,()=>{ console.log(`Server Running on port ${PORT}`); })<file_sep>const map = L.map("map").setView([22.9074872, 79.07306671], 5); // open street map url const tileUrl = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"; const attribution = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors-<NAME>'; const tiles = L.tileLayer(tileUrl, { attribution }); // adding to map tiles.addTo(map); // adding layers to map const CLayer = L.circle([26.524075, 93.963188], { radius: 20000, color: "coral", fillColor: "blue", }); //stroke:false CLayer.addTo(map); // adding rectangle const bounds = [ [54.559322, -5.767822], [56.1210604, -3.02124], ]; const rectangle = L.rectangle(bounds); rectangle.addTo(map); // polygon const Btringle = [ [ [25.774, -80.19], [18.466, -66.118], [32.321, -64.757], ], ]; const polygon = L.polygon(Btringle); polygon.addTo(map); // polyline const latlngs = [ [45.51, -122.68], [37.77, -122.43], [34.04, -118.2], ]; const polyline = L.polyline(latlngs); polyline.addTo(map); // adding marker to map // const CMarker = L.circleMarker([26.5577358, 93.8052436], { color: "purple" }); // CMarker.addTo(map); // adding custom icon const icon = L.icon({ iconUrl: "https://cdn.onlinewebfonts.com/svg/img_319799.png", iconSize: [30, 30], }); // marker // const marker = L.marker([26.5577358, 93.8052436], { icon }); const marker1 = L.marker([26.5577358, 93.8052436], { icon }); // marker.bindPopup('Rakesh Shop') // marker.bindPopup('<h2>Rakesh Shop</h2>') marker1.bindTooltip("<h2>Rakesh Shop</h2>").openTooltip(); // marker.addTo(map); marker1.addTo(map);
c5434cdfc094033702030122f25f7b4664162d35
[ "JavaScript" ]
4
JavaScript
DebasisSaikia/Advance-React-concept-Example
258ffa2b83199595896a3678e3a5aac975ef6e49
4f0f7ed09cc35431bc60b851c0bc235a15132e5e
refs/heads/master
<file_sep>package com.kekexun.soochat.smack; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.security.auth.callback.CallbackHandler; import org.jivesoftware.smack.AbstractXMPPConnection; import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode; import org.jivesoftware.smack.ConnectionListener; import org.jivesoftware.smack.ReconnectionManager; import org.jivesoftware.smack.SASLAuthentication; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.StanzaListener; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.chat.Chat; import org.jivesoftware.smack.chat.ChatManager; import org.jivesoftware.smack.chat.ChatManagerListener; import org.jivesoftware.smack.filter.StanzaFilter; import org.jivesoftware.smack.filter.StanzaTypeFilter; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.packet.Presence.Type; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.roster.Roster; import org.jivesoftware.smack.roster.RosterEntry; import org.jivesoftware.smack.roster.RosterListener; import org.jivesoftware.smack.sasl.SASLMechanism; import org.jivesoftware.smack.tcp.XMPPTCPConnection; import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration; import org.jivesoftware.smackx.iqregister.packet.Registration; import org.jivesoftware.smackx.ping.android.ServerPingWithAlarmManager; import android.content.SharedPreferences; import android.util.Log; import com.kekexun.soochat.common.K; import com.kekexun.soochat.pojo.ChatItem; /** * * @author Ke.Wang * @date 2015.11.25 * */ public class BaseIMServer implements IMServer { private static final String tag = "BaseIMServer"; /** * 唯一实例 */ private static BaseIMServer instance; /** * 链接 */ private AbstractXMPPConnection conn; /** * 花名册 */ private Roster roster; /** * 会话管理 */ private ChatManager chatManager; /** * */ private SharedPreferences sharedPreferences; /** * 是否连接到IMServer */ private boolean isConnected = false; /** * 花名册列表 */ private List<ChatItem> rosterList; /** * Construct * @param sharedPreferences */ private BaseIMServer() { } /** * 花名册监听对象 */ private RosterListener rosterListener = new RosterListener() { @Override public void entriesAdded(Collection<String> addresses) { Log.d(tag, "------ BaseIMServer.rosterListener.entriesAdded()"); } @Override public void presenceChanged(Presence presence) { Log.d(tag, "------ BaseIMServer.rosterListener.presenceChanged()"); Type type = presence.getType(); System.out.println("------" + type); } @Override public void entriesUpdated(Collection<String> addresses) { Log.d(tag, "------ BaseIMServer.rosterListener.entriesUpdated()"); } @Override public void entriesDeleted(Collection<String> addresses) { Log.d(tag, "------ BaseIMServer.rosterListener.entriesDeleted()"); } }; /** * 会话监听器 */ private ChatManagerListener chatManagerListener = new ChatManagerListener() { @Override public void chatCreated(Chat chat, boolean createdLocally) { if (!createdLocally) { //TODO chat.addMessageListener(new MyNewMessageListener()); } } }; /** * 获取实例 * @return */ public static BaseIMServer getInstance() { if (instance == null) { Log.d(tag, "------ 新创建 BaseIMServer 实例"); instance = new BaseIMServer(); return instance; } Log.d(tag, "------ 返回已经存在的 BaseIMServer 实例"); return instance; } /** * 获取 JID 指定的部分 */ @Override public String getJidPart(String jid, String type) { if (type == "100") { return jid.substring(0, jid.indexOf("@")); } else if (type == "010") { return jid.substring(jid.indexOf("@"), jid.lastIndexOf("\\/")); } else if (type == "001") { return jid.substring(jid.lastIndexOf("\\/")); } else if (type == "110") { return jid.substring(jid.lastIndexOf("\\/")); } return null; } /** * 注册 * @param account * @param password * @return 1、注册成功 0、服务器没有返回结果2、这个账号已经存在3、注册失败 */ public String register(String account, String password) {// TODO // 设置属性 Map<String, String> attributes = new HashMap<String, String>(); attributes.put("name", "soosky"); attributes.put("first", "wang"); attributes.put("last", "ke"); attributes.put("email", "<EMAIL>"); attributes.put("city", "xi'an"); attributes.put("state", "0"); // the user's state attributes.put("zip", "71000"); attributes.put("phone", "15091545831"); attributes.put("url", "www.kekexun.com"); attributes.put("misc", ""); // other miscellaneous information to associate with the account. attributes.put("text", "wk"); // textual information to associate with the account. //attributes.put("remove", ""); //empty flag to remove account. Registration reg = new Registration(attributes); reg.setType(IQ.Type.set); reg.setTo("192.168.9.111"); /*PacketFilter filter = new AndFilter(new PacketIDFilter(reg.getPacketID()), new PacketTypeFilter(IQ.class)); PacketCollector collector = getConn().createPacketCollector(filter); getConn().sendStanza(reg); IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Stop queuing results collector.cancel();// 停止请求results(是否成功的结果) if (result == null) { Log.e("RegistActivity", "No response from server."); return "0"; } else if (result.getType() == IQ.Type.result) { return "1"; } else { // if (result.getType() == IQ.Type.ERROR) if (result.getError().toString().equalsIgnoreCase("conflict(409)")) { Log.e("RegistActivity", "IQ.Type.ERROR: " + result.getError().toString()); return "2"; } else { Log.e("RegistActivity", "IQ.Type.ERROR: " + result.getError().toString()); return "3"; } }*/ return "0"; } /** * 连接的 IMServer 服务器 */ @Override public boolean connect(String username, String password) throws Exception { if (getConn() != null && getConn().isConnected()) { Log.d(tag, "------ BaseIMServer.connect() already connected. return true !"); return true; } // XMPP service (i.e., the XMPP domain) String serviceName = sharedPreferences.getString(K.PreferenceKey.KEY_XMPP_RESOURCE, "192.168.9.115"); // 资源 String resource = sharedPreferences.getString(K.PreferenceKey.KEY_XMPP_RESOURCE, "SooChat"); // 端口 int port = sharedPreferences.getInt(K.PreferenceKey.KEY_XMPP_SERVER_PORT, 5222); XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder(); configBuilder.setDebuggerEnabled(true) .setUsernameAndPassword(username, password) .setServiceName(serviceName) .setPort(port) .setResource(resource) .setSecurityMode(SecurityMode.disabled); SASLAuthentication.registerSASLMechanism(new SASLMechanism() { @Override protected SASLMechanism newInstance() { return this; } @Override public int getPriority() { return 0; } @Override public String getName() { return null; } @Override protected byte[] getAuthenticationText() throws SmackException { return null; } @Override public void checkIfSuccessfulOrThrow() throws SmackException { } @Override protected void authenticateInternal(CallbackHandler cbh) throws SmackException { } }); try { conn = new XMPPTCPConnection(configBuilder.build()); // 连接 conn.connect(); // 设置回执包超时时长 conn.setPacketReplyTimeout(10000); // 设置自动重连 ReconnectionManager.getInstanceFor(conn).enableAutomaticReconnection(); // TODO 不清楚 ServerPingWithAlarmManager.getInstanceFor(conn).setEnabled(true); // 添加链接监听器 conn.addConnectionListener(new MyConnectionListener()); // 添加花名册监听器 roster = Roster.getInstanceFor(getConn()); roster.addRosterListener(rosterListener); // 添加消息监听器 chatManager = ChatManager.getInstanceFor(getConn()); chatManager.addChatListener(chatManagerListener); // 添加IQ监听器 StanzaFilter stanzaFilter = new StanzaTypeFilter(IQ.class); StanzaListener myListener = new StanzaListener() { @Override public void processPacket(Stanza stanza) throws NotConnectedException { String from = stanza.getFrom(); String to = stanza.getTo(); System.out.println("------ from=" + from + " to=" + to + " stanza=" + stanza); // 初始化花名册 initRoster(); } }; conn.addAsyncStanzaListener(myListener, stanzaFilter); // 登录 conn.login(); if (conn != null && conn.isConnected()) { // TODO 异常情况未考虑完整 return true; } } catch (Exception e) { e.printStackTrace(); Log.e(tag, "@@@@@@ 登录到 IMServer 出错,详细原因:" + e.getMessage()); return false; } return false; } /** * 更改用户状态 */ public void setPresence(int code) throws Exception { Presence presence; switch (code) { case 0: presence = new Presence(Presence.Type.available); getConn().sendStanza(presence); Log.v("state", "设置在线"); break; case 1: presence = new Presence(Presence.Type.available); presence.setMode(Presence.Mode.chat); getConn().sendStanza(presence); Log.v("state", "设置Q我吧"); System.out.println(presence.toXML()); break; case 2: presence = new Presence(Presence.Type.available); presence.setMode(Presence.Mode.dnd); getConn().sendStanza(presence); Log.v("state", "设置忙碌"); System.out.println(presence.toXML()); break; case 3: presence = new Presence(Presence.Type.available); presence.setMode(Presence.Mode.away); getConn().sendStanza(presence); Log.v("state", "设置离开"); System.out.println(presence.toXML()); break; case 4: Collection<RosterEntry> entries = roster.getEntries(); for (RosterEntry entry : entries) { presence = new Presence(Presence.Type.unavailable); //presence.setStanzaID(Packet.ID_NOT_AVAILABLE); presence.setFrom(getConn().getUser()); presence.setTo(entry.getUser()); getConn().sendStanza(presence); System.out.println(presence.toXML()); } // 向同一用户的其他客户端发送隐身状态 presence = new Presence(Presence.Type.unavailable); //presence.setStanzaID(Packet.ID_NOT_AVAILABLE); presence.setFrom(getConn().getUser()); //presence.setTo(StringUtils.parseBareAddress(getConn().getUser())); getConn().sendStanza(presence); Log.v("state", "设置隐身"); break; case 5: presence = new Presence(Presence.Type.unavailable); getConn().sendStanza(presence); Log.v("state", "设置离线"); break; default: break; } } /** * 获取花名册 * @param conn * @return */ @Override public List<ChatItem> queryRoster() throws Exception { return rosterList; } /** * 设置 SharedPreferences * @param sharedPreferences */ public void setSharedPreferences(SharedPreferences sharedPreferences) { this.sharedPreferences = sharedPreferences; } /** * 获取链接 * @return */ public XMPPConnection getConn() { return conn; } public synchronized boolean isConnected() { return isConnected; } public synchronized void setConnected(boolean isConnected) { this.isConnected = isConnected; } /** * Initialize roster */ private void initRoster() { if (getConn() == null || !getConn().isConnected()) { Log.d(tag, "------ BaseIMServer.queryRoster() 连接异常:conn=" + getConn()); return; } Log.d(tag, "------ BaseIMServer.initRoster() 准备初始化花名册:roster=" + roster); rosterList = new ArrayList<ChatItem>(); Collection<RosterEntry> entries = roster.getEntries(); Log.d(tag, "------ BaseIMServer.initRoster() 准备初始化花名册:entries=" + entries); for (RosterEntry entry : entries) { String jid = entry.getUser(); String name = entry.getName() != null ? entry.getName() : getJidPart(jid, "100"); //ItemStatus itemStatus = entry.getStatus(); //ItemType itemType = entry.getType(); //List<RosterGroup> groups = entry.getGroups(); ChatItem chatItem = new ChatItem("ID-" + name, "icon", name, "用户的 JID 是: " + jid); rosterList.add(chatItem); } Log.d(tag, "------ BaseIMServer.initRoster() 完成花名册初始化:rosterList=" + rosterList); } /** * 链接监听器 */ private class MyConnectionListener implements ConnectionListener { private static final String tag = "MyConnectionListener"; @Override public void connected(XMPPConnection connection) { Log.d(tag, "------ MyConnectionListener.connected()"); } @Override public void authenticated(XMPPConnection connection, boolean resumed) { Log.d(tag, "------ MyConnectionListener.authenticated()"); } @Override public void connectionClosed() { Log.d(tag, "------ MyConnectionListener.connectionClosed()"); } @Override public void connectionClosedOnError(Exception e) { Log.d(tag, "------ MyConnectionListener.connectionClosedOnError()"); } @Override public void reconnectionSuccessful() { Log.d(tag, "------ MyConnectionListener.reconnectionSuccessful()"); } @Override public void reconnectingIn(int seconds) { Log.d(tag, "------ MyConnectionListener.reconnectingIn()"); } @Override public void reconnectionFailed(Exception e) { Log.d(tag, "------ MyConnectionListener.reconnectionFailed()"); } } } <file_sep>package com.kekexun.soochat.smack; import org.jivesoftware.smack.provider.IntrospectionProvider.IQIntrospectionProvider; public class TimeProvider extends IQIntrospectionProvider<Time> { protected TimeProvider(Class<Time> elementClass) { super(elementClass); } } <file_sep>package com.kekexun.soochat.smack; import org.jivesoftware.smack.packet.IQ; public class CustomIQ extends IQ { /** * * @param childElementName * @param childElementNamespace */ public CustomIQ(String childElementName, String childElementNamespace) { super(childElementName, childElementNamespace); } @Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { xml.append(">"); //TODO why return xml; } } <file_sep>package com.kekexun.soochat.smack; import java.util.List; import com.kekexun.soochat.pojo.ChatItem; public interface IMServer { public String getJidPart(String jid, String type); public boolean connect(String username, String password) throws Exception; public List<ChatItem> queryRoster() throws Exception; } <file_sep>package com.kekexun.soochat.pojo; import java.io.Serializable; public class ChatItem extends BasePojo implements Serializable { private static final long serialVersionUID = -441994848867283491L; private String id; private String icon; private String title; private String desc; private String time; public ChatItem() { } public ChatItem(String id, String icon, String title) { this.id = id; this.icon = icon; this.title = title; } public ChatItem(String id, String icon, String title, String desc) { this.id = id; this.icon = icon; this.title = title; this.desc = desc; } public ChatItem(String id, String icon, String title, String desc, String time) { this.id = id; this.icon = icon; this.title = title; this.desc = desc; this.time = time; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } } <file_sep>package com.kekexun.soochat.activity.sign; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.Toast; import com.kekexun.soochat.activity.BaseActivity; import com.kekexun.soochat.activity.R; import com.kekexun.soochat.activity.main.MainActivity; import com.kekexun.soochat.activity.register.RegisterActivity; import com.kekexun.soochat.business.sign.impl.SignBusiness; /** * * @author Ke.Wang * @date 2015.11.25 * */ public class SignActivity extends BaseActivity { private static final String tag = "LoginActivity"; private ImageView ivHeader; private EditText etLoginName; private EditText etLoginPassword; private SignBusiness signBusiness; /** * 更新登录用户头像事件类型 */ private final static int SHOW_LOGIN_HEADER_IMAGE = 0; private final static int QUERY_LOGIN_HEADER_IMAGE_ERROR = 1; public final static int CONNECT_TO_IMSERVER_SUCCESS = 2; public final static int CONNECT_TO_IMSERVER_FAILURE = 3; /** * 主线程消息处理器 */ private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { switch(msg.what) { case SHOW_LOGIN_HEADER_IMAGE: Bitmap bitmap = (Bitmap) msg.obj; ivHeader.setImageBitmap(bitmap); break; case QUERY_LOGIN_HEADER_IMAGE_ERROR: String content = (String) msg.obj; Toast.makeText(SignActivity.this, content, Toast.LENGTH_LONG).show(); break; case CONNECT_TO_IMSERVER_SUCCESS: // 保存登录信息 signBusiness.saveLoginInfo(etLoginName.getText().toString().trim(), etLoginPassword.getText().toString().trim(), true); // 跳转到主页面 Intent intent = new Intent(SignActivity.this, MainActivity.class); SignActivity.this.startActivity(intent); SignActivity.this.finish(); break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_sign); // 检查网络状态 //checkNetState(LIFTCYCLE_CREATE); // Initialize SignBusiness signBusiness = new SignBusiness(this); // Initialize views initViews(); //queryMyHeaderImage("a", "b"); } @Override protected void onStart() { super.onStart(); // 检查网络状态 //checkNetState(LIFTCYCLE_START); } /** * 初始化控件 */ private void initViews() { ivHeader = (ImageView) this.findViewById(R.id.iv_header); etLoginName = (EditText) this.findViewById(R.id.et_login_name); etLoginPassword = (EditText) this.findViewById(R.id.et_login_password); } /** * 获取登录用户的头像 */ private void queryMyHeaderImage(String loginName, String path) { final String tmp = "http://a.hiphotos.baidu.com/image/pic/item/aec379310a55b319c3dd7a9e45a98226cffc1730.jpg"; new Thread() { @Override public void run() { try { URL url = new URL(tmp); HttpURLConnection httpUrlConnection = (HttpURLConnection) url.openConnection(); // 设置请求的方式 httpUrlConnection.setRequestMethod("GET"); // 设置链接超时时间 httpUrlConnection.setConnectTimeout(5000); // 设置读取超时时间(读取图片一般时,网络掉线等异常) httpUrlConnection.setReadTimeout(10000); // 设置其他参数 httpUrlConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36"); // 获取响应吗 int responseCode = httpUrlConnection.getResponseCode(); switch(responseCode) { case 200: InputStream is = httpUrlConnection.getInputStream(); Bitmap bitmap = BitmapFactory.decodeStream(is); //ivHeader.setImageBitmap(bitmap); //告诉主线程一个消息,帮当前线程更新头像控件 Message message = new Message(); message.what = SHOW_LOGIN_HEADER_IMAGE; message.obj = bitmap; handler.sendMessage(message); is.close(); break; } } catch (Exception e) { e.printStackTrace(); Message message = new Message(); message.what = QUERY_LOGIN_HEADER_IMAGE_ERROR; message.obj = "获取图片失败!详细原因:" + e.getMessage(); handler.sendMessage(message); Log.e(tag, "@@@@@@ 获取登录头像出错!详细信息:" + e.getMessage()); } } }.start(); } /** * 登录 * @param view */ public void signInAction(View view) { String loginName = etLoginName.getText().toString().trim(); if (TextUtils.isEmpty(loginName)) { Toast.makeText(this, "登录账号不能为空!", Toast.LENGTH_SHORT).show(); return; } String loginPassword = etLoginPassword.getText().toString().trim(); if (TextUtils.isEmpty(loginPassword)) { Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show(); return; } try { signBusiness.doSignIn(loginName, loginPassword, handler); } catch (Exception e) { Log.e(tag, "登录发生异常!" + e.getMessage()); Toast.makeText(this, "登录异常!原因:" + e.getMessage(), Toast.LENGTH_LONG).show(); } } /** * 打开登录窗口 * @param view */ public void openRegister(View view) { Intent intent = new Intent(this, RegisterActivity.class); startActivity(intent); } } <file_sep>package com.kekexun.soochat.activity; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; /** * * @author Ke.Wang * @date 2015.11.25 * */ public class BaseActivity extends Activity { protected static final int LIFTCYCLE_CREATE = 0; protected static final int LIFTCYCLE_START = 1; // 竖屏 protected static final int WINDOW_VERTICAL = 1; // 横屏 protected static final int WINDOW_HORIZONTAL = 0; // 配置选项 protected SharedPreferences sharedPreferences; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); sharedPreferences = getSharedPreferences("prefenrences", Context.MODE_PRIVATE); } /** * 检查网络状态 */ protected boolean getNetState(int liftcycle) { ConnectivityManager conectivityManager = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = conectivityManager.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { return true; } return false; } /** * 横屏或竖屏 * @return */ @SuppressWarnings("deprecation") protected int horizontalOrVertical() { int width = getWindowManager().getDefaultDisplay().getWidth(); //TODO 方法过期 int height = getWindowManager().getDefaultDisplay().getHeight(); if (width < height) { return WINDOW_VERTICAL; // 竖屏 } else { return WINDOW_HORIZONTAL; // 横屏 } } } <file_sep># SooChat 搜聊即使消息 <file_sep>package com.kekexun.soochat.activity.main.chat; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.kekexun.soochat.activity.BaseActivity; import com.kekexun.soochat.activity.R; import com.kekexun.soochat.activity.main.MainActivity; public class ChatWinActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_main_chat_chatwin); initViews(); } /** * Initialize */ private void initViews() { TextView tvUserTitle = (TextView) findViewById(R.id.tvUserTitle); tvUserTitle.setText(getIntent().getStringExtra("userTitle")); } /** * ·µ»Ø * @param view */ public void goBack(View view) { /*Intent intent = new Intent(this, MainActivity.class); //TODO·µ»ØÒì³£ this.startActivity(intent);*/ this.finish(); } } <file_sep>package com.kekexun.soochat.activity.main.myself; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.kekexun.soochat.activity.BaseFragment; import com.kekexun.soochat.activity.R; public class MyselfFragment extends BaseFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.activity_main_myself, null); } } <file_sep>package com.kekexun.soochat.business.impl; import com.kekexun.soochat.business.IBaseBusiness; public class BaseBusiness implements IBaseBusiness { }
fda3ac7ec69aa82c3df1e1212606affbfad46ff2
[ "Markdown", "Java" ]
11
Java
yuwei-z/SooChat
1b16babcd44305c8cd805c9d99a22e94af0a1737
87cd3b2f9ff60f9aa7bb5224435647d6bbb9b45e
refs/heads/master
<repo_name>woshicezai/learnPromise<file_sep>/webpack.config.js module.exports={ mode:"development", // 开发环境 development devtool:'cheap-module-eval-source-map', entry:__dirname+'/index.js',//入口文件 output:{ path:__dirname,//打包后的文件位置 filename:'bundle.js'//打包后的文件 }, module:{ rules:[ { test: /(\.jsx|\.js)$/, use:[{ loader:"babel-loader", options:{ presets:[ "env","react","stage-0" ] }}], exclude:/node_modules/ }] } }<file_sep>/simplePromise.js const PENDING = "pending"; const FULLFILLED = "fullfilled"; const REJECTED = "rejected"; export default class AjPromise { constructor(fn) { this.value = ""; this.reason = ""; this.resolveCallbackArrays = []; this.rejectCallbackArrays = []; try { fn(this.resovle, this.reject); } catch (e) { reject(e); } } resovle = value => { this.value = value; setTimeout(() => { this.resolveCallbackArrays.forEach(fn => { this.value = fn(this.value); }); }); }; reject = reason => { this.reason = reason; setTimeout(() => { this.rejectCallbackArrays.forEach(fn => { this.reason = fn(this.reason); }); }); }; then = (fn)=>{ this.resolveCallbackArrays.push(fn); return this; } } module.export = AjPromise; <file_sep>/index.js import SecondPromise from "./secondePromise"; let p = new SecondPromise((resolve, reject) => { resolve(2); }); p.then(value=>{ return value+4; }) setTimeout(()=>{ console.log(p.state); if(p.state == 'fullfilled'){ p.then(value=>{ console.log('value',value); return value+2; }).then(value=>{ console.log('value2',value); }) } },2000);
66c2a169ae6896f70d9f0e7295f0c544ccaf4b49
[ "JavaScript" ]
3
JavaScript
woshicezai/learnPromise
63534a4cdd01699b0585ed97979a17c986e69d54
de0fc25332d32c108794fff3fc6fa132e2f0c8f4
refs/heads/main
<file_sep># Narita Simple Shell [![Image from game Narita Boy that helped us to disperse in moments of despair](https://github.com/Ksualboy/simple_shell/blob/main/narita.png?raw=true "Image from game Narita Boy that helped us to disperse in moments of despair")](https://github.com/Ksualboy/simple_shell/blob/main/narita.png?raw=true "Image from game Narita Boy that helped us to disperse in moments of despair") ## Description Narita Simple Shell also known as hsh is a simple shell created as a evaluation project for Holberton School. This shell is a simple command line prompt that runs the basics commands that are present in the bash shell. The shell works like the bash and other basic shells. The NSS have the exact same output as `sh (/bin/sh)` as well as the exact same error output. The only difference is when print an error, the name of the program must be equivalent to the `argv[0]` The shell was compiled and tested with gcc, compiled this way: `gcc -Wall -Werror -Wextra -pedantic *.c -o hsh` ## Example of how to launch the shell after compiling: `./hsh` Output: prompt: `#cisfun$` ## Syntax This shell works with commands and arguments (if passed) given by the user throgh input. It handles all the programs that are in the operating system. The syntax is the following: `command_name [arguments]` This will execute the program "command_name" with the given arguments. ` ls file -la ` This code will run the program "ls", and it will pass the arguments "file" and "-la" to the program. This shell has two built-in commands that are "exit" and "env". The first one exits the shell, while the other one prints all the enviroment variables. Feel free to check the man file for more information. ## Builtins We got two builtin you can use programmed in this shell. `env` - built-in, that prints all of the current environment variables with their values. `exit` - built-in, that exits the shell. ## Exiting commands and the shell You can exit out of a command or process of the shell with Control C. `Ctrl+C` stop and abort the proccess you want to terminate. `Ctrl+D` will just exit the shell. If you want to exit the shell, you can type `exit`. ## Files ` README.md` : Current file, contains all the information about this project and the files in this directory ` AUTHORS` : Contains the authors of this "beautiful" shell ` flowchart.png` : the flowchart image file ` man_1_simple_shell` : man file of this shell ` memory_handler.c` : C file that contains all memory-related functions. ` narita.h` : Header file, contains all prototypes for funcitons used, as well as libriaries ` narita.png` : Image from Narita Boy Game ` path_handler.c` : C file that contains all the functions related to the handling of the $PATH enviroment variable ` simple_shell.c` : C file that contains the shell main function, together with some external functions that are used in the main ` str_handler.c` : C file that contains all the functions that handle strings and arrays. ## Flowchart [![Flowchart of NSS](https://github.com/Ksualboy/simple_shell/blob/main/flowchart.png?raw=true)](https://github.com/Ksualboy/simple_shell/blob/main/flowchart.png?raw=true ) The flowchart we do to make this shell ## Bugs Probably some ones but we dont find them ## Authors <NAME> - https://github.com/ksualboy <NAME> - https://github.com/chitny<file_sep>#include "narita.h" /** * _getenv - gets the enviroment variable needed * @name: name of the environment variable * @environ: enviroment variables * * Return: the line with the environment variable */ char *_getenv(char *name, char **environ) { int i, j, n; n = _strlen(name); for (i = 0; environ[i]; i++) { for (j = 0; environ[i][j] == name[j]; j++) { } if (j == n && environ[i][j] == '=') return (environ[i]); } return (NULL); } /** * getpath - Gets the PATH variable * @environ: enviroment variable * @input: command pass by user * * Return: the splitted PATH variable */ char *getpath(char **environ, char *input) { char **path = NULL, *command; unsigned int input_len, path_len, i, j, k; struct stat st; path = _split(_getenv("PATH", environ), "=:"); input_len = _strlen(input); for (i = 1; path[i]; i++) { path_len = _strlen(path[i]); command = malloc(sizeof(char) * (path_len + input_len + 2)); if (!command) { write(2, "Unable to allocate memory", 25); exit(1); } for (j = 0; path[i][j]; j++) command[j] = path[i][j]; command[j++] = '/'; for (k = 0; input[k]; k++) command[j + k] = input[k]; command[j + k] = '\0'; if (stat(command, &st) == 0) { array_cleaner(path); return (command); } free(command); } array_cleaner(path); return (NULL); } <file_sep>#include "narita.h" /** * array_cleaner - Cleans a double pointer * @fire: Double pointer to clean (Best name) * * Return: 1 */ int array_cleaner(char **fire) { int i; for (i = 0; fire[i]; i++) { free(fire[i]); } free(fire); return (1); } <file_sep>#include "narita.h" /** * execute - Runs a given program * @command: command to run * @arguments: arguments to pass to execve * @av: name of the program * * Return: -1 if it breaks, 0 if it doesn't */ int execute(char *command, char **arguments, char *av) { int id; id = fork(); if (id != 0) wait(NULL); if (id == 0 && execve(command, arguments, NULL) == -1) { write(2, av, _strlen(av)); perror(": "); return (errno); } return (0); } /** * main - Entry function * @ac: Ammount of arguments passed * @av: Arguments passed * @env: Enviroment variables * * Return: 0 if success */ int main(int ac __attribute__((unused)), char **av, char **env) { char *input, **splitted; size_t size = 32; int *error_value = malloc(sizeof(int)), n, error, lines = 1; *error_value = 0; input = input_maker(size); if (!input) exit(-1); while (1) { if (isatty(0) == 1) write(1, "#cisfun$ ", 9); n = getline(&input, &size, stdin); if (n == -1) break; if (n == 1) continue; input[n - 1] = ' '; splitted = _split(input, " "); if (!*splitted) { free(splitted); continue; } switch (core(input, splitted, lines, env, av, error_value)) { case 0: error = *error_value; free(error_value); exit(error); case 1: continue; } lines++; } free(input); error = *error_value; free(error_value); return (error); } /** * core - the heart of our shell * @input: the imput of the user * @split: proccessed input * @lines: ammount of lines * @env: enviroment variable * @av: arguments * @err: error pointer * * Return: 10 if success, 0 if exit, 1 if continue, -1 if return-1 */ int core(char *input, char **split, int lines, char **env, char **av, int *err) { char *command; int i; struct stat st; if (_strcmp(split[0], "exit")) { array_cleaner(split); free(input); return (0); } if (_strcmp(split[0], "env")) { for (i = 0; env[i]; i++) { write(1, env[i], _strlen(env[i])); write(1, "\n", 1); } return (array_cleaner(split)); } if (stat(split[0], &st) == 0) { *err = execute(split[0], split, av[0]); return (array_cleaner(split)); } command = getpath(env, split[0]); if (!command) { *err = 127; error_message(lines, split[0], av); } else if (execute(command, split, av[0]) == -1) { perror(": "); *err = errno; return (0); } array_cleaner(split); free(command); return (10); } /** * error_message - Prints the error message * @lines: Ammount of lines so far * @split: proccessed input * @av: ammount of lines */ void error_message(int lines, char *split, char **av) { char *strlines = numtostr(lines); write(2, av[0], _strlen(av[0])); write(2, ": ", 2); write(2, strlines, _strlen(strlines)); write(2, ": ", 2); write(2, split, _strlen(split)); write(2, ": not found\n", 12); free(strlines); } /** * input_maker - Creates the input variable * @size: Size of the malloc * * Return: input */ char *input_maker(size_t size) { char *input; input = (malloc(sizeof(char) * size)); if (!input) write(2, "Unable to allocate memory", 25); return (input); }
7e6dba0b7b51603bd9d90c09e3d58c047c92fc1c
[ "Markdown", "C" ]
4
Markdown
ksualcode/simple_shell
e9a661e75498ea4033dfd2d22b84baa883ae65aa
ac063b00dd621c4b43b5210ad2c6a8a330039088
refs/heads/master
<repo_name>FineDevelop/plugin-dynamicsheetcontrol<file_sep>/README.md # 动态控制要展示和打印的sheet |参数名|参数值| |------|-----| | sheetnotshow|sheet的名字或者sheet的索引(从0开始计数)| ***备注:*** 重点代码分析 * 集成WriteActor保证该预览方式以op=write参数来访问以支持多sheet展示 * 重载方法```executeWorkBook```,用于根据参数删除掉指定的sheet(指报表结果) * 重载方法```processMultipleSheet```,用于根据参数删除掉指定的sheet并生成正确的sheet外观(指sheet展示) ```java package com.fr.plugin.control; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.json.JSONArray; import com.fr.main.impl.WorkBook; import com.fr.main.workbook.ResultWorkBook; import com.fr.report.core.sheet.SheetSequenceExecutor; import com.fr.stable.WriteActor; import com.fr.stable.web.Repository; import com.fr.web.RepositoryHelper; import com.fr.web.core.ReportSession; import com.fr.web.RTypeService; import java.util.Map; /** * @author richie * @date 2015-03-21 * @since 8.0 */ public class SheetControlActor extends WriteActor { private static final String SHEET_INDEX_NOT_BE_SHOW_PARA_NAME = "SHEETNOTSHOW"; public ResultWorkBook executeWorkBook(WorkBook workBook, Map parameterMap) { if (parameterMap.containsKey(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME)) { Number index = GeneralUtils.objectToNumber(parameterMap.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME), true); if (index != null) { workBook.removeReport(index.intValue()); } else { workBook.removeReport(GeneralUtils.objectToString(parameterMap.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME))); } } return new SheetSequenceExecutor(workBook, parameterMap).execute(this); } public JSONArray processMultipleSheet(Repository repository) { Map map = repository.getReportParameterMap(); int sheetIndex = -1; String sheetName = null; if (map.containsKey(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME)) { Number index = GeneralUtils.objectToNumber(map.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME), true); if (index != null) { sheetIndex = index.intValue(); } else { sheetName = GeneralUtils.objectToString(map.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME)); } } JSONArray ja = new JSONArray(); int reportCount = getReportCountInRepo(repository); for (int i = 0; i < reportCount; i++) { ReportSession sessionIDInfo = (ReportSession) RepositoryHelper.getSessionIDInfor(repository); String title = sessionIDInfo.getReportName(i); if (i == sheetIndex || ComparatorUtils.equals(sheetName, title)) { continue; } RTypeService.executeSheetName(repository, title, ja, i); } return ja; } } ``` <file_sep>/src/com/fr/plugin/control/SheetControlActor.java package com.fr.plugin.control; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.json.JSONArray; import com.fr.main.impl.WorkBook; import com.fr.main.workbook.ResultWorkBook; import com.fr.report.core.sheet.SheetSequenceExecutor; import com.fr.stable.WriteActor; import com.fr.stable.web.Repository; import com.fr.web.RepositoryHelper; import com.fr.web.core.ReportSession; import com.fr.web.RTypeService; import java.util.Map; /** * @author richie * @date 2015-03-21 * @since 8.0 */ public class SheetControlActor extends WriteActor { private static final String SHEET_INDEX_NOT_BE_SHOW_PARA_NAME = "SHEETNOTSHOW"; public ResultWorkBook executeWorkBook(WorkBook workBook, Map parameterMap) { if (parameterMap.containsKey(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME)) { Number index = GeneralUtils.objectToNumber(parameterMap.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME), true); if (index != null) { workBook.removeReport(index.intValue()); } else { workBook.removeReport(GeneralUtils.objectToString(parameterMap.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME))); } } return new SheetSequenceExecutor(workBook, parameterMap).execute(this); } public JSONArray processMultipleSheet(Repository repository) { Map map = repository.getReportParameterMap(); int sheetIndex = -1; String sheetName = null; if (map.containsKey(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME)) { Number index = GeneralUtils.objectToNumber(map.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME), true); if (index != null) { sheetIndex = index.intValue(); } else { sheetName = GeneralUtils.objectToString(map.get(SHEET_INDEX_NOT_BE_SHOW_PARA_NAME)); } } JSONArray ja = new JSONArray(); int reportCount = getReportCountInRepo(repository); for (int i = 0; i < reportCount; i++) { ReportSession sessionIDInfo = (ReportSession) RepositoryHelper.getSessionIDInfor(repository); String title = sessionIDInfo.getReportName(i); if (i == sheetIndex || ComparatorUtils.equals(sheetName, title)) { continue; } RTypeService.executeSheetName(repository, title, ja, i); } return ja; } } <file_sep>/src/com/fr/plugin/control/SheetControlActorProvider.java package com.fr.plugin.control; import com.fr.report.fun.ActorProvider; import com.fr.report.stable.fun.Actor; /** * @author richie * @date 2015-03-21 * @since 8.0 */ public class SheetControlActorProvider implements ActorProvider { @Override public Actor[] createActor() { return new Actor[]{new SheetControlActor()}; } }
372ecd2761512020e28bcea90af8b437781890fd
[ "Markdown", "Java" ]
3
Markdown
FineDevelop/plugin-dynamicsheetcontrol
370f7464788dd34adbd43dcd9d137726e2790819
1836a99d8ec7b1ea0b125e514bc09d95142df66b
refs/heads/master
<repo_name>spencerparkin/MathTree<file_sep>/scripts/test2.py # test2.py root = rev(_n('a')*_n('b')*_n('c'))<file_sep>/scripts/test3.py # test3.py root = (_n('a')^_n('b'))*(_n('c')^_n('d'))<file_sep>/manipulators/distributor.py # distribution.py from math_tree import MathTreeManipulator, MathTreeNode class Distributor(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node_a): # TODO: We may not be able to indiscriminately distribute here. Otherwise, we'll fight with collection. # The general rule may be to never distribute anything of non-zero grade over a sum of zero grade. if any([product == node_a.data for product in ['.', '^', '*', 'rev']]): for i, node_b in enumerate(node_a.child_list): if node_b.data == '+' and len(node_b.child_list) > 1: sum = MathTreeNode('+') for node_c in node_b.child_list: product = MathTreeNode(node_a.data) product.child_list += [term.copy() for term in node_a.child_list[:i]] product.child_list.append(node_c.copy()) product.child_list += [term.copy() for term in node_a.child_list[i+1:]] sum.child_list.append(product) return sum<file_sep>/manipulators/collector.py # collector.py from math_tree import MathTreeManipulator, MathTreeNode class Collector(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node): # TODO: We may not be able to indiscriminately collect here. Otherwise, we'll fight with distribution. if node.data == '+': for i in range(len(node.child_list)): child_a = node.child_list[i] for j in range(i + 1, len(node.child_list)): child_b = node.child_list[j] if child_a.data == child_b.data and any([op == child_a.data for op in ['^', '.', '*']]): joined_root = self._join_trees(child_a, child_b) product_a = MathTreeNode('*', []) product_b = MathTreeNode('*', []) for joined_child in joined_root.child_list: if joined_child.data[0] is None and joined_child.data[1].calculate_grade() == 0: product_a.child_list.append(joined_child.data[1]) elif joined_child.data[1] is None and joined_child.data[0].calculate_grade() == 0: product_b.child_list.append(joined_child.data[0]) elif not joined_child.is_perfect_join(): break else: del node.child_list[j] del node.child_list[i] node.child_list.append(MathTreeNode('*', [ MathTreeNode('+', [ product_a, product_b ]), joined_root.intersect_join() ])) return self<file_sep>/scripts/test6.py # test6.py root = _n(5.0) - _n(3.0) - _n(1.0) / _n(4.0)<file_sep>/manipulators/adder.py # adder.py from math_tree import MathTreeManipulator, MathTreeNode class Adder(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node): if node.data == '+': for i in range(len(node.child_list)): child_a = node.child_list[i] for j in range(i + 1, len(node.child_list)): child_b = node.child_list[j] if isinstance(child_a.data, float) and isinstance(child_b.data, float): del node.child_list[j] del node.child_list[i] node.child_list.insert(0, MathTreeNode(child_a.data + child_b.data)) return node adjacent_swap_count = self._sort_list(node.child_list, lambda node: len(node.display_text())) if adjacent_swap_count > 0: return node<file_sep>/manipulators/degenerate_case_handler.py # degenerate_case_handler.py from math_tree import MathTreeManipulator, MathTreeNode class DegenerateCaseHandler(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node): if any([op == node.data for op in ['*', '.', '^', '+']]): if len(node.child_list) == 1: return node.child_list[0] if any([op == node.data for op in ['*', '.', '^']]): if len(node.child_list) == 0: return MathTreeNode(1.0) if any([child.data == 0.0 for child in node.child_list]): return MathTreeNode(0.0) for i, child in enumerate(node.child_list): if child.data == 1.0: del node.child_list[i] return node if node.data == '+': if len(node.child_list) == 0: return MathTreeNode(0.0) for i, child in enumerate(node.child_list): if child.data == 0.0: del node.child_list[i] return node op_list = ['*', '^'] for i in range(2): if node.data == op_list[i]: for j, child in enumerate(node.child_list): if child.data == op_list[(i + 1) % 2]: for k in range(len(node.child_list)): if k != j: if node.child_list[k].calculate_grade() != 0: break else: node.data = op_list[(i + 1) % 2] return node break<file_sep>/scripts/test9.py # test9.py v = _n('ev') p = no + v + 0.5*(v|v)*ni root = p|p # This should yield zero.<file_sep>/scripts/test12.py # test12.py a = _n('a') b = _n('b') c = _n('c') root = a + a + a^b + b^a + a^(b|c)<file_sep>/scripts/test10.py # test10.py a = _n('a') b = _n('b') root = (a^b)*inv(a^b)<file_sep>/manipulators/inverter.py # inverter.py from math_tree import MathTreeManipulator, MathTreeNode class Inverter(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node_a): if node_a.data == '-' and len(node_a.child_list) == 2: return MathTreeNode('+', [ node_a.child_list[0].copy(), MathTreeNode('*', [ MathTreeNode(-1.0), node_a.child_list[1].copy() ]) ]) elif node_a.data == '/' and len(node_a.child_list) == 2: return MathTreeNode('*', [ node_a.child_list[0].copy(), MathTreeNode('inv', [node_a.child_list[1].copy()]) ]) elif node_a.data == 'inv' or node_a.data == 'rev': if len(node_a.child_list) == 1: node_b = node_a.child_list[0] if node_b.data == '*' and len(node_b.child_list) > 1: return MathTreeNode('*', [MathTreeNode(node_a.data, [node_c.copy()]) for node_c in reversed(node_b.child_list)]) if node_a.data == 'inv': if isinstance(node_b.data, float): return MathTreeNode(1.0 / node_b.data) scalar_list, vector_list = self._parse_blade(node_b) if scalar_list is not None and vector_list is not None and len(vector_list) > 0: return MathTreeNode('*', [ MathTreeNode(-1.0 if len(vector_list) % 2 == 0 else 1.0), MathTreeNode('inv', [ MathTreeNode('.', scalar_list + [ MathTreeNode('^', [vector.copy() for vector in vector_list]), MathTreeNode('^', [vector.copy() for vector in vector_list]) ]) ]), MathTreeNode('^', [vector.copy() for vector in reversed(vector_list)]) ]) if node_a.data == 'rev': grade = node_b.calculate_grade() if grade == 0 or grade == 1: return node_b<file_sep>/window.py # window.py import traceback from PyQt5 import QtGui, QtCore, QtWidgets, QtOpenGL from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * from math_tree import MathTreeNode, simplify_tree from math2d_aa_rect import AxisAlignedRectangle from math2d_line_segment import LineSegment from math2d_vector import Vector from script_edit import ScriptEditPanel class GLCanvas(QtOpenGL.QGLWidget): simplify_step_taken_signal = QtCore.pyqtSignal() def __init__(self, parent): gl_format = QtOpenGL.QGLFormat() gl_format.setAlpha(True) gl_format.setDepth(False) gl_format.setDoubleBuffer(True) super().__init__(gl_format, parent) self.root_node = None self.proj_rect = None self.anim_proj_rect = AxisAlignedRectangle() self.animation_timer = QtCore.QTimer() self.animation_timer.start(1) self.animation_timer.timeout.connect(self.animation_tick) self.auto_simplify = False self.dragPos = None self.dragging = False def set_root_node(self, node): self.root_node = node if isinstance(node, MathTreeNode): node.calculate_target_positions() node.assign_initial_positions() self._recalc_projection_rect() def get_root_node(self): return self.root_node def mousePressEvent(self, event): if event.button() == QtCore.Qt.LeftButton: self.grabMouse() self.dragPos = event.pos() self.dragging = True elif event.button() == QtCore.Qt.RightButton: pass # TODO: Maybe use OpenGL selection mechanism on the tree? def mouseMoveEvent(self, event): if self.dragging: sensativity = 0.003 * self.proj_rect.Width() delta = event.pos() - self.dragPos delta = Vector(-float(delta.x()), float(delta.y())) * sensativity self.dragPos = event.pos() self.proj_rect.min_point += delta self.proj_rect.max_point += delta self.update() def mouseReleaseEvent(self, event): self.releaseMouse() self.dragging = False def wheelEvent(self, event): delta = int(event.angleDelta().y() / 120) if delta < 0.0: scale = 1.1 else: scale = 0.9 delta = abs(delta) for i in range(delta): self.proj_rect.Scale(scale) self.update() def initializeGL(self): glClearColor(1.0, 1.0, 1.0, 0.0) def resizeGL(self, width, height): glViewport(0, 0, width, height) if isinstance(self.root_node, MathTreeNode): self._recalc_projection_rect() def _recalc_projection_rect(self): viewport = glGetIntegerv(GL_VIEWPORT) viewport_rect = AxisAlignedRectangle() viewport_rect.min_point.x = 0.0 viewport_rect.min_point.y = 0.0 viewport_rect.max_point.x = float(viewport[2]) viewport_rect.max_point.y = float(viewport[3]) self.proj_rect = self.root_node.calculate_subtree_bounding_rectangle(targets=True) self.proj_rect.Scale(1.1) self.proj_rect.ExpandToMatchAspectRatioOf(viewport_rect) def paintGL(self): glClear(GL_COLOR_BUFFER_BIT) if isinstance(self.root_node, MathTreeNode): if self.proj_rect is None: self._recalc_projection_rect() glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D( self.anim_proj_rect.min_point.x, self.anim_proj_rect.max_point.x, self.anim_proj_rect.min_point.y, self.anim_proj_rect.max_point.y) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glBegin(GL_LINES) try: glColor3f(0.0, 0.0, 0.0) self._render_edges(self.root_node) finally: glEnd() for node in self.root_node.yield_nodes(): self._render_node(node) glFlush() def _render_node(self, node): rect = node.calculate_bounding_rectangle(targets=False) glBegin(GL_QUADS) try: glColor3f(0.8, 0.8, 0.8) glVertex2f(rect.min_point.x, rect.min_point.y) glVertex2f(rect.max_point.x, rect.min_point.y) glVertex2f(rect.max_point.x, rect.max_point.y) glVertex2f(rect.min_point.x, rect.max_point.y) finally: glEnd() glColor3f(0.0, 0.0, 0.0) self._render_text(GLUT_STROKE_ROMAN, node.display_text(), rect) def _render_text(self, font, text, rect): total_width = 0.0 for char in text: width = glutStrokeWidth(font, ord(char)) total_width += float(width) text_rect = AxisAlignedRectangle() text_rect.min_point.x = 0.0 text_rect.max_point.x = total_width text_rect.min_point.y = 0.0 text_rect.max_point.y = 119.05 original_height = text_rect.Height() text_rect.ExpandToMatchAspectRatioOf(rect) height = text_rect.Height() scale = rect.Width() / text_rect.Width() glPushMatrix() try: glTranslatef(rect.min_point.x, rect.min_point.y + (height - original_height) * 0.5 * scale, 0.0) glScalef(scale, scale, 1.0) for char in text: glutStrokeCharacter(font, ord(char)) finally: glPopMatrix() def _render_edges(self, node): for child in node.child_list: glVertex2f(node.position.x, node.position.y) glVertex2f(child.position.x, child.position.y) self._render_edges(child) def animation_tick(self): if isinstance(self.root_node, MathTreeNode): if not self.root_node.is_settled(): self.root_node.advance_positions(0.3) self.update() elif self.auto_simplify: self.do_simplify_step() if self.proj_rect is not None: if ((self.anim_proj_rect.min_point - self.proj_rect.min_point).Length() > 0.0 or (self.anim_proj_rect.max_point - self.proj_rect.max_point).Length() > 0.0): self.anim_proj_rect.min_point = LineSegment(self.anim_proj_rect.min_point, self.proj_rect.min_point).Lerp(0.1) self.anim_proj_rect.max_point = LineSegment(self.anim_proj_rect.max_point, self.proj_rect.max_point).Lerp(0.1) self.update() def do_simplify_step(self): if isinstance(self.root_node, MathTreeNode): try: new_root_node = simplify_tree(self.root_node, max_iters=1) except Exception as ex: tb = traceback.format_exc() error = str(ex) msgBox = QtWidgets.QMessageBox(parent=self) msgBox.setWindowTitle('Simplification error!') msgBox.setText('ERROR: ' + str(error) + '\n\n' + tb) msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgBox.exec_() self.auto_simplify = False else: self.root_node = new_root_node self.root_node.calculate_target_positions() self.root_node.assign_initial_positions() self.update() self.simplify_step_taken_signal.emit() class Window(QtWidgets.QMainWindow): def __init__(self): super().__init__() self.locals_dict = {} self.setWindowTitle('Math Tree') self.canvas = GLCanvas(self) self.canvas.simplify_step_taken_signal.connect(self.simplify_step_taken) self.line_edit = QtWidgets.QLineEdit() self.line_edit.returnPressed.connect(self.line_edit_enter_pressed) self.expression_label = QtWidgets.QLabel() self.expression_label.setFixedHeight(20) simplify_button = QtWidgets.QPushButton('Simplify') simplify_button.setFixedWidth(60) simplify_button.clicked.connect(self.simplify_button_pressed) self.auto_simplify_check = QtWidgets.QCheckBox('Auto Simplify') self.auto_simplify_check.clicked.connect(self.auto_simplify_check_pressed) self.auto_simplify_check.setFixedWidth(80) top_layout = QtWidgets.QHBoxLayout() top_layout.addWidget(simplify_button) top_layout.addWidget(self.expression_label) top_layout.addWidget(self.auto_simplify_check) main_layout = QtWidgets.QVBoxLayout() main_layout.addLayout(top_layout) main_layout.addWidget(self.canvas) main_layout.addWidget(self.line_edit) main_widget = QtWidgets.QWidget() main_widget.setLayout(main_layout) self.setCentralWidget(main_widget) script_edit_panel = ScriptEditPanel(self) script_edit_panel.execute_button_pressed_signal.connect(self.script_edit_execute_pressed) self.addDockWidget(QtCore.Qt.RightDockWidgetArea, script_edit_panel) def auto_simplify_check_pressed(self): self.canvas.auto_simplify = self.auto_simplify_check.isChecked() def script_edit_execute_pressed(self, code): self._execute_code(code) def line_edit_enter_pressed(self): code = self.line_edit.text() if self._execute_code(code): self.line_edit.clear() def _execute_code(self, code): from math_tree import MathTreeNode globals_dict = { '_n': lambda x: MathTreeNode(x), 'inv': lambda x: MathTreeNode('inv', [x]), 'rev': lambda x: MathTreeNode('rev', [x]), 'e1': MathTreeNode('e1'), 'e2': MathTreeNode('e2'), 'e3': MathTreeNode('e3'), 'no': MathTreeNode('no'), 'ni': MathTreeNode('ni'), '_v': lambda x, y, z: MathTreeNode('+', [ MathTreeNode('*', [MathTreeNode(x), MathTreeNode('e1')]), MathTreeNode('*', [MathTreeNode(y), MathTreeNode('e2')]), MathTreeNode('*', [MathTreeNode(z), MathTreeNode('e3')]) ]), 'simplify': simplify_tree } try: exec(code, globals_dict, self.locals_dict) except Exception as ex: error = str(ex) msgBox = QtWidgets.QMessageBox(parent=self) msgBox.setWindowTitle('Oops!') msgBox.setText('ERROR: ' + str(error)) msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgBox.exec_() return False else: root_node = self.locals_dict.get('root', None) self.canvas.set_root_node(root_node) self.canvas.update() self.update_expression_label() return True def update_expression_label(self): root_node = self.canvas.get_root_node() text = '' if root_node is None else root_node.expression_text() metrics = QtGui.QFontMetrics(self.expression_label.font()) text = metrics.elidedText(text, QtCore.Qt.ElideRight, self.expression_label.width()) self.expression_label.setText(text) def simplify_step_taken(self): self.update_expression_label() def simplify_button_pressed(self): self.canvas.do_simplify_step() <file_sep>/scripts/test11.py # test11.py a = _n('a') b = _n('b') root = (a^b)*(a^b)<file_sep>/manipulators/outer_product_handler.py # outer_product_handler.py from math_tree import MathTreeManipulator, MathTreeNode class OuterProductHandler(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node): scalar_list, vector_list = self._parse_blade(node) if scalar_list is not None and vector_list is not None: for i in range(len(vector_list)): vector_a = vector_list[i] for j in range(i + 1, len(vector_list)): vector_b = vector_list[j] if vector_a.data == vector_b.data: return MathTreeNode(0.0) adjacent_swap_count = self._sort_list(vector_list, sort_key=lambda vector: vector.data) if adjacent_swap_count > 0: new_node = MathTreeNode('^', scalar_list + vector_list) if adjacent_swap_count % 2 == 1: new_node.child_list.insert(0, MathTreeNode(-1.0)) return new_node<file_sep>/scripts/test8.py # test8.py v = _v('$x', '$y', '$z') p = no + v + 0.5*(v|v)*ni root = p|p<file_sep>/manipulators/geometric_product_handler.py # geometric_product_handler.py from math_tree import MathTreeManipulator, MathTreeNode class GeometricProductHandler(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node): new_node = self._manipulate_subtree_internal(node, False) if new_node: return new_node return self._manipulate_subtree_internal(node, True) def _manipulate_subtree_internal(self, node, allow_same_grade): if node.data == '*': for i in range(len(node.child_list) - 1): node_a = node.child_list[i] node_b = node.child_list[i + 1] scalar_list_a, vector_list_a = self._parse_blade(node_a) scalar_list_b, vector_list_b = self._parse_blade(node_b) if vector_list_a is not None and vector_list_b is not None: if len(vector_list_a) > 0 and len(vector_list_b) > 0: if len(vector_list_a) != len(vector_list_b) or allow_same_grade: if len(vector_list_a) == 1 or len(vector_list_b) == 1: sum = MathTreeNode('+', [ MathTreeNode('.', [ MathTreeNode('^', [vector.copy() for vector in vector_list_a]), MathTreeNode('^', [vector.copy() for vector in vector_list_b]) ]), MathTreeNode('^', [ MathTreeNode('^', [vector.copy() for vector in vector_list_a]), MathTreeNode('^', [vector.copy() for vector in vector_list_b]) ]), ]) else: if len(vector_list_a) <= len(vector_list_b): sum = MathTreeNode('+', [ MathTreeNode('*', [ vector_list_a[0].copy(), MathTreeNode('^', [vector.copy() for vector in vector_list_a[1:]]), MathTreeNode('^', [vector.copy() for vector in vector_list_b]) ]), MathTreeNode('*', [ MathTreeNode(-1.0), MathTreeNode('.', [ vector_list_a[0].copy(), MathTreeNode('^', [vector.copy() for vector in vector_list_a[1:]]), ]), MathTreeNode('^', [vector.copy() for vector in vector_list_b]) ]) ]) else: sum = MathTreeNode('+', [ MathTreeNode('*', [ MathTreeNode('^', [vector.copy() for vector in vector_list_a]), MathTreeNode('^', [vector.copy() for vector in vector_list_b[:-1]]), vector_list_b[-1].copy() ]), MathTreeNode('*', [ MathTreeNode(-1.0), MathTreeNode('^', [vector.copy() for vector in vector_list_a]), MathTreeNode('.', [ MathTreeNode('^', [vector.copy() for vector in vector_list_b[:-1]]), vector_list_b[-1].copy() ]) ]) ]) node.child_list += scalar_list_a + scalar_list_b del node.child_list[i] del node.child_list[i] node.child_list.insert(i, sum) return node<file_sep>/script_edit.py # script_edit.py from PyQt5 import QtWidgets, QtCore, QtGui, Qsci class ScriptEditPanel(QtWidgets.QDockWidget): execute_button_pressed_signal = QtCore.pyqtSignal(str) def __init__(self, parent): super().__init__(parent) self.setWindowTitle('Script Editor') self.script_edit = ScriptEditControl(self) execute_button = QtWidgets.QPushButton('Execute') execute_button.clicked.connect(self.execute_button_pressed) load_button = QtWidgets.QPushButton('Load Script...') load_button.clicked.connect(self.load_button_pressed) button_layout = QtWidgets.QHBoxLayout() button_layout.addWidget(execute_button) button_layout.addWidget(load_button) main_layout = QtWidgets.QVBoxLayout() main_layout.addWidget(self.script_edit) main_layout.addLayout(button_layout) main_widget = QtWidgets.QWidget() main_widget.setLayout(main_layout) self.setWidget(main_widget) def execute_button_pressed(self): code = self.script_edit.text() self.execute_button_pressed_signal.emit(code) def load_button_pressed(self): path = QtWidgets.QFileDialog.getOpenFileName(self, 'Load Script')[0] if len(path) > 0: with open(path, 'r') as handle: code = handle.read() self.script_edit.setText(code) class ScriptEditControl(Qsci.QsciScintilla): def __init__(self, parent): super ().__init__(parent) font = QtGui.QFont() font.setFamily('Courier') font.setFixedPitch(True) font.setPointSize(10) self.setFont(font) self.setMarginsFont(font) fontMetrics = QtGui.QFontMetrics(font) self.setMarginsFont(font) self.setMarginWidth(0, fontMetrics.width("00000") + 6) self.setMarginLineNumbers(0, True) self.setMarginsBackgroundColor(QtGui.QColor("#cccccc")) self.markerDefine(Qsci.QsciScintilla.RightArrow, self.SC_MARK_MINUS) self.setMarkerBackgroundColor(QtGui.QColor("#ee1111"), self.SC_MARK_MINUS) self.setBraceMatching(Qsci.QsciScintilla.SloppyBraceMatch) self.setCaretLineVisible(True) self.setCaretLineBackgroundColor(QtGui.QColor("#ffe4e4")) lexer = Qsci.QsciLexerPython() lexer.setDefaultFont(font) self.setLexer(lexer) self.SendScintilla(Qsci.QsciScintilla.SCI_SETEOLMODE, Qsci.QsciScintilla.SC_EOL_CR) self.setTabWidth(4) self.setIndentationsUseTabs(False) self.setAutoIndent(True) self.setAcceptDrops(True) def dragEnterEvent(self, event): # TODO: Why is this never called? :( if event.mimeData().hasUrls: event.accept() else: event.ignore() def dropEvent(self, event): text_list = [] for url in event.mimeData().urls(): path = str(url.toLocalFile()) with open(path, 'r') as handle: text_list.append(handle.read()) self.setText('\n'.join(text_list))<file_sep>/math_tree.py # math_tree.py import copy import math from math2d_vector import Vector from math2d_aa_rect import AxisAlignedRectangle from math2d_line_segment import LineSegment class MathTreeNode(object): # Note that no node instance should appear more than once in the tree. def __init__(self, data, child_list=None): self.position = None self.target_position = None self.child_list = [] if child_list is None else child_list self.data = data def is_valid(self): node_set = set() for node in self.yield_nodes(): key = str(node) if key in node_set: return False node_set.add(key) return True def size(self): return 1 + sum([child.size() for child in self.child_list]) def calculate_target_positions(self): self.target_position = Vector(0.0, 0.0) for node in self.child_list: node.calculate_target_positions() rect_list = [node.calculate_subtree_bounding_rectangle(targets=True) for node in self.child_list] padding = 0.5 total_width = sum([rect.Width() for rect in rect_list]) + float(len(rect_list) - 1) * padding position = Vector(-total_width / 2.0, -2.0) for i, node in enumerate(self.child_list): rect = rect_list[i] position += Vector(rect.Width() / 2.0, 0.0) node.translate_target_positions(position) position += Vector(rect.Width() / 2.0, 0.0) position += Vector(padding, 0.0) def calculate_subtree_bounding_rectangle(self, targets=True): rect = self.calculate_bounding_rectangle(targets) if len(self.child_list) > 0: for other_node in self.yield_nodes(): rect.GrowFor(other_node.calculate_bounding_rectangle(targets)) return rect def calculate_bounding_rectangle(self, targets=True): rect = AxisAlignedRectangle() rect.min_point = self.target_position if targets else self.position rect.max_point = self.target_position if targets else self.position rect.min_point -= Vector(0.5, 0.5) rect.max_point += Vector(0.5, 0.5) return rect def yield_nodes(self): yield self for child in self.child_list: yield from child.yield_nodes() def translate_target_positions(self, translation): self.target_position += translation for node in self.child_list: node.translate_target_positions(translation) def assign_initial_positions(self, parent_position=None): if parent_position is None: parent_position = Vector(0.0, 0.0) if self.position is None: self.position = parent_position for child in self.child_list: child.assign_initial_positions(self.position) def advance_positions(self, lerp_value, eps=1e-2): line_segment = LineSegment(self.position, self.target_position) if line_segment.Length() < eps: self.position = self.target_position else: self.position = line_segment.Lerp(lerp_value) for child in self.child_list: child.advance_positions(lerp_value) def is_settled(self): if self.position != self.target_position: return False for child in self.child_list: if not child.is_settled(): return False return True def display_text(self): if isinstance(self.data, str): return self.data elif isinstance(self.data, float): return '%1.2f' % self.data else: return str(self.data) def expression_text(self): if len(self.child_list) > 0: display_text = self.display_text() if len(display_text) == 1: return '(' + display_text.join([child.expression_text() for child in self.child_list]) + ')' else: return display_text + '(' + ','.join([child.expression_text() for child in self.child_list]) + ')' else: return self.display_text() def generate_latex_code(self): pass def calculate_grade(self): if isinstance(self.data, float) or (isinstance(self.data, str) and self.data[0] == '$'): return 0 elif isinstance(self.data, str) and self.data[0].isalpha() and len(self.child_list) == 0: return 1 elif self.data == '+' or self.data == '^' or self.data == '.' or self.data == '*' or self.data == 'inv': if len(self.child_list) == 0: return 0 grade_list = [child.calculate_grade() for child in self.child_list] if any([grade == None for grade in grade_list]): return None if len(grade_list) == 1: return grade_list[0] if self.data == '+': if all([grade_list[0] == grade for grade in grade_list[1:]]) or len(grade_list) == 1: return grade_list[0] elif self.data == '^': return sum(grade_list) elif self.data == '.': non_zero_grade_list = [grade for grade in grade_list if grade != 0] if len(non_zero_grade_list) > 2: raise Exception('Ambiguous inner product!') elif len(non_zero_grade_list) == 2: grade_a = non_zero_grade_list[0] grade_b = non_zero_grade_list[1] return abs(grade_a - grade_b) elif len(non_zero_grade_list) == 1: return non_zero_grade_list[0] else: return 0 def copy(self): return copy.deepcopy(self) @staticmethod def cast(obj): if isinstance(obj, MathTreeNode): return obj.copy() if isinstance(obj, float) or isinstance(obj, str): return MathTreeNode(obj) if isinstance(obj, int): return MathTreeNode(float(obj)) raise Exception('Cannot cast: %s' % str(obj)) def __add__(self, other): return MathTreeNode('+', [self.copy(), self.cast(other)]) def __radd__(self, other): return MathTreeNode('+', [self.cast(other), self.copy()]) def __sub__(self, other): return MathTreeNode('-', [self.copy(), self.cast(other)]) def __rsub__(self, other): return MathTreeNode('-', [self.cast(other), self.copy()]) def __mul__(self, other): return MathTreeNode('*', [self.copy(), self.cast(other)]) def __rmul__(self, other): return MathTreeNode('*', [self.cast(other), self.copy()]) def __truediv__(self, other): return MathTreeNode('/', [self.copy(), self.cast(other)]) def __rtruediv__(self, other): return MathTreeNode('/', [self.cast(other), self.copy()]) def __xor__(self, other): return MathTreeNode('^', [self.copy(), self.cast(other)]) def __rxor__(self, other): return MathTreeNode('^', [self.cast(other), self.copy()]) def __or__(self, other): return MathTreeNode('.', [self.copy(), self.cast(other)]) def __ror__(self, other): return MathTreeNode('.', [self.cast(other), self.copy()]) def is_perfect_join(self): if self.data[0].data != self.data[1].data: return False for child in self.child_list: if not child.is_perfect_join(): return False return True def intersect_join(self): if self.data[0].data == self.data[1].data: new_node = MathTreeNode(self.data[0].data) for child in self.child_list: node = child.intersect_join() if node is not None: new_node.child_list.append(node) return node class MathTreeManipulator(object): def __init__(self): pass def _manipulate_subtree(self, node): raise Exception('Method not implemented.') def manipulate_tree(self, node): for i, child in enumerate(node.child_list): new_child = self.manipulate_tree(child) if new_child is not None: node.child_list[i] = new_child return node # Notice that we go as deep into the tree before we try to manipulate anything. # This is an optimization, because it lets us simplify sub-trees as far as possible # before they potentially get copied by distribution or something else that might # want to copy an entire sub-tree. new_node = self._manipulate_subtree(node) if new_node is not None: return new_node def _sort_list(self, given_list, sort_key): # Note that this is a stable sort. adjacent_swap_count = 0 if len(given_list) > 1: keep_going = True while keep_going: keep_going = False for i in range(len(given_list) - 1): key_a = sort_key(given_list[i]) key_b = sort_key(given_list[i + 1]) if key_a > key_b: given_list[i], given_list[i + 1] = given_list[i + 1], given_list[i] adjacent_swap_count += 1 keep_going = True return adjacent_swap_count def _bucket_sort(self, node): scalar_list = [] vector_list = [] other_list = [] for child in node.child_list: grade = child.calculate_grade() if grade == 0: scalar_list.append(child) elif grade == 1: vector_list.append(child) else: other_list.append(child) return scalar_list, vector_list, other_list def _parse_blade(self, node): if any([op == node.data for op in ['.', '^', '*']]): scalar_list, vector_list, other_list = self._bucket_sort(node) if len(other_list) > 0: return None, None if len(vector_list) > 1 and node.data != '^': return None, None return scalar_list, vector_list else: grade = node.calculate_grade() if grade == 0: return [node], [] if grade == 1: return [], [node] return None, None def _join_trees(self, root_a, root_b): # This might not be the best way to join the trees, but I like the general idea. root = MathTreeNode((root_a, root_b)) queue = [root] while len(queue) > 0: parent = queue.pop(0) child_list_a = parent.data[0].child_list child_list_b = parent.data[1].child_list i = 0 j = 0 while True: if i < len(child_list_a) and j < len(child_list_b): child_a = child_list_a[i] child_b = child_list_b[j] if child_a.data == child_b.data: parent.child_list.append(MathTreeNode((child_a, child_b))) queue.append(parent.child_list[-1]) else: u = i while u < len(child_list_a) and child_list_a[u].data != child_b.data: u += 1 v = j while j < len(child_list_b) and child_list_b[v].data != child_a.data: v += 1 if u <= v: while i < u: parent.child_list.append(MathTreeNode((child_list_a[i], None))) i += 1 elif v < u: while j < v: parent.child_list.append(MathTreeNode((None, child_list_b[i]))) j += 1 elif i < len(child_list_a): while i < len(child_list_a): parent.child_list.append(MathTreeNode((child_list_a[i], None))) i += 1 elif j < len(child_list_b): while j < len(child_list_b): parent.child_list.append(MathTreeNode((None, child_list_b[j]))) j += 1 else: break return root def manipulate_tree(node, manipulator_list, max_iters=None, max_tree_size=None, log=print): iter_count = 0 expression_set = set() expression_set.add(node.expression_text()) while max_iters is None or iter_count < max_iters: iter_count += 1 for manipulator in manipulator_list: new_node = manipulator.manipulate_tree(node) if new_node is not None: log(manipulator.__class__.__name__) if not new_node.is_valid(): raise Exception('Manipulated tree is not valid!') tree_size = new_node.size() log('Tree size: %d' % tree_size) if max_tree_size is not None: if tree_size > max_tree_size: raise Exception('Tree size (%d) exceeded limit (%d).' % (tree_size, max_tree_size)) node = new_node expression_text = node.expression_text() if expression_text in expression_set: raise Exception('Expression repeated!') expression_set.add(expression_text) break else: break return node # I believe it worth noting here an alternative to the entire approach taken in this program to the # simplifying of a general GA expression. Forgetting about a free-form tree, create a data-structure # that gives the general layout of any fully simplified GA expression: a sum over blades, each blade # being a polynomial paired with an ordered set of vectors. Now all that remains is the ability to # combine any two of these data-structure together into another such data-structure in any operation. # Admittedly, this was my original approach in previous programs, and it worked very well for numeric # computation, and I believe it could also work for symbolic computation as well. So why might a free-form # tree, and the approach taken in this program, be any better? I struggle with this question. Maybe it's # not any better. Maybe it's worse. One idea, however, is that there is more flexibility in a free-form # tree if there were ever other forms of the expression that we wanted to find. For example, we might # want the factored form of a simplified GA expression in terms of the inner product. I as yet have no # idea how to provide this functionality, but our choice of data-structure does not limit us to only GA # expressions of the most expanded, simplified form. def simplify_tree(node, max_iters=None, bilinear_form=None, log=print): from manipulators.adder import Adder from manipulators.associator import Associator from manipulators.degenerate_case_handler import DegenerateCaseHandler from manipulators.distributor import Distributor from manipulators.geometric_product_handler import GeometricProductHandler from manipulators.inner_product_handler import InnerProductHandler from manipulators.inverter import Inverter from manipulators.multiplier import Multiplier from manipulators.outer_product_handler import OuterProductHandler # The order of manipulators here has been carefully chosen. # In some cases, the order may not matter; in others, very much so. manipulator_list = [ InnerProductHandler(bilinear_form), Associator(), DegenerateCaseHandler(), Inverter(), GeometricProductHandler(), Adder(), Multiplier(), OuterProductHandler(), Distributor(), ] return manipulate_tree(node, manipulator_list, max_iters, log=log)<file_sep>/README.md # MathTree Playing with math trees... <file_sep>/manipulators/multiplier.py # multiplier.py from math_tree import MathTreeManipulator, MathTreeNode class Multiplier(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node_a): if any([op == node_a.data for op in ['*', '.', '^']]): for i in range(len(node_a.child_list)): child_a = node_a.child_list[i] for j in range(i + 1, len(node_a.child_list)): child_b = node_a.child_list[j] if isinstance(child_a.data, float) and isinstance(child_b.data, float): del node_a.child_list[j] del node_a.child_list[i] node_a.child_list.insert(0, MathTreeNode(child_a.data * child_b.data)) return node_a for node_b in node_a.child_list: if any([op == node_b.data for op in ['*', '.', '^']]): for i, node_c in enumerate(node_b.child_list): if node_c.calculate_grade() == 0: del node_b.child_list[i] node_a.child_list.insert(0, node_c) return node_a # Here we rely on the stable sort property since the products are not generally commutative. adjacent_swap_count = self._sort_list(node_a.child_list, lambda child: 0 if child.calculate_grade() == 0 else 1) if adjacent_swap_count > 0: return node_a<file_sep>/manipulators/associator.py # associator.py from math_tree import MathTreeManipulator, MathTreeNode class Associator(MathTreeManipulator): def __init__(self): super().__init__() def _manipulate_subtree(self, node_a): # Note that the inner product and subtraction are not generally associative. if any([op == node_a.data for op in ['+', '*', '^']]): for i, node_b in enumerate(node_a.child_list): if node_b.data == node_a.data: node = MathTreeNode(node_a.data) node.child_list += [node_c.copy() for node_c in node_a.child_list[:i]] node.child_list += [node_c.copy() for node_c in node_b.child_list] node.child_list += [node_c.copy() for node_c in node_a.child_list[i+1:]] return node<file_sep>/manipulators/inner_product_handler.py # inner_product_handler.py from math_tree import MathTreeManipulator, MathTreeNode class InnerProductHandler(MathTreeManipulator): def __init__(self, bilinear_form=None): super().__init__() self.bilinear_form = bilinear_form if bilinear_form is not None else self._default_bilinear_form def _manipulate_subtree(self, node): if node.data == '.': scalar_list_a = scalar_list_b = None vector_list_a = vector_list_b = None other_list = [] for child in node.child_list: scalar_list, vector_list = self._parse_blade(child) if scalar_list is not None and vector_list is not None and len(vector_list) > 0: if scalar_list_a is None: scalar_list_a = scalar_list vector_list_a = vector_list elif scalar_list_b is None: scalar_list_b = scalar_list vector_list_b = vector_list else: raise Exception('Ambiguous inner product!') else: other_list.append(child) if scalar_list_a is not None and scalar_list_b is not None: if len(vector_list_a) == 1 and len(vector_list_b) == 1: vector_a = vector_list_a[0].data vector_b = vector_list_b[0].data scalar = self.bilinear_form(vector_a, vector_b) if scalar is not None: return MathTreeNode('*', [MathTreeNode(scalar)] + other_list + scalar_list_a + scalar_list_b) elif vector_a > vector_b: return MathTreeNode('.', other_list + scalar_list_a + scalar_list_b + vector_list_b + vector_list_a) elif len(vector_list_a) == 1 and len(vector_list_b) > 1: sum = self._expand_vector_with_blade(vector_list_a[0], vector_list_b, 1) return MathTreeNode('*', other_list + scalar_list_a + scalar_list_b + [sum]) elif len(vector_list_a) > 1 and len(vector_list_b) == 1: j = 1 if len(vector_list_a) % 2 == 1 else 0 sum = self._expand_vector_with_blade(vector_list_b[0], vector_list_a, j) return MathTreeNode('*', other_list + scalar_list_a + scalar_list_b + [sum]) elif len(vector_list_a) > 1 and len(vector_list_b) > 1: product = MathTreeNode('*') product.child_list += other_list + scalar_list_a + scalar_list_b if len(vector_list_a) >= len(vector_list_b): vector = vector_list_a[-1] del vector_list_a[-1] product.child_list.append(MathTreeNode('.', [ MathTreeNode('^', vector_list_a), MathTreeNode('.', [ vector, MathTreeNode('^', vector_list_b) ]) ])) else: vector = vector_list_b[0] del vector_list_b[0] product.child_list.append(MathTreeNode('.', [ MathTreeNode('.', [ MathTreeNode('^', vector_list_a), vector ]), MathTreeNode('^', vector_list_b) ])) return product def _expand_vector_with_blade(self, vector, vector_list, j): sum = MathTreeNode('+') for i in range(len(vector_list)): product = MathTreeNode('.') if i % 2 == j: product.child_list.append(MathTreeNode(-1.0)) product.child_list += [vector.copy(), vector_list[i].copy()] blade = MathTreeNode('^') blade.child_list.append(product) blade.child_list += [vec.copy() for vec in vector_list[:i]] blade.child_list += [vec.copy() for vec in vector_list[i + 1:]] sum.child_list.append(blade) return sum def _default_bilinear_form(self, vector_a, vector_b): key = vector_a + '.' + vector_b if key in _conformal_bilinear_form_map: return _conformal_bilinear_form_map[key] if (vector_a == 'no' or vector_a == 'ni') and vector_b[0] == 'e': return 0.0 if (vector_b == 'no' or vector_b == 'ni') and vector_a[0] == 'e': return 0.0 _conformal_bilinear_form_map = { 'e1.e1': 1.0, 'e1.e2': 0.0, 'e1.e3': 0.0, 'e1.no': 0.0, 'e1.ni': 0.0, 'e2.e1': 0.0, 'e2.e2': 1.0, 'e2.e3': 0.0, 'e2.no': 0.0, 'e2.ni': 0.0, 'e3.e1': 0.0, 'e3.e2': 0.0, 'e3.e3': 1.0, 'e3.no': 0.0, 'e3.ni': 0.0, 'no.e1': 0.0, 'no.e2': 0.0, 'no.e3': 0.0, 'no.no': 0.0, 'no.ni': -1.0, 'ni.e1': 0.0, 'ni.e2': 0.0, 'ni.e3': 0.0, 'ni.no': -1.0, 'ni.ni': 0.0 }<file_sep>/scripts/test5.py # test5.py root = 7*_n('no')|(-2*_n('ni')^(_n('no')*5))<file_sep>/scripts/test1.py # test1.py root = (_n('a') + _n('b'))*(_n('c') + _n('d'))
0d9b98f08d7d149d0208e8b2ba1f9e447d16ff2a
[ "Markdown", "Python" ]
24
Python
spencerparkin/MathTree
4aa286248c2dc6a34ad2ef3e56d48b60838f3b72
6d21d732dbd6be5c57a85bc9f45d5a04c30cbad7
refs/heads/master
<file_sep>#!/bin/bash #<NAME> # Wall = %e, User = %U, System= %S, # CPU = %P, Involuntary context switches = %c, # Voluntary context switches = %w TIMEFORMAT="%e,%U,%S,%P,%c,%w" MAKE="make -s" schedulers[1]=SCHED_OTHER schedulers[2]=SCHED_FIFO schedulers[3]=SCHED_RR size[1]=SMALL size[2]=MEDIUM size[3]=LARGE process[1]=CPU process[2]=IO process[3]=MIXED #NICE_VAL="-7" RESULT_FILE="/home/user/Desktop/Lab4/data/results.csv" RESULT_FILE_NICE="/home/user/Desktop/Lab4/data/resultsNice.csv" echo Building code... $MAKE clean $MAKE x=1 while [ $x -le 100 ] do echo "Creating rwinput-$x" dd if=/dev/urandom of=./rwinput-$x bs=$INPUTBLOCKSIZEBYTES count=$INPUTBLOCKS > /dev/null 2>&1 x=$(( $x + 1 )) done #Echo out the header file for the CSV - overwrite any existing benchmarks echo "\"Process Type\",\"Scheduler Type\",Iterations,\"Num Processes\",Wall,User,System,CPU,I-Switched,V-switched,Priority" > "$RESULT_FILE" echo Starting test runs... echo echo cpu-process tests... echo for l in 1 2 3 do for k in 1 2 3 do for j in 1 2 3 do for i in 1 2 3 4 5 do /usr/bin/time -f "$TIMEFORMAT" -o "$RESULT_FILE" -a sudo ./scheduler ${schedulers[j]} ${size[k]} ${process[l]} > /dev/null done echo Running "${process[l]}"-process with "${schedulers[j]}" and "${size[k]}" simultaneous processes... echo done done done for l in 1 2 3 do for k in 1 2 3 do for j in 1 2 3 do for i in 1 2 3 4 5 do /usr/bin/time -f "$TIMEFORMAT" -o "$RESULT_FILE_NICE" -a sudo nice -n $[RANDOM%-20+19] ./scheduler ${schedulers[j]} ${size[k]} ${process[l]} > /dev/null done echo Running "${process[l]}"-process with "${schedulers[j]}" and "${size[k]}" simultaneous processes... echo done done done $MAKE clean <file_sep>#include <stdio.h> #include <linux/kernel.h> #include <sys/syscall.h> #include <unistd.h> int main() { int res; syscall(1123,1, 10, &res); printf("The answer for the userspace is %d\n", res); return 0; } <file_sep>#include <linux/kernel.h> #include <linux/linkage.h> asmlinkage long sys_Simple_add(int number1, int number2, int *result) { *result = number1 + number2; printk (KERN_ALERT "The numbers to be added are %d and %d \n", number1, number2); printk(KERN_ALERT "the answer is = %d\n", *result); return 0; } <file_sep>//<NAME> #include <pthread.h> #define MAX_INPUT_FILES 10 #define MAX_RESOLVE_THREADS 10 #define MIN_RESOLVE_THREADS 2 #define MAX_NAME_LENGTHS 1025 #define MAX_IP_LENGTH INET6_ADDRSTRLEN typedef int bool; //for readability #define true 1 #define false 0 bool requests_exist = true; //Threads struct thread{ queue* hostQueue; FILE* threadFile; pthread_mutex_t* buffMutex; pthread_mutex_t* outMutex; }; <file_sep>Installation: Make sure you are in the same working directory as the program. RunL $make to compile the program Usage: $./testscript.sh This program will run all 54 combinations of tests for the schedulers, processes and the number of processes. ./scheduler <Scheduler> <#Processes> <ProcessType> Options: <Scheduler>: SCHED_FIFO, SCHED_OTHER, SCHED_RR <#Processes>: SMALL, MEDIUM, LARGE <ProcessType>:CPU, IO, MIXED <file_sep># The following repository includes mainly all the C/C++ projects I have worked on. <file_sep>//<NAME> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <pthread.h> #include <unistd.h> #include "util.h" #include "queue.h" #include "multi-lookup.h" #define MINARGS 3 #define USAGE "<inputFilePath> <outputFilePath>" #define SBUFSIZE 1025 #define INPUTFS "%1024s" void* requestThread(void* id){ struct thread* thread = id; //Make a thread to hold info char hostname[MAX_NAME_LENGTHS]; //hostname char arrays char *domain; bool done = false; //flag FILE* inputfp = thread->threadFile; //Input file pthread_mutex_t* buffMutex = thread->buffMutex; //Buffer mutex queue* hostQueue = thread->hostQueue; //Queue while(fscanf(inputfp, INPUTFS, hostname) > 0){ //Read input and push int buffer while(!done){ //Repeat until hostname is pushed to the queue domain = malloc(SBUFSIZE); //allocate memory for domain (or hostname) strncpy(domain, hostname, SBUFSIZE); //copy hostname to domain, max number of characters pthread_mutex_lock(buffMutex);//Lock/block the buffer while(queue_is_full(hostQueue)){ //When queue is full pthread_mutex_unlock(buffMutex); //Unlock/block buffe usleep(rand() % 100 + 5); //Wait 0-100 microseconds pthread_mutex_lock(buffMutex); //Lock/block } queue_push(hostQueue, domain); pthread_mutex_unlock(buffMutex); //Unlock/block the thread done = true; //hostname was pushed thru successfully } done = false; //Reset push for next hostname } return NULL; } void* resolveThread(void* id){ struct thread* thread = id; //Make a thread to hold info char* domain; //domain char arrays FILE* outFile = thread->threadFile; //Output file for results pthread_mutex_t* buffMutex = thread->buffMutex; //Buffer mutex pthread_mutex_t* outMutex = thread->outMutex; //Output mutex queue* hostQueue = thread->hostQueue; //Queue char IPAdd[MAX_IP_LENGTH]; //IP Addresses with length limit, array while(!queue_is_empty(hostQueue) || requests_exist){ //loop while the queue is not empty and requestThreads exist pthread_mutex_lock(buffMutex); //lock/block buffer domain = queue_pop(hostQueue); //pop from queue if(domain == NULL){ //if empty/no domain, unlock pthread_mutex_unlock(buffMutex); usleep(rand() % 100 + 5);//Wait 0-100 microseconds } else { //Unlock/block and continue pthread_mutex_unlock(buffMutex); if(dnslookup(domain, IPAdd, sizeof(IPAdd)) == UTIL_FAILURE)//look up domain strncpy(IPAdd, "", sizeof(IPAdd)); printf("%s:%s\n", domain, IPAdd); //Print Domain/host with IP Address pthread_mutex_lock(outMutex); //lock output file fprintf(outFile, "%s,%s\n", domain, IPAdd); //write to output file same as above print statement pthread_mutex_unlock(outMutex); //unlock output } free(domain);//deallocates the memory (domain) previously allocated by malloc } return NULL; } int main(int argc, char* argv[]){ /* Local Vars */ queue hostQueue; //Hostname queue int inputFiles = argc-2; //Number of arguments passed FILE* outFile = NULL; //output pointer for out file int nCPU = sysconf( _SC_NPROCESSORS_ONLN ); FILE* inputfps[inputFiles]; //Array of inputs int resolveThreads; /* Check Arguments */ if(argc < MINARGS){ fprintf(stderr, "Not enough arguments: %d\n", (argc - 1)); fprintf(stderr, "Usage:\n %s %s\n", argv[0], USAGE); return EXIT_FAILURE; } /*Set amount of threads */ if (nCPU < MAX_RESOLVE_THREADS) resolveThreads = nCPU; else if (nCPU < MIN_RESOLVE_THREADS) resolveThreads = MIN_RESOLVE_THREADS; else resolveThreads = MAX_RESOLVE_THREADS; /*Arrays of threads for requests and resolves */ pthread_t requests[inputFiles]; pthread_t resolves[resolveThreads]; /*Mutexes for hostQueue and output file*/ pthread_mutex_t buffMutex; pthread_mutex_t outMutex; struct thread requestInfo[inputFiles]; struct thread resolveInfo[resolveThreads]; printf("Numver of Requests: %d\n", inputFiles); printf("Number of Resolveds: %d\n\n", resolveThreads); /* Limit check for number of files, 10 max */ if((inputFiles)>MAX_INPUT_FILES){ fprintf(stderr, "Max number of files allowed is %d\n", MAX_INPUT_FILES); fprintf(stderr, "Usage:\n %s %s\n", argv[0], USAGE); return EXIT_FAILURE; } /*Open Output File */ outFile = fopen(argv[argc-1], "w"); //Open output/results file if(!outFile){ perror("Error Opening to the Output File"); return EXIT_FAILURE; } /*Loop Through Input Files */ int i; for(i=1; i<(argc-1); i++){ //Open input files up to 3 inputfps[i-1] = fopen(argv[i], "r"); } /*Initialize Queue */ queue_init(&hostQueue, MAX_INPUT_FILES); /* Initialize mutexes */ pthread_mutex_init(&buffMutex, NULL); pthread_mutex_init(&outMutex, NULL); /*Create request pthreads*/ for(i=0; i<inputFiles; i++){ //Iterate thru input files //Set data for struct to pass to current pthread requestInfo[i].threadFile = inputfps[i]; requestInfo[i].buffMutex = &buffMutex; requestInfo[i].outMutex = NULL; requestInfo[i].hostQueue = &hostQueue; //pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg); arg==id passed to request pthread_create(&(requests[i]), NULL, requestThread, &(requestInfo[i])); printf("Create request thread %d\n", i); } /*Create resolve pthreads*/ for(i=0; i<resolveThreads; i++){ resolveInfo[i].threadFile = outFile; resolveInfo[i].buffMutex = &buffMutex; resolveInfo[i].outMutex = &outMutex; resolveInfo[i].hostQueue = &hostQueue; pthread_create(&(resolves[i]), NULL, resolveThread, &(resolveInfo[i])); printf("Create resolve thread %d\n", i); } /*Wait for Request Threads to complete*/ for(i=0; i<inputFiles; i++){ pthread_join(requests[i], NULL); printf("Requested %d \n", i); } requests_exist=false; /*Wait for Resolve Threads to complete*/ for(i=0; i<resolveThreads; i++){ pthread_join(resolves[i], NULL); // int pthread_join(pthread_t thread, void **retval); joins with a termindated thread printf("Resolved %d \n", i); } /*Clean up the Queue*/ queue_cleanup(&hostQueue); /*Close the Output file */ fclose(outFile); /*Close the Input Files */ for(i=0; i<inputFiles; i++){ fclose(inputfps[i]); } /*Destroy Mutexes*/ pthread_mutex_destroy(&buffMutex); pthread_mutex_destroy(&outMutex); return 0; }
fb3ed697418a31af72466aeeff27992715228aa2
[ "Markdown", "C", "Shell" ]
7
Shell
shambhavi94/C-projects
e72408718d3d8e3d0477d9c5212d6e5d01f54510
74b8534963f576677a99e57ce4322015af9a99d4
refs/heads/master
<repo_name>Rawgers/Rune<file_sep>/test/lib/pathTestingUtility.ts export const displayPath = (start: Tile, end: Tile, path: Tile[]) => { /* Display a path in a readable format */ console.log({x: start.x, y: start.y}, ' -> ', {x: end.x, y: end.y}); console.log(path.slice().reverse().map(tile => { return {x: tile.x, y: tile.y}; })); } export const validatePath = (start: Tile, end: Tile, path: Tile[], shouldStartConnected: boolean) => { /* Check if the path starts and ends at the specified tile. This function does not care about the efficiency of the path. */ /* Start */ if (shouldStartConnected) { let isStartConnected = false; for (const neighbor of path[path.length - 1].neighborList) { if (neighbor.x === start.x && neighbor.y === start.y) { isStartConnected = true; break; } } expect(isStartConnected).toBe(true); } /* End */ expect(path[0]).toEqual(end); /* No blocked tiles */ for (const tile of path) { expect(tile.isBlocked).toBe(false); } };<file_sep>/src/lib/PriorityQueue.ts import BinaryMinHeap from './BinaryMinHeap'; export default class PriorityQueue<T> { heap: BinaryMinHeap<T>; size: number; constructor() { this.heap = new BinaryMinHeap<T>(); this.size = 0; } enqueue(node: T) { /* Adds an element to the queue. */ this.size++; this.heap.insert(node); } dequeue(): T | null { /* Removes the first element from the queue. */ if (this.isEmpty()) return null; this.size--; return this.heap.remove(1); } peek(): T | null { /* Show the first item of the queue without removing it. */ if (this.isEmpty()) return null; return this.heap.nodes[1]; } isEmpty(): boolean { /* Returns whether or not the queue has any more elements. */ return this.size === 0; } notifyUpdate(i: number) { this.heap.modifyPosition(i); } elementAt(i: number): T { return this.heap.nodes[i]; } contains(node: T): number { return this.heap.contains(node); } find(condition: (node: T) => boolean): number { return this.heap.find(condition); } }<file_sep>/dist/ThetaStar.js import { Grid } from './Grid'; import { PathTile, AStar } from './AStar'; var Axis; (function (Axis) { Axis[Axis["X"] = 0] = "X"; Axis[Axis["Y"] = 1] = "Y"; })(Axis || (Axis = {})); export class AnyAnglePathTile extends PathTile { constructor(tile, parent, end) { super(tile, parent, end); } calculateAnyAngleCumulativeWeight(parent, lineTiles) { if (!this.parent) return 0; let cumulativeWeight = parent.cumulativeWeight + Grid.squaredDistanceBetween(parent.tile, this.tile); for (const tile of lineTiles) { cumulativeWeight += tile.weight; } return cumulativeWeight; } } export class ThetaStar extends AStar { constructor(grid) { super(grid); } updatePathTile(current, neighbor, queuedNeighbor) { const lineTiles = this.lineOfSight(current.parent.tile, neighbor); if (lineTiles) { if (queuedNeighbor.calculateAnyAngleCumulativeWeight(current.parent, lineTiles) < queuedNeighbor.cumulativeWeight) { queuedNeighbor.updatePathToThis(current.parent); return; } } if (queuedNeighbor.calculateCumulativeWeight(current) < queuedNeighbor.cumulativeWeight) { queuedNeighbor.updatePathToThis(current); } } lineOfSight(from, to) { const tiles = []; if (from.x === to.x && from.y === to.y) { return tiles; } const current = { [Axis.X]: from.x, [Axis.Y]: from.y }; const destination = { [Axis.X]: to.x, [Axis.Y]: to.y }; const delta = { [Axis.X]: Math.abs(to.x - from.x), [Axis.Y]: Math.abs(to.y - from.y) }; const direction = { [Axis.X]: (to.x - from.x > 0) ? 1 : -1, [Axis.Y]: (to.y - from.y > 0) ? 1 : -1 }; const primaryAxis = delta[Axis.X] > delta[Axis.Y] ? Axis.X : Axis.Y; const secondaryAxis = delta[Axis.X] > delta[Axis.Y] ? Axis.Y : Axis.X; const deltaError = Math.abs(delta[secondaryAxis] / delta[primaryAxis]); let previousError = 0.0; let error = deltaError / -2; const goThrough = (tile) => { tile.isBlocked || tiles.push(tile); return !tile.isBlocked; }; while (current[primaryAxis] != destination[primaryAxis] + direction[primaryAxis]) { if (!goThrough(this.grid.tileAt(current[Axis.X], current[Axis.Y]))) { return null; } error += deltaError; if (error >= 0.5) { current[secondaryAxis] += direction[secondaryAxis]; if (error > 0.5) { if (!goThrough(this.grid.tileAt(current[Axis.X], current[Axis.Y]))) { return null; } } error--; } current[primaryAxis] += direction[primaryAxis]; } return tiles.slice(1); } } <file_sep>/src/lib/PairingHeap.ts // TODO: Implement a Pairing Heap to optimize the priority-changing runtime of PQ. export default class PairingHeap { constructor() { this.size = 0; } size(): number { return this.size; } isEmpty(): boolean { return this.size == 0; } }<file_sep>/test/lib/Grid.test.ts import { Grid, Tile, Direction } from '../../src/lib/Grid'; test('Grid constructor/greetNeighbors', () => { const grid = new Grid(2, 3); const expectedTiles = [ [new Tile(0, 0), new Tile(1, 0)], [new Tile(0, 1), new Tile(1, 1)], [new Tile(0, 2), new Tile(1, 2)] ]; expectedTiles[0][0].neighbors = new Map<Direction, Tile>([ [Direction.East, expectedTiles[0][1]], [Direction.South, expectedTiles[1][0]], //[Direction.Southeast, expectedTiles[1][1]] ]); expectedTiles[0][1].neighbors = new Map<Direction, Tile>([ [Direction.West, expectedTiles[0][0]], [Direction.South, expectedTiles[1][1]], //[Direction.Southwest, expectedTiles[1][0]] ]); expectedTiles[1][0].neighbors = new Map<Direction, Tile>([ [Direction.East, expectedTiles[1][1]], [Direction.North, expectedTiles[0][0]], //[Direction.Northeast, expectedTiles[0][1]], [Direction.South, expectedTiles[2][0]], //[Direction.Southeast, expectedTiles[2][1]] ]); expectedTiles[1][1].neighbors = new Map<Direction, Tile>([ [Direction.West, expectedTiles[1][0]], [Direction.North, expectedTiles[0][1]], //[Direction.Northwest, expectedTiles[0][0]], [Direction.South, expectedTiles[2][1]], //[Direction.Southwest, expectedTiles[2][0]] ]); expectedTiles[2][0].neighbors = new Map<Direction, Tile>([ [Direction.East, expectedTiles[2][1]], [Direction.North, expectedTiles[1][0]], //[Direction.Northeast, expectedTiles[1][1]] ]); expectedTiles[2][1].neighbors = new Map<Direction, Tile>([ [Direction.West, expectedTiles[2][0]], [Direction.North, expectedTiles[1][1]], //[Direction.Northwest, expectedTiles[1][0]] ]); /* Can't directly compare grid.tiles and expectedTiles because that operation exceeds the maximum call stack size */ for (const row of grid.tiles) { for (const tile of row) { for (const key of tile.neighbors.keys()) { const actualNeighbor = tile.neighbors.get(key); const expectedNeighbor = expectedTiles[tile.y][tile.x].neighbors.get(key); expect([actualNeighbor.x, actualNeighbor.y]).toEqual([expectedNeighbor.x, expectedNeighbor.y]); } } } }); test('Grid tileAt()', () => { const grid = new Grid(2, 3); expect(grid.tileAt(0, 1)).toEqual(grid.tiles[1][0]); }); test('Grid squaredDistanceBetween()', () => { const grid = new Grid(2, 3); expect(Grid.squaredDistanceBetween(grid.tileAt(0, 0), grid.tileAt(1, 2))) .toEqual(Math.sqrt(2 ** 2 + 1 ** 2)); }); test('Tile neighborList()', () => { const grid = new Grid(2, 3); expect(grid.tileAt(0, 1).neighborList).toEqual([ grid.tileAt(1, 1), grid.tileAt(0, 0), grid.tileAt(0, 2) ]); });<file_sep>/test/lib/AStar.test.ts import { Grid, Tile } from '../../src/lib/Grid'; import { AStar, PathTile } from '../../src/lib/AStar'; import { displayPath, validatePath } from './pathTestingUtility.ts'; test('All weights 0', () => { const grid = new Grid(5, 5); const aStar = new AStar(grid); const [start, end] = [grid.tileAt(0, 0), grid.tileAt(4, 3)]; const path = aStar.navigate(start, end); displayPath(start, end, path); validatePath(start, end, path, true); }); test('Consider weights', () => { const grid = new Grid(5, 5); /* Create a wall □□□□□ □■■■□ □■□□□ □■□□□ □□□□□ */ grid.tileAt(3, 1).weight = 100; grid.tileAt(3, 2).weight = 100; grid.tileAt(1, 3).weight = 100; grid.tileAt(2, 3).weight = 100; grid.tileAt(3, 3).weight = 100; const aStar = new AStar(grid); const [start, end] = [grid.tileAt(0, 0), grid.tileAt(4, 4)]; const path = aStar.navigate(start, end); displayPath(start, end, path); validatePath(start, end, path, true); }); test('The same AStar instance can be reused', () => { const grid = new Grid(5, 5); const aStar = new AStar(grid); const [start1, end1] = [grid.tileAt(0, 0), grid.tileAt(2, 4)]; const path1 = aStar.navigate(start1, end1); displayPath(start1, end1, path1); validatePath(start1, end1, path1, true); const [start2, end2] = [grid.tileAt(1, 3), grid.tileAt(4, 0)]; const path2 = aStar.navigate(start2, end2); displayPath(start2, end2, path2); validatePath(start2, end2, path2, true); });<file_sep>/test/lib/ThetaStar.test.ts import { Grid, Tile } from '../../src/lib/Grid'; import { ThetaStar } from '../../src/lib/ThetaStar'; import { displayPath, validatePath } from './pathTestingUtility.ts'; const tilesToCoordinates = (tiles: Tile[]): number[][] => { /* To compare lists of tiles, we need to compare only their coordinates. Otherwise, the comparison leads to an infinite loop as each tile object has reference to its neighboring tiles. */ return tiles.map((tile: Tile) => [tile.x, tile.y]); }; test('lineOfSight checks for the correct tiles', () => { const grid = new Grid(5, 5); const thetaStar = new ThetaStar(grid); // x: positive, y: positive, primary: x const actual1 = thetaStar.lineOfSight( grid.tileAt(0, 0), grid.tileAt(3, 2) ); const expected1 = [ //grid.tileAt(1, 0), grid.tileAt(1, 1), grid.tileAt(2, 1), //grid.tileAt(2, 2), grid.tileAt(3, 2) ]; expect(tilesToCoordinates(actual1)).toEqual(tilesToCoordinates(expected1)); // x: positive, y: positive, primary: y const actual2 = thetaStar.lineOfSight( grid.tileAt(0, 0), grid.tileAt(1, 2) ); const expected2 = [ //grid.tileAt(0, 1), grid.tileAt(1, 1), grid.tileAt(1, 2) ]; expect(tilesToCoordinates(actual2)).toEqual(tilesToCoordinates(expected2)); // x: positive, y: negative, primary: x const actual3 = thetaStar.lineOfSight( grid.tileAt(0, 1), grid.tileAt(2, 0) ); const expected3 = [ //grid.tileAt(1, 1), grid.tileAt(1, 0), grid.tileAt(2, 0) ]; expect(tilesToCoordinates(actual3)).toEqual(tilesToCoordinates(expected3)); // x: negative, y: positive, primary: x const actual4 = thetaStar.lineOfSight( grid.tileAt(2, 0), grid.tileAt(0, 1) ); const expected4 = [ //grid.tileAt(1, 0), grid.tileAt(1, 1), grid.tileAt(0, 1) ]; expect(tilesToCoordinates(actual4)).toEqual(tilesToCoordinates(expected4)); // x: negative, y: negative, primary: y const actual5 = thetaStar.lineOfSight( grid.tileAt(1, 2), grid.tileAt(0, 0) ); const expected5 = [ //grid.tileAt(1, 1), grid.tileAt(0, 1), grid.tileAt(0, 0) ]; expect(tilesToCoordinates(actual5)).toEqual(tilesToCoordinates(expected5)); // x: zero, y: positive, primary: y const actual6 = thetaStar.lineOfSight( grid.tileAt(0, 0), grid.tileAt(0, 3) ); const expected6 = [ grid.tileAt(0, 1), grid.tileAt(0, 2), grid.tileAt(0, 3) ]; expect(tilesToCoordinates(actual6)).toEqual(tilesToCoordinates(expected6)); // x: negative, y: zero, primary: x const actual7 = thetaStar.lineOfSight( grid.tileAt(3, 0), grid.tileAt(0, 0) ); const expected7 = [ grid.tileAt(2, 0), grid.tileAt(1, 0), grid.tileAt(0, 0) ]; expect(tilesToCoordinates(actual7)).toEqual(tilesToCoordinates(expected7)); // x: positive, y: negative, primary: even (slope = 1) const actual8 = thetaStar.lineOfSight( grid.tileAt(0, 0), grid.tileAt(3, 3) ); const expected8 = [ grid.tileAt(1, 1), grid.tileAt(2, 2), grid.tileAt(3, 3) ]; expect(tilesToCoordinates(actual8)).toEqual(tilesToCoordinates(expected8)); }); test('lineOfSight recognizes blocked tiles', () => { }); test('All weights 0', () => { const grid = new Grid(5, 5); const thetaStar = new ThetaStar(grid); const [start, end] = [grid.tileAt(0, 0), grid.tileAt(2, 3)]; const path = thetaStar.navigate(start, end); displayPath(start, end, path); validatePath(start, end, path, false); }); test('Consider weights', () => { const grid = new Grid(5, 5); const thetaStar = new ThetaStar(grid); /* Assign weights */ for (const row of grid.tiles) { for (const tile of row) { tile.weight = 0; } } grid.tileAt(2, 3).weight = 100; const [start, end] = [grid.tileAt(3, 4), grid.tileAt(0, 0)]; const path = thetaStar.navigate(start, end); displayPath(start, end, path); validatePath(start, end, path, false); }); test('Avoid blocked tiles', () => { const grid = new Grid(5, 5); const thetaStar = new ThetaStar(grid); /* Create a wall □□□□□ □■■□□ □■□□■ □■□■■ □■□□□ */ grid.tileAt(1, 1).isBlocked = true; grid.tileAt(2, 1).isBlocked = true; grid.tileAt(1, 2).isBlocked = true; grid.tileAt(4, 2).isBlocked = true; grid.tileAt(1, 3).isBlocked = true; grid.tileAt(3, 3).isBlocked = true; grid.tileAt(4, 3).isBlocked = true; grid.tileAt(1, 4).isBlocked = true; const [start, end] = [grid.tileAt(0, 0), grid.tileAt(4, 4)]; const path = thetaStar.navigate(start, end); displayPath(start, end, path); validatePath(start, end, path, false); }); test('Go through corners of blocked cells', () => { /* Allow diagonal steps if either side is clear S■ □G or S□ ■G */ /* Disallow diagonal steps if both sides are blocked S■ ■□ */ });<file_sep>/dist/Grid.js export var Direction; (function (Direction) { Direction[Direction["West"] = 0] = "West"; Direction[Direction["East"] = 1] = "East"; Direction[Direction["North"] = 2] = "North"; Direction[Direction["Northwest"] = 3] = "Northwest"; Direction[Direction["Northeast"] = 4] = "Northeast"; Direction[Direction["South"] = 5] = "South"; Direction[Direction["Southwest"] = 6] = "Southwest"; Direction[Direction["Southeast"] = 7] = "Southeast"; })(Direction || (Direction = {})); export class Tile { constructor(x, y, isBlocked = false, weight = 0) { this.x = x; this.y = y; this.isBlocked = isBlocked; this.weight = weight; this.neighbors = new Map(); } get neighborList() { const neighborList = []; Object.keys(Direction) .map((key) => Direction[key]) .filter((value) => typeof value === 'number') .forEach((key) => { this.neighbors.has(key) && neighborList.push(this.neighbors.get(key)); }); return neighborList; } } export class Grid { constructor(x, y) { [this.x, this.y] = [x, y]; this.tiles = []; for (let y = 0; y < this.y; y++) { const row = []; for (let x = 0; x < this.x; x++) { row.push(new Tile(x, y)); } this.tiles.push(row); } for (let y = 0; y < this.y; y++) { for (let x = 0; x < this.x; x++) { this.greetNeighbors(this.tiles[y][x]); } } } tileAt(x, y) { return this.tiles[y][x]; } greetNeighbors(tile) { if (tile.x - 1 >= 0) { tile.neighbors.set(Direction.West, this.tileAt(tile.x - 1, tile.y)); } if (tile.x + 1 < this.x) { tile.neighbors.set(Direction.East, this.tileAt(tile.x + 1, tile.y)); } if (tile.y - 1 >= 0) { tile.neighbors.set(Direction.North, this.tileAt(tile.x, tile.y - 1)); } if (tile.neighbors.has(Direction.West) && tile.neighbors.has(Direction.North)) { tile.neighbors.set(Direction.Northwest, this.tileAt(tile.x - 1, tile.y - 1)); } if (tile.neighbors.has(Direction.East) && tile.neighbors.has(Direction.North)) { tile.neighbors.set(Direction.Northeast, this.tileAt(tile.x + 1, tile.y - 1)); } if (tile.y + 1 < this.y) { tile.neighbors.set(Direction.South, this.tileAt(tile.x, tile.y + 1)); } if (tile.neighbors.has(Direction.West) && tile.neighbors.has(Direction.South)) { tile.neighbors.set(Direction.Southwest, this.tileAt(tile.x - 1, tile.y + 1)); } if (tile.neighbors.has(Direction.East) && tile.neighbors.has(Direction.South)) { tile.neighbors.set(Direction.Southeast, this.tileAt(tile.x + 1, tile.y + 1)); } } static squaredDistanceBetween(a, b) { return Math.pow((a.x - b.x), 2) + Math.pow((a.y - b.y), 2); } } <file_sep>/dist/PriorityQueue.js import BinaryMinHeap from './BinaryMinHeap'; export default class PriorityQueue { constructor() { this.heap = new BinaryMinHeap(); this.size = 0; } enqueue(node) { this.size++; this.heap.insert(node); } dequeue() { this.size--; return this.heap.remove(1); } peek() { return this.heap.nodes[1]; } isEmpty() { return this.size === 0; } notifyUpdate(i) { this.heap.modifyPosition(i); } elementAt(i) { return this.heap.nodes[i]; } contains(node) { return this.heap.contains(node); } find(condition) { return this.heap.find(condition); } } <file_sep>/src/Character.ts class Character { constructor(tile: Grid.Tile) { this.tile = tile; } move(destination) { const path = AStar.findPath(this.tile.coordinates, destination); } }<file_sep>/dist/BinaryMinHeap.js import { PathTile } from './AStar'; export default class BinaryMinHeap { constructor(array) { this.nodes = [null]; this.size = 0; array && this.heapify(array); } heapify(array) { for (const node of array) { this.insert(node); } } nodeValue(i) { if (i === 0) return null; if (typeof this.nodes[i] === 'number') { return this.nodes[i]; } if (this.nodes[i] instanceof PathTile) { return this.nodes[i].cost; } throw 'Unrecognized node type'; } insert(node) { this.nodes.push(node); this.size++; this.bubbleUp(this.size); } remove(i) { const toRemove = this.nodes[i]; this.nodes[i] = this.nodes[this.size]; this.size--; this.nodes.pop(); this.modifyPosition(i); return toRemove; } modifyPosition(i) { if (i <= this.size && this.nodeValue(i) < this.nodeValue(Math.floor(i / 2))) { this.bubbleUp(i); } else { this.bubbleDown(i); } } bubbleUp(i) { while (Math.floor(i / 2) > 0) { if (this.nodeValue(i) < this.nodeValue(Math.floor(i / 2))) { [this.nodes[i], this.nodes[Math.floor(i / 2)]] = [this.nodes[Math.floor(i / 2)], this.nodes[i]]; } i = Math.floor(i / 2); } } bubbleDown(i) { let mChildIndex; while (i * 2 <= this.size) { mChildIndex = this.minChildIndex(i); if (this.nodeValue(i) > this.nodeValue(mChildIndex)) { [this.nodes[i], this.nodes[mChildIndex]] = [this.nodes[mChildIndex], this.nodes[i]]; } i = mChildIndex; } } minChildIndex(i) { if (i * 2 >= this.size) { return i * 2; } else { if (this.nodeValue(i * 2) < this.nodeValue(i * 2 + 1)) { return i * 2; } else { return i * 2 + 1; } } } contains(node) { for (let i = 1; i <= this.size; i++) { if (this.nodes[i] === node) { return i; } } return 0; } find(condition) { for (let i = 1; i < this.size; i++) { if (condition(this.nodes[i])) { return i; } } return 0; } } <file_sep>/dist/AStar.js import { Grid } from './Grid'; import PriorityQueue from './PriorityQueue'; export class PathTile { constructor(tile, parent, end) { this.tile = tile; this.parent = parent; this.cumulativeWeight = this.calculateCumulativeWeight(this.parent); this.distance = Grid.squaredDistanceBetween(this.tile, end); this.cost = this.cumulativeWeight + this.distance; } updatePathToThis(newParent) { this.parent = newParent; this.cumulativeWeight = this.calculateCumulativeWeight(this.parent); this.cost = this.cumulativeWeight + this.distance; } calculateCumulativeWeight(parent) { if (!this.parent) return 0; return (parent.cumulativeWeight + Grid.squaredDistanceBetween(parent.tile, this.tile) + this.tile.weight); } } export class AStar { constructor(grid) { this.grid = grid; } navigate(start, end) { const queue = new PriorityQueue(); const searched = []; queue.enqueue(new PathTile(start, null, end)); let current; while (!queue.isEmpty()) { current = queue.dequeue(); searched.push(current); if (current.tile === end) { return this.constructPath(current); } for (const neighbor of current.tile.neighborList) { if (searched.map((pathTile) => pathTile.tile).includes(neighbor)) { continue; } const indexInQueue = queue.find((pathTile) => pathTile.tile === neighbor); if (indexInQueue > 0) { this.updatePathTile(current, neighbor, queue.elementAt(indexInQueue)); queue.notifyUpdate(indexInQueue); } else { queue.enqueue(new PathTile(neighbor, current, end)); } } } return []; } updatePathTile(current, neighbor, queuedNeighbor) { if (queuedNeighbor.calculateCumulativeWeight(current) < queuedNeighbor.cumulativeWeight) { queuedNeighbor.updatePathToThis(current); } } constructPath(end) { const path = []; let current = end; while (current.parent) { path.push(current.tile); current = current.parent; } return path; } } <file_sep>/note.md What Slave did: - Get Jest working (Run `npm run test` to test) - Enable testing of TypeScript files - Transform JS in `lib` to TS (To compile them, run `npm run tsc`) - Use generics in BinaryMinHeap and PriorityQueue - Modify a node's value directly and bubble it up/down instaed of removing and readding it. Not sure if it's efficient enough. - Test Grid.ts - Debug/refactor AStar and Grid - Test AStar.ts (Efficiency still needs to be checked manually) - Add my SSH key to push without authentication - Implement line-of-sight and Theta* (needs a lot of debugging!) Todo: - Switch between GitHub users using `git config` - Fix やばいきたない in AStar.ts - Modify the way to calculate cumulative weights in Theta* - Test A* with blocked tiles - Remove diagonal directions (like Northeast) from neighbors to reduce redundant checks in Theta* - Fix this problem: https://www.redblobgames.com/grids/line-drawing.html#orgda0327f Questions: - Can't we `break` the while loop once bubbling up/down ends? - Absolute weights (like obstacles) vs relative weights (like heights)?? - Will we have blocked and unblocked tiles? - Can we take the square root of the distance to give advantage to diagonal movements?<file_sep>/test/lib/BinaryMinHeap.test.ts import BinaryMinHeap from '../../src/lib/BinaryMinHeap'; test('heapify/insert', () => { const heap = new BinaryMinHeap<number>([8, 12, 10, 2, 5, 9, 1]); expect(heap.nodes).toEqual([null, 1, 5, 2, 12, 8, 10, 9]); }); test('remove', () => { const heap = new BinaryMinHeap<number>([8, 12, 10, 2, 5, 9, 1]); heap.remove(1); // Root (1) expect(heap.nodes).toEqual([null, 2, 5, 9, 12, 8, 10]); heap.remove(6); // Last (10) expect(heap.nodes).toEqual([null, 2, 5, 9, 12, 8]); heap.remove(4); // Middle (12) expect(heap.nodes).toEqual([null, 2, 5, 9, 8]); }); test('contains', () => { const heap = new BinaryMinHeap<number>([8, 12, 10, 2, 5, 9, 1]); expect(heap.contains(8)).toBe(5); expect(heap.contains(100)).toBe(0); });
6809a2df06b501b0070a0ca792e9eab85d7e7fab
[ "JavaScript", "TypeScript", "Markdown" ]
14
TypeScript
Rawgers/Rune
61eac432b896b0dcf72087956d35132878bb0ef2
a8143431339c28ff1c798c5e3659c6e764862bcd
refs/heads/master
<repo_name>samlachance/pinatra<file_sep>/app.rb require 'sinatra' require 'feedjira' class Media # This allows you to call all on any Class to get a list of its objects def self.all ObjectSpace.each_object(self).to_a end # In order to control mplayer in slave mode it needs a file to read changes from # I went ahead and just threw it in /tmp/ because it seemed like the right thing to do # This checks to see if that file exists and then creates it if it doesn't def self.fifo unless File.exist?('/tmp/mplayer-control') `mkfifo /tmp/mplayer-control` end end # This method creates the fifo file (if not already present) then, # starts mplayer in slave mode and tells it to watch the fifo file. def self.play(source) fifo `mplayer -slave -input file=/tmp/mplayer-control #{source}` redirect to('/controls') end # This method allows you to pass in commands for mplayer. Commands can be found with the google def self.mplayer(command) `echo "#{command}" > /tmp/mplayer-control` end end class Podcast < Media attr_accessor :name, :url, :episodes def initialize(name, url) @name = name @url = url end # Fetches podcasts from a source url def fetch(source) Feedjira::Feed.fetch_and_parse source end # Searches for an object of Podcast class by name def self.search_name(query) a = self.all.to_a # the to_a is needed to perform the search a.select! { |n| n.name == query } # Searches each object in the arracy for the object with your name a[0] # Returns the object in the 0 index end # Essentially utilizes the search_name method to prevent duplicate podcasts from being created def self.spawn(name, url) if Podcast.search_name(name).nil? Podcast.new(name, url) # If a podcast with that name already exists, it will return nil end end # This method is called when the user wants to play a podcast. # The podcast is downloaded into the /tmp/podcast.mp3 file and # and then passed into the play method. This is done to allow # the user to pause and seek without dropping the stream. def self.podcast(source) `wget -O /tmp/podcast.mp3 #{source}` play("/tmp/podcast.mp3") end # Call this method on the object to store a current list of episodes in the @episodes variable def populate self.episodes = fetch(@url) end end get '/' do erb :index end get '/controls' do erb :controls end # The controls post to the '/' directory and then redirect back to where you came from post '/' do command = params[:command].to_s Media.mplayer(command) redirect to('/controls') end # Normal internet radio streams post to here. The stream source (which is specified in the markup) # is then passed into the play method. post '/stream' do stream = params[:stream].to_s Media.play(stream) redirect to('/controls') end # Podcasts post here. When a source is passed into the podcast method, the file is downloaded # and then played locally post '/stream-podcast' do source = params[:stream_podcast].to_s Podcast.podcast(source) redirect to('/controls') end # Below are examples of different podcasts. I wanted them to be on seperate pages because the list of episodes # can get long. Doing it this way also allows you to fine tune how many episodes appear in the list get '/sgu' do Podcast.spawn("SGU", "http://www.theskepticsguide.org/feed/sgu/") #Spawns the Podcast object podcast = Podcast.search_name("SGU") # Finds that object podcast.populate # Populates the @episodes variable @episodes = podcast.episodes.entries[0..29] # Pulls the first 10 episodes and then stores it for the view erb :podcast # Renders the view end get '/rd' do Podcast.spawn("Reconcilable Differences", "https://www.relay.fm/rd/feed") podcast = Podcast.search_name("Reconcilable Differences") podcast.populate @episodes = podcast.episodes.entries[0..29] erb :podcast end get '/ct' do Podcast.spawn("Car Talk", "http://www.npr.org/rss/podcast.php?id=510208") podcast = Podcast.search_name("Car Talk") podcast.populate @episodes = podcast.episodes.entries[0..9] erb :podcast end get '/rl' do Podcast.spawn("Radio Lab", "http://feeds.wnyc.org/radiolab?format=xml") podcast = Podcast.search_name("Radio Lab") podcast.populate @episodes = podcast.episodes.entries[0..9] erb :podcast end get '/htde' do Podcast.spawn("How to do Everything", "http://www.npr.org/rss/podcast.php?id=510303") podcast = Podcast.search_name("How to do Everything") podcast.populate @episodes = podcast.episodes.entries[0..9] erb :podcast end get '/tfl' do Podcast.spawn("The Flop House", "http://theflophouse.libsyn.com/rss") podcast = Podcast.search_name("The Flop House") podcast.populate @episodes = podcast.episodes.entries[0..9] erb :podcast end get '/otm' do Podcast.spawn("On the Media", "http://www.onthemedia.org/feeds/episodes/") podcast = Podcast.search_name("On the Media") podcast.populate @episodes = podcast.episodes.entries[0..9] erb :podcast end
69ffbeb2f070340e7f948b17e36903eafe310ec9
[ "Ruby" ]
1
Ruby
samlachance/pinatra
a01d58e6d581ec385a05dea1b139e6fcbc9d9a30
f21356412326365d41d48a7d1dfb11bb27487a5f
refs/heads/master
<file_sep>package com.cubicfox.service; import com.cubicfox.entity.User; import com.cubicfox.repository.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import java.util.ArrayList; @Service public class UserService implements UserDetailsService { @Autowired private UserRepository userRepository; public User getUser(String username){ return userRepository.findByUsername(username); } @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user = userRepository.findByUsername(username); if (user != null) { return new org.springframework.security.core.userdetails.User(user.username, user.password, new ArrayList<>()); } else { throw new UsernameNotFoundException("User not found with username: " + username); } } } <file_sep>package com.cubicfox.controller; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @CrossOrigin public class WelcomeController { @GetMapping("/") public ResponseEntity<String> HelloSpring() { return ResponseEntity.ok("Hello Spring :)"); } } <file_sep># Cubicfox Demo Project # REST API demo project ## Project details ## **Database config**: src\main\resources\application.properties<br/> **API Endpoints**: [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html)<br/> **Test user**: admin / Secret123 <br/> **Demo data**: export\20200131_2140.sql
8c0ae6462f96ec2b4bcaba73000d0ecefa2ae887
[ "Markdown", "Java" ]
3
Java
szonyim/cubicfox
6e0216283e47072ee2b76575397fc386ad2043f9
381dffa393d669d56ecb646d0796da90783a3557
refs/heads/master
<repo_name>JinHee8989/play-spring-in-action<file_sep>/src/main/resources/data.sql insert into users(username,password) values('user1','<PASSWORD>'); insert into users(username,password) values('user2','<PASSWORD>'); insert into authorities(username,authority) values('user1','ROLE_USER'); insert into authorities(username,authority) values('user2','ROLE_USER'); commit;<file_sep>/src/main/java/tacos/web/WebConfig.java package tacos.web; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class WebConfig implements WebMvcConfigurer { //사용자 입력을 처리하지 않는 간단한 컨트롤러의 경우 뷰 컨트롤러에 정의할 수 있음. //어떤 클래스건 WebMvcConfigurer를 상속받으면 addViewControllers()메소드 오버라이딩 가능 @Override public void addViewControllers(ViewControllerRegistry registry) { //이 메소드로 HomeController의 역할을 대신할 수 있음 registry.addViewController("/").setViewName("home"); registry.addViewController("/login"); } }
bc864bda331f8db98af2d3e7c9883805d3984770
[ "Java", "SQL" ]
2
SQL
JinHee8989/play-spring-in-action
efc01ddba1288144d64366bca41a6008db3a5317
4846e755561c60f82abf429a60d0c54cf0e72aa7
refs/heads/main
<file_sep>import React, {useContext, useState, useLayoutEffect} from 'react'; import { TouchableOpacity, View, StyleSheet, Text, StatusBar, } from 'react-native'; import { SELECT_SYMPTOM } from '../config/Reducer'; import { Context } from '../config/Context'; import { Ionicons } from '@expo/vector-icons'; import ModalBox from '../components/ModalBox'; import TransactionList from '../components/TransactionList'; export default function Transactions({ navigation }) { const { dispatch } = useContext(Context); const [modalVisible, setModalVisible] = useState(false); const transactions = [ { id: 1, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 2, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 3, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 4, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 5, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 6, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" } ]; useLayoutEffect(() => { navigation.setOptions({ headerStyle: { backgroundColor: "#fff", borderBottomWidth: 0, elevation: 0, shadowOpacity: 0, }, headerTitleStyle: { display: "none" }, headerLeft: () => { return ( <View style={{ padding: 20, marginTop: 8, marginBottom: 10, display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center" }}> <TouchableOpacity style={{ padding: 8, marginTop: 8, backgroundColor: "#e7e7e7", borderRadius: 9999 }} activeOpacity={0.4} onPress={() => navigation.goBack()}> <Ionicons name="md-chevron-back-sharp" size={21} color="#000" /> </TouchableOpacity> </View> ) } }) }, []); const handleCloseModal = () => setModalVisible(false); const handleModalVisible = (transaction) => { setModalVisible(true); dispatch({ type: SELECT_SYMPTOM, payload: transaction }); }; return ( <React.Fragment> <StatusBar barStyle="dark-content" backgroundColor="#fff" /> <View style={styles.container}> <ModalBox isModalVisible={modalVisible} closeModal={handleCloseModal} /> <View style={styles.greetingInfo}> <Text style={styles.title}> My Transactions</Text> </View> <View style={styles.result}> { transactions.length === 0 ? ( <Text style={{ flex: 1, justifyContent: 'center', alignItems: 'center', fontFamily: 'Poppins', fontSize: 14 }}> No transaction </Text> ) : ( <TransactionList transactions={transactions} onSelectTransaction={handleModalVisible} /> ) } </View> </View> </React.Fragment> ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', fontFamily: "Poppins", paddingTop: 20, paddingHorizontal: 20 }, greetingInfo: { color: "#000000", marginTop: 10, justifyContent: "center", alignItems: "center" }, input: { borderRadius: 10, borderColor: "#cbcaca", borderWidth: 2, paddingVertical: 15, paddingHorizontal: 18, marginTop: 5, marginBottom: 10, fontFamily: "Poppins", fontSize: 14 }, title: { fontSize: 27, fontFamily: "PoppinsBold", letterSpacing: 1, textAlign: "center", color: "#000" }, text: { paddingBottom: 10, marginLeft: 5, color: "#000000", fontFamily: "PoppinsBold", fontSize: 19, }, result: { paddingTop: 40, height: "100%", paddingBottom: 10 }, buttonClose: { backgroundColor: "#E7E7E7", borderRadius: 10, padding: 10, elevation: 2, alignItems: "flex-end" }, centeredView: { flex: 1, justifyContent: "center", alignItems: "center", marginTop: 22, }, modalView: { backgroundColor: "white", borderRadius: 20, padding: 15, alignItems: "center", shadowColor: "#000", shadowOffset: { width: 0, height: 2 } }, }) <file_sep>import * as React from 'react'; import { StyleSheet, ActivityIndicator, View, Text} from 'react-native'; export function SyncLoading() { const [spinnerText, setSpinnerText] = React.useState("Getting the data...."); React.useEffect(() => { setTimeout(() => setSpinnerText('Anaylizing the data...'), 5000); }, []); return ( <View style={[styles.container]}> <ActivityIndicator size={90} color="#fc031c" /> <Text style={styles.spinnerText}>{spinnerText}</Text> </View> ) }; const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#ffffff', fontFamily: "Poppins", paddingBottom: 40, paddingHorizontal: 20, justifyContent: 'center', alignItems: 'center' }, spinnerText: { fontSize: 17, fontFamily: "Poppins", marginVertical: 30 }, })<file_sep>import React from 'react' import { View, Modal, StyleSheet, Text, TouchableOpacity } from 'react-native'; import { Context } from '../config/Context'; import { Ionicons } from '@expo/vector-icons'; import Transactions from '../pages/Transactions'; export default function ModalBox({ isModalVisible, closeModal }) { const { state } = React.useContext(Context); const transcation = state.selectedSymptom; const [isLoading, setLoading] = React.useState(false); React.useEffect(() => { let subscribe = true; const getNoData = async () => { setLoading(true); try { const data = await new Promise((resolve, reject) => { setTimeout(() => { resolve(true); }, 7000); }); if(data && subscribe){ setLoading(false); } } catch (e) { console.warn(e); } } getNoData() return () => subscribe = false; }, [isModalVisible]); return ( <View style={styles.container}> <Modal animationType="fade" transparent={true} visible={isModalVisible} onRequestClose={() => {}} > <View style={styles.centeredView}> <View style={styles.modalView}> <TouchableOpacity activeOpacity={0.8} style={[styles.button, styles.buttonClose]} onPress={() => closeModal()} > <Ionicons name="close-sharp" size={25} color="black" /> </TouchableOpacity> <View style={styles.greetingInfo}> <Text style={styles.title}>Transaction Detail</Text> </View> <View style={{paddingTop: 20}}> <View style={styles.group}> <Text style={styles.label}>Sent From</Text> <Text style={styles.text}>{transcation.sender}</Text> </View> <View style={styles.group}> <Text style={styles.label}>Amount</Text> <Text style={styles.text}>{transcation.amount}</Text> </View> <View style={styles.group}> <Text style={styles.label}>Sent on</Text> <Text style={styles.text}>{transcation.created_at}</Text> </View> </View> </View> </View> </Modal> </View> ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', fontFamily: "Poppins", paddingHorizontal: 20 }, buttonClose: { backgroundColor: "#e7e7e7", borderRadius: 30, paddingVertical: 15, position: "absolute", right: 10, fontWeight: "900", elevation: 2, display: "flex", flexDirection: "row", justifyContent: "center", alignItems: "center", marginBottom: 27, marginRight: 28, width: 45, height: 45 }, detailContainer: { flex: 1, height: '100%', width: "100%", backgroundColor: '#ffffff', paddingHorizontal: 10, paddingVertical: 10 }, text: { paddingBottom: 10, marginLeft: 5, color: "#000000", fontFamily: "Poppins", fontSize: 19, }, centeredView: { flex: 1, marginTop: 22, backgroundColor: "#fff" }, greetingInfo: { color: "#000000", marginTop: 40, justifyContent: "center", alignItems: "center" }, title: { fontSize: 25, fontFamily: "PoppinsBold", letterSpacing: 1, textAlign: "center", color: "#000" }, modalView: { backgroundColor: "white", borderRadius: 20, paddingTop: 30, paddingHorizontal: 30, shadowColor: "#000", shadowOffset: { width: 0, height: 2 } }, label: { fontSize: 18, fontFamily: "PoppinsBold" }, group: { marginVertical: 10 } }) <file_sep>import 'react-native-gesture-handler'; import * as React from 'react'; import Welcome from "./pages/Welcome"; import Login from "./pages/Login"; import Register from "./pages/Register"; import ForgotPassword from "./pages/ForgotPassword"; import { useFonts } from "expo-font"; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import ContextProvider from './config/Context'; import { Context } from './config/Context'; import Dashboard from './pages/Dashboard'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import * as SplashScreen from 'expo-splash-screen'; import { useEffect } from 'react'; import RequestMoney from './pages/RequestMoney'; import SendMoney from './pages/SendMoney'; import Transactions from './pages/Transactions'; import { StripeProvider } from '@stripe/stripe-react-native' import FundWallet from './pages/FundWallet'; //Prevent splashscreen from auto hiding until the app finish loading auth state SplashScreen.preventAutoHideAsync(); const Stack = createStackNavigator(); const MyStack = () => { let { state } = React.useContext(Context); return ( state.auth ? ( <Stack.Navigator> <Stack.Screen name="Dashboard" component={Dashboard} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> <Stack.Screen name="Fund-Wallet" component={FundWallet} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> <Stack.Screen name="Send-Money" component={SendMoney} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> <Stack.Screen name="My-Transactions" component={Transactions} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> <Stack.Screen name="Request-Money" component={RequestMoney} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> </Stack.Navigator> ) : ( <Stack.Navigator> <Stack.Screen name="Welcome" component={Welcome} options={{ headerStyle: { display: "none" }, headerTitleStyle: { display: 'none', }, headerShown: false }} /> <Stack.Screen name="Login" component={Login} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> <Stack.Screen name="Register" component={Register} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> <Stack.Screen name="ForgetPassword" component={ForgotPassword} options={{ headerTitleStyle: { display: "none" }, headerShown: true }} /> </Stack.Navigator> ) ); }; export default function App() { const [loaded] = useFonts({ Poppins: require('./assets/fonts/Poppins-Medium.ttf'), PoppinsBold: require('./assets/fonts/Poppins-Bold.ttf') }); useEffect(() => { setTimeout(async () => { // Hide the splash after 4s await SplashScreen.hideAsync() }, 4000); }, []); if (!loaded) { return null; } return ( <SafeAreaProvider> <ContextProvider> <NavigationContainer> <StripeProvider publishableKey="<KEY>"> <MyStack /> </StripeProvider> </NavigationContainer> </ContextProvider> </SafeAreaProvider> ) }; <file_sep>import React, { useContext, useState } from 'react' import { StyleSheet, Text, TouchableOpacity } from 'react-native'; import { Formik } from 'formik'; import PasswordInputField from './PasswordInputField'; import EmailInputField from './EmailInputField'; import { AUTHENTICATION_SUCCESS } from '../config/Reducer'; import { Context } from '../config/Context'; import AsyncStorage from '@react-native-async-storage/async-storage'; import AlertModalBox from './AlertModalBox'; export default function LoginForm({ navigation }) { const [modalVisibility, setModalVisibility] = useState(false); const [message, setMessage] = useState(""); const [alertType, setAlertType] = useState(""); let { dispatch } = useContext(Context); const handleCloseModal = () => setModalVisibility(false); const handleSubmit = async (values, actions) => { const users = await AsyncStorage.getItem("@users"); const all_users = JSON.parse(users); const matched_users = all_users.filter(user => user.email.toLocaleLowerCase() === values.email.toLocaleLowerCase()); if(values.email === "" || values.password === ""){ actions.setSubmitting(false); setMessage("Email and Password is required"); setAlertType("error"); setModalVisibility(true); return; } if(matched_users.length > 0) { if(matched_users[0].password === values.password){ await AsyncStorage.setItem("@user_data", JSON.stringify(matched_users[0])); actions.setSubmitting(false); setModalVisibility(false); dispatch({ type: AUTHENTICATION_SUCCESS, payload: matched_users[0]}); }else{ setMessage("Invalid email or Password"); setAlertType("error"); setModalVisibility(true); actions.setSubmitting(false); } }else{ setMessage("Credential does not match any record"); setModalVisibility(true); setAlertType("error"); actions.setSubmitting(false); }; } return ( <React.Fragment> <Formik initialValues={{ email: '', password: '' }} onSubmit={(values, actions) => handleSubmit(values, actions)} > {(props) => ( <> <EmailInputField currentValue={props.values.email} fieldName="email" handleBlur={props.handleBlur} handleChange={props.handleChange} /> <PasswordInputField currentValue={props.values.password} labelName="Password" fieldName="password" handleBlur={props.handleBlur} handleChange={props.handleChange} /> <Text style={styles.link} onPress={() => {navigation.navigate('ForgetPassword') }} > Forget Password </Text> <TouchableOpacity disabled={props.isSubmitting} activeOpacity={0.8} onPress={props.handleSubmit} style={props.isSubmitting ? styles.disabled : styles.button}> {!props.isSubmitting ? <Text style={styles.buttonText}>Log in</Text> : <Text style={styles.buttonText}>Loading...</Text> } </TouchableOpacity> </> )} </Formik> <AlertModalBox type={alertType} isModalVisible={modalVisibility} message={message} closeModalhandler={handleCloseModal} /> </React.Fragment> ) } const styles = StyleSheet.create({ link: { paddingVertical: 5, textAlign: "right", color: "#dc143c", fontWeight: "500", fontFamily: "Poppins", fontSize: 13 }, buttonText: { textTransform: "uppercase", color: "white", textAlign: "center", fontFamily: "PoppinsBold", fontSize: 13, }, button: { backgroundColor: "#000000", paddingVertical: 18, borderRadius: 50, width: "100%", marginTop: 25, }, disabled: { opacity: .56, backgroundColor: "#000", paddingVertical: 17, borderRadius: 50, width: "100%", marginTop: 15, } }) <file_sep>import React from 'react' import { StyleSheet, Text, ScrollView, TouchableOpacity, View } from 'react-native' export default function TransactionList({ transactions, onSelectTransaction}) { return ( <ScrollView style={{paddingVertical: 20}}> { transactions.map(transaction => ( <TouchableOpacity key={transaction.id} activeOpacity={0.4} style={style.button} onPress={() => onSelectTransaction(transaction)} > <View> <Text style={style.text}>Sent from {transaction.sender}</Text> <Text style={style.time}>{transaction.created_at}</Text> </View> <Text style={style.text}>{transaction.amount}</Text> </TouchableOpacity> )) } </ScrollView> ) } const style = StyleSheet.create({ container: { flex: 1, }, buttonTitle: { textTransform: "uppercase", color: "white", fontFamily: "Poppins", fontSize: 20, fontWeight: "bold", color: "#dc143c" }, button: { paddingVertical: 17, paddingHorizontal: 15, width: "100%", marginVertical: 10, borderRadius: 10, borderColor: "#6d6d6d", borderWidth: 1, display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, text: { marginLeft: 5, color: "#000000", fontFamily: "PoppinsBold", fontSize: 18, fontWeight: "900" }, time: { marginLeft: 5, color: "#000", fontFamily: "Poppins", fontSize: 15, fontWeight: "900", opacity: .5 } }) <file_sep>import React, {useState, useLayoutEffect, useContext, useEffect } from 'react'; import { Ionicons, Feather, Entypo } from '@expo/vector-icons'; import { View, StyleSheet, Text, TouchableOpacity, StatusBar } from 'react-native'; import { Context } from '../config/Context'; import { ScrollView } from 'react-native'; import { LOG_OUT_SUCCESS } from '../config/Reducer'; import AsyncStorage from '@react-native-async-storage/async-storage'; import TransactionList from '../components/TransactionList'; export default function Dashboard({ navigation }) { let { state, dispatch } = useContext(Context); const [greetMessage, setGreetingMessage] = useState("How has been your day?"); const [time] = useState(new Date().getHours()); const [isShowBalance, setIsShowBalance] = useState(false) const user = state.currentUser; const transactions = [ { id: 1, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 2, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 3, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 4, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 5, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" }, { id: 6, sender: "<NAME>", receiver: "<NAME>", created_at: "2021-09-12 09:34pm", amount: "#120,000" } ]; const handleLogOut = async () => { await AsyncStorage.removeItem("@user_data"); dispatch({ type: LOG_OUT_SUCCESS, payload: null}); }; useLayoutEffect(() => { navigation.setOptions({ headerStyle: { backgroundColor: "#fff", borderBottomWidth: 0, elevation: 0, shadowOpacity: 0, }, headerTitleStyle: { display: "none" }, headerRight: () => { return ( <View style={{ paddingHorizontal: 30 }}> <TouchableOpacity activeOpacity={0.4} onPress={handleLogOut}> <Ionicons name="log-out-outline" size={28} color="black" /> </TouchableOpacity> </View> ) } }) }); useEffect(() => { if (time < 12) { setGreetingMessage("Good morning ☁️. Have a nice day"); } if (time > 12 && time < 17) { setGreetingMessage("Good afternoon ☀️. How has been your day?"); } if (time > 17 && time < 22) { setGreetingMessage("Good Evening 🌤️. How was your day?"); } if(time >= 22){ setGreetingMessage("Good Night. Have a wonderful Dream 🌙"); } }, [time]); return ( <React.Fragment> <StatusBar backgroundColor="#fff" barStyle="dark-content" /> <ScrollView> <View style={styles.container}> <View style={{paddingVertical: 20}}> <View style={{ marginBottom: 35, }}> <Text style={{ color: "#000", fontFamily: "PoppinsBold", fontSize: 22, textTransform: "capitalize" }}>Hello, {user.firstname}</Text> <Text style={styles.greetingText}>{greetMessage}</Text> </View> </View> <View style={{ paddingHorizontal: 30, paddingVertical: 30, backgroundColor: "#000", borderColor: "#000", marginBottom: 25, marginTop: -20, borderRadius: 20, display: "flex", flexDirection: "row", justifyContent: "space-between", alignItem: "center" }}> <View> <Text style={{ color: "#fff", fontFamily: "Poppins", fontSize: 19 }}> Your Balance </Text> {isShowBalance ? ( <Text style={styles.amount}> <Text style={{fontSize: 23}}>₦ </Text> 456, 000 </Text> ) : ( <Text style={styles.amount}> XXX,xxx </Text> )} </View> <View style={{ flex: 1, justifyContent: "center", alignItems: "flex-end"}}> <TouchableOpacity style={{ paddingVertical: 8, paddingHorizontal: 12, marginTop: 8, backgroundColor: "#e7e7e7", borderRadius: 9 }} activeOpacity={0.8} onPress={() => setIsShowBalance(!isShowBalance)}> <Text style={{fontSize: 15, fontFamily: "Poppins"}}> {isShowBalance ? "Hide Balance" : "Show Balance"} </Text> </TouchableOpacity> </View> </View> <View style={{ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center"}}> <TouchableOpacity style={{ paddingVertical: 20, paddingHorizontal: 20, marginTop: 8, backgroundColor: "#000", width: "40%", borderRadius: 99 }} activeOpacity={0.7} onPress={() => navigation.navigate("Send-Money")}> <Text style={styles.buttonText}>Send Money</Text> </TouchableOpacity> <TouchableOpacity style={{ paddingVertical: 20, paddingHorizontal: 20, marginTop: 8, backgroundColor: "green", width: "40%", borderRadius: 99 }} activeOpacity={0.7} onPress={() => navigation.navigate("Fund-Wallet")}> <Text style={styles.outlineText}>Request Money</Text> </TouchableOpacity> </View> <View style={{ paddingVertical: 30, marginTop: 40 }}> <View style={{ flex: 1, flexDirection: "row", justifyContent: "space-between", alignItems: "center"}}> <Text style={styles.title}> Recent Transactions </Text> <Text style={styles.link} onPress={() => navigation.navigate("My-Transactions")}> See All </Text></View> <View style={styles.result}> { transactions.length === 0 ? ( <Text style={{ flex: 1, justifyContent: 'center', alignItems: 'center', fontFamily: 'Poppins', fontSize: 14 }}> No transaction </Text> ) : ( <TransactionList transactions={transactions} onSelectTransaction={(transaction) => console.log(transaction)} /> ) } </View> </View> </View> </ScrollView> </React.Fragment> ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', fontFamily: "Poppins", paddingTop: 20, paddingBottom: 130, paddingHorizontal: 25, }, navigationContainer: { backgroundColor: "#ecf0f1", borderBottomColor: '#fff' }, title: { textTransform: "uppercase", color: "#000", textAlign: "left", fontFamily: "PoppinsBold", fontSize: 17 }, amount: { color: "#fff", fontFamily: "PoppinsBold", fontSize: 30, textTransform: "uppercase" }, greetingText: { fontSize: 15, fontFamily: "Poppins", letterSpacing: 1, fontWeight: "800", color: "#000" }, text: { paddingLeft: 0, marginLeft: 5, color: "#000000", fontFamily: "Poppins", fontSize: 18, fontWeight: "700" }, buttonText: { textTransform: "uppercase", color: "#fff", textAlign: "center", fontFamily: "PoppinsBold", fontSize: 13, }, outlineText: { textTransform: "uppercase", color: "#fff", textAlign: "center", fontFamily: "PoppinsBold", fontSize: 13, }, button: { backgroundColor: "#dc143c", paddingVertical: 18, borderRadius: 50, width: "100%", marginTop: 45, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }, link: { padding: 10, marginLeft: 14, color: "#dc143c", fontSize: 17, fontFamily: "Poppins", fontWeight: "bold" }, }); <file_sep>import React from 'react'; import { CardField, useStripe } from '@stripe/stripe-react-native'; import { StyleSheet, View } from 'react-native'; export default function FundWallet() { const { confirmPayment } = useStripe(); return ( <View style={styles.container}> <CardField postalCodeEnabled={false} placeholder={{ number: '4242 4242 4242 4242', }} cardStyle={{ backgroundColor: '#FFFFFF', textColor: '#000000', }} style={{ width: '100%', height: '100%', marginVertical: 30, }} onCardChange={(cardDetails) => { console.log('cardDetails', cardDetails); }} onFocus={(focusedField) => { console.log('focusField', focusedField); }} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'white', padding: 30, justifyContent: "center", alignItems: "center" } })
fb76618078306a24ae62e417ed5345284ac437e6
[ "JavaScript" ]
8
JavaScript
ayodeji334/expo-sample
e06be105383fda25cc3ea584b2d6f18851db18c9
ca0c76b6e59b1ac3e04d5b5e52c07685c0e92c02
refs/heads/master
<repo_name>2667/XLsn0wScrollUnderlineButton<file_sep>/Podfile platform :ios, '9.0' use_frameworks! target 'XLsn0wScrollUnderlineButton' do pod 'XLsn0wKit_objc' end <file_sep>/README.md ## 滚动下划线按钮,如网易新闻类滚动Bar ![gif](https://github.com/XLsn0w/XLsn0wScrollUnderlineButton/blob/master/gif.gif?raw=true)
cf74eebe2974f24b6eba8545afdbf670e84ca1c2
[ "Markdown", "Ruby" ]
2
Ruby
2667/XLsn0wScrollUnderlineButton
8ab78686b8681a69e7e6f953291ed19b28a84607
b8cd368da876fdc17353e7da8b2d92089877cf2f
refs/heads/main
<repo_name>craigc2016/NewsApp<file_sep>/app/src/main/java/com/example/newsapiclient/domain/usecase/GetSavedNewsUseCase.kt package com.example.newsapiclient.domain.usecase import com.example.newsapiclient.data.model.Article import com.example.newsapiclient.domain.respository.NewsRepository import kotlinx.coroutines.flow.Flow /** *Created by <NAME> on 25/05/2021. */ class GetSavedNewsUseCase(private val newsRepository: NewsRepository) { fun execute() : Flow<List<Article>> { return newsRepository.getSavedNews() } }<file_sep>/app/src/test/java/com/example/newsapiclient/data/api/NewsAPIServiceTest.kt package com.example.newsapiclient.data.api import kotlinx.coroutines.runBlocking import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okio.buffer import okio.source import org.junit.After import org.junit.Before import org.junit.Test import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory import com.google.common.truth.Truth.assertThat /** *Created by <NAME> on 25/05/2021. */ class NewsAPIServiceTest { private lateinit var service: NewsAPIService private lateinit var server: MockWebServer @Before fun setUp() { server = MockWebServer() service = Retrofit.Builder() .baseUrl(server.url("")) .addConverterFactory(GsonConverterFactory.create()) .build() .create(NewsAPIService::class.java) } private fun enqueueMockResponse( fileName: String ) { val inputStream = javaClass.classLoader!!.getResourceAsStream(fileName) val source = inputStream.source().buffer() val mockResponse = MockResponse() mockResponse.setBody(source.readString(Charsets.UTF_8)) server.enqueue(mockResponse) } @After fun tearDown() { server.shutdown() } @Test fun getTopHeadlines_sendRequest_receivedExpected() { runBlocking { enqueueMockResponse("newsresponse.json") val responseBody = service.getTopHeadlines("us",1).body() val request = server.takeRequest() assertThat(responseBody).isNotNull() assertThat(request.path).isEqualTo("/v2/top-headlines?country=us&page=1&apiKey=55ccc7a54eec4c92a39e136a50fccc8e") } } @Test fun getTopHeadlines_receivedResponse_correctPageSize() { runBlocking { enqueueMockResponse("newsresponse.json") val responseBody = service.getTopHeadlines("us",1).body() val articlesList = responseBody!!.articles assertThat(articlesList.size).isEqualTo(20) } } @Test fun getTopHeadlines_receivedResponse_correctContent() { runBlocking { enqueueMockResponse("newsresponse.json") val responseBody = service.getTopHeadlines("us",1).body() val articlesList = responseBody!!.articles val article = articlesList[0] assertThat(article.author).isEqualTo("<NAME>, CNN") assertThat(article.url).isEqualTo("https://www.cnn.com/2021/05/24/politics/william-barr-memo-trump-obstruction-doj-appeal/index.html") assertThat(article.publishedAt).isEqualTo("2021-05-25T06:39:00Z") } } }<file_sep>/app/src/main/java/com/example/newsapiclient/domain/usecase/GetSearchedNewsUseCase.kt package com.example.newsapiclient.domain.usecase import com.example.newsapiclient.data.model.APIResponse import com.example.newsapiclient.domain.respository.NewsRepository import com.example.newsapiclient.data.util.Resource /** *Created by <NAME> on 25/05/2021. */ class GetSearchedNewsUseCase(private val newsRepository: NewsRepository) { suspend fun execute( country: String, searchQuery: String, page: Int ) : Resource<APIResponse> { return newsRepository.getSearchedNews(country, searchQuery, page) } }<file_sep>/app/src/main/java/com/example/newsapiclient/data/repository/datasource/NewsRemoteDataSource.kt package com.example.newsapiclient.data.repository.datasource import com.example.newsapiclient.data.model.APIResponse import retrofit2.Response /** *Created by <NAME> on 25/05/2021. */ interface NewsRemoteDataSource { suspend fun getTopHeadlines(country:String, page: Int) : Response<APIResponse> suspend fun getSearchedNews(country:String, searchQuery: String, page: Int) : Response<APIResponse> }<file_sep>/app/src/main/java/com/example/newsapiclient/presentation/di/UseCaseModule.kt package com.example.newsapiclient.presentation.di import com.example.newsapiclient.domain.respository.NewsRepository import com.example.newsapiclient.domain.usecase.* import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton /** *Created by <NAME> on 25/05/2021. */ @InstallIn(SingletonComponent::class) @Module class UseCaseModule { @Singleton @Provides fun providesGetNewsHeadlinesUseCase( newsRepository: NewsRepository ) : GetNewsHeadlinesUseCase{ return GetNewsHeadlinesUseCase(newsRepository) } @Singleton @Provides fun providesGetSearchedNewsUseCase( newsRepository: NewsRepository ) : GetSearchedNewsUseCase{ return GetSearchedNewsUseCase(newsRepository) } @Singleton @Provides fun providesSavedNewsUseCase( newsRepository: NewsRepository ) : SaveNewsUseCase { return SaveNewsUseCase(newsRepository) } @Singleton @Provides fun providesGetSavedNewsUseCase( newsRepository: NewsRepository ) : GetSavedNewsUseCase { return GetSavedNewsUseCase(newsRepository) } @Singleton @Provides fun providesDeleteSavedNewsUseCase( newsRepository: NewsRepository ) : DeleteSavedNewsUseCase { return DeleteSavedNewsUseCase(newsRepository) } }<file_sep>/app/src/main/java/com/example/newsapiclient/domain/usecase/DeleteSavedNewsUseCase.kt package com.example.newsapiclient.domain.usecase import com.example.newsapiclient.data.model.Article import com.example.newsapiclient.domain.respository.NewsRepository /** *Created by <NAME> on 25/05/2021. */ class DeleteSavedNewsUseCase(private val newsRepository: NewsRepository) { suspend fun execute(article: Article) = newsRepository.deleteNews(article) }<file_sep>/app/src/main/java/com/example/newsapiclient/data/repository/datasourceimpl/NewsRemoteDataSourceImpl.kt package com.example.newsapiclient.data.repository.datasourceimpl import com.example.newsapiclient.data.api.NewsAPIService import com.example.newsapiclient.data.model.APIResponse import com.example.newsapiclient.data.repository.datasource.NewsRemoteDataSource import retrofit2.Response /** *Created by <NAME> on 25/05/2021. */ class NewsRemoteDataSourceImpl( private val newsAPIService: NewsAPIService, ) : NewsRemoteDataSource { override suspend fun getTopHeadlines(country: String, page: Int): Response<APIResponse> { return newsAPIService.getTopHeadlines(country,page) } override suspend fun getSearchedNews(country: String, searchQuery: String, page: Int): Response<APIResponse> { return newsAPIService.getSearchedTopHeadlines(country,searchQuery,page) } }<file_sep>/app/src/main/java/com/example/newsapiclient/presentation/di/RepositoryModule.kt package com.example.newsapiclient.presentation.di import com.example.newsapiclient.data.repository.NewsRepositoryImpl import com.example.newsapiclient.data.repository.datasource.NewsLocalDataSource import com.example.newsapiclient.data.repository.datasource.NewsRemoteDataSource import com.example.newsapiclient.domain.respository.NewsRepository import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton /** *Created by <NAME> on 25/05/2021. */ @InstallIn(SingletonComponent::class) @Module class RepositoryModule { @Singleton @Provides fun providesNewsRepository( newsRemoteDataSource: NewsRemoteDataSource, newsLocalDataSource: NewsLocalDataSource ) : NewsRepository { return NewsRepositoryImpl( newsRemoteDataSource, newsLocalDataSource ) } }<file_sep>/README.md # NewsApp This app was developed as part of The Complete Android 11 Jetpack Masterclass 2021. The app architecture used was mvvm it uses one activity with fragments for the view. # VIEW It uses view binding library to get references to widgets within the view. It uses Android's Navigation component to create and set up the linking between the views. # NETWORKING It uses Retrofit library/ coroutines to perform network request to the news API. It uses Glide library to load images from the API into image views. # STORAGE It uses Room Database to store news headlines and information locally. Coroutines is used while making database queries. # DI Dagger2/hilt was used for dependecy injection. <file_sep>/app/src/main/java/com/example/newsapiclient/presentation/di/DatabaseModule.kt package com.example.newsapiclient.presentation.di import android.app.Application import androidx.room.Room import com.example.newsapiclient.data.db.ArticleDao import com.example.newsapiclient.data.db.ArticleDatabase import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton /** *Created by <NAME> on 26/05/2021. */ @Module @InstallIn(SingletonComponent::class) class DatabaseModule { @Singleton @Provides fun providesNewsDatabase(app:Application) : ArticleDatabase { return Room.databaseBuilder( app, ArticleDatabase::class.java, "news_db") .fallbackToDestructiveMigration() .build() } @Singleton @Provides fun providesNewDao(articleDatabase: ArticleDatabase) : ArticleDao { return articleDatabase.getArticleDao() } }<file_sep>/app/src/main/java/com/example/newsapiclient/presentation/NewsApp.kt package com.example.newsapiclient.presentation import android.app.Application import dagger.hilt.android.HiltAndroidApp /** *Created by <NAME> on 25/05/2021. */ @HiltAndroidApp class NewsApp : Application()<file_sep>/app/src/main/java/com/example/newsapiclient/domain/usecase/SaveNewsUseCase.kt package com.example.newsapiclient.domain.usecase import com.example.newsapiclient.data.model.Article import com.example.newsapiclient.domain.respository.NewsRepository /** *Created by <NAME> on 25/05/2021. */ class SaveNewsUseCase(private val newsRepository: NewsRepository) { suspend fun execute(article: Article) = newsRepository.saveNews(article) }<file_sep>/app/src/main/java/com/example/newsapiclient/domain/usecase/GetNewsHeadlinesUseCase.kt package com.example.newsapiclient.domain.usecase import com.example.newsapiclient.data.model.APIResponse import com.example.newsapiclient.domain.respository.NewsRepository import com.example.newsapiclient.data.util.Resource /** *Created by <NAME> on 25/05/2021. */ class GetNewsHeadlinesUseCase(private val newsRepository: NewsRepository) { suspend fun execute(country: String, page: Int) : Resource<APIResponse> { return newsRepository.getNewsHeadlines(country,page) } }<file_sep>/app/src/main/java/com/example/newsapiclient/data/repository/NewsRepositoryImpl.kt package com.example.newsapiclient.data.repository import com.example.newsapiclient.data.model.APIResponse import com.example.newsapiclient.data.model.Article import com.example.newsapiclient.data.repository.datasource.NewsLocalDataSource import com.example.newsapiclient.data.repository.datasource.NewsRemoteDataSource import com.example.newsapiclient.data.util.Resource import com.example.newsapiclient.domain.respository.NewsRepository import kotlinx.coroutines.flow.Flow import retrofit2.Response /** *Created by <NAME> on 25/05/2021. */ class NewsRepositoryImpl( private val newsRemoteDataSource: NewsRemoteDataSource, private val newsLocalDataSource: NewsLocalDataSource ) : NewsRepository { private fun responseToResult(response:Response<APIResponse>) : Resource<APIResponse> { if (response.isSuccessful){ response.body()?.let { result -> return Resource.Success(result) } } return Resource.Error(response.message()) } override suspend fun getNewsHeadlines(country: String, page: Int): Resource<APIResponse> { return responseToResult(newsRemoteDataSource.getTopHeadlines(country, page)) } override suspend fun getSearchedNews( country: String, searchQuery: String, page: Int ): Resource<APIResponse> { return responseToResult( newsRemoteDataSource.getSearchedNews(country,searchQuery,page) ) } override suspend fun saveNews(article: Article) { newsLocalDataSource.saveArticleToDB(article) } override suspend fun deleteNews(article: Article) { newsLocalDataSource.deleteArticlesFromDB(article) } override fun getSavedNews(): Flow<List<Article>> { return newsLocalDataSource.getSavedArticles() } }
1cd03473cd66bd9248a5373c7a845602731c6d50
[ "Markdown", "Kotlin" ]
14
Kotlin
craigc2016/NewsApp
3463560a0e8161fb60c232c68d524883fce8ed5a
4b433b43102a6461d977b9385d042c0d9467f49e
refs/heads/master
<repo_name>AlexandrUkr/doloadImage<file_sep>/README.md # image preloading Uploading images as needed Example of use ```html <img data-src="/image.jpg"> ``` ```javascript LoadImage.check(); $(window).scroll(function(){ LoadImage.check(); }); ``` <a href="http://jsfiddle.net/d3k8aepv/4/" target="_blank">demo page</a> <file_sep>/doloadImage.js var doloadImage = { check: function() { $('[data-src]').each(function(e){ if(doloadImage.is_view($(this))) $(this).attr('src', $(this).attr('data-src')).removeAttr('data-src').hide().fadeIn("slow"); }); }, is_view: function(e){ var wtop = $(window).scrollTop(), wbottom = wtop + $(window).height(), etop = $(e).offset().top, ebottom = etop + $(e).height(); return ((ebottom >= wtop) && (etop <= wbottom)); } }
03ab1e2acd32c456950e4b0cfc691741de2fbb48
[ "Markdown", "JavaScript" ]
2
Markdown
AlexandrUkr/doloadImage
8c90d35178df7037a504669f0a62fa5b5ab4b5fd
ba015492f8931d8f11cf5389b82cf5e7640e808e
refs/heads/main
<file_sep>export default interface AsyncSuccessState<T> { readonly data: T; readonly error?: undefined; readonly loading: false; } <file_sep>import type AsyncErrorState from '../types/async-error-state'; import type AsyncLoadingState from '../types/async-loading-state'; import type AsyncSuccessState from '../types/async-success-state'; type AsyncState<T> = AsyncErrorState | AsyncLoadingState | AsyncSuccessState<T>; export default AsyncState; <file_sep>import mapToDefault from '../utils/map-to-default'; import validateArrayOfStrings from '../utils/validate-array-of-strings'; import validateDefault from '../utils/validate-default'; export default async function fetchCardNames(): Promise<string[]> { return import('../data/card-names.json') .then(validateDefault) .then(mapToDefault) .then(validateArrayOfStrings); } <file_sep>export default interface AsyncErrorState { readonly data?: undefined; readonly error: Error; readonly loading: false; } <file_sep>export { default } from './card-collection.view'; <file_sep>import { useState } from 'react'; import Locale from '../../constants/locale'; interface State { readonly locale: Locale; } export default function useApp(): State { const [locale] = useState(Locale.English); return { locale, }; } <file_sep>import isRecordOf from '../utils/is-record-of'; import isRecordOfNumbers from '../utils/is-record-of-numbers'; export default function isRecordOfRecordOfNumbers( value: unknown, ): value is Record<number | string, Record<number | string, number>> { return isRecordOf(value, isRecordOfNumbers); } <file_sep>import isArrayOfNumbers from '../utils/is-array-of-numbers'; export default function validateArrayOfNumbers(value: unknown): number[] { if (!isArrayOfNumbers(value)) { throw new Error('Expected an array of numbers.'); } return value; } <file_sep>import type Metadata from '../types/metadata'; import mapToDefault from '../utils/map-to-default'; import validateDefault from '../utils/validate-default'; import validateMetaData from '../utils/validate-meta-data'; export default async function fetchMetadata(): Promise<Metadata> { return import('../data/metadata.json') .then(validateDefault) .then(mapToDefault) .then(validateMetaData); } <file_sep>import type Default from '../types/default'; import isDefault from '../utils/is-default'; export default function validateDefault<T>(value: unknown): Default<T> { if (!isDefault<T>(value)) { throw new Error('Value is not a default export.'); } return value; } <file_sep>export default interface Default<T> { readonly default: T; } <file_sep>import type MagicCard from '../../types/magic-card'; const SORT_PREVIOUS = -1; const SORT_NEXT = 1; export default function sortCards(one: MagicCard, two: MagicCard): number { if (one.cardName < two.cardName) { return SORT_PREVIOUS; } if (one.cardName > two.cardName) { return SORT_NEXT; } if (one.multiverseId < two.multiverseId) { return SORT_PREVIOUS; } return SORT_NEXT; } <file_sep>export { default } from './scryfall-image.view'; <file_sep>import isNumber from '../utils/is-number'; export default function isArrayOfNumbers(value: unknown): value is number[] { return Array.isArray(value) && value.every(isNumber); } <file_sep>import type { NonCancelableCustomEvent } from '@awsui/components-react'; import type { CardsProps } from '@awsui/components-react/cards'; import type { PaginationProps } from '@awsui/components-react/pagination'; import type { TextFilterProps } from '@awsui/components-react/text-filter'; import download from 'downloadjs'; import type { TranslateFunction } from 'lazy-i18n'; import { useTranslate } from 'lazy-i18n'; import { useCallback, useMemo, useState } from 'react'; import { usePagination, useTextFilter } from 'use-awsui'; import type MagicCard from '../../types/magic-card'; import mapMapToRecord from '../../utils/map-map-to-record'; import useAddToCollection from './card-collection.hook.add-to-collection'; import useCardDefinition from './card-collection.hook.card-definition'; import useSubtractFromCollection from './card-collection.hook.subtract-from-collection'; interface State { readonly cardDefinition: CardsProps.CardDefinition<MagicCard>; readonly currentPageIndex: number; readonly filteringPlaceholder?: string; readonly filteringText: string; readonly handleClearFilter: () => void; readonly handleExport: () => void; readonly isExportDisabled: boolean; readonly items: readonly MagicCard[]; readonly pagesCount: number; readonly selectedItems: readonly MagicCard[]; readonly handleTextFilterChange: ( event: Readonly< NonCancelableCustomEvent<Readonly<TextFilterProps.ChangeDetail>> >, ) => void; readonly handlePaginationChange: ( event: Readonly< NonCancelableCustomEvent<Readonly<PaginationProps.ChangeDetail>> >, ) => void; } const DEFAULT_COLLECTION: Map<number, number> = new Map<number, number>(); const NONE = 0; const PAGE_SIZE = 8; export default function useCardCollection(cards: readonly MagicCard[]): State { // Contexts const translate: TranslateFunction = useTranslate(); // States const { currentPageIndex, handleChange: handlePaginationChange, paginate, } = usePagination({ pageSize: PAGE_SIZE, }); const [collection, setCollection] = useState<Map<number, number>>(DEFAULT_COLLECTION); const { filteringText, handleChange: handleTextFilterChange, setFilteringText, } = useTextFilter(); const lowerCaseFilteringText: string = filteringText.toLowerCase(); const filteredItems: readonly MagicCard[] = useMemo((): readonly MagicCard[] => { if (lowerCaseFilteringText === '') { return cards; } const filterByName = ({ cardName }: MagicCard): boolean => cardName.toLowerCase().includes(lowerCaseFilteringText); return cards.filter(filterByName); }, [cards, lowerCaseFilteringText]); return { currentPageIndex, filteringPlaceholder: translate('Filter by name'), filteringText, handlePaginationChange, handleTextFilterChange, isExportDisabled: collection.size === NONE, pagesCount: Math.ceil(filteredItems.length / PAGE_SIZE), cardDefinition: useCardDefinition({ collection, onAddToCollection: useAddToCollection(setCollection), onSubtractFromCollection: useSubtractFromCollection(setCollection), }), handleClearFilter: useCallback((): void => { setFilteringText(''); }, [setFilteringText]), handleExport: useCallback((): void => { const newExport: Record<number, number> = mapMapToRecord(collection); download( JSON.stringify(newExport), 'mtgenius-collection.json', 'application/json', ); }, [collection]), items: useMemo( (): readonly MagicCard[] => paginate(filteredItems), [filteredItems, paginate], ), selectedItems: useMemo((): readonly MagicCard[] => { const filterBySelected = ({ multiverseId }: MagicCard): boolean => collection.has(multiverseId); return cards.filter(filterBySelected); }, [cards, collection]), }; } <file_sep>import trueFunction from './true-function'; describe('trueFunction', (): void => { it('should return true', (): void => { expect(trueFunction()).toBe(true); }); }); <file_sep>declare module '*.json' { const _: { default: Record<number | string, unknown> }; export = _; } <file_sep>import mapToDefault from '../utils/map-to-default'; import validateDefault from '../utils/validate-default'; import validateRecordOfStrings from '../utils/validate-record-of-strings'; export default async function fetchScryfallIds(): Promise< Record<string, string> > { return import('../data/scryfall-ids.json') .then(validateDefault) .then(mapToDefault) .then(validateRecordOfStrings); } <file_sep>export default function mapMapToRecord<T>( map: Readonly<Map<number | string, T>>, ): Record<number | string, T> { const record: Record<number | string, T> = {}; for (const [key, value] of map.entries()) { record[key] = value; } return record; } <file_sep>import type Metadata from '../types/metadata'; import isMetaData from '../utils/is-meta-data'; export default function validateMetaData(value: unknown): Metadata { if (!isMetaData(value)) { throw new Error('Expected meta data.'); } return value; } <file_sep>import { useCallback, useEffect, useMemo } from 'react'; import useAsyncState from '../../hooks/use-async-state'; import type MagicCard from '../../types/magic-card'; import NOOP from '../../utils/noop'; import sortCards from './load-cards.util.sort-cards'; interface Props { readonly cardNamesSize: number; readonly fetchCardNames: () => Promise<string[]>; readonly fetchScryfallIds: () => Promise<Record<string, string>>; readonly fetchSetCodes: () => Promise<string[]>; readonly fetchSetNames: () => Promise<string[]>; readonly scryfallIdsSize: number; readonly setCodesSize: number; readonly setIndexCardIndexMultiverseIdsSize: number; readonly setNamesSize: number; readonly fetchSetIndexCardIndexMultiverseIds: () => Promise< Record<number | string, Record<number | string, number>> >; } interface State { readonly bytesLoaded: number; readonly bytesTotal: number; readonly cards: MagicCard[]; readonly errors: Error[]; readonly handleRetryClick: () => void; } export default function useLoadCards({ cardNamesSize, fetchCardNames, fetchScryfallIds, fetchSetCodes, fetchSetIndexCardIndexMultiverseIds, fetchSetNames, scryfallIdsSize, setCodesSize, setIndexCardIndexMultiverseIdsSize, setNamesSize, }: Props): State { const [cardNamesState, initCardNamesState] = useAsyncState(fetchCardNames); const [setCodesState, initSetCodesState] = useAsyncState(fetchSetCodes); const [setNamesState, initSetNamesState] = useAsyncState(fetchSetNames); const [scryfallIdsState, initScryfallIdsState] = useAsyncState(fetchScryfallIds); const [ setIndexCardIndexMultiverseIdsState, initSetIndexCardIndexMultiverseIdsState, ] = useAsyncState(fetchSetIndexCardIndexMultiverseIds); useEffect((): void => { initCardNamesState().catch(NOOP); initScryfallIdsState().catch(NOOP); initSetCodesState().catch(NOOP); initSetNamesState().catch(NOOP); initSetIndexCardIndexMultiverseIdsState().catch(NOOP); }, [ initCardNamesState, initScryfallIdsState, initSetCodesState, initSetNamesState, initSetIndexCardIndexMultiverseIdsState, ]); const cardNames: string[] | undefined = cardNamesState.data; const multiverseIds: | Record<number | string, Record<number | string, number>> | undefined = setIndexCardIndexMultiverseIdsState.data; const scryfallIds: Record<string, string> | undefined = scryfallIdsState.data; const setCodes: string[] | undefined = setCodesState.data; const setNames: string[] | undefined = setNamesState.data; const isCardNamesLoaded: boolean = typeof cardNames !== 'undefined'; const isScryfallIdsLoaded: boolean = typeof scryfallIds !== 'undefined'; const isSetCodesLoaded: boolean = typeof setCodes !== 'undefined'; const isSetIndexCardIndexMultiverseIdsLoaded: boolean = typeof multiverseIds !== 'undefined'; const isSetNamesLoaded: boolean = typeof setNames !== 'undefined'; return { bytesLoaded: useMemo((): number => { let newBytesLoaded = 0; if (isCardNamesLoaded) { newBytesLoaded += cardNamesSize; } if (isScryfallIdsLoaded) { newBytesLoaded += scryfallIdsSize; } if (isSetCodesLoaded) { newBytesLoaded += setCodesSize; } if (isSetIndexCardIndexMultiverseIdsLoaded) { newBytesLoaded += setIndexCardIndexMultiverseIdsSize; } if (isSetNamesLoaded) { newBytesLoaded += setNamesSize; } return newBytesLoaded; }, [ cardNamesSize, isCardNamesLoaded, isScryfallIdsLoaded, isSetCodesLoaded, isSetIndexCardIndexMultiverseIdsLoaded, isSetNamesLoaded, scryfallIdsSize, setCodesSize, setNamesSize, setIndexCardIndexMultiverseIdsSize, ]), bytesTotal: cardNamesSize + scryfallIdsSize + setCodesSize + setIndexCardIndexMultiverseIdsSize + setNamesSize, cards: useMemo((): MagicCard[] => { const newCards: MagicCard[] = []; if ( typeof cardNames === 'undefined' || typeof multiverseIds === 'undefined' || typeof scryfallIds === 'undefined' || typeof setCodes === 'undefined' || typeof setNames === 'undefined' ) { return newCards; } for (const [setIndexStr, cardsRecord] of Object.entries(multiverseIds)) { const setIndex: number = parseInt(setIndexStr, 10); const setCode: string = setCodes[setIndex]; const setName: string = setNames[setIndex]; for (const [cardIndexStr, multiverseId] of Object.entries( cardsRecord, )) { const cardIndex: number = parseInt(cardIndexStr, 10); newCards.push({ cardName: cardNames[cardIndex], multiverseId, scryfallId: scryfallIds[multiverseId], setCode, setName, }); } } return newCards.sort(sortCards); }, [cardNames, multiverseIds, scryfallIds, setCodes, setNames]), errors: useMemo((): Error[] => { const newErrors: Error[] = []; if (cardNamesState.error) { newErrors.push(cardNamesState.error); } if (scryfallIdsState.error) { newErrors.push(scryfallIdsState.error); } if (setCodesState.error) { newErrors.push(setCodesState.error); } if (setIndexCardIndexMultiverseIdsState.error) { newErrors.push(setIndexCardIndexMultiverseIdsState.error); } if (setNamesState.error) { newErrors.push(setNamesState.error); } return newErrors; }, [ cardNamesState.error, scryfallIdsState.error, setCodesState.error, setIndexCardIndexMultiverseIdsState.error, setNamesState.error, ]), handleRetryClick: useCallback(async (): Promise<unknown[]> => { const inits: Promise<unknown>[] = []; if (cardNamesState.error) { inits.push(initCardNamesState()); } if (scryfallIdsState.error) { inits.push(initScryfallIdsState()); } if (setCodesState.error) { inits.push(initSetCodesState()); } if (setIndexCardIndexMultiverseIdsState.error) { inits.push(initSetIndexCardIndexMultiverseIdsState()); } if (setNamesState.error) { inits.push(initSetNamesState()); } return Promise.all(inits); }, [ cardNamesState.error, initCardNamesState, initScryfallIdsState, initSetCodesState, initSetIndexCardIndexMultiverseIdsState, initSetNamesState, scryfallIdsState.error, setCodesState.error, setIndexCardIndexMultiverseIdsState.error, setNamesState.error, ]), }; } <file_sep>import isRecordOfRecordOfNumbers from '../utils/is-record-of-record-of-numbers'; export default function validateRecordOfRecordOfNumbers( value: unknown, ): Record<number | string, Record<number | string, number>> { if (!isRecordOfRecordOfNumbers(value)) { throw new Error('Expected record of record of numbers.'); } return value; } <file_sep>import isRecord from '../utils/is-record'; export default function isRecordOf<T>( value: unknown, isOfType: (item: unknown) => item is T, ): value is Record<number | string, T> { return isRecord(value) && Object.values(value).every(isOfType); } <file_sep>import type { Dispatch, SetStateAction } from 'react'; import { useCallback } from 'react'; const NONE = 0; const SINGLE = 1; export default function useSubtractFromCollection( setCollection: Dispatch<SetStateAction<Map<number, number>>>, ): (multiverseId: number) => void { return useCallback( (multiverseId: number): void => { setCollection( (oldCollection: Readonly<Map<number, number>>): Map<number, number> => { const oldCount: number = oldCollection.get(multiverseId) ?? NONE; if (oldCount === NONE) { return oldCollection; } const newCollection: Map<number, number> = new Map(oldCollection); if (oldCount === SINGLE) { newCollection.delete(multiverseId); } else { newCollection.set(multiverseId, oldCount - SINGLE); } return newCollection; }, ); }, [setCollection], ); } <file_sep>import type Metadata from '../types/metadata'; import isRecord from '../utils/is-record'; export default function isMetaData(value: unknown): value is Metadata { return ( isRecord(value) && Object.prototype.hasOwnProperty.call(value, 'cardKingdomIdsSize') && Object.prototype.hasOwnProperty.call(value, 'cardNamesSize') && Object.prototype.hasOwnProperty.call(value, 'date') && Object.prototype.hasOwnProperty.call(value, 'scryfallIdsSize') && Object.prototype.hasOwnProperty.call(value, 'setCodesSize') && Object.prototype.hasOwnProperty.call(value, 'setNamesSize') && Object.prototype.hasOwnProperty.call(value, 'tcgplayerProductIdsSize') && Object.prototype.hasOwnProperty.call( value, 'setIndexCardIndexMultiverseIdsSize', ) && typeof value.cardKingdomIdsSize === 'number' && typeof value.cardNamesSize === 'number' && typeof value.date === 'string' && typeof value.scryfallIdsSize === 'number' && typeof value.setCodesSize === 'number' && typeof value.setIndexCardIndexMultiverseIdsSize === 'number' && typeof value.setNamesSize === 'number' && typeof value.tcgplayerProductIdsSize === 'number' ); } <file_sep>import type { Reducer } from 'react'; import { useCallback, useReducer } from 'react'; import type AsyncState from '../types/async-state'; interface ErrorAction { error: Error; type: 'ERROR'; } interface InitAction { type: 'INIT'; } interface SuccessAction<T> { data: T; type: 'SUCCESS'; } const defaultInitializer = <T>(): AsyncState<T> => ({ loading: true, }); const reducer = <T>( _prevState: AsyncState<T>, action: ErrorAction | InitAction | SuccessAction<T>, ): AsyncState<T> => { switch (action.type) { case 'ERROR': return { error: action.error, loading: false, }; case 'INIT': return { loading: true, }; case 'SUCCESS': return { data: action.data, loading: false, }; } }; export default function useAsyncState<T>( act: () => Promise<T>, ): [AsyncState<T>, () => Promise<void>] { const [state, dispatch] = useReducer< Reducer<AsyncState<T>, ErrorAction | InitAction | SuccessAction<T>>, null >(reducer, null, defaultInitializer); return [ state, useCallback(async (): Promise<void> => { const handleError = (err: Readonly<Error>): void => { dispatch({ error: err, type: 'ERROR', }); }; const handleSuccess = (data: T): void => { dispatch({ data, type: 'SUCCESS', }); }; dispatch({ type: 'INIT' }); return act().then(handleSuccess).catch(handleError); }, [act]), ]; } <file_sep>export default interface Metadata { readonly cardKingdomIdsSize: number; readonly cardNamesSize: number; readonly date: string; readonly scryfallIdsSize: number; readonly setCodesSize: number; readonly setIndexCardIndexMultiverseIdsSize: number; readonly setNamesSize: number; readonly tcgplayerProductIdsSize: number; } <file_sep>export default interface MagicCard { readonly cardName: string; readonly multiverseId: number; readonly scryfallId: string; readonly setCode: string; readonly setName: string; } <file_sep>import isString from '../utils/is-string'; export default function isArrayOfStrings(value: unknown): value is string[] { return Array.isArray(value) && value.every(isString); } <file_sep>import isNumber from '../utils/is-number'; import isRecordOf from '../utils/is-record-of'; export default function isRecordOfNumbers( value: unknown, ): value is Record<number | string, number> { return isRecordOf(value, isNumber); } <file_sep>import type Default from '../types/default'; import isDefault from './is-default'; export default function mapToDefault<T>(t: Default<T> | T): T { if (isDefault(t)) { return t.default; } return t; } <file_sep>const BORDER_CROP_WIDTH = 480; const LARGE_WIDTH = 672; const NORMAL_WIDTH = 488; const PNG_WIDTH = 745; const SMALL_WIDTH = 146; export default function mapImageToWidth( image: 'art_crop' | 'border_crop' | 'large' | 'normal' | 'png' | 'small', ): number | undefined { switch (image) { case 'art_crop': return; case 'border_crop': return BORDER_CROP_WIDTH; case 'large': return LARGE_WIDTH; case 'normal': return NORMAL_WIDTH; case 'png': return PNG_WIDTH; case 'small': return SMALL_WIDTH; } } <file_sep>import type { PaginationProps } from '@awsui/components-react/pagination'; import type { TranslateFunction } from 'lazy-i18n'; import { useTranslate } from 'lazy-i18n'; import { useMemo } from 'react'; interface State { readonly ariaLabels: PaginationProps.Labels; } export default function usePagination(): State { const translate: TranslateFunction = useTranslate(); return { ariaLabels: useMemo( (): PaginationProps.Labels => ({ nextPageLabel: translate('Next page'), previousPageLabel: translate('Previous page'), pageLabel(pageNumber: number): string { return translate('Page $n', { n: pageNumber }) ?? ''; }, }), [translate], ), }; } <file_sep>import mapToDefault from '../utils/map-to-default'; import validateDefault from '../utils/validate-default'; import validateRecordOfRecordOfNumbers from '../utils/validate-record-of-record-of-numbers'; export default async function fetchSetIndexCardIndexMultiverseIds(): Promise< Record<number | string, Record<number | string, number>> > { return import('../data/set-index-card-index-multiverse-ids.json') .then(validateDefault) .then(mapToDefault) .then(validateRecordOfRecordOfNumbers); } <file_sep>import { useEffect } from 'react'; import useAsyncState from '../../hooks/use-async-state'; import type AsyncState from '../../types/async-state'; import type Metadata from '../../types/metadata'; import NOOP from '../../utils/noop'; interface Props { readonly fetchMetadata: () => Promise<Metadata>; } interface State { readonly handleRetryClick: () => void; readonly metadataState: AsyncState<Metadata>; } export default function useLoadMetadata({ fetchMetadata }: Props): State { // States const [metadataState, initMetadataState] = useAsyncState<Metadata>(fetchMetadata); useEffect((): void => { initMetadataState().catch(NOOP); }, [initMetadataState]); return { handleRetryClick: initMetadataState, metadataState, }; } <file_sep>export default interface AsyncLoadingState { readonly data?: undefined; readonly error?: undefined; readonly loading: true; } <file_sep>import type Default from '../types/default'; import isRecord from '../utils/is-record'; export default function isDefault<T>(value: unknown): value is Default<T> { return ( isRecord(value) && Object.prototype.hasOwnProperty.call(value, 'default') ); } <file_sep>import type { Translations } from 'lazy-i18n'; import Locale from '../constants/locale'; import en from '../translations/en.json'; const TRANSLATIONS: Record<Locale, Translations | undefined> = { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions [Locale.English]: en as unknown as Record<string, string>, }; export default TRANSLATIONS; <file_sep>import isRecordOf from '../utils/is-record-of'; import isString from '../utils/is-string'; export default function isRecordOfStrings( value: unknown, ): value is Record<number | string, string> { return isRecordOf(value, isString); } <file_sep>const BORDER_CROP_HEIGHT = 680; const LARGE_HEIGHT = 936; const NORMAL_HEIGHT = 680; const PNG_HEIGHT = 1040; const SMALL_HEIGHT = 204; export default function mapImageToHeight( image: 'art_crop' | 'border_crop' | 'large' | 'normal' | 'png' | 'small', ): number | undefined { switch (image) { case 'art_crop': return; case 'border_crop': return BORDER_CROP_HEIGHT; case 'large': return LARGE_HEIGHT; case 'normal': return NORMAL_HEIGHT; case 'png': return PNG_HEIGHT; case 'small': return SMALL_HEIGHT; } } <file_sep>import isRecordOfStrings from '../utils/is-record-of-strings'; export default function validateRecordOfStrings( value: unknown, ): Record<number | string, string> { if (!isRecordOfStrings(value)) { throw new Error('Expected record of strings.'); } return value; } <file_sep>export { default } from './load-cards.view'; <file_sep>import mapImageToHeight from './scryfall-image.util.map-image-to-height'; import mapImageToWidth from './scryfall-image.util.map-image-to-width'; interface Props { readonly scryfallId: string; readonly image: | 'art_crop' | 'border_crop' | 'large' | 'normal' | 'png' | 'small'; } interface State { height?: number; src: string; width?: number; } const FIRST_CHARACTER = 0; const SECOND_CHARACTER = 1; const SINGLE_CHARACTER = 1; export default function useScryfallImage({ image, scryfallId }: Props): State { const srcDir1: string = scryfallId.substr(FIRST_CHARACTER, SINGLE_CHARACTER); const srcDir2: string = scryfallId.substr(SECOND_CHARACTER, SINGLE_CHARACTER); return { height: mapImageToHeight(image), src: `https://c1.scryfall.com/file/scryfall-cards/${image}/front/${srcDir1}/${srcDir2}/${scryfallId}.jpg`, width: mapImageToWidth(image), }; } <file_sep>export { default } from './load-metadata.view'; <file_sep># Magic: The Gathering Collection <file_sep>export default function trueFunction(): true { return true; } <file_sep>export default { artist: '<NAME>', availability: [ 'mtgo', 'paper' ], borderColor: 'black', colorIdentity: [ 'W' ], colors: [ 'W' ], convertedManaCost: 7, edhrecRank: 16033, frameVersion: '2003', hasFoil: false, hasNonFoil: true, identifiers: { cardKingdomId: '122719', mcmId: '16165', mcmMetaId: '156', mtgjsonV4Id: 'ad41be73-582f-58ed-abd4-a88c1f616ac3', mtgoFoilId: '27501', mtgoId: '27500', multiverseId: '130550', scryfallId: '7a5cd03c-4227-4551-aa4b-7d119f0468b5', scryfallIllustrationId: 'be2f7173-c8b7-4172-a388-9b2c6b3c16e5', scryfallOracleId: 'fc2ccab7-cab1-4463-b73d-898070136d74', tcgplayerProductId: '15032' }, isReprint: true, keywords: [ 'First strike' ], layout: 'normal', legalities: { commander: 'Legal', duel: 'Legal', legacy: 'Legal', modern: 'Legal', penny: 'Legal', premodern: 'Legal', vintage: 'Legal' }, manaCost: '{5}{W}{W}', name: "Ancestor's Chosen", number: '1', originalText: 'First strike (This creature deals combat damage before creatures without first strike.)\n' + "When Ancestor's Chosen comes into play, you gain 1 life for each card in your graveyard.", originalType: 'Creature - Human Cleric', power: '4', printings: [ '10E', 'JUD', 'UMA' ], purchaseUrls: { cardKingdom: 'https://mtgjson.com/links/9fb51af0ad6f0736', cardmarket: 'https://mtgjson.com/links/ace8861194ee0b6a', tcgplayer: 'https://mtgjson.com/links/4843cea124a0d515' }, rarity: 'uncommon', rulings: [], setCode: '10E', subtypes: [ 'Human', 'Cleric' ], supertypes: [], text: 'First strike (This creature deals combat damage before creatures without first strike.)\n' + "When Ancestor's Chosen enters the battlefield, you gain 1 life for each card in your graveyard.", toughness: '4', type: 'Creature — Human Cleric', types: [ 'Creature' ], uuid: '5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c', variations: [ 'b7c19924-b4bf-56fc-aa73-f586e940bd42' ], }; <file_sep>export { default } from './pagination.view'; <file_sep>import isArrayOfStrings from '../utils/is-array-of-strings'; export default function validateArrayOfStrings(value: unknown): string[] { if (!isArrayOfStrings(value)) { throw new Error('Expected an array of strings.'); } return value; } <file_sep>export default function isError(value: unknown): value is Error { return value instanceof Error; } <file_sep>import fs from 'fs'; const input = JSON.parse(fs.readFileSync('./scripts/data/AllPrintings.json')); const cardKingdomIds = {}; const cardNames = []; const scryfallIds = {}; const setCodes = []; const setIndexCardIndexMultiverseIds = {}; const setNames = []; const tcgplayerProductIds = {}; for (const { cards, code: setCode, isOnlineOnly, name: setName, } of Object.values(input.data)) { if (isOnlineOnly) { continue; } const setIndex = setNames.length; setCodes.push(setCode); setNames.push(setName); for (const { availability, identifiers: { cardKingdomId: cardKingdomIdStr, multiverseId: multiverseIdStr, scryfallId, tcgplayerProductId: tcgplayerProductIdStr, }, name: cardName, } of cards) { if (availability.indexOf('paper') === -1) { continue; } const multiverseId = parseInt(multiverseIdStr, 10); if (Number.isNaN(multiverseId)) { continue; } const findCardName = card => card.name === cardName; let cardIndex = cardNames.findIndex(findCardName); if (cardIndex === -1) { cardIndex = cardNames.length; cardNames.push(cardName); } if ( !Object.prototype.hasOwnProperty.call( setIndexCardIndexMultiverseIds, setIndex, ) ) { setIndexCardIndexMultiverseIds[setIndex] = {}; } setIndexCardIndexMultiverseIds[setIndex][cardIndex] = multiverseId; if (cardKingdomIdStr) { cardKingdomIds[multiverseId] = parseInt(cardKingdomIdStr, 10); } if (scryfallId) { scryfallIds[multiverseId] = scryfallId; } if (tcgplayerProductIdStr) { tcgplayerProductIds[multiverseId] = parseInt(tcgplayerProductIdStr, 10); } } } const cardKingdomIdsStr = JSON.stringify(cardKingdomIds, null, 0); const cardNamesStr = JSON.stringify(cardNames, null, 0); const setCodesStr = JSON.stringify(setCodes, null, 0); const setNamesStr = JSON.stringify(setNames, null, 0); const scryfallIdsStr = JSON.stringify(scryfallIds, null, 0); const tcgplayerProductIdsStr = JSON.stringify(tcgplayerProductIds, null, 0); const setIndexCardIndexMultiverseIdsStr = JSON.stringify( setIndexCardIndexMultiverseIds, null, 0, ); fs.writeFileSync('./src/data/card-names.json', cardNamesStr); fs.writeFileSync('./src/data/card-kingdom-ids.json', cardKingdomIdsStr); fs.writeFileSync('./src/data/set-codes.json', setCodesStr); fs.writeFileSync('./src/data/set-names.json', setNamesStr); fs.writeFileSync('./src/data/scryfall-ids.json', scryfallIdsStr); fs.writeFileSync( './src/data/set-index-card-index-multiverse-ids.json', setIndexCardIndexMultiverseIdsStr, ); fs.writeFileSync( './src/data/tcgplayer-product-ids.json', tcgplayerProductIdsStr, ); fs.writeFileSync( './src/data/metadata.json', JSON.stringify( { cardKingdomIdsSize: cardKingdomIdsStr.length, cardNamesSize: cardNamesStr.length, date: input.meta.date, scryfallIdsSize: scryfallIdsStr.length, setCodesSize: setCodesStr.length, setIndexCardIndexMultiverseIdsSize: setIndexCardIndexMultiverseIdsStr.length, setNamesSize: setNamesStr.length, tcgplayerProductIdsSize: tcgplayerProductIdsStr.length, }, null, 2, ), );
af7a32e8d326b7f5b084d26befddc58a0e1efdb7
[ "Markdown", "TypeScript", "JavaScript" ]
51
TypeScript
mtgenius/collection
1ca9dfd40e6875cf0678d53ec0cb46a8d2b3e7c1
61a35c765c8472404dffde0fee0084e4680bafe1
refs/heads/master
<file_sep>//begin the umnify software again <file_sep>#include <iostream> #include <fstream> #include <vector> using namespace std; int main() { cout << "Input: "; string input; getline(cin, input); ifstream readfile(input.c_str()); vector<string> file; readfile >> input; while(readfile) { file.push_back(input); readfile >> input; } ofstream writefile("output.txt", ios::app); for(unsigned int i=0;i<file.size();i++) { writefile << file[i] << " "; } return 0; } <file_sep>#include <iostream> #include <fstream> #include <unistd.h> #include <vector> using namespace std; bool isHeader(string input) { if(input == "#include") return true; return false; } string tab(int spacing) { string temp = ""; for(int i=0;i<spacing;i++) temp += "\t"; return temp; } int main(int argc, char** argv) { cout << "-----------------------" << endl; cout << "----- Uminify cpp -----" << endl; cout << "-----------------------" << endl; cout << "By: <NAME>..." << endl << endl; string filename, outputFile; int braceMap = 0, run = 0; bool sameLine = true, push = false, boolFile = false, boolOut = false, error = false; if(argc > 1) { for(int i=1;i<argc;i++) { string temp = argv[i]; if(temp == "--help") { cout << "Uminify help..." << endl; cout << "Usage: " << endl; cout << "uminify [option] [filename]" << endl << endl; cout << "-o \t output filename" << endl; cout << "-f \t input filename" << endl; cout << "-of \t mixture of two commands" << endl << endl; return 0; } if(temp == "-f" && argv[i+1] != "\0") { filename = argv[i+1]; boolFile = true; } else if(temp == "-o" && argv[i+1] != "\0") { outputFile = argv[i+1]; boolOut = true; } else if(temp == "-fo" && argv[i+1] != "\0" && argv[i+2] != "\0") { filename = argv[i+1]; outputFile = argv[i+2]; boolFile = true; boolOut = true; } else if(temp == "-of" && argv[i+1] != "\0" && argv[i+2] != "\0") { outputFile = argv[i+1]; filename = argv[i+2]; boolFile = true; boolOut = true; } } if(!boolFile) { cout << "No input file..." << endl; error = true; } if(!boolOut) { cout << "No output file..." << endl; error = true; } if(error) return 0; } else { cout << "Error... Little or no arguments" << endl; cout << "Run --help for input functions" << endl; return 0; } //store file in vector vector<string> file; string temp; ifstream read(filename.c_str()); read >> temp; while(read) { file.push_back(temp); read >> temp; } //write to file ofstream write(outputFile.c_str()); for(unsigned int i=0;i<file.size();i++) { int k; bool ripped = false; if(file[i].size() == 2) if(file[i][0] == '}' && file[i][1] == ';') { ripped = true; file[i] = file[i][0]; } switch(file[i][0]) { case '#': if(isHeader(file[i])) { k = i; vector<string> temp; do { if(file[k][file[k].size() -1] != '>' && file[k][file[k].size() -1] != '\"') temp.push_back(file[k]); else { temp.push_back(file[k]); break; } } while(++k); for(unsigned int j=0;j<temp.size();j++) write << temp[j] + " "; write << endl; i = k; } break; case '{': if(file[i].size() > 1) write << file[i] << endl; else { write << endl << tab(braceMap) << file[i] << endl; braceMap++; } push = true; break; case '}': braceMap--; if(ripped) file[i] += ';'; write << tab(braceMap) << file[i] << endl << endl; break; default: if(push) { write << tab(braceMap) << file[i] << " "; push = false; } else if(sameLine) write << file[i] << " "; else { write << tab(braceMap) << file[i] << " "; sameLine = true; } run++; break; } if(file[i][file[i].size() -1] == ';' || file[i][file[i].size() -1] == ':') { write << endl; sameLine = false; } } read.close(); write.close(); return 0; }
88e4b71fee0c09dce4d06760aa42c2bed009c0f3
[ "C++" ]
3
C++
collinsnji/Working-Projects
efc4620dac9eddec7dc7ee9c8436178389bfc8a1
7a3255ebafd2ba5439fa6eaa109813f950ffde35
refs/heads/master
<repo_name>likaiji/personDemo<file_sep>/public/javascript/whiteDemo.js /** * Created by Administrator on 2017/3/15. */ $(function(){ //初始化sunmmernote $("#summernote").summernote({ width:"100%", height:"300px", callbacks:{ //当在summernote中发生图片选择事件后,进行上传图片 onImageUpload:function(files){ /*遍历图片信息*/ var len=files.length; for(var i=0;i<len;i++){ sendFile(files[i]); } } } }); function sendFile(file){ data=new FormData(); data.append("demofile",file); console.log("-----开始提交到后台-----"); $.ajax({ data:data, type:"post", url:"/demofileSubmit", cache:false, contentType:false, processData:false, success:function(url){ console.log("后台返回前台的文件保存地址:"+url); $("#summernote").summernote("insertImage",url); //表示将传回来的文件地址放到summernote里面,这个insertImage不能变 } }) } $("#sub").click(function(){ //定义一个空白对象,发到路由端 var writeData={}; //获取输入的标题 writeData.title=document.getElementById("demoTitle").value; //console.log(titleInput) //获取summernote的文本信息 writeData.text=$("#summernote").summernote("code"); console.log(writeData); //传信息到后台 $.ajax({ type:"post", url:"/textSubmit", data:writeData, dataType:"text", success:function(data){ alert("项目信息添加成功!!!!"); window.location.href="/#!/demoContent?data="+data; }, error:function(jqXHR){ console.log(jqXHR.status); } }) }); });<file_sep>/public/javascript/index.js /** * Created by Administrator on 2017/3/13. */ $(function(){ //设置进度条消失 function changeWidth(){ var loadBarComeWidth=document.getElementById("loadBarCome").clientWidth; if(loadBarComeWidth==300){ document.getElementById("loadBox").style.display="none"; } } setInterval(changeWidth,2000); //清除导航栏的z-index function clearNav(){ document.getElementById("navStart").style.zIndex="5"; } setInterval(clearNav,3000); }); <file_sep>/public/javascript/angularIndex.js /** * Created by Administrator on 2017/3/13. */ angular.module("personDemo",["ngRoute","ngTable","ngAnimate"]) //配置路由 .config(["$locationProvider","$routeProvider", function($locationProvider,$routeProvider){ //如果后端是PHP,java,不是node,就不用配置下面的两行 //angular中的路由不带#号 $locationProvider.html5Mode(true); //angular中的不搜索框引擎优化 $locationProvider.hashPrefix("!"); //路由到页面 $routeProvider //表示用户默认进入index.html时,就加在这个personData.hbs,控制器为personDataController .when("/",{ templateUrl:"template/personData.hbs", controller:"personDataController" }) //表示用户默认进入personData时,就加在这个personData.hbs,控制器为personDataController .when("/personData",{ templateUrl:"template/personData.hbs", controller:"personDataController" }) //表示用户默认进入personEvaluate时,就加在这个personEvaluate.hbs,控制器为personEvaluateController .when("/personEvaluate",{ templateUrl:"template/personEvaluate.hbs", controller:"personEvaluateController" }) //表示用户默认进入personProject时,就加在这个personProject.hbs,控制器为personProjectController .when("/personProject",{ templateUrl:"template/personProject.hbs", controller:"personProjectController" }) //表示用户默认进入personSkill时,就加在这个personSkill.hbs,控制器为personSkillController .when("/personSkill",{ templateUrl:"template/personSkill.hbs", controller:"personSkillController" }) //表示用户默认进入sendMail时,就加在这个sendMail.hbs,控制器为sendMailController .when("/sendMail",{ templateUrl:"template/sendMail.hbs", controller:"sendMailController" }) //表示用户进入demoContent详情页面,加载demoContentController控制器 .when("/demoContent",{ templateUrl:"template/demoContent.hbs", controller:"demoContentController" }) } ]) //personDataController配置控制器 .controller("personDataController",["$scope",function($scope){ var self=this; $scope.pageMove="pagemove"; }]) //personEvaluateController控制器 .controller("personEvaluateController",["$scope",function($scope){ var self=this; $scope.pageMove="pagemove"; }]) //personProjectController控制器 .controller("personProjectController",["$scope",function($scope){ var self=this; $scope.pageMove="pagemove"; self.data=[ { img:"../images/cque/ershizhuanzhuan.png", dataUrl:"./public/jsons/1489653973418.json" }, { img:"../images/simple.png", dataUrl:"./public/jsons/1489655641722.json" }, { img:"../images/staywithme.png", dataUrl:"./public/jsons/1489657016497.json" }, { img:"../images/shenjia.png", dataUrl:"./public/jsons/1489657383654.json" } ] }]) //personSkillController控制器 .controller("personSkillController",["$scope",function($scope){ var self=this; $scope.pageMove="pagemove"; }]) //sendMailController控制器 .controller("sendMailController",["$scope",function($scope){ var self=this; $scope.pageMove="pagemove"; }]) //demoContentController控制器 .controller("demoContentController",["$scope",function($scope){ var self=this; $scope.pageMove="pagemove"; }]); <file_sep>/lib/email.js //nodemailer是一个简单易用的nodejs发邮件组件 var nodemailer=require("nodemailer"); module.exports=function(credentials){ var mailTransport=nodemailer.createTransport("SMTP",{ //service QQ host:"smtp.qq.com", //发邮件主机 secureConnection:true, //使用SSL安全连接 port:465, //smtp端口号 auth:{ user: credentials.QQMail.user, pass: <PASSWORD> } }); var from='"欢迎您访问我的主页!!!"<<EMAIL>>'; var errorRecipient='<EMAIL>'; return { send: function (to,subj,body) { mailTransport.sendMail({ from: from, to: to, subject: subj, html: body, generateTextFromHtml: true }, function (err) { if (err)console.error('Unable to send email: ' + err); } ) }, emailError: function (message, filename, exception) { var body = '<h1>Meadowlark Travel Site Error</h1>' + 'message:<br><pre>' + message + '</pre><br>'; if (exception) body += 'exception:<br><pre>' + exception + '</pre><br>'; if (filename) body += 'filename:<br><pre>' + filename + '</pre><br>'; mailTransport.sendMail({ from: from, to: errorRecipient, subject: 'Meadowlark Travel Site Error', html: body, generateTextFromHtml: true }, function (err) { if (err)console.error('Unable to send email: ' + err); }); } } };
fc41410aa9f1374a1f85406ecf4be877b16017a1
[ "JavaScript" ]
4
JavaScript
likaiji/personDemo
c7315acb9f7255de6708664b2b47f352b6317386
05f29a8ae62e56f5c4f685991e84a2b27183d616
refs/heads/master
<file_sep>// // AddViewController.swift // 16-day // // Created by Adolfrank on 4/12/16. // Copyright © 2016 Frank. All rights reserved. // import UIKit protocol AddViewControllerDelegate:class { func addViewController(AddVC:AddViewController , Model: ContactModel) -> Void } class AddViewController: UIViewController { weak var delegate: AddViewControllerDelegate? @IBOutlet weak var nameField: UITextField! @IBOutlet weak var phoneNumberField: UITextField! @IBOutlet weak var addBtn: UIButton! override func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.textChange), name: UITextFieldTextDidChangeNotification, object: nameField) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.textChange), name: UITextFieldTextDidChangeNotification, object: phoneNumberField) } deinit{ NSNotificationCenter.defaultCenter().removeObserver(self) } func textChange(){ if (nameField.text?.characters.count > 0 && phoneNumberField.text?.characters.count > 0) { addBtn.enabled = true addBtn.backgroundColor = UIColor.blueColor() } } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) nameField.becomeFirstResponder() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func addBtnDidTouch(sender: UIButton) { self.navigationController?.popViewControllerAnimated(true) let data = ContactModel() data.name = nameField.text! data.phoneNumber = phoneNumberField.text! delegate?.addViewController(self, Model: data) } } <file_sep>// // FirstViewController.swift // 15-day // // Created by <NAME> on 16/4/11. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class FirstViewController: UITableViewController { var tableData = ["Personal Life", "Buddy Company", "#30 days Swift Project", "Body movement training", "AppKitchen Studio", "Project Read", "Others" ] override func viewDidLoad() { super.viewDidLoad() self.tableView.registerClass(FirstTableCell.self, forCellReuseIdentifier: "FirstTableCell") } override func viewWillAppear(animated: Bool) { animateTable() } // MARK: 动画载入效果核心代码 func animateTable() { self.tableView.reloadData() let cells = tableView.visibleCells let tableHeight: CGFloat = tableView.bounds.size.height var index = 0 for i in cells { let cell: UITableViewCell = i as UITableViewCell cell.transform = CGAffineTransformMakeTranslation(0, tableHeight) } for a in cells { let cell: UITableViewCell = a as UITableViewCell UIView.animateWithDuration(1.5, delay: 0.05 * Double(index), usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { cell.transform = CGAffineTransformMakeTranslation(0, 0); }, completion: nil) index += 1 } } // MARK: - Table view data source override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return tableData.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("FirstTableCell", forIndexPath: indexPath) cell.textLabel?.text = tableData[indexPath.row] return cell } func colorforIndex(index: Int) -> UIColor { let itemCount = tableData.count - 1 let color = (CGFloat(index) / CGFloat(itemCount)) * 0.6 return UIColor(red: color, green: 0.0, blue: 1.0, alpha: 1.0) } override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { cell.backgroundColor = colorforIndex(indexPath.row) } override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { performSegueWithIdentifier("First2Second", sender: nil) } } <file_sep>// // BackViewController.swift // 24-day // // Created by <NAME> on 16/5/4. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class BackViewController: UITableViewController { var TableArrary = [String]() override func viewDidLoad() { super.viewDidLoad() TableArrary = ["FriendRead", "Article"] self.tableView.tableFooterView = UIView(frame: CGRectZero) self.tableView.separatorColor = UIColor(red:0.159, green:0.156, blue:0.181, alpha:1) self.view.backgroundColor = UIColor.darkGrayColor() } override func prefersStatusBarHidden() -> Bool { return true } override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation { return UIStatusBarAnimation.Slide } // MARK: - Table view data source override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return TableArrary.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier(TableArrary[indexPath.row], forIndexPath: indexPath) as UITableViewCell cell.textLabel?.text = TableArrary[indexPath.row] cell.backgroundColor = UIColor.clearColor() cell.textLabel?.textColor = UIColor.whiteColor() return cell } override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let selectedCell:UITableViewCell = tableView.cellForRowAtIndexPath(indexPath)! selectedCell.contentView.backgroundColor = UIColor(red:0.245, green:0.247, blue:0.272, alpha:0.817) } } <file_sep>// // HomeTableController.swift // 21-day // // Created by <NAME> on 16/4/28. // Copyright © 2016年 Frank. All rights reserved. // import UIKit private let kRefreshViewHeight: CGFloat = 200 let kWidth: CGFloat = UIScreen.mainScreen().bounds.width class HomeTableController: UITableViewController, RefreshViewDelegate { var dataArray: Array<String> = ["😂", "🤗", "😳", "😌", "😊","😂", "🤗", "😳", "😌", "😊"] var cunstumRefresh: RefreshView! override func viewDidLoad() { super.viewDidLoad() cunstumRefresh = RefreshView(frame: CGRect(x: 0 , y: -kRefreshViewHeight, width: kWidth , height: kRefreshViewHeight ), scrollView: tableView) self.cunstumRefresh.delegate = self tableView.insertSubview(cunstumRefresh, atIndex: 0) } override func scrollViewDidScroll(scrollView: UIScrollView) { cunstumRefresh.scrollViewDidScroll(scrollView) } override func scrollViewWillEndDragging(scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { cunstumRefresh.scrollViewWillEndDragging(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset) } // MARK: - Table view data source override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return dataArray.count } override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 80 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("idCell", forIndexPath: indexPath) cell.textLabel!.text = dataArray[indexPath.row] cell.textLabel?.font = UIFont(name: "Apple Color Emoji", size: 40) cell.textLabel?.textAlignment = NSTextAlignment.Center return cell } func refreshviewDidRefresh(refreshView: RefreshView) { sleep(3) cunstumRefresh.endRefresh() } } <file_sep>// // ViewController.swift // 16-day // // Created by <NAME> on 16/4/12. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ViewController: UIViewController { let width = UIScreen.mainScreen().bounds.width let height = UIScreen.mainScreen().bounds.height @IBOutlet weak var loginBtn: UIButton! @IBOutlet weak var usernameLable: UITextField! @IBOutlet weak var passwordLable: UITextField! override func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.textChange), name: UITextFieldTextDidChangeNotification, object: usernameLable) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.textChange), name: UITextFieldTextDidChangeNotification, object: passwordLable) } deinit{ NSNotificationCenter.defaultCenter().removeObserver(self) } func textChange(){ if (usernameLable.text?.characters.count > 0 && passwordLable.text?.characters.count > 0) { loginBtn.enabled = true loginBtn.backgroundColor = UIColor.blueColor() } } override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { self.view.endEditing(true) } @IBAction func loginBtnDidTouch(sender: AnyObject) { if !(usernameLable.text == "frank") { let hud = MBProgressHUD.showHUDAddedTo(self.view, animated: true) hud.mode = MBProgressHUDMode.Text hud.label.text = "账户不存在" hud.offset = CGPointMake(0, -60) hud.hideAnimated(true, afterDelay: 1.0) return } if !(passwordLable.text == "123") { let hud = MBProgressHUD.showHUDAddedTo(self.view, animated: true) hud.mode = MBProgressHUDMode.Text hud.label.text = "密码错误" hud.offset = CGPointMake(0, -60) hud.hideAnimated(true, afterDelay: 1.0) return } let hud = MBProgressHUD.showHUDAddedTo(self.view, animated: true) hud.label.text = "正在登录中" let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(0.5 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { self.performSegueWithIdentifier("login2contacts", sender: nil) hud.hideAnimated(true) } } } <file_sep>// // HomeTableCell.swift // 18-day // // Created by <NAME> on 16/4/20. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeTableCell: UITableViewCell { @IBOutlet weak var bannerImageView: UIImageView! @IBOutlet weak var avatarView: UIImageView! @IBOutlet weak var titleView: UILabel! @IBOutlet weak var authorView: UILabel! override func awakeFromNib() { super.awakeFromNib() avatarView.layer.cornerRadius = 4 avatarView.layer.masksToBounds = true } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } <file_sep>// // HomeViewController.swift // 22-day // // Created by <NAME> on 16/4/29. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeViewController: UICollectionViewController, UINavigationControllerDelegate { var selectedCell: CardViewCell! override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.navigationController?.delegate = self } // MARK: UICollectionViewDataSource override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 10 } override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cardCell", forIndexPath: indexPath) as! CardViewCell cell.cardImage.image = UIImage(named: "2") return cell } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "detail" { let detailVC = segue.destinationViewController as! DetailViewController detailVC.image = self.selectedCell.cardImage.image } } func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { if operation == UINavigationControllerOperation.Push { return MagicMoveTransion() } else { return nil } } override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { self.selectedCell = collectionView.cellForItemAtIndexPath(indexPath) as! CardViewCell self.performSegueWithIdentifier("detail", sender: nil) } } <file_sep>// // ThemeTableCell.swift // 11-day // // Created by <NAME> on 16/3/24. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ThemeTableCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } <file_sep>// // FifthViewController.swift // 25-day // // Created by <NAME> on 16/5/19. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class FifthViewController: UIViewController { @IBOutlet weak var trump1: UIImageView! @IBOutlet weak var trump2: UIImageView! @IBOutlet weak var trump3: UIImageView! @IBOutlet weak var trump4: UIImageView! @IBOutlet weak var trump5: UIImageView! @IBOutlet weak var trump6: UIImageView! @IBOutlet weak var trump7: UIImageView! @IBOutlet weak var trump8: UIImageView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } func spin() { UIView.animateWithDuration(0.8, delay: 0, options: .CurveLinear, animations: { self.trump1.transform = CGAffineTransformRotate(self.trump1.transform, CGFloat(M_PI)) self.trump2.transform = CGAffineTransformRotate(self.trump2.transform, CGFloat(M_PI)) self.trump3.transform = CGAffineTransformRotate(self.trump3.transform, CGFloat(M_PI)) self.trump4.transform = CGAffineTransformRotate(self.trump4.transform, CGFloat(M_PI)) self.trump5.transform = CGAffineTransformRotate(self.trump5.transform, CGFloat(M_PI)) self.trump6.transform = CGAffineTransformRotate(self.trump6.transform, CGFloat(M_PI)) self.trump7.transform = CGAffineTransformRotate(self.trump7.transform, CGFloat(M_PI)) self.trump8.transform = CGAffineTransformRotate(self.trump8.transform, CGFloat(M_PI)) }) { (finished) -> Void in self.spin() } } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.spin() } } <file_sep>// // imageCell.swift // 06-day // // Created by <NAME> on 16/3/21. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class imageCell: UICollectionViewCell { @IBOutlet weak var featureImage: UIImageView! @IBOutlet weak var featureLable: UILabel! var interest: data! { didSet { updateUIs() } } private func updateUIs() { featureLable?.text! = interest.title featureImage?.image! = interest.featuredImage } override func layoutSubviews() { super.layoutSubviews() self.layer.cornerRadius = 8.0 self.clipsToBounds = true } } <file_sep>// // RefreshView.swift // 21-day // // Created by <NAME> on 16/4/28. // Copyright © 2016年 Frank. All rights reserved. // import UIKit protocol RefreshViewDelegate: class { func refreshviewDidRefresh(refreshView:RefreshView) } private let kScreenHeight: CGFloat = 120.0 class RefreshView: UIView, UIScrollViewDelegate { private unowned var scrollView: UIScrollView private var progress: CGFloat = 0.0 var refreshItems = [RefreshItem]() weak var delegate: RefreshViewDelegate? var isRefreshing: Bool = false init(frame: CGRect,scrollView: UIScrollView ) { self.scrollView = scrollView super.init(frame: frame) updateBackgroundColor() setupRefreshItems() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func setupRefreshItems() { let groundImageView = UIImageView(image: UIImage(named: "ground")) let buildingsImageView = UIImageView(image: UIImage(named: "buildings")) let sunImageView = UIImageView(image: UIImage(named: "sun")) let catImageView = UIImageView(image: UIImage(named: "cat")) let capeBackImageView = UIImageView(image: UIImage(named: "cape_back")) let capeFrontImageView = UIImageView(image: UIImage(named: "cape_front")) refreshItems = [ RefreshItem(view: buildingsImageView, centerEnd: CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetHeight(bounds) - CGRectGetHeight(groundImageView.bounds) - CGRectGetHeight(buildingsImageView.bounds) / 2), parallaxRatio: 1.5, screenHeight: kScreenHeight), RefreshItem(view: sunImageView, centerEnd: CGPoint(x: CGRectGetWidth(bounds) * 0.1, y: CGRectGetHeight(bounds) - CGRectGetHeight(groundImageView.bounds) - CGRectGetHeight(sunImageView.bounds)), parallaxRatio: 3, screenHeight: kScreenHeight), RefreshItem(view: groundImageView, centerEnd: CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetHeight(bounds) - CGRectGetHeight(groundImageView.bounds)/2), parallaxRatio: 0.5, screenHeight: kScreenHeight), RefreshItem(view: capeBackImageView, centerEnd: CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetHeight(bounds) - CGRectGetHeight(groundImageView.bounds)/2 - CGRectGetHeight(capeBackImageView.bounds)/2), parallaxRatio: -1, screenHeight: kScreenHeight), RefreshItem(view: catImageView, centerEnd: CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetHeight(bounds) - CGRectGetHeight(groundImageView.bounds)/2 - CGRectGetHeight(catImageView.bounds)/2), parallaxRatio: 1, screenHeight: kScreenHeight), RefreshItem(view: capeFrontImageView, centerEnd: CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetHeight(bounds) - CGRectGetHeight(groundImageView.bounds)/2 - CGRectGetHeight(capeFrontImageView.bounds)/2), parallaxRatio: -1, screenHeight: kScreenHeight), ] for refreshItem in refreshItems { addSubview(refreshItem.view) } } func updateRefreshItemPositions() { for refreshItem in refreshItems { refreshItem.updateViewPositionForPercentage(progress) } } func beginRefresh() { isRefreshing = true UIView.animateWithDuration(0.4, delay: 0, options: .CurveEaseOut, animations: { self.scrollView.contentInset.top += kScreenHeight }) { (true) in } let cape = refreshItems[3].view let cat = refreshItems[4].view cape.transform = CGAffineTransformMakeRotation(CGFloat(-M_PI/32)) cat.transform = CGAffineTransformMakeTranslation(1.0, 0) UIView.animateWithDuration(0.2, delay: 0, options: .Repeat, animations: { cape.transform = CGAffineTransformMakeRotation(CGFloat(M_PI/32)) cat.transform = CGAffineTransformMakeTranslation(-1.0, 0) }, completion: nil) // 有问题,这段动画无法执行 // let buildings = refreshItems[0].view // let ground = refreshItems[2].view // UIView.animateWithDuration(0.2, delay: 0, options: UIViewAnimationOptions.CurveEaseInOut , animations: { // ground.center.y += kScreenHeight // buildings.center.y += kScreenHeight // }){ (true) in } } func endRefresh() { UIView.animateWithDuration(0.4, delay: 0, options: .CurveEaseOut, animations: { self.scrollView.contentInset.top -= kScreenHeight }) { (true) in self.isRefreshing = false } let cape = refreshItems[3].view let cat = refreshItems[4].view cape.transform = CGAffineTransformIdentity cat.transform = CGAffineTransformIdentity cape.layer.removeAllAnimations() } func scrollViewDidScroll(scrollView: UIScrollView) { if isRefreshing { return } let refreshHeight = max(0, -scrollView.contentOffset.y - scrollView.contentInset.top) progress = min(1, refreshHeight / kScreenHeight) updateBackgroundColor() updateRefreshItemPositions() } func scrollViewWillEndDragging(scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { if !isRefreshing && progress == 1 { beginRefresh() targetContentOffset.memory.y = -scrollView.contentInset.top delegate?.refreshviewDidRefresh(self) } } func updateBackgroundColor(){ backgroundColor = UIColor(white: 0.7 * progress + 0.2 , alpha: 1) } } <file_sep>// // PostViewController.swift // 19-day // // Created by <NAME> on 16/4/27. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class PostViewController: UIViewController { @IBOutlet weak var textBtn: UIButton! @IBOutlet weak var photoBtn: UIButton! @IBOutlet weak var quoteBtn: UIButton! @IBOutlet weak var linkBtn: UIButton! @IBOutlet weak var chatBtn: UIButton! @IBOutlet weak var audioBtn: UIButton! let transitionManager = MenuTransitionManager() override func viewDidLoad() { super.viewDidLoad() self.transitioningDelegate = self.transitionManager } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } } <file_sep>// // AvatarImage.swift // 11-day // // Created by <NAME> on 16/3/25. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class AvatarImage: UIImageView { override func awakeFromNib() { self.layer.cornerRadius = 4 // self.layer.borderColor = UIColor.whiteColor().CGColor // self.layer.borderWidth = 0 self.clipsToBounds = true } } <file_sep>// // MagicMoveTransion.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit class MagicMoveTransion: NSObject, UIViewControllerAnimatedTransitioning { func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { return 0.5 } func animateTransition(transitionContext: UIViewControllerContextTransitioning) { //1.获取动画的源控制器和目标控制器 let fromVC = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) as! HomeViewController let toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) as! DetailViewController let container = transitionContext.containerView() //2.创建一个 Cell 中 imageView 的截图,并把 imageView 隐藏,造成使用户以为移动的就是 imageView 的假象 let snapshotView = fromVC.selectedCell.cardImage.snapshotViewAfterScreenUpdates(false) snapshotView.frame = container!.convertRect(fromVC.selectedCell.cardImage.frame, fromView: fromVC.selectedCell) fromVC.selectedCell.cardImage.hidden = true //3.设置目标控制器的位置,并把透明度设为0,在后面的动画中慢慢显示出来变为1 toVC.view.frame = transitionContext.finalFrameForViewController(toVC) toVC.view.alpha = 0 //4.都添加到 container 中。注意顺序不能错了 container!.addSubview(toVC.view) container!.addSubview(snapshotView) //5.执行动画 /* 这时avatarImageView.frame的值只是跟在IB中一样的, 如果换成屏幕尺寸不同的模拟器运行时avatarImageView会先移动到IB中的frame,动画结束后才会突然变成正确的frame。 所以需要在动画执行前执行一次toVC.avatarImageView.layoutIfNeeded() update一次frame */ toVC.avatarImage.layoutIfNeeded() UIView.animateWithDuration(transitionDuration(transitionContext), delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in snapshotView.frame = toVC.avatarImage.frame toVC.view.alpha = 1 }) { (finish: Bool) -> Void in fromVC.selectedCell.cardImage.hidden = false toVC.avatarImage.image = toVC.image snapshotView.removeFromSuperview() //一定要记得动画完成后执行此方法,让系统管理 navigation transitionContext.completeTransition(true) } } } <file_sep>// // HomeViewController.swift // 10-day // // Created by <NAME> on 16/3/23. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeViewController: VideoSplashViewController { @IBOutlet weak var loginBtn: UIButton! override func viewDidLoad() { super.viewDidLoad() setupVideoBackground() loginBtn.layer.cornerRadius = 4 print("viewDidLoad") } @IBAction func loginBtnDidTouch(sender: AnyObject) { } func setupVideoBackground() { let url = NSURL.fileURLWithPath(NSBundle.mainBundle().pathForResource("welcome_2_0", ofType: "mp4")!) videoFrame = view.frame fillMode = .ResizeAspectFill alwaysRepeat = true sound = true startTime = 2.0 alpha = 0.7 contentURL = url view.userInteractionEnabled = true } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } } <file_sep># Swift_practise 我的swift项目练习代码 <file_sep>// // HomeViewController.swift // 07-day // // Created by <NAME> on 16/3/21. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func prefersStatusBarHidden() -> Bool { return false } override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation { return UIStatusBarAnimation.Slide } } <file_sep>// // HomeViewController.swift // 11-day // // Created by <NAME> on 16/3/24. // Copyright © 2016年 Frank. All rights reserved. // import UIKit struct video { let image: String let title: String let subTitle: String let source: String let avatar: String } class HomeViewController: UITableViewController,UIGestureRecognizerDelegate { @IBOutlet var HomeTable: UITableView! override func viewDidLoad() { super.viewDidLoad() self.navigationController?.interactivePopGestureRecognizer?.delegate = self } // MARK: - 添加滑动返回手势,别忘了加上 UIGestureRecognizerDelegate 代理方法 func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool { self.view.backgroundColor = UIColor.whiteColor() return true } override func viewWillAppear(animated: Bool) { self.view.backgroundColor = UIColor.whiteColor() // self.navigationController?.setNavigationBarHidden(false, animated: true) self.navigationController?.navigationBar.alpha = 0.001 } override func viewDidAppear(animated: Bool) { self.navigationController?.navigationBar.alpha = 1 } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.Default } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 3 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return data.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = HomeTable.dequeueReusableCellWithIdentifier("homecell", forIndexPath: indexPath) as! HomeTableCell let cellInfo = data[indexPath.row] cell.titleImage.image = UIImage(named: cellInfo.image) cell.titleLable.text = cellInfo.title return cell } // MARK: - 设置表格的表头样式,可自定义 override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let aaa:UITableViewHeaderFooterView = UITableViewHeaderFooterView() aaa.textLabel?.text = "" aaa.contentView.backgroundColor = UIColor.whiteColor() return aaa } // MARK: - 在此方法中设置要通过push传递的数据,并在目标控制器中设置对应的变量接受此方法中传递的数据 override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "ProfileSegue" { let toView = segue.destinationViewController as! ProfileViewController let indexPath = tableView.indexPathForCell(sender as! UITableViewCell)! toView.textToGo = data[indexPath.row].title toView.imageToGo = data[indexPath.row].image toView.avatarToGo = data[indexPath.row].avatar } } } <file_sep>// // CenterViewController.swift // 05-day // // Created by Adolfrank on 3/19/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit protocol CenterViewControllerDelegate:class{ func storiesBtnDidTouch(width: CGFloat) } class CenterViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { weak var delegate: CenterViewControllerDelegate? @IBOutlet weak var homeTableView: UITableView! override func viewDidLoad() { super.viewDidLoad() homeTableView.delegate = self homeTableView.dataSource = self // Nib 注册 self.homeTableView.registerNib(UINib(nibName: "HomeViewCell", bundle: nil), forCellReuseIdentifier: "cell") // Class 注册 // self.homeTableView.registerClass(HomeViewCell.self, forCellReuseIdentifier: "cell") } @IBAction func storiesBtnDidTouch(sender: AnyObject) { delegate?.storiesBtnDidTouch(self.homeTableView.bounds.width * 2) } override func prefersStatusBarHidden() -> Bool { return false } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.Default } override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation { return UIStatusBarAnimation.Slide } func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 400 } func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 1 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = homeTableView.dequeueReusableCellWithIdentifier("cell") return cell! } } <file_sep>// // ViewController.swift // 07-day // // Created by <NAME> on 16/3/21. // Copyright © 2016年 Frank. All rights reserved. // import UIKit import CoreLocation class ViewController: UIViewController,CLLocationManagerDelegate { @IBOutlet weak var locationLable: UILabel! var locationManager: CLLocationManager! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func prefersStatusBarHidden() -> Bool { return true } override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation { return UIStatusBarAnimation.Slide } @IBAction func locationBtnDidTouch(sender: AnyObject) { locationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestAlwaysAuthorization() locationManager.startUpdatingLocation() } func locationManager(manager: CLLocationManager, didFailWithError error: NSError) { self.locationLable.text = "Error while updating location. " + error.localizedDescription } func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { CLGeocoder().reverseGeocodeLocation(manager.location!, completionHandler: {(placemarks, error)->Void in if (error != nil) { self.locationLable.text = "Reverse geocoder failed with error: " + error!.localizedDescription return } if placemarks!.count > 0 { let pm = placemarks![0] self.displayLocationInfo(pm) } else { self.locationLable.text = "Problem with the data received from geocoder: " } }) } func displayLocationInfo(placemark: CLPlacemark?) { if let containsPlacemark = placemark { //stop updating location to save battery life locationManager.stopUpdatingLocation() let locality = (containsPlacemark.locality != nil) ? containsPlacemark.locality : "" let postalCode = (containsPlacemark.postalCode != nil) ? containsPlacemark.postalCode : "" let administrativeArea = (containsPlacemark.administrativeArea != nil) ? containsPlacemark.administrativeArea : "" let country = (containsPlacemark.country != nil) ? containsPlacemark.country : "" self.locationLable.text = "你的位置是 \(locality!) \(administrativeArea! ) \(country!),恭喜你,你已经被大浦洞导弹锁定。" } } } <file_sep>// // PatternCell.swift // 23-day // // Created by <NAME> on 16/5/3. // Copyright © 2016年 Frank. All rights reserved. // import UIKit struct pattern { let image: String let name: String } class PatternCell: UITableViewCell { @IBOutlet weak var patternImage: UIImageView! @IBOutlet weak var patternLable: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } <file_sep>// // CardViewCell.swift // 22-day // // Created by <NAME> on 16/4/29. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class CardViewCell: UICollectionViewCell { @IBOutlet weak var cardImage: UIImageView! @IBOutlet weak var cardLable: UILabel! }<file_sep>// // TableView.swift // 03-day // // Created by <NAME> on 16/3/18. // Copyright © 2016年 Frank. All rights reserved. // import UIKit import AVKit import AVFoundation struct video { let image: String let title: String let subTitle: String let source: String } class TableView: UITableViewController { var data = [ video(image: "screenshot01", title: "Introduce 3DS Mario", subTitle: "Youtube - 06:32", source: "video01.mp4"), video(image: "screenshot02", title: "Emoji Among Us", subTitle: "Vimeo - 3:34", source: "video01.mp4"), video(image: "screenshot03", title: "Seals Documentary", subTitle: "Vine - 00:06", source: "video01.mp4"), video(image: "screenshot04", title: "Adventure Time", subTitle: "Youtube - 02:39", source: "video01.mp4"), video(image: "screenshot05", title: "Facebook HQ", subTitle: "Facebook - 10:20", source: "video02.mp4"), video(image: "screenshot06", title: "Lijiang Lugu Lake", subTitle: "Allen - 20:30", source: "video02.mp4"), video(image: "screenshot07", title: "Lijiang Lugu Lake", subTitle: "Allen - 20:30", source: "video02.mp4"), video(image: "screenshot08", title: "Lijiang Lugu Lake", subTitle: "Allen - 20:30", source: "video02.mp4") ] var playViewController = AVPlayerViewController() var playerView = AVPlayer() @IBOutlet var videoTableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.blackColor() } func playVideo (indexPath: NSIndexPath){ let videoInfo = data[indexPath.row] let path = NSBundle.mainBundle().pathForResource(videoInfo.source, ofType: nil) playerView = AVPlayer(URL: NSURL(fileURLWithPath: path!)) playViewController.player = playerView self.presentViewController(playViewController, animated: true) { self.playViewController.player?.play() } } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return data.count } override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 220 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = videoTableView.dequeueReusableCellWithIdentifier("VideoCell", forIndexPath: indexPath) as! VideoCell let videoInfo = data[indexPath.row] cell.titleV.text = videoInfo.title cell.subTitleV.text = videoInfo.subTitle cell.imageV.image = UIImage(named: videoInfo.image) return cell } override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { playVideo(indexPath) } } <file_sep>// // RefreshItem.swift // 21-day // // Created by <NAME> on 16/4/28. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class RefreshItem { private var centerStart: CGPoint private var centerEnd: CGPoint unowned var view: UIView init(view: UIView, centerEnd: CGPoint, parallaxRatio: CGFloat, screenHeight: CGFloat) { self.view = view self.centerEnd = centerEnd centerStart = CGPoint(x: centerEnd.x , y: centerEnd.y + (parallaxRatio * screenHeight)) self.view.center = centerStart } func updateViewPositionForPercentage(percentage: CGFloat) { view.center = CGPoint( x: centerStart.x + (centerEnd.x - centerStart.x) * percentage, y: centerStart.y + (centerEnd.y - centerStart.y) * percentage) } } <file_sep>// // HomeViewController.swift // 08-day // // Created by Adolfrank on 3/21/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class HomeViewController: UITableViewController { let cellIdentifer = "NewCellIdentifier" let favoriteEmoji = ["🤗🤗🤗🤗🤗", "😅😅😅😅😅", "😆😆😆😆😆"] let newFavoriteEmoji = ["🏃🏃🏃🏃🏃", "💩💩💩💩💩", "👸👸👸👸👸", "🤗🤗🤗🤗🤗", "😅😅😅😅😅", "😆😆😆😆😆" ] var emojiData = [String]() // var tableViewController = UITableViewController(style: .Plain) // var refreshControl = UIRefreshControl() @IBAction func showNav(sender: AnyObject) { print("yyy") } override func viewDidLoad() { super.viewDidLoad() emojiData = favoriteEmoji let emojiTableView = self.tableView emojiTableView.backgroundColor = UIColor(red:0.092, green:0.096, blue:0.116, alpha:1) emojiTableView.dataSource = self emojiTableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: cellIdentifer) emojiTableView.tableFooterView = UIView(frame: CGRectZero) emojiTableView.separatorStyle = UITableViewCellSeparatorStyle.None self.refreshControl = UIRefreshControl() self.refreshControl?.addTarget(self, action: "didRoadEmoji", forControlEvents: UIControlEvents.ValueChanged) self.refreshControl!.backgroundColor = UIColor(red:100/255/0 , green:0.113, blue:0.145, alpha:1) let attributes = [NSForegroundColorAttributeName: UIColor.whiteColor()] self.refreshControl!.attributedTitle = NSAttributedString(string: "Last updated on \(NSDate())", attributes: attributes) self.refreshControl!.tintColor = UIColor.whiteColor() // self.title = "emoji" let titleLabel = UILabel(frame: CGRectMake(0, 0, 0 , 44)) titleLabel.textAlignment = NSTextAlignment.Center titleLabel.text = "下拉刷新" titleLabel.textColor = UIColor.whiteColor() self.navigationItem.titleView = titleLabel self.navigationController?.hidesBarsOnSwipe self.navigationController?.navigationBar.setBackgroundImage(UIImage(named: "bg"), forBarMetrics: UIBarMetrics.Default) self.navigationController?.navigationBar.shadowImage = UIImage(named: "bg") emojiTableView.rowHeight = UITableViewAutomaticDimension emojiTableView.estimatedRowHeight = 60.0 } func didRoadEmoji() { print("ttt") self.emojiData = newFavoriteEmoji self.tableView.reloadData() self.refreshControl!.endRefreshing() } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return emojiData.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifer, forIndexPath: indexPath) // let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifer)! as UITableViewCell // Configure the cell... cell.textLabel!.text = self.emojiData[indexPath.row] cell.textLabel!.textAlignment = NSTextAlignment.Center cell.textLabel!.font = UIFont.systemFontOfSize(50) cell.backgroundColor = UIColor.clearColor() cell.selectionStyle = UITableViewCellSelectionStyle.None return cell } } <file_sep>// // ContactModel.swift // 16-day // // Created by Adolfrank on 4/12/16. // Copyright © 2016 Frank. All rights reserved. // import Foundation class ContactModel: NSObject { var name: String = "" var phoneNumber: String = "" } <file_sep>// // NavController.swift // 11-day // // Created by <NAME> on 16/3/24. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class NavController: UINavigationController { override func viewDidLoad() { super.viewDidLoad() hideNavImage() // Do any additional setup after loading the view. } override func pushViewController(viewController: UIViewController, animated: Bool) { // 这个方法可以拦截所有通过导航栏进来的push super.pushViewController(viewController, animated: animated) } // MARK: - 找出导航栏地步的黑条 private func hairlineImageViewInNavigationBar(view: UIView) -> UIImageView? { if let imageView = view as? UIImageView where imageView.bounds.height <= 1 { return imageView } for subview: UIView in view.subviews { if let imageView = hairlineImageViewInNavigationBar(subview) { return imageView } } return nil } // MARK: - 隐藏导航栏的黑条 func hideNavImage(){ let NavImage: UIImageView = self.hairlineImageViewInNavigationBar(self.navigationBar)! NavImage.hidden = true } } /* 找出导航栏的黑条 extension UIToolbar { func hideHairline() { let navigationBarImageView = hairlineImageViewInToolbar(self)?.hidden = true } func showHairline() { let navigationBarImageView = hairlineImageViewInToolbar(self)?.hidden = false } private func hairlineImageViewInToolbar(view: UIView) -> UIImageView? { if let imageView = view as? UIImageView where imageView.bounds.height <= 1 { return imageView } for subview: UIView in view.subviews { if let imageView = hairlineImageViewInToolbar(subview) { return imageView } } return nil } } */ <file_sep>// // LoginViewController.swift // 14-day // // Created by Adolfrank on 4/9/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class LoginViewController: UIViewController { @IBOutlet weak var navBar: UINavigationBar! @IBOutlet weak var BGScrollView: UIScrollView! @IBOutlet weak var usernameLable: UITextField! @IBOutlet weak var passwordLable: UITextField! @IBOutlet weak var loginLable: UIButton! let width = UIScreen.mainScreen().bounds.width let height = UIScreen.mainScreen().bounds.height override func viewDidLoad() { super.viewDidLoad() loginLable.alpha = 0 usernameLable.alpha = 0 passwordLable.alpha = 0 // Do any additional setup after loading the view. } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) BGScrollView.contentSize = CGSizeMake(width, height * 2) print(BGScrollView.contentSize.height) } override func viewDidAppear(animated: Bool) { UIView.animateWithDuration(0.5, delay: 0.00, options: UIViewAnimationOptions.CurveEaseIn, animations: { self.usernameLable.alpha = 1 self.view.layoutIfNeeded() }, completion: nil) UIView.animateWithDuration(0.5, delay: 0.20, options: .CurveEaseOut, animations: { self.passwordLable.alpha = 1 self.view.layoutIfNeeded() }, completion: nil) UIView.animateWithDuration(0.5, delay: 0.60, options: .CurveEaseOut, animations: { self.loginLable.alpha = 1 }, completion: nil) } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } @IBAction func backBtnDidTouch(sender: AnyObject) { self.dismissViewControllerAnimated(true, completion: nil) } } <file_sep>// // HomeTableCell.swift // 11-day // // Created by <NAME> on 16/3/24. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeTableCell: UITableViewCell { @IBOutlet weak var titleImage: UIImageView! @IBOutlet weak var titleLable: UILabel! // verride func awakeFromNib() { // super.awakeFromNib() // // Initialization code // } // // override func setSelected(selected: Bool, animated: Bool) { // super.setSelected(selected, animated: animated) // // Configure the view for the selected state // } } <file_sep>// // ProfileViewController.swift // 11-day // // Created by <NAME> on 16/3/24. // Copyright © 2016年 Frank. All rights reserved. // import UIKit /* 这三个值调节动画效果 在storyboard中,先指定各控件的位置,再在这里调节数值 */ let offset_HeaderStop:CGFloat = 136 // 背景图片与导航栏的高度差 At this offset the Header stops its transformations let offset_B_LabelHeader:CGFloat = 165 // 控制标题出现那刻的Y值 At this offset the Black label reaches the Header let distance_W_LabelHeader:CGFloat = 43 // 控制标题最终位置的Y值 The distance between the bottom of the Header and the top of the White Label class ProfileViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { @IBOutlet weak var backBtn: UIButton! @IBOutlet var Header: UIView! @IBOutlet weak var HeaderLable: UILabel! @IBOutlet weak var shareBtn: UIButton! @IBOutlet weak var AvatarImage: UIImageView! @IBOutlet weak var ProfileTable: UITableView! @IBAction func shareBtnDidTouch(sender: AnyObject) { // MARK: - 初始化 action sheet let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet) let deleteAction = UIAlertAction(title: "Delete", style: .Default, handler: { (alert: UIAlertAction!) -> Void in }) let saveAction = UIAlertAction(title: "Save", style: .Default, handler: { (alert: UIAlertAction!) -> Void in }) let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: { (alert: UIAlertAction!) -> Void in }) optionMenu.addAction(deleteAction) optionMenu.addAction(saveAction) optionMenu.addAction(cancelAction) self.presentViewController(optionMenu, animated: true, completion: nil) } var textToGo:String = "" var imageToGo: String = "" var avatarToGo: String = "" @IBOutlet weak var AvatarLable: UILabel! @IBOutlet var headerImageView:UIImageView! @IBOutlet var headerBlurImageView:UIImageView! // MARK: - 设置自定义导航栏 override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.whiteColor() // MARK: 设置代理和数据源 ProfileTable.delegate = self ProfileTable.dataSource = self // MARK: 设置自定义导航栏的初始化 AvatarLable.text = textToGo HeaderLable.text = textToGo AvatarImage.image = UIImage(named: avatarToGo) headerImageView = UIImageView(frame: Header.bounds) /* tableview前插入UIView的时候,tableview的autolayout貌似有点问题,所以在此方法中直接指定 Header 的宽度等于屏幕宽度 */ Header.bounds = CGRectMake(0, 0, self.view.frame.height, 200) ProfileTable.bounds = CGRectMake(0, 0, self.view.frame.width, self.view.frame.height) headerImageView?.image = UIImage(named: imageToGo) headerImageView?.contentMode = UIViewContentMode.ScaleAspectFill Header.insertSubview(headerImageView, belowSubview: HeaderLable) // MARK: 设置导航栏的背景图片 - blur效果等 headerBlurImageView = UIImageView(frame: Header.bounds) headerBlurImageView?.image = UIImage(named: imageToGo)?.blurredImageWithRadius(3, iterations: 20, tintColor: UIColor.clearColor()) headerBlurImageView?.contentMode = UIViewContentMode.ScaleAspectFill headerBlurImageView?.alpha = 1 Header.insertSubview(headerBlurImageView, belowSubview: HeaderLable) Header.clipsToBounds = true // MARK: 设置导航栏按钮 - 顶置图层 self.view.bringSubviewToFront(backBtn) self.view.bringSubviewToFront(shareBtn) } @IBAction func backBtnDidTouch(sender: AnyObject) { // MARK: 此方法回到push过来的上一级 self.navigationController?.popViewControllerAnimated(true) } // MARK: - 此方法中定义了导航栏的关键动画效果 func scrollViewDidScroll(scrollView: UIScrollView) { let offset = scrollView.contentOffset.y var avatarTransform = CATransform3DIdentity var headerTransform = CATransform3DIdentity // PULL DOWN ----------------- if offset <= 0 { let headerScaleFactor:CGFloat = -(offset) / Header.bounds.height let headerSizevariation = ((Header.bounds.height * (1.0 + headerScaleFactor)) - Header.bounds.height)/2.0 headerTransform = CATransform3DTranslate(headerTransform, 0, headerSizevariation, 0) headerTransform = CATransform3DScale(headerTransform, 1.0 + headerScaleFactor, 1.0 + headerScaleFactor, 0) Header.layer.transform = headerTransform } // SCROLL UP/DOWN ------------ else { // Header ----------- headerTransform = CATransform3DTranslate(headerTransform, 0, max(-offset_HeaderStop, -offset), 0) // ------------ Label let labelTransform = CATransform3DMakeTranslation(0, max(-distance_W_LabelHeader, offset_B_LabelHeader - offset), 0) HeaderLable.layer.transform = labelTransform // ------------ 导航栏按钮顶置 let navBtnTrasform = CATransform3DMakeTranslation(0, 0, 10) backBtn.layer.transform = navBtnTrasform shareBtn.layer.transform = navBtnTrasform // ------------ 设置导航栏背景的Blur动画 // headerBlurImageView?.alpha = min (1.0, (offset - offset_B_LabelHeader)/distance_W_LabelHeader) // Avatar ----------- let avatarScaleFactor = (min(offset_HeaderStop, offset)) / AvatarImage.bounds.height / 1.4 // Slow down the animation let avatarSizeVariation = ((AvatarImage.bounds.height * (1.0 + avatarScaleFactor)) - AvatarImage.bounds.height) / 2.0 avatarTransform = CATransform3DTranslate(avatarTransform, 0, avatarSizeVariation, 0) avatarTransform = CATransform3DScale(avatarTransform, 1.0 - avatarScaleFactor, 1.0 - avatarScaleFactor, 0) if offset <= offset_HeaderStop { if AvatarImage.layer.zPosition < Header.layer.zPosition{ Header.layer.zPosition = 0 } }else { if AvatarImage.layer.zPosition >= Header.layer.zPosition{ Header.layer.zPosition = 2 } } } // Apply Transformations Header.layer.transform = headerTransform AvatarImage.layer.transform = avatarTransform } // MARK: - 此方法中隐藏系统自带的导航栏,因为此方法会在每次push进来的时候加载 override func viewWillAppear(animated: Bool) { self.navigationController?.setNavigationBarHidden(true, animated: false) } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } override func viewWillDisappear(animated: Bool) { self.navigationController?.setNavigationBarHidden(false, animated: false) } // MARK: - 设置表格的行数/列数/每行的数据 func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 10 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = ProfileTable.dequeueReusableCellWithIdentifier("profilecell", forIndexPath: indexPath) as! ProfileTableCell return cell } } <file_sep>// // ViewController.swift // 09-day // // Created by <NAME> on 16/3/22. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ViewController: UIViewController,UIScrollViewDelegate{ var imageView:UIImageView! @IBOutlet weak var scrollView: UIScrollView! override func viewDidLoad() { super.viewDidLoad() setUpScrollView() setZoomScaleFor(scrollView.bounds.size) } private func setUpScrollView(){ imageView = UIImageView(image: UIImage(named:"jobs")) scrollView.contentSize = imageView.bounds.size scrollView.delegate = self scrollView.addSubview(imageView) } private func setZoomScaleFor(srollViewSize: CGSize) { let imageSize = imageView.bounds.size let widthScale = srollViewSize.width / imageSize.width let heightScale = srollViewSize.height / imageSize.height scrollView.minimumZoomScale = min(widthScale, heightScale) scrollView.maximumZoomScale = max(widthScale, heightScale) scrollView.zoomScale = scrollView.minimumZoomScale } private func recenterImage() { let scrollViewSize = scrollView.bounds.size let imageViewSize = imageView.frame.size let horizontalSpace = (imageViewSize.width < scrollViewSize.width) ? ((scrollViewSize.width - imageViewSize.width) / 2 ) : 0 let verticalSpace = (imageViewSize.height < scrollViewSize.height) ? ((scrollViewSize.height - imageViewSize.height) / 2 ) : 0 scrollView.contentInset = UIEdgeInsetsMake(verticalSpace, horizontalSpace, verticalSpace, horizontalSpace) } func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? { return imageView } func scrollViewDidZoom(scrollView: UIScrollView) { recenterImage() } } <file_sep>// // SecondViewController.swift // 25-day // // Created by <NAME> on 16/5/19. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class SecondViewController: UIViewController { @IBOutlet weak var exampleImageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) UIView.animateWithDuration(2, animations: { self.exampleImageView.alpha = 0 }) } } <file_sep>// // ViewController.swift // 01-day // // Created by Adolfrank on 3/17/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var timeLable: UILabel! @IBOutlet weak var controlBtn: UIButton! var Count = 0.0 var Timer = NSTimer() var IsPlaying = false override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } override func viewDidLoad() { super.viewDidLoad() timeLable.text = String(Count) } @IBAction func resetBtnDidTouch(sender: AnyObject) { Count = 0.0 timeLable.text = String(Count) } @IBAction func controlBtnDidTouch(sender: AnyObject) { if (IsPlaying == false) { Timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: ("timeUpdate"), userInfo: nil, repeats: true) controlBtn.setImage(UIImage(named: "stop_btn"), forState: UIControlState.Normal) controlBtn.backgroundColor = UIColor(red: 204/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0) IsPlaying = true } else { Timer.invalidate() controlBtn.setImage(UIImage(named: "play_btn"), forState: UIControlState.Normal) controlBtn.backgroundColor = UIColor(red: 49/255.0, green: 104/255.0, blue: 250/255.0, alpha: 1.0) IsPlaying = false } } func timeUpdate(){ Count += 0.1 timeLable.text = String(format: "%.1f", arguments: [Count]) } } <file_sep>// // HomeViewController.swift // 04-day // // Created by Adolfrank on 3/19/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class HomeViewController: UIViewController,UIScrollViewDelegate { @IBOutlet weak var scrollView: UIScrollView! override func viewDidLoad() { super.viewDidLoad() self.navigationController?.hidesBarsOnSwipe = true let leftView:LeftViewController = LeftViewController() let rightView:RightViewController = RightViewController(nibName:"RightViewController",bundle: nil) self.addChildViewController(leftView) self.scrollView.addSubview(leftView.view) leftView.view.frame = CGRectMake(0, 0, scrollView.frame.width, scrollView.frame.height) leftView.didMoveToParentViewController(self) self.addChildViewController(rightView) rightView.view.frame = CGRectMake(scrollView.frame.width, 0, scrollView.frame.width, scrollView.frame.height) self.scrollView.addSubview(rightView.view) rightView.didMoveToParentViewController(self) self.scrollView.contentSize = CGSizeMake(scrollView.frame.width * 2, 0 ) self.scrollView.delegate = self // self.scrollView.backgroundColor } func scrollViewWillEndDragging(scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { } } <file_sep>// // CellData.swift // 12-day // // Created by Adolfrank on 3/26/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit var tableData = ["Read 3 article on Medium", "Cleanup bedroom", "Go for a run", "Hit the gym", "Build another swift project", "Movement training", "Fix the layout problem of a client project", "Write the experience of #30daysSwift", "Inbox Zero", "Booking the ticket to Chengdu", "Test the Adobe Project Comet", "Hop on a call to mom"] <file_sep>// // HomeViewController.swift // 18-day // // Created by <NAME> on 16/4/20. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeViewController: UITableViewController, MenuTransitionManagerDelegate { let menuTransitionManager = MenuTransitionManager() override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } override func viewDidLoad() { super.viewDidLoad() tableView.separatorStyle = UITableViewCellSeparatorStyle.None view.backgroundColor = UIColor(red:0.062, green:0.062, blue:0.07, alpha:1) } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 5 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! HomeTableCell if indexPath.row == 0 { cell.bannerImageView.image = UIImage(named: "banner01") cell.titleView.text = "Love mountain." cell.authorView.text = "<NAME>" cell.avatarView.image = UIImage(named: "header01") } else if indexPath.row == 1 { cell.bannerImageView.image = UIImage(named: "banner02") cell.titleView.text = "New graphic design - LIVE FREE" cell.authorView.text = "Cole" cell.avatarView.image = UIImage(named: "header02") } else if indexPath.row == 2 { cell.bannerImageView.image = UIImage(named: "banner03") cell.titleView.text = "Summer sand" cell.authorView.text = "<NAME>" cell.avatarView.image = UIImage(named: "header03") } else if indexPath.row == 3{ cell.bannerImageView.image = UIImage(named: "banner04") cell.titleView.text = "Seeking for signal" cell.authorView.text = "Noby-Wan Kenobi" cell.avatarView.image = UIImage(named: "header04") } else { cell.bannerImageView.image = UIImage(named: "banner05") cell.titleView.text = "Seeking for signal" cell.authorView.text = "Noby-Wan Kenobi" cell.avatarView.image = UIImage(named: "header05") } return cell } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { let menuTableViewController = segue.destinationViewController as! MenuViewController // menuTableViewController.currentItem = self.title! menuTableViewController.transitioningDelegate = menuTransitionManager menuTransitionManager.delegate = self } func dismiss() { dismissViewControllerAnimated(true, completion: nil) } func unwindToHome(segue: UIStoryboardSegue) { let sourceController = segue.sourceViewController as! MenuViewController self.title = sourceController.currentItem } } <file_sep>// // TableHeader.swift // 12-day // // Created by Adolfrank on 3/26/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class TableHeader: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } <file_sep>// // data.swift // 11-day // // Created by <NAME> on 16/3/25. // Copyright © 2016年 Frank. All rights reserved. // import UIKit // MARK: 这里存放数据-数组 var data :[video] = [ video(image: "screenshot01", title: "Introduce 3DS Mario", subTitle: "Youtube - 06:32", source: "video01.mp4", avatar: "avatar01"), video(image: "screenshot02", title: "Emoji Among Us", subTitle: "Vimeo - 3:34", source: "video01.mp4", avatar: "avatar02"), video(image: "screenshot03", title: "Seals Documentary", subTitle: "Vine - 00:06", source: "video01.mp4", avatar: "avatar03"), video(image: "screenshot04", title: "Adventure Time", subTitle: "Youtube - 02:39", source: "video01.mp4", avatar: "avatar04"), video(image: "screenshot05", title: "Facebook HQ", subTitle: "Facebook - 10:20", source: "video02.mp4", avatar: "avatar05"), video(image: "screenshot06", title: "Lijiang Lugu Lake", subTitle: "Allen - 20:30", source: "video02.mp4", avatar: "avatar06"), video(image: "screenshot07", title: "Lijiang Lugu Lake", subTitle: "Allen - 20:30", source: "video02.mp4", avatar: "avatar07"), video(image: "screenshot08", title: "Lijiang Lugu Lake", subTitle: "Allen - 20:30", source: "video02.mp4", avatar: "avatar08") ] <file_sep>// // LeftViewController.swift // 04-day // // Created by Adolfrank on 3/19/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class LeftViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() self.tableView.registerClass(UITableViewCell.classForCoder(), forCellReuseIdentifier: "cell") self.tableView.rowHeight = 160 // self.tableView.separatorColor = UIColor.whiteColor() } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 10 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) cell.textLabel?.text = "这是第\(indexPath.row)行" cell.imageView?.image = UIImage(named: "screenshot") return cell } } <file_sep>// // ViewController.swift // 02-day // // Created by <NAME> on 16/3/18. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { var data = ["30 Days Swift", "习近平:共产主义决不是土豆烧牛肉那么简单,不可能唾手可得", "党的十八大以来,针对社会上存在的“共产主义虚无缥缈,遥遥无期”的论调,习近平总书记鲜明地指出", "共产主义决不是“土豆烧牛肉”那么简单,不可能唾手可得、一蹴而就,但我们不能因为实现共产主义理想是一个漫长的过程,就认为那是虚无缥缈的海市蜃楼,就不去做一个忠诚的共产党员", "这昭示我们:共产主义是共产党人的精神旗帜,什么时候都不能丢!", "微博 @adolfrank"] var fontNames = ["MFTongXin_Noncommercial-Regular", "MFJinHei_Noncommercial-Regular", "MFZhiHei_Noncommercial-Regular"] var fontIndex = 0 var fontSize:CGFloat = 16 @IBOutlet weak var smallerFontBtn: UIButton! @IBOutlet weak var biggerFontBtn: UIButton! override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } @IBOutlet weak var fontView: UITableView! @IBOutlet weak var changFontBtn: UIButton! @IBAction func changFontBtnDidTouch(sender: AnyObject) { fontIndex = (fontIndex + 1) % 3 fontView.reloadData() } @IBAction func biggBtnDidTouch(sender: AnyObject) { fontSize += 2 fontView.reloadData() } @IBAction func smallerBtnDidTouch(sender: AnyObject) { fontSize -= 2 fontView.reloadData() } override func viewDidLoad() { super.viewDidLoad() fontView.dataSource = self fontView.delegate = self // for family in UIFont.familyNames(){ // for font in UIFont.fontNamesForFamilyName(family){ // print(font) // } // } biggerFontBtn.layer.cornerRadius = 50 smallerFontBtn.layer.cornerRadius = 50 changFontBtn.layer.cornerRadius = 50 fontView.estimatedRowHeight = 60 fontView.rowHeight = UITableViewAutomaticDimension } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return data.count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = fontView.dequeueReusableCellWithIdentifier("fontcell", forIndexPath: indexPath) let text = data[indexPath.row] cell.textLabel?.text = text cell.textLabel?.textColor = UIColor.whiteColor() cell.textLabel?.font = UIFont(name:self.fontNames[fontIndex], size: CGFloat(fontSize)) cell.textLabel?.numberOfLines = 0 return cell } } <file_sep>// // RightViewController.swift // 05-day // // Created by Adolfrank on 3/19/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit protocol RightViewControllerDelegate:class{ func backBtnDidTouch(width: CGFloat) } class RightViewController: UIViewController,UIScrollViewDelegate { @IBOutlet var RightView: UIView! @IBOutlet weak var RightScrollView: UIScrollView! weak var delegate: CenterViewControllerDelegate? override func viewDidLoad() { super.viewDidLoad() RightScrollView.contentSize = CGSizeMake(375, 1334) let downView:UIImageView = UIImageView() RightScrollView.addSubview(downView) downView.image = UIImage(named: "profile") downView.frame = CGRectMake(0, 667, 375, 667) downView.backgroundColor = UIColor.redColor() } override func prefersStatusBarHidden() -> Bool { return false } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.Default } override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation { return UIStatusBarAnimation.Slide } @IBAction func backBtnDidTouch(sender: AnyObject) { delegate?.storiesBtnDidTouch(self.RightView.bounds.width) } } <file_sep>// // VideoCell.swift // 03-day // // Created by <NAME> on 16/3/18. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class VideoCell: UITableViewCell { @IBOutlet weak var imageV: UIImageView! @IBOutlet weak var titleV: UILabel! @IBOutlet weak var subTitleV: UILabel! } <file_sep>// // LineLayout.swift // 06-day // // Created by <NAME> on 16/3/21. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class LineLayout: UICollectionViewFlowLayout { override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? { print("hehehe") return super.layoutAttributesForElementsInRect(rect) } } <file_sep>// // NavController.swift // tete // // Created by Adolfrank on 3/27/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class NavController: UINavigationController { var tmpImages:[UIImageView] = [UIImageView]() // var someInts = Int[]() lazy var lastTmpImage:UIImageView = { let lastTmpImage:UIImageView = self.tmpImages[self.tmpImages.count - 2] let window:UIWindow = UIApplication.sharedApplication().keyWindow! lastTmpImage.frame = window.bounds return lastTmpImage }() @IBAction func tocuid(sender: AnyObject) { print("hahaha") } override func viewDidLoad() { super.viewDidLoad() let recognizer: UIPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(NavController.dragging(_:))) self.view.addGestureRecognizer(recognizer) } func createScreenShot() { UIGraphicsBeginImageContext(self.view.frame.size) self.view.layer.renderInContext(UIGraphicsGetCurrentContext()!) let image = UIGraphicsGetImageFromCurrentImageContext() let tmpImage = UIImageView(image: image) self.tmpImages.append(tmpImage) } override func viewDidAppear(animated: Bool) { super.viewDidAppear(true) if self.tmpImages.count > 0 { return } else { createScreenShot() } } func dragging(recognizer: UIPanGestureRecognizer){ if self.viewControllers.count <= 1 { // 判断4:A 如果只有1个子控制器,禁止拖拽 return } else { // 判断4: B如果有2个控制器 let tx:CGFloat = recognizer.translationInView(self.view).x if tx < 0 // ------判断3: A禁止右滑------ { return } else { // ------判断3: B左滑------ if recognizer.state == UIGestureRecognizerState.Ended || recognizer.state == UIGestureRecognizerState.Cancelled { // ------判断2:左滑 A正常结束------ let x :CGFloat = self.view.frame.origin.x if ( x >= self.view.frame.size.width * 0.5 ) { //判断1:左滑 A:距离足够 UIView.animateWithDuration(0.25, animations: { self.view.transform = CGAffineTransformMakeTranslation(self.view.frame.size.width, 0) }, completion: { (true) in self.tmpImages.removeLast() self.lastTmpImage.removeFromSuperview() self.popViewControllerAnimated(false) self.view.transform = CGAffineTransformIdentity }) } else { // 判断1:左滑 B: 距离不足 UIView.animateWithDuration(0.25, animations: { self.view.transform = CGAffineTransformIdentity }) } } else { // ------判断2:左滑 B 其他情况------ self.view.transform = CGAffineTransformMakeTranslation(tx, 0) let window:UIWindow = UIApplication.sharedApplication().keyWindow! self.lastTmpImage.image = self.tmpImages[self.tmpImages.count - 2].image // let ox = self.view.transform.tx // print(ox) // lastTmpImage.transform = CGAffineTransformMakeTranslation(ox - 375, 0) window.insertSubview(lastTmpImage, atIndex: 0) } } // ------判断3 B左滑------ } // 判断4: B如果有2个控制器 } override func pushViewController(viewController: UIViewController, animated: Bool) { super.pushViewController(viewController, animated: true) createScreenShot() } } <file_sep>// // ThemeViewControllerTableViewController.swift // 11-day // // Created by <NAME> on 16/3/24. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ThemeViewControllerTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.whiteColor() } @IBOutlet var ThemeTable: UITableView! override func viewWillAppear(animated: Bool) { self.navigationController?.setNavigationBarHidden(true, animated: false) } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } override func viewWillDisappear(animated: Bool) { self.navigationController?.setNavigationBarHidden(false, animated: false) } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 20 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = ThemeTable.dequeueReusableCellWithIdentifier("themecell", forIndexPath: indexPath) as! ThemeTableCell return cell } } <file_sep>// // DetailViewController.swift // 22-day // // Created by <NAME> on 16/4/29. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class DetailViewController: UIViewController, UINavigationControllerDelegate { var image: UIImage! @IBOutlet weak var avatarImage: UIImageView! @IBOutlet weak var backgroundScrollView: UIScrollView! private var percentDrivenTransition: UIPercentDrivenInteractiveTransition? override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func viewWillAppear(animated: Bool) { super.viewDidAppear(animated) avatarImage.frame = CGRectMake(0, -64, 375, 550) backgroundScrollView.contentSize = CGSizeMake(375, 669) self.navigationController?.delegate = self //手势监听器 let edgePan = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(DetailViewController.edgePanGesture(_:))) edgePan.edges = UIRectEdge.Left self.view.addGestureRecognizer(edgePan) } func edgePanGesture(edgePan: UIScreenEdgePanGestureRecognizer) { let progress = edgePan.translationInView(self.view).x / self.view.bounds.width if edgePan.state == UIGestureRecognizerState.Began { self.percentDrivenTransition = UIPercentDrivenInteractiveTransition() self.navigationController?.popViewControllerAnimated(true) } else if edgePan.state == UIGestureRecognizerState.Changed { self.percentDrivenTransition?.updateInteractiveTransition(progress) } else if edgePan.state == UIGestureRecognizerState.Cancelled || edgePan.state == UIGestureRecognizerState.Ended { if progress > 0.5 { self.percentDrivenTransition?.finishInteractiveTransition() } else { self.percentDrivenTransition?.cancelInteractiveTransition() } self.percentDrivenTransition = nil } } func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { if operation == UINavigationControllerOperation.Pop { return MagicMovePopTransion() } else { return nil } } func navigationController(navigationController: UINavigationController, interactionControllerForAnimationController animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { if animationController is MagicMovePopTransion { return self.percentDrivenTransition } else { return nil } } } <file_sep>// // navBarContriller.swift // 04-day // // Created by Adolfrank on 3/19/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class navBarContriller: UINavigationController { override func viewDidLoad() { super.viewDidLoad() } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } } <file_sep>// // MenuTableCell.swift // 18-day // // Created by <NAME> on 16/4/20. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class MenuTableCell: UITableViewCell { @IBOutlet weak var titleLable: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } <file_sep>// // HomeViewController.swift // 12-day // // Created by Adolfrank on 3/26/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class HomeViewController: UITableViewController { @IBOutlet var HomeTable: UITableView! override func viewDidLoad() { super.viewDidLoad() // self.view.backgroundColor = UIColor.redColor() self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None self.tableView.tableFooterView = UIView(frame: CGRectZero) self.tableView.registerClass(HomeCellView.self, forCellReuseIdentifier: "tableCell") self.HomeTable.rowHeight = 60 } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 3 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return tableData.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = HomeTable.dequeueReusableCellWithIdentifier("tableCell", forIndexPath: indexPath) cell.textLabel?.text = tableData[indexPath.row] cell.textLabel?.textColor = UIColor.whiteColor() cell.textLabel?.backgroundColor = UIColor.clearColor() cell.textLabel?.font = UIFont(name: "Avenir Next", size: 18) cell.selectionStyle = UITableViewCellSelectionStyle.None return cell } func colorforIndex(index: Int) -> UIColor { let itemCount = tableData.count - 1 let color = (CGFloat(index) / CGFloat(itemCount)) * 0.6 return UIColor(red: color / 2, green: color, blue: color / 3 , alpha: 1.0) } override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { cell.backgroundColor = colorforIndex(indexPath.row) } override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let Header = HomeTable.dequeueReusableCellWithIdentifier("headerCell") return Header } override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { let height:CGFloat = 60 return height } } <file_sep>// // HomeViewController.swift // 19-day // // Created by <NAME> on 16/4/27. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class HomeViewController: UIViewController { @IBOutlet weak var postBtn: UIButton! override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBarHidden = true postBtn.layer.cornerRadius = 5 } override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent } @IBAction func unwindToMainViewController (sender: UIStoryboardSegue){ self.dismissViewControllerAnimated(true, completion: nil) } } <file_sep>// // HomeViewCell.swift // 05-day // // Created by Adolfrank on 3/20/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class HomeViewCell: UITableViewCell { @IBOutlet weak var bgView: UIImageView! override func awakeFromNib() { super.awakeFromNib() // self.backgroundColor = UIColor.blueColor() bgView.image = UIImage(named: "bg") } // Class 初始化 override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) self.backgroundColor = UIColor.blueColor() } required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder)! } } <file_sep>// // ThirdViewController.swift // 25-day // // Created by <NAME> on 16/5/19. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ThirdViewController: UIViewController { @IBOutlet weak var scaleImageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) UIView.animateWithDuration(0.8, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 1, options: .CurveEaseIn, animations: { () -> Void in self.scaleImageView.transform = CGAffineTransformMakeScale(2, 2) self.scaleImageView.alpha = 1 }, completion: nil ) } } <file_sep>// // ViewController.swift // 20-day // // Created by <NAME> on 16/4/28. // Copyright © 2016年 Frank. All rights reserved. // import UIKit class ViewController: UIViewController, UITextViewDelegate { @IBOutlet weak var textFieldView: UITextView! @IBOutlet weak var bottomBar: UIView! @IBOutlet weak var charCountLable: UILabel! override func viewDidLoad() { super.viewDidLoad() textFieldView.delegate = self NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.keyBoardWillShow(_:)), name: UIKeyboardWillShowNotification, object: nil) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.keyBoardWillHide(_:)), name: UIKeyboardWillHideNotification, object: nil) } func keyBoardWillShow(note:NSNotification) { let userInfo = note.userInfo let keyBoardBounds = (userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue).CGRectValue() let duration = (userInfo![UIKeyboardAnimationDurationUserInfoKey] as! NSNumber).doubleValue let deltaY = keyBoardBounds.size.height let animations:(() -> Void) = { self.bottomBar.transform = CGAffineTransformMakeTranslation(0,-deltaY) } if duration > 0 { let options = UIViewAnimationOptions(rawValue: UInt((userInfo![UIKeyboardAnimationCurveUserInfoKey] as! NSNumber).integerValue << 16)) UIView.animateWithDuration(duration, delay: 0, options:options, animations: animations, completion: nil) }else { animations() } } func keyBoardWillHide(note:NSNotification) { let userInfo = note.userInfo let duration = (userInfo![UIKeyboardAnimationDurationUserInfoKey] as! NSNumber).doubleValue let animations:(() -> Void) = { self.bottomBar.transform = CGAffineTransformIdentity } if duration > 0 { let options = UIViewAnimationOptions(rawValue: UInt((userInfo![UIKeyboardAnimationCurveUserInfoKey] as! NSNumber).integerValue << 16)) UIView.animateWithDuration(duration, delay: 0, options:options, animations: animations, completion: nil) }else{ animations() } } override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { view.endEditing(true) } func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool { let myTextViewString = textFieldView.text charCountLable.text = "\(140 - myTextViewString.characters.count)" if range.length > 140{ return false } let newLength = (myTextViewString?.characters.count)! + range.length return newLength < 140 } } <file_sep>// // ViewController.swift // 05-day // // Created by Adolfrank on 3/19/16. // Copyright © 2016 FrankAdol. All rights reserved. // import UIKit class ViewController: UIViewController,UIScrollViewDelegate, CenterViewControllerDelegate,RightViewControllerDelegate{ @IBOutlet weak var homeScrollView: UIScrollView! let leftVC:LeftViewController = LeftViewController() let centerVC:CenterViewController = CenterViewController() let rightVC:RightViewController = RightViewController() let width:CGFloat = UIScreen.mainScreen().bounds.width var indexA = 0 let x :CGFloat = UIScreen.mainScreen().bounds.width override func viewDidLoad() { super.viewDidLoad() setupVC() scrollViewDidEndScrollingAnimation(homeScrollView) } func setupVC() { self.addChildViewController(leftVC) self.addChildViewController(centerVC) self.addChildViewController(rightVC) self.homeScrollView.contentSize = CGSizeMake(width * 3, 0) self.homeScrollView.delegate = self self.homeScrollView.bounces = false } func scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) { let tmpWidth:CGFloat = homeScrollView.frame.width let tmpHight:CGFloat = homeScrollView.frame.height let tmpOffsetX:CGFloat = homeScrollView.contentOffset.x let index:NSInteger = NSInteger (tmpOffsetX / tmpWidth) let willShowVC:UIViewController = self.childViewControllers[index] if (willShowVC.isViewLoaded() == true){ return } else { willShowVC.view.frame = CGRectMake(tmpOffsetX, 0, tmpWidth, tmpHight) homeScrollView.addSubview(willShowVC.view) } centerVC.delegate = self rightVC.delegate = self } func scrollViewDidEndDecelerating(scrollView: UIScrollView) { let tmpWidth:CGFloat = homeScrollView.frame.width let tmpHight:CGFloat = homeScrollView.frame.height let tmpOffsetX:CGFloat = homeScrollView.contentOffset.x let index:NSInteger = NSInteger (tmpOffsetX / tmpWidth) let willShowVC:UIViewController = self.childViewControllers[index] indexA = index willShowVC.setNeedsStatusBarAppearanceUpdate() if (willShowVC.isViewLoaded() == true){ return } else { willShowVC.view.frame = CGRectMake(tmpOffsetX, 0, tmpWidth, tmpHight) homeScrollView.addSubview(willShowVC.view) } centerVC.delegate = self rightVC.delegate = self } override func childViewControllerForStatusBarHidden() -> UIViewController? { if indexA == 0 { return leftVC } else if indexA == 1 { return centerVC } else if indexA == 2{ return rightVC } else { return nil } } override func childViewControllerForStatusBarStyle() -> UIViewController? { if indexA == 0 { return leftVC } else if indexA == 1 { return centerVC } else if indexA == 2{ return rightVC } else { return nil } } func storiesBtnDidTouch(width: CGFloat) { self.homeScrollView.setContentOffset(CGPointMake(width, 0) , animated: true) } func backBtnDidTouch(width: CGFloat) { self.homeScrollView.setContentOffset(CGPointMake(width, 0) , animated: true) } } <file_sep>// // EditViewController.swift // 16-day // // Created by <NAME> on 16/4/13. // Copyright © 2016年 Frank. All rights reserved. // import UIKit protocol EditViewControllerDelegate:class { func editVCSaveBtnDidTouch(editVC:EditViewController , data: ContactModel) -> Void } class EditViewController: UIViewController { weak var delegate: EditViewControllerDelegate? @IBOutlet weak var editBtn: UIBarButtonItem! @IBOutlet weak var nameField: UITextField! @IBOutlet weak var phoneNumberField: UITextField! @IBOutlet weak var saveBtn: UIButton! var data = ContactModel() override func viewDidLoad() { super.viewDidLoad() nameField.text = data.name phoneNumberField.text = data.phoneNumber } @IBAction func editBtnDidTouch(sender: AnyObject) { if (nameField.enabled == true) { nameField.enabled = false phoneNumberField.enabled = false self.view.endEditing(true) editBtn.title = "编辑" nameField.text = data.name phoneNumberField.text = data.phoneNumber } else { nameField.enabled = true phoneNumberField.enabled = true phoneNumberField.becomeFirstResponder() editBtn.title = "取消" saveBtn.hidden = false } } @IBAction func saveBtnDidTouch(sender: AnyObject) { self.navigationController?.popViewControllerAnimated(true) data.name = nameField.text! data.phoneNumber = phoneNumberField.text! self.delegate?.editVCSaveBtnDidTouch(self, data: data) } } <file_sep>// // ContractsViewController.swift // 16-day // // Created by Adolfrank on 4/12/16. // Copyright © 2016 Frank. All rights reserved. // import UIKit class ContractsViewController: UITableViewController, AddViewControllerDelegate, EditViewControllerDelegate{ @IBOutlet var contactsTable: UITableView! lazy var contactData = [ContactModel]() override func viewDidLoad() { super.viewDidLoad() } @IBAction func logoutBtnDidTouch(sender: AnyObject) { let logoutMenu = UIAlertController(title: "注销", message: "是否要注销?", preferredStyle: .ActionSheet) let logoutAction = UIAlertAction(title: "确认注销", style: .Destructive) { (alert: UIAlertAction) in self.navigationController?.popViewControllerAnimated(true) } let cancelAction = UIAlertAction(title: "取消", style: .Cancel) { (alert: UIAlertAction) in } logoutMenu.addAction(logoutAction) logoutMenu.addAction(cancelAction) self.presentViewController(logoutMenu, animated: true, completion: nil) } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { let toView = segue.destinationViewController if toView.isKindOfClass(AddViewController) { let addVC:AddViewController = toView as! AddViewController addVC.delegate = self } else if toView.isKindOfClass(EditViewController) { let editVC:EditViewController = toView as! EditViewController let path = contactsTable.indexPathForSelectedRow editVC.data = contactData[(path?.row)!] editVC.delegate = self } } // MARK: - Table view data source override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return contactData.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = contactsTable.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) let contact: ContactModel = contactData[indexPath.row] cell.textLabel?.text = contact.name cell.detailTextLabel?.text = contact.phoneNumber return cell } override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? { let edit = UITableViewRowAction(style: .Normal, title: "编辑") { action, index in // let editVC = EditViewController() //// print(self.contactData[indexPath.row].name) // editVC.data = self.contactData[indexPath.row] // editVC.delegate = self // self.navigationController?.pushViewController(editVC, animated: true) } edit.backgroundColor = UIColor.lightGrayColor() let delete = UITableViewRowAction(style:.Normal , title: "删除") { action, index in self.contactData.removeAtIndex(indexPath.row) self.contactsTable.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Bottom) } delete.backgroundColor = UIColor.redColor() return [delete , edit] } // override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { // return true // } // override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { // // you need to implement this method too or you can't swipe to display the actions // } func addViewController(AddVC: AddViewController, Model: ContactModel) { contactData.append(Model) contactsTable.reloadData() } func editVCSaveBtnDidTouch(editVC: EditViewController, data: ContactModel) { contactsTable.reloadData() } }
d63dadd891eb59604bc8845d27d1cf44c54900ec
[ "Swift", "Markdown" ]
56
Swift
adolfrank/Swift_practise
24f0bb0dd01682ffb4305f950a1074e34b1cc0f7
ebeecfa8708a9f3d828cf93ad14a0f7c37a79150
refs/heads/master
<repo_name>dybangel/huiyoufu_api<file_sep>/upload.php <?php $s=dirname(__FILE__); //获的服务器路劲 # ob_start(); # $arr[]=var_dump($_POST); # $result = ob_get_clean(); # //$post=print_r($_POST); # $ff=$s."/uploads/"."post.txt"; # file_put_contents($ff, sizeof($_POST)); //给图片文件写入数据 $time =time(); //获得当前时间戳 for($x=0; $x<sizeof($_POST); $x++){ $files=$_POST['files'.($x+1)]; $file=''; if (strstr($files,",")){ $files = explode(',',$files); $file = $files[1]; } $tmp = base64_decode($file); $fp=$s."/uploads/".$time."-".$x.".jpg"; //确定图片文件位置及名称 //写文件 file_put_contents( $fp, $tmp); //给图片文件写入数据 } // $time =time(); //获得当前时间戳 // $files =$_POST['files1']; // $file=''; // if (strstr($files,",")){ // $files = explode(',',$files); // $file = $files[1]; // } // //$files1 = substr($files1,22); //百度一下就可以知道base64前面一段需要清除掉才能用。 // //解码 // $tmp = base64_decode($file); // $fp=$s."/uploads/".$time.".jpg"; //确定图片文件位置及名称 // //写文件 // file_put_contents( $fp, $tmp); //给图片文件写入数据 // $time =time(); //获得当前时间戳 // $files =$_POST['files2']; // $file=''; // if (strstr($files,",")){ // $files = explode(',',$files); // $file = $files[1]; // } // //$files1 = substr($files1,22); //百度一下就可以知道base64前面一段需要清除掉才能用。 // //解码 // $tmp = base64_decode($file); // $fp=$s."/uploads/".$time."-2".".jpg"; //确定图片文件位置及名称 // //写文件 // file_put_contents( $fp, $tmp); //给图片文件写入数据 echo 1; ?><file_sep>/api.php <?php #跨域访问 /* 会有福服务器API */ $debug=false; header("Access-Control-Allow-Origin: *"); #echo sizeof($_GET); if(sizeof($_GET)==0){ echo "缺少调用参数"; exit; } $str = $_SERVER['QUERY_STRING']; $arr = explode('&', $str); #$res = array(); $pv=""; $pn=""; #k 是数字下标 v是key=value foreach ($arr as $k => $v) { $arr = explode('=', $v); # echo "v=".$v."<br>"; #echo $arr[0]."<br>"; #echo $arr[1]."<br>"; #给数组赋值 if($arr[0]!='action' && $arr[0]!='null'){ if($pv==''){ $pv='"'.$arr[1].'"'; }else{ $pv=$pv.',"'.$arr[1].'"'; } }else{ $pn=$arr[1]; } #$res[$arr[0]] = $arr[1]; } $pv='('.$pv.')'; $dsql="call ".$pn.$pv; if($debug=='true'){ $s=dirname(__FILE__); //获的服务器路劲 $ff=$s."/par.txt"; file_put_contents($ff, $dsql."\r\n",FILE_APPEND); //给图片文件写入数据 } # exit; $action=$_GET['action']; if(isset($_GET['member_id'])){ $member_id=$_GET['member_id']; } $dbhostip="127.0.0.1"; $username="root"; $userpassword="<PASSWORD>"; $dbdatabasename="huiyoufu"; $link=mysqli_connect($dbhostip,$username,$userpassword,$dbdatabasename) or die("Unable to connect to db!"); $link->query("SET NAMES utf8"); #$res=mysqli_query($link,$sql); #字符集 mysqli_query($link,"SET NAMES UTF8"); $result =mysqli_query($link,$dsql); if(!mysqli_affected_rows($link)){ echo json_encode('null');exit; } //var_dump($result);exit; while($row=mysqli_fetch_assoc($result)){ // foreach ($row as $k=>$v) { // $row["$k"] = iconv('GB2312', 'UTF-8', $v); // } //$myarray['array'] = $row; $myarray[] = $row; } echo json_encode($myarray); // echo json_encode((object)$arr); mysqli_close($link); ?>
5d5fc166b0b54aca372b5fea85c0a42ab4fa6ee4
[ "PHP" ]
2
PHP
dybangel/huiyoufu_api
6f43e34c6c33540782129dfdd2fc5a03005bd75c
ac66bd29aa7d4c1c8932273420d1705cf9b7c3bb
refs/heads/master
<repo_name>pradyumnac/STM32<file_sep>/32/arduinoide_stlink/arduino_spi/arduino_spi.ino #include "SPI.h" #define pinLED PC13 #define pinRST PB0 #define pinIRQ PB1 #define pinSPI_SS PA4 #define pinSPI_CLK PA5 #define pinSPI_MISO PA6 #define pinSPI_MOSI PA7 volatile int irqCounter = 0; int lastIrqCounter = 0; void handleIRQ(){ irqCounter++; } void setup(){ pinMode(pinLED, OUTPUT); pinMode(pinSPI_SS, OUTPUT); pinMode(pinRST, OUTPUT); pinMode(pinIRQ, INPUT); Serial.begin(115200); Serial.println("START"); attachInterrupt(pinIRQ, handleIRQ, RISING); // Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high. SPI.begin(); digitalWrite(pinRST, LOW); delay(200); digitalWrite(pinRST, HIGH); delay(100); } void spiTest(){ unsigned long msg = 0; SPI.beginTransaction(SPISettings(16000000L, MSBFIRST, SPI_MODE0)); digitalWrite(pinSPI_SS, LOW); SPI.transfer(0x00); msg = SPI.transfer(0x00); msg = (msg << 8) + SPI.transfer(0x00); msg = (msg << 8) + SPI.transfer(0x00); msg = (msg << 8) + SPI.transfer(0x00); digitalWrite(pinSPI_SS, HIGH); SPI.endTransaction(); Serial.println(msg, HEX); } void loop(){ digitalWrite(pinLED, HIGH); delay(100); digitalWrite(pinLED, LOW); delay(100); if (irqCounter != lastIrqCounter){ Serial.println(irqCounter); lastIrqCounter = irqCounter; } spiTest(); delay(2000); } <file_sep>/32/ec_workspace/Blinky_2/src/main.cpp // // This file is part of the GNU ARM Eclipse distribution. // Copyright (c) 2014 <NAME>. // // ---------------------------------------------------------------------------- #include <stdio.h> #include "diag/Trace.h" #include <stm32f10x.h> // ---------------------------------------------------------------------------- // // STM32F1 empty sample (trace via ITM). // // Trace support is enabled by adding the TRACE macro definition. // By default the trace messages are forwarded to the ITM output, // but can be rerouted to any device or completely suppressed, by // changing the definitions required in system/src/diag/trace_impl.c // (currently OS_USE_TRACE_ITM, OS_USE_TRACE_SEMIHOSTING_DEBUG/_STDOUT). // // ----- main() --------------------------------------------------------------- // Sample pragmas to cope with warnings. Please note the related line at // the end of this function, used to pop the compiler diagnostics status. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wmissing-declarations" #pragma GCC diagnostic ignored "-Wreturn-type" void delay(volatile uint32_t d) { while (d-- != 0) ; } void c_pin_on(volatile uint32_t pin){ GPIOC->ODR |= (1<<pin); // set green LED } void c_pin_off(volatile uint32_t pin){ GPIOC->ODR &= ~(1<<pin); // clr green LED } int main(int argc, char* argv[]) { // At this stage the system clock should have already been configured // at high speed. // Infinite loop RCC->APB2ENR = RCC_APB2ENR_IOPCEN; // enable PORTC GPIOC->CRH = (0b0010 << 20); // CNF=0, MODE=2 (2MHz output) (isto kot 0b 0000 0000 0010 0000 0000 0000 0000 0000) // PC013 //GPIOC->CRH = (0b0010 << 4); // CNF=0, MODE=2 (2MHz output) (isto kot 0b 0000 0000 0000 0000 0000 0000 0010 0000) // PC09 //GPIOC->CRH = (0b0010); // CNF=0, MODE=2 (2MHz output) (isto kot 0b 0000 0000 0000 0000 0000 0000 0010 0000) // PC08 //GPIOC->CRL = (0b0010 << 4); // CNF=0, MODE=2 (2MHz output) (isto kot 0b 0000 0000 0000 0000 0000 0000 0010 0000) // PC01 //GPIOC->CRL = (0b0010); // CNF=0, MODE=2 (2MHz output) (isto kot 0b 0000 0000 0000 0000 0000 0000 0000 0010) // PC00 while (1) { // forever loop c_pin_on(13); // set green LED delay(1000000); c_pin_off(13); // clr green LED delay(800000); } } #pragma GCC diagnostic pop // ---------------------------------------------------------------------------- <file_sep>/README.md # STM32 my Tryst with STMs
b15d9735784afe91a2f8816fc4e4aaaf3c393ab8
[ "Markdown", "C++" ]
3
C++
pradyumnac/STM32
d054ba5970cd34abfe76fccbcb7a3f742164eff2
c7be9d68451b0c10aa640b0ad8a369598530fa8c
refs/heads/master
<file_sep>package eu.wauz.upwardutils; import java.awt.Color; import java.io.File; import java.net.URL; import java.util.Random; /** * Static utility methods, used across the game. * * @author Wauzmons */ public class UpWardUtils { public static final Color TRANSPARENT_COLOR = new Color(0f, 0f, 0f, 0f ); /** * An instance of the random class, to have a fixed seed. */ private static Random random = new Random(); /** * Loads a resource, based on a path, from the given context. * * @param context A class of the project, the resource is contained in. * @param path The path to a resource. * * @return The file from the resources folder. */ public static File getResource(Class<?> context, String path) { ClassLoader classLoader = context.getClassLoader(); URL resource = classLoader.getResource(path); return new File(resource.getFile()); } /** * Rotates a pixel array clockwise. * * @param inputPixels The pixel array to rotate. * @param size The width and height of the pixel array * @param rotation How much the texture should be rotated. 1 equals 90 degrees. * * @return The rotated pixel array. */ public static int[] rotateClockwise(int[] inputPixels, int size, int rotation) { if(rotation == 0) { return inputPixels; } else { int[] pixels = new int[inputPixels.length]; for(int i = rotation; i > 0; i--) { for (int x = 0; x < size; x++) { for (int y = 0; y < size; y++) { pixels[x * size + y] = inputPixels[(size - 1) * size - (((x * size + y) % size) * size) + (x * size + y) / size]; } } } return rotateClockwise(pixels, size, rotation - 1); } } /** * @return A random boolean. */ public static boolean randomBoolean() { return random.nextBoolean(); } /** * @param chance The chance for true between 0 and 1. * * @return A random boolean. */ public static boolean randomBoolean(double chance) { return random.nextDouble() < chance; } /** * @param bound The exclusive maximum value. * * @return A random integer. */ public static int randomInt(int bound) { return random.nextInt(bound); } /** * @param min Minimum returned value. * @param max Maximum returned value. * * @return A random integer between given values. */ public static int randomInt(int min, int max) { return random.nextInt(max - min + 1) + min; } /** * @return a random float. */ public static float randomFloat() { return random.nextFloat(); } } <file_sep>package eu.wauz.upward.game.terraria; import eu.wauz.upward.entity.MovingEntity; import eu.wauz.upward.game.GameBlock; import eu.wauz.upward.game.GameWindow; /** * A renderer for random terraria-like world generation. * * @author Wauzmons */ public class TerrariaRenderer { /** * The pixels for the game window. */ private int[][] pixels; /** * The map, this renderer is working with. */ private TerrariaMap map; /** * The horizontal pixel, where the rendering should start. */ private int startPixelX; /** * The vertical pixel, where the rendering should start. */ private int startPixelY; /** * The horizontal block, where the rendering should start. */ private int startBlockX; /** * The vertical block, where the rendering should start. */ private int startBlockY; /** * The length of a block in pixels. */ private int blockSize = 16; /** * Creates a renderer, that fills out the pixels of the game window. * * @param map The map, this renderer is working with. */ public TerrariaRenderer(TerrariaMap map) { this.map = map; } /** * Runs the renderer, to fill out the window. * TODO: Doing this every frame will totally kill the performance. * * @param window The window, that should be filled with pixels. */ public void render(GameWindow window) { int windowWidth = window.getGameWidth(); int windowHeight = window.getGameHeight(); pixels = new int[windowWidth][windowHeight]; if(!(window.getCurrentCamera() instanceof MovingEntity)) { return; } MovingEntity camera = (MovingEntity) window.getCurrentCamera(); determineStartingBlock(camera.getxPos(), camera.getyPos(), windowWidth, windowHeight); int blockX = startBlockX; for(int pixelX = startPixelX; pixelX < windowWidth + blockSize; pixelX += blockSize) { int blockY = startBlockY; for(int pixelY = startPixelY; pixelY < windowHeight + blockSize; pixelY += blockSize) { if(blockX < 0 || blockY < 0) { continue; } if(blockX >= map.getBlocks().length || blockY >= map.getBlocks()[0].length) { continue; } GameBlock block = map.getBlocks()[blockX][blockY]; block.render(pixels, pixelX, pixelY, 0); blockY++; } blockX++; } int[] pixels = new int[windowWidth * windowHeight]; for(int i = 0; i < pixels.length; i++) { int x = i % windowWidth; int y = (int) Math.ceil(i / windowWidth); window.getPixels()[i] = this.pixels[x][y]; } } /** * Determines the points, where rendering should start. * Used to assure, that only visible blocks are calculated. * * @param centerX The x postion of the camera. * @param centerY The y postion of the camera. * @param pixelsX The total visible pixels on the x axis. * @param pixelsY The total visible pixels on the y axis. */ public void determineStartingBlock(double centerX, double centerY, int pixelsX, int pixelsY) { startBlockX = (int) Math.floor(centerX); startBlockY = (int) Math.floor(centerY); int offsetX = getOffsetPixels(centerX); int offsetY = getOffsetPixels(centerY); for(int currentX = pixelsX / 2 - offsetX; currentX > - blockSize; currentX -= blockSize) { startPixelX = currentX; startBlockX -= 1; } for(int currentY = pixelsY / 2 - offsetY; currentY > - blockSize; currentY -= blockSize) { startPixelY = currentY; startBlockY -= 1; } } /** * How many pixels the coordinate is offset from the full (.0) block position. * Used for calculating screen locations of blocks, that are only partially visible. * * @param exactCoordinate The decimal coordinate of the camera. * @return How many pixels it is from the .0 block position. */ public int getOffsetPixels(double exactCoordinate) { double remains = exactCoordinate % 1; double pixelSize = 1.0 / blockSize; return (int) (remains / pixelSize); } /** * @return The length of a block in pixels. */ public int getBlockSize() { return blockSize; } /** * @param blockSize The new length of a block in pixels. */ public void setBlockSize(int blockSize) { this.blockSize = blockSize; } } <file_sep>package eu.wauz.uwt; import java.awt.Color; import java.awt.FlowLayout; import java.awt.LayoutManager; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JPanel; import javax.swing.border.TitledBorder; /** * A basic container with flow or box layout. * * @author Wauzmons */ public class UFlow extends JPanel { /** * This element's UUID. */ private static final long serialVersionUID = 1580312346517621084L; /** * Initializes an empty flow panel. * * @param vertical If the flow should be vertical. */ public UFlow(boolean vertical) { LayoutManager layout; if(vertical) { layout = new BoxLayout(this, vertical ? BoxLayout.Y_AXIS : BoxLayout.X_AXIS); } else { layout = new FlowLayout(); } setLayout(layout); setBackground(Color.BLACK); } /** * Adds a title border around the flow panel. * * @param text The title of the panel. */ public void addTitle(String text) { TitledBorder border = BorderFactory.createTitledBorder(text); border.setTitleColor(Color.WHITE); setBorder(border); } } <file_sep>package eu.wauz.upward.entity.doom; import eu.wauz.upward.game.doom.DoomMap; /** * A test entity, that can move across a pseudo 3D doom map. * Is invisible and can only rotate and move forward. * * @author Wauzmons * * @see DoomEntity * @see DoomMap */ public class DoomTestEntity extends DoomEntity { /** * Creates a new entity, with given starting position. * * @param xPos * @param yPos * @param xDir * @param yDir * @param xPlane * @param yPlane */ public DoomTestEntity(double xPos, double yPos, double xDir, double yDir, double xPlane, double yPlane) { super(xPos, yPos, xDir, yDir, xPlane, yPlane); } /** * Moves rotates, while constantly moving forward, if possible. */ @Override public void updatePosition(int[][] map) { if(true) { moveForward(map); } if(true) { rotate(rotationSpeed); } } } <file_sep>package eu.wauz.upward.game.terraria; import java.awt.Color; import eu.wauz.upward.game.GameMap; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.generation.CellularAutomaton; import eu.wauz.upward.generation.ResourceSpawner; import eu.wauz.upward.generation.VegetationSpawner; /** * A map for random terraria-like world outlines. * * @author Wauzmons */ public class CellularAutomatonMap extends GameMap { /** * The pixels for the game window. */ private int[] pixels; /** * Creates a new cellular automaton map with the size of the given map matrix. * * @param mapMatrix The empty game map, for measurement. */ public CellularAutomatonMap(int[][] mapMatrix) { super(mapMatrix, null, false); } /** * Runs the renderer, to fill out the window. * * @param window The window, that should be filled with pixels. * * @see CellularAutomatonMap#generate() */ @Override public void render(GameWindow window) { generate(); for(int i = 0; i < window.getPixels().length; i++) { window.getPixels()[i] = pixels[i]; } } /** * Creates a new cellular automaton, for a new map. * Automatically maps values to pixel colors. * * @see CellularAutomaton */ public void generate() { CellularAutomaton automaton = new CellularAutomaton(mapWidth, mapHeight).withTerrariaPreset(); ResourceSpawner resourceSpawner = new ResourceSpawner(automaton); resourceSpawner.setMinDeadNeighbours(4); resourceSpawner.setMinDepth(100); resourceSpawner.setMaxDepth(250); resourceSpawner.run(2, 0.030f); resourceSpawner.setMinDepth(150); resourceSpawner.setMaxDepth(300); resourceSpawner.run(3, 0.025f); resourceSpawner.setMinDepth(200); resourceSpawner.setMaxDepth(350); resourceSpawner.run(4, 0.020f); VegetationSpawner vegetationSpawner = new VegetationSpawner(automaton); vegetationSpawner.run(5, 0.3f); int[][] cellMatrix = automaton.getCellMatrix(); pixels = new int[mapWidth * mapHeight]; for(int i = 0; i < pixels.length; i++) { int x = i; int y = 0; while (x >= mapWidth) { x -= mapWidth; y++; } Color color; switch (cellMatrix[x][y]) { case 1: color = Color.ORANGE; break; case 2: color = Color.GREEN; break; case 3: color = Color.CYAN; break; case 4: case 5: color = Color.MAGENTA; break; default: color = Color.DARK_GRAY; break; } pixels[i] = color.getRGB(); } } } <file_sep>package eu.wauz.upward.demo; import java.awt.Color; import eu.wauz.upward.entity.isaac.IsaacEntityFactory; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.game.isaac.IsaacMap; import eu.wauz.upward.textures.GameTexture; import eu.wauz.upward.textures.GameTileset; /** * A demo application to show the capabilities of the engine. * Renders a randomly generated top down rougelike world for an Isaac clone. * TODO: Split into multiple methods and update documentation. * * @author Wauzmons * * @see IsaacMap */ public class IsaacDemo implements Runnable { /** * The Isaac Map is initialized with an empty array, to determine the room size. * A tileset is created by loading textures from the resources. * The Isaac Map creates 32x32 sized blocks from the assigned textures. * A 416x288 pixel window with doubled size and 40 fps is created, to load the random map. * A controllable 2D camera is added to the map, before the game starts. * * @see GameWindow */ @Override public void run() { int[][] mapMatrix = new int[13][9]; GameTileset tileset = new GameTileset(); GameTexture floorTexture = new GameTexture("images/isaac/floor.png", 32); floorTexture.addAlternatives(new GameTexture(Color.RED.darker().darker(), 32)); tileset.add(floorTexture); tileset.add(new GameTexture("images/isaac/wall.png", 32)); tileset.add(new GameTexture("images/isaac/corner.png", 32)); tileset.add(new GameTexture("images/isaac/door_closed.png", 32)); tileset.add(new GameTexture("images/isaac/door_opened.png", 32)); IsaacMap map = new IsaacMap(mapMatrix, tileset); map.setBlockSize(32); GameWindow game = new GameWindow(416, 288, 2); game.setFps(40); game.loadMap(map); IsaacEntityFactory.placeCamera(game, 6, 4); IsaacEntityFactory.placeTestEntity(game, 2, 6); IsaacEntityFactory.placeTestEntity(game, 10, 2); game.setTitle("The Binding of Joe"); game.start(); } } <file_sep>package eu.wauz.upward.entity.isaac; import java.awt.Color; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.textures.GameTexture; /** * TODO: Document me! * * @author Wauzmons */ public class IsaacEntityFactory { public static void placeCamera(GameWindow game, double xPos, double yPos) { IsaacCamera camera = new IsaacCamera(xPos + pixelsToBlock(8), yPos + pixelsToBlock(6)); camera.setTexture(new GameTexture("images/isaac/joe.png", 32)); camera.setShotTexture(new GameTexture(Color.CYAN, 8)); camera.setShotSize(0.25); camera.setOffsetTop(pixelsToBlock(6)); camera.setOffsetBottom(pixelsToBlock(1)); camera.setOffsetLeft(pixelsToBlock(8)); camera.setOffsetRight(pixelsToBlock(8)); game.placeCamera(camera); } public static void placeTestEntity(GameWindow game, double xPos, double yPos) { IsaacTestEntity entity = new IsaacTestEntity(xPos + pixelsToBlock(5), yPos + pixelsToBlock(5)); entity.setTexture(new GameTexture("images/isaac/flungus.png", 32)); entity.setOffsetTop(pixelsToBlock(5)); entity.setOffsetBottom(pixelsToBlock(1)); entity.setOffsetLeft(pixelsToBlock(5)); entity.setOffsetRight(pixelsToBlock(5)); game.placeEntity(entity); } private static double pixelsToBlock(int pixels) { return 0.03125 * pixels; } } <file_sep>package eu.wauz.upward.entity.isaac; import eu.wauz.upward.UpWardOptions; import eu.wauz.upward.entity.interfaces.Collidable; import eu.wauz.upward.game.isaac.IsaacMap; /** * A projectile, that can damage entities on an isaac map. * * @author Wauzmons * * @see IsaacEntity * @see IsaacMap */ public class IsaacProjectile extends IsaacEntity { /** * The entity who shot this projectile. */ private IsaacEntity shooter; /** * In how many ticks, the entity will die. */ private int ticksTillDeath = 30; /** * Creates a new projectile, with given starting position. * * @param shooter The entity who shot this projectile. * @param The size of this projectile's hitbox in blocks. * @param direction The direction, where every increase is a 90 degree rotation. * @param faction The faction (player, enemy) id that this entity belongs to. */ public IsaacProjectile(IsaacEntity shooter, double size, int direction, int faction) { super( shooter.getxPos() + (shooter.getSize() - size) / 2 - shooter.getOffsetLeft(), shooter.getyPos() + (shooter.getSize() - size) / 2 - shooter.getOffsetTop()); this.shooter = shooter; setSize(size); setFaction(faction); setMovementSpeed(0.14); switch (direction) { case 0: up = true; break; case 1: right = true; break; case 2: down = true; break; case 3: left = true; break; default: break; } UpWardOptions.WINDOWS.getMainWindow().placeEntity(this); } /** * Lets the projectile fly in its direction, till it dies. */ @Override public void updatePosition(int[][] map) { if(ticksTillDeath == 0) { UpWardOptions.WINDOWS.getMainWindow().removeEntity(this); return; } else { ticksTillDeath--; } if(up) { moveUp(map); } if(down) { moveDown(map); } if(left) { moveLeft(map); } if(right) { moveRight(map); } } /** * Called when the entity collides with another. * * @param entity The other entity. */ @Override public void collide(Collidable entity) { if(entity == null || getFaction() < entity.getFaction()) { UpWardOptions.WINDOWS.getMainWindow().removeEntity(this); } } /** * @return The entity who shot this projectile. */ public IsaacEntity getShooter() { return shooter; } /** * @param shooter The new entity who shot this projectile. */ public void setShooter(IsaacEntity shooter) { this.shooter = shooter; } /** * @return In how many ticks, the entity will die. */ public int getTicksTillDeath() { return ticksTillDeath; } /** * @param ticksTillDeath In how many ticks, the entity will die. */ public void setTicksTillDeath(int ticksTillDeath) { this.ticksTillDeath = ticksTillDeath; } } <file_sep>package eu.wauz.upward.game.isaac; import java.util.ArrayList; import java.util.List; import eu.wauz.upward.UpWardOptions; import eu.wauz.upward.entity.MovingEntity; import eu.wauz.upward.entity.isaac.IsaacCamera; import eu.wauz.upward.entity.isaac.IsaacDoor; import eu.wauz.upward.game.GameBlock; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.textures.GameTileset; /** * A single room of a map for top down rougelike worlds. * * @author Wauzmons */ public class IsaacRoom { /** * The floor, that this room is located in. */ private IsaacFloor floor; /** * The pixels for the game window, that stay the same for this room. */ private int[][] staticPixels; /** * The width of the room in blocks. */ private int width; /** * The height of the room in blocks. */ private int height; /** * The length of a block in pixels. */ private int blockSize = 16; /** * The tileset to use, for texturing the map. */ private GameTileset tileset; /** * All entities located in this room. */ private List<MovingEntity> entities = new ArrayList<>(); /** * The neighbour rooms of this room. */ private IsaacRoom topRoom, bottomRoom, leftRoom, rightRoom; /** * Creates a new isaac room with the given sizes. * * @param floor The floor, that this room is located in. * @param width The width of the room in blocks. * @param height The height of the room in blocks. * @param blockSize The length of a block in pixels. * @param tileset The tileset to use, for texturing the map. */ public IsaacRoom(IsaacFloor floor, int width, int height, int blockSize, GameTileset tileset) { this.floor = floor; this.width = width; this.height = height; this.blockSize = blockSize; this.tileset = tileset; } /** * Generates the pixels for the game window, that stay the same for this room. */ public void generateStaticPixels() { GameWindow window = UpWardOptions.WINDOWS.getMainWindow(); staticPixels = new int[window.getGameWidth()][window.getGameHeight()]; renderWalls(); renderFloor(); renderCorners(); renderOpenDoors(); } /** * Renders the floor, based on the tileset. */ public void renderFloor() { GameBlock floorBlock = new GameBlock(tileset.get(1), blockSize); for(int x = 1; x < width - 1; x++) { for(int y = 1; y < height - 1; y++) { floorBlock.render(staticPixels, x * blockSize, y * blockSize, 0); } } } /** * Renders the walls, based on the tileset. */ public void renderWalls() { GameBlock wallBlock = new GameBlock(tileset.get(2), blockSize); int rightEdge = (width - 1) * blockSize; int bottomEdge = (height - 1) * blockSize; for(int x = 1; x < width - 1; x++) { wallBlock.render(staticPixels, x * blockSize, 0, 0); wallBlock.render(staticPixels, x * blockSize, bottomEdge, 2); } for(int y = 1; y < height - 1; y++) { wallBlock.render(staticPixels, 0, y * blockSize, 3); wallBlock.render(staticPixels, rightEdge, y * blockSize, 1); } } /** * Renders the corners, based on the tileset. */ public void renderCorners() { GameBlock cornerBlock = new GameBlock(tileset.get(3), blockSize); int rightEdge = (width - 1) * blockSize; int bottomEdge = (height - 1) * blockSize; cornerBlock.render(staticPixels, 0, 0, 0); cornerBlock.render(staticPixels, rightEdge, 0, 1); cornerBlock.render(staticPixels, rightEdge, bottomEdge, 2); cornerBlock.render(staticPixels, 0, bottomEdge, 3); } /** * Renders open doors, based on the tileset. */ public void renderOpenDoors() { GameBlock openDoorBlock = new GameBlock(tileset.get(5), blockSize); if(topRoom != null) { entities.add(new IsaacDoor(topRoom, width / 2, 0.1)); openDoorBlock.render(staticPixels, (width / 2) * blockSize, 0, 0); } if(rightRoom != null) { entities.add(new IsaacDoor(rightRoom, width - 1.1, height / 2)); openDoorBlock.render(staticPixels, (width - 1) * blockSize, (height / 2) * blockSize, 1); } if(bottomRoom != null) { entities.add(new IsaacDoor(bottomRoom, width / 2, height - 1.1)); openDoorBlock.render(staticPixels, (width / 2) * blockSize, (height - 1) * blockSize, 2); } if(leftRoom != null) { entities.add(new IsaacDoor(leftRoom, 0.1, height / 2)); openDoorBlock.render(staticPixels, 0, (height / 2) * blockSize, 3); } } /** * Loads all entities in this room into the game window. */ public void loadEntities() { GameWindow window = UpWardOptions.WINDOWS.getMainWindow(); for(MovingEntity entity : entities) { window.placeEntity(entity); } } /** * Unloads all entities from the game window, back to this room. * The camera is kept in the window, but teleported to the opposite end. */ public void unloadEntities() { entities.clear(); GameWindow window = UpWardOptions.WINDOWS.getMainWindow(); for(MovingEntity entity : new ArrayList<>(window.getEntities())) { if(entity instanceof IsaacCamera) { IsaacCamera camera =(IsaacCamera) entity; double xPos = camera.getxPos(); double yPos = camera.getyPos(); if(xPos > width - 3) { camera.setxPos(1 + camera.getOffsetLeft()); } if(xPos < 3) { camera.setxPos(width - 1 - camera.getOffsetRight() - (camera.getSize() / 2)); } if(yPos > height - 3) { camera.setyPos(1 + camera.getOffsetTop()); } if(yPos < 3) { camera.setyPos(height - 1 - camera.getOffsetBottom() - camera.getSize()); } } else { window.removeEntity(entity); entities.add(entity); } } } /** * @return The floor, that this room is located in. */ public IsaacFloor getFloor() { return floor; } /** * @return The pixels for the game window, that stay the same for this room. */ public int[][] getStaticPixels() { return staticPixels; } /** * @return The top neighbour room of this room. */ public IsaacRoom getTopRoom() { return topRoom; } /** * @param topRoom The new top neighbour room of this room. */ public void setTopRoom(IsaacRoom topRoom) { this.topRoom = topRoom; } /** * @return The bottom neighbour room of this room. */ public IsaacRoom getBottomRoom() { return bottomRoom; } /** * @param bottomRoom The new bottom neighbour room of this room. */ public void setBottomRoom(IsaacRoom bottomRoom) { this.bottomRoom = bottomRoom; } /** * @return The left neighbour room of this room. */ public IsaacRoom getLeftRoom() { return leftRoom; } /** * @param leftRoom The new left neighbour room of this room. */ public void setLeftRoom(IsaacRoom leftRoom) { this.leftRoom = leftRoom; } /** * @return The right neighbour room of this room. */ public IsaacRoom getRightRoom() { return rightRoom; } /** * @param rightRoom The new right neighbour room of this room. */ public void setRightRoom(IsaacRoom rightRoom) { this.rightRoom = rightRoom; } } <file_sep>package eu.wauz.upward.demo; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.game.isaac.RoomLayoutMap; /** * A demo application to show the capabilities of the engine. * Renders a randomly generated floor outline for an Isaac clone. * * @author Wauzmons * * @see IsaacDemo Full Demo * @see RoomLayoutMap */ public class IsaacRoomLayoutDemo implements Runnable { /** * The Room Layout Map is initialized with an empty array, * that will hold the map data, that is freshly generated every frame. * A 21x21 pixel window with 16x size and 0.5 fps is created, to load the map. * * @see GameWindow */ @Override public void run() { int width = 21; int height = 21; int[][] mapMatrix = new int[width][height]; RoomLayoutMap map = new RoomLayoutMap(mapMatrix); GameWindow game = new GameWindow(width, height, 16); game.setFps(0.5); game.loadMap(map); game.setTitle("Room Layout"); game.start(); } } <file_sep>package eu.wauz.upward.game.isaac; import java.awt.Color; import eu.wauz.upward.game.GameMap; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.generation.PathGenerator; /** * A map for random paths. * * @author Wauzmons */ public class PathMap extends GameMap { /** * The pixels for the game window. */ private int[] pixels; /** * Creates a new path map with the size of the given map matrix. * * @param mapMatrix The empty game map, for measurement. */ public PathMap(int[][] mapMatrix) { super(mapMatrix, null, false); } /** * Runs the renderer, to fill out the window. * * @param window The window, that should be filled with pixels. * * @see PathMap#generate() */ @Override public void render(GameWindow window) { generate(); for(int i = 0; i < window.getPixels().length; i++) { window.getPixels()[i] = pixels[i]; } } /** * Creates a new path generator, for a new map. * Automatically maps values to pixel colors. * * @see PathGenerator */ public void generate() { PathGenerator generator = new PathGenerator(mapWidth, mapHeight); generator.run(); int[][] pathMatrix = generator.getPathMatrix(); pixels = new int[mapWidth * mapHeight]; for(int i = 0; i < pixels.length; i++) { int x = i; int y = 0; while (x >= mapWidth) { x -= mapWidth; y++; } Color color; switch (pathMatrix[x][y]) { case 1: color = Color.ORANGE; break; default: color = Color.DARK_GRAY; break; } pixels[i] = color.getRGB(); } } } <file_sep>package eu.wauz.upward.entity.terraria; import java.awt.event.KeyEvent; import eu.wauz.upward.UpWardOptions; import eu.wauz.upward.entity.MovingEntity; import eu.wauz.upward.entity.interfaces.Controller; import eu.wauz.upward.game.terraria.TerrariaMap; /** * A camera entity, that can move freely across a terraria map. * * @author Wauzmons * * @see TerrariaMap */ public class TerrariaCamera extends MovingEntity implements Controller { /** * If the entity is moving in this direction. */ private boolean up, down, left, right; /** * Creates a new entity, with given starting position. * * @param xPos * @param yPos * @param xDir * @param yDir * @param xPlane * @param yPlane */ public TerrariaCamera(double xPos, double yPos, double xDir, double yDir, double xPlane, double yPlane) { super(xPos, yPos, xDir, yDir, xPlane, yPlane); movementSpeed = 0.25; } /** * Determine what to do if a key is typed. */ @Override public void keyTyped(KeyEvent key) { } /** * Determine what to do if a key is pressed. * Starts directional movement. */ @Override public void keyPressed(KeyEvent key) { if(key.getKeyCode() == UpWardOptions.CONTROLS.getMoveForward()) { up = true; } else if(key.getKeyCode() == UpWardOptions.CONTROLS.getMoveBackward()) { down = true; } else if(key.getKeyCode() == UpWardOptions.CONTROLS.getRotateLeft()) { left = true; } else if(key.getKeyCode() == UpWardOptions.CONTROLS.getRotateRight()) { right = true; } } /** * Determine what to do if a key is released. * Stops directional movement. */ @Override public void keyReleased(KeyEvent key) { if(key.getKeyCode() == UpWardOptions.CONTROLS.getMoveForward()) { up = false; } else if(key.getKeyCode() == UpWardOptions.CONTROLS.getMoveBackward()) { down = false; } else if(key.getKeyCode() == UpWardOptions.CONTROLS.getRotateLeft()) { left = false; } else if(key.getKeyCode() == UpWardOptions.CONTROLS.getRotateRight()) { right = false; } } /** * Moves into the active directions, if possible. */ @Override public void updatePosition(int[][] map) { if(up) { moveUp(map); } if(down) { moveDown(map); } if(left) { moveLeft(map); } if(right) { moveRight(map); } } /** * Moves up. * * @param map The map to move on. */ public void moveUp(int[][] map) { yPos -= movementSpeed; } /** * Moves down. * * @param map The map to move on. */ public void moveDown(int[][] map) { yPos += movementSpeed; } /** * Moves left. * * @param map The map to move on. */ public void moveLeft(int[][] map) { xPos -= movementSpeed; } /** * Moves right. * * @param map The map to move on. */ public void moveRight(int[][] map) { xPos += movementSpeed; } } <file_sep>package eu.wauz.upward.game; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import eu.wauz.upward.UpWardOptions; /** * The default listener of a game window. * Used to handle game independent key events. * * @author Wauzmons */ public class GameWindowListener implements KeyListener { /** * If the info string should be visible in the game window. */ private boolean showInfoString = false; /** * Determine what to do if a key is typed. */ @Override public void keyTyped(KeyEvent e) { } /** * Determine what to do if a key is pressed. * Function 3 toggles the info string display. */ @Override public void keyPressed(KeyEvent key) { if(key.getKeyCode() == UpWardOptions.CONTROLS.getFunction03()) { showInfoString = !showInfoString; } } /** * Determine what to do if a key is released. */ @Override public void keyReleased(KeyEvent e) { } /** * Checks if the info string should be shown. * * @return If the info string should be visible in the game window. */ public boolean isShowInfoString() { return showInfoString; } } <file_sep>package eu.wauz.upward.demo; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.game.terraria.CellularAutomatonMap; /** * A demo application to show the capabilities of the engine. * Renders a randomly generated world outline for a Terraria clone. * * @author Wauzmons * * @see TerrariaDemo Full Demo * @see CellularAutomatonMap */ public class TerrariaCellularAutomataDemo implements Runnable { /** * The Cellular Automaton Map is initialized with an empty array, * that will hold the map data, that is freshly generated every frame. * A 1200x350 pixel window with 1 fps is created, to load the map. * * @see GameWindow */ @Override public void run() { int width = 1200; int height = 350; int[][] mapMatrix = new int[width][height]; CellularAutomatonMap map = new CellularAutomatonMap(mapMatrix); GameWindow game = new GameWindow(width, height, 1); game.setFps(1); game.loadMap(map); game.setTitle("Cellular Automaton"); game.start(); } } <file_sep>package eu.wauz.uwt; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; /** * A basic push button. * * @author Wauzmons */ public class UButton extends JButton { /** * This element's UUID. */ private static final long serialVersionUID = 5261994755986197919L; /** * Initializes a push button, which executes the given runnable. * * @param text The label of the button. * @param runnable The action of the button. */ public UButton(String text, final Runnable runnable) { setFocusPainted(false); setForeground(Color.WHITE); setBackground(Color.BLACK); setText(text); addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { runnable.run(); } }); } /** * Changes the foreground of the button. * * @param color The new color. * * @return The recolored button. */ public UButton withForeground(Color color) { setForeground(color); return this; } /** * Changes the background of the button. * * @param color The new color. * * @return The recolored button. */ public UButton withBackground(Color color) { setBackground(color); return this; } } <file_sep>package eu.wauz.upward.entity.isaac; import eu.wauz.upward.entity.Hitbox; import eu.wauz.upward.entity.MovingEntity; import eu.wauz.upward.entity.interfaces.Collidable; import eu.wauz.upward.entity.interfaces.Visible; import eu.wauz.upward.game.GameMap; import eu.wauz.upward.game.isaac.IsaacMap; import eu.wauz.upward.textures.GameTexture; /** * An entity, that can move and shoot across an isaac map. * * @author Wauzmons * * @see MovingEntity * @see IsaacMap */ public abstract class IsaacEntity extends MovingEntity implements Visible, Collidable { /** * If the entity is moving in this direction. */ protected boolean up, down, left, right; /** * The faction (player, enemy) id that this entity belongs to. */ protected int faction = 0; /** * The size of the entity's hitbox in blocks. */ private double size = 1; /** * The top offset of the entity's hitbox in blocks. */ private double offsetTop = 0; /** * The bottom offset of the entity's hitbox in blocks. */ private double offsetBottom = 0; /** * The left offset of the entity's hitbox in blocks. */ private double offsetLeft = 0; /** * The right offset of the entity's hitbox in blocks. */ private double offsetRight = 0; /** * The entity's current hitbox. */ private Hitbox hitbox; /** * The appearance of this entity. */ private GameTexture texture; /** * Creates a new entity, with given starting position. * * @param xPos * @param yPos */ public IsaacEntity(double xPos, double yPos) { super(xPos, yPos, 0, 0, 0, 0); hitbox = new Hitbox(xPos, yPos, size, size); } /** * Moves up, if possible. * * @param map The map to move on. */ public void moveUp(int[][] map) { move(map, xPos, yPos - getRegulatedMovementSpeed()); } /** * Moves down, if possible. * * @param map The map to move on. */ public void moveDown(int[][] map) { move(map, xPos, yPos + getRegulatedMovementSpeed()); } /** * Moves left, if possible. * * @param map The map to move on. */ public void moveLeft(int[][] map) { move(map, xPos - getRegulatedMovementSpeed(), yPos); } /** * Moves right, if possible. * * @param map The map to move on. */ public void moveRight(int[][] map) { move(map, xPos + getRegulatedMovementSpeed(), yPos); } /** * Moves the entity, if possible. * * @param map The map to move on. * @param xPosNew The x position to move to. * @param yPosNew The y position to move to. */ public void move(int[][] map, double xPosNew, double yPosNew) { if(map [(int) xPosNew] [(int) yPos] == 0 && map [(int) Math.ceil(xPosNew + size - offsetLeft - offsetRight) - 1] [(int) yPos] == 0) { xPos = xPosNew; } else { xPos = xPosNew > xPos ? (Math.floor(xPosNew) + offsetLeft + offsetRight) : Math.ceil(xPosNew); collide(null); } if(map [(int) xPos] [(int) yPosNew] == 0 && map [(int) xPos] [(int) Math.ceil(yPosNew + size - offsetTop - offsetBottom) - 1] == 0) { yPos = yPosNew; } else { yPos = yPosNew > yPos ? (Math.floor(yPosNew) + offsetTop + offsetBottom) : Math.ceil(yPosNew); collide(null); } resizeHitbox(); } /** * Recalculates size and position of the entity's hitbox. */ public void resizeHitbox() { hitbox.resize(xPos, yPos, size - offsetLeft - offsetRight, size - offsetTop - offsetBottom); hitbox.checkForCollisions(this); } /** * Regulates the movement speed, by reducing it, if the entity moves vertically. * * @return The regulated movement speed. */ public double getRegulatedMovementSpeed() { return (up || down) && (left || right) ? movementSpeed / 1.4142 : movementSpeed; } /** * Runs the renderer, to place the entity in the window. * * @param window The game map, where the entity is located. */ @Override public void render(GameMap map) { if(!(map instanceof IsaacMap)) { return; } IsaacMap isaacMap = (IsaacMap) map; int[][] pixels = isaacMap.getPixels(); int blockSize = isaacMap.getBlockSize(); int startX = getStartingPixel(xPos - offsetLeft, blockSize); int startY = getStartingPixel(yPos - offsetTop, blockSize); texture.render(pixels, startX, startY); drawGui(pixels); } /** * Finds the coordinate, where the rendering should start. * * @param exactCoordinate The decimal coordinate of the entity. * @param blockSize The length of a block in pixels. * * @return The pixel where rendering should start. */ public int getStartingPixel(double exactCoordinate, int blockSize) { int startingPixel = ((int) Math.floor(exactCoordinate)) * blockSize; double remains = exactCoordinate % 1; double pixelSize = 1.0 / blockSize; int offsetPixels = (int) (remains / pixelSize); return startingPixel + offsetPixels; } /** * Called when the entity collides with another. * * @param entity The other entity. */ @Override public void collide(Collidable entity) { } /** * @return The size of the entity's hitbox in blocks. */ public double getSize() { return size; } /** * @param size The new size of the entity's hitbox in blocks. */ public void setSize(double size) { this.size = size; resizeHitbox(); } /** * @return The top offset of the entity's hitbox in blocks. */ public double getOffsetTop() { return offsetTop; } /** * @param offsetTop The new top offset of the entity's hitbox in blocks. */ public void setOffsetTop(double offsetTop) { this.offsetTop = offsetTop; resizeHitbox(); } /** * @return The bottom offset of the entity's hitbox in blocks. */ public double getOffsetBottom() { return offsetBottom; } /** * @param offsetBottom The new bottom offset of the entity's hitbox in blocks. */ public void setOffsetBottom(double offsetBottom) { this.offsetBottom = offsetBottom; resizeHitbox(); } /** * @return The left offset of the entity's hitbox in blocks. */ public double getOffsetLeft() { return offsetLeft; } /** * @param offsetLeft The new left offset of the entity's hitbox in blocks. */ public void setOffsetLeft(double offsetLeft) { this.offsetLeft = offsetLeft; resizeHitbox(); } /** * @return The right offset of the entity's hitbox in blocks. */ public double getOffsetRight() { return offsetRight; } /** * @param offsetRight The new right offset of the entity's hitbox in blocks. */ public void setOffsetRight(double offsetRight) { this.offsetRight = offsetRight; resizeHitbox(); } /** * @return The entity's current hitbox. */ @Override public Hitbox getHitbox() { return hitbox; } /** * @param hitbox The entity's new hitbox. */ public void setHitbox(Hitbox hitbox) { this.hitbox = hitbox; } /** * @return The appearance of this entity. */ public GameTexture getTexture() { return texture; } /** * @param texture The new appearance of this entity. */ public void setTexture(GameTexture texture) { this.texture = texture; } /** * The faction (player, enemy) id that this entity belongs to. */ @Override public int getFaction() { return faction; } /** * @param faction The new faction (player, enemy) id that this entity belongs to. */ public void setFaction(int faction) { this.faction = faction; } } <file_sep>package eu.wauz.upward.entity.isaac; /** * Factions represent groups of entities, that help to determine, * how they interact with each other. * Each faction has a fixed integer id. * * @author Wauzmons */ public class IsaacFaction { /** * The faction id of players. */ public final static int PLAYER = 100; /** * The faction id of projectiles of players. */ public final static int PLAYER_PROJECTILE = 110; /** * The faction id of enemies or other harmful objects. */ public final static int ENEMY = 600; } <file_sep>package eu.wauz.upward.game; import eu.wauz.upward.textures.GameTexture; import eu.wauz.upwardutils.UpWardUtils; /** * A block with a square shaped texture for creating 2D worlds. * * @author Wauzmons */ public class GameBlock { /** * The texture of the block. */ private GameTexture texture; /** * The length of the block in pixels. */ private int blockSize; /** * If entities can walk through this block. */ private boolean passable = false; /** * Creates a block with given texture and size. * * @param texture The texture of the block. * @param blockSize The length of the block in pixels. */ public GameBlock(GameTexture texture, int blockSize) { this.texture = texture; this.blockSize = blockSize; } /** * Renders the block at the given position. * * @param pixels The array, that the block will be rendered into. * @param startX The left pixel to start. * @param startY The top pixel to start. * @param rotation How much the texture should be rotated. 1 equals 90 degrees. */ public void render(int[][] pixels, int startX, int startY, int rotation) { int[] texturePixels = UpWardUtils.rotateClockwise(texture.getPixels(), blockSize, rotation); int pixel = -1; for(int pixelY = startY; pixelY < startY + blockSize && pixelY < pixels[0].length; pixelY++) { for(int pixelX = startX; pixelX < startX + blockSize && pixelX < pixels.length; pixelX++) { pixel++; if(pixelX < 0 || pixelY < 0) { continue; } pixels[pixelX][pixelY] = texturePixels[pixel]; } } } /** * @return If entities can walk through this block. */ public boolean isPassable() { return passable; } /** * @param passable If entities can walk through this block now. */ public void setPassable(boolean passable) { this.passable = passable; } /** * @return The texture of the block. */ public GameTexture getTexture() { return texture; } /** * @param texture The new texture of the block. */ public void setTexture(GameTexture texture) { this.texture = texture; } } <file_sep># UpWard [![CodeFactor](https://www.codefactor.io/repository/github/sevenducks/upward/badge)](https://www.codefactor.io/repository/github/sevenducks/upward) [![codebeat badge](https://codebeat.co/badges/39fb1e9c-2e24-4f6e-aa8b-774bf28a4d35)](https://codebeat.co/projects/github-com-sevenducks-upward-master) [![JDK](https://img.shields.io/badge/Java-Oracle%20JDK%2011-orange.svg)](https://www.oracle.com/technetwork/java/javase/downloads/index.html) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/SevenDucks/UpWard)](https://shields.io/category/size) Seven Ducks Java Game Framework <file_sep>package eu.wauz.uwt; import java.awt.Color; import java.awt.Toolkit; import javax.swing.JFrame; import eu.wauz.upwardutils.UpWardUtils; /** * The base of a top-level window with a title and a border. * * @author Wauzmons */ public class UFrame extends JFrame { /** * This element's UUID. */ private static final long serialVersionUID = -413955229682582547L; /** * Initializes an empty frame. */ public UFrame() { String iconPath = UpWardUtils.getResource(getClass(), "images/icon.png").getAbsolutePath(); setIconImage(Toolkit.getDefaultToolkit().getImage(iconPath)); setTitle("UpWard"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBackground(Color.BLACK); } /** * Centers the window and sets its visibility to true. */ public void open() { setLocationRelativeTo(null); setVisible(true); } } <file_sep>package eu.wauz.upward.entity.interfaces; /** * Allows an entity to be damaged or die. * * @author Wauzmons */ public interface Damageable { /** * @return How much life the entity currently has. */ public int getHitpoints(); /** * @param hitpoints How much life the entity has now. */ public void setHitpoints(int hitpoints); /** * @return How much life the entity can maximally have. */ public int getMaximumHitpoints(); /** * @param maxHitpoints How much life the entity can maximally have now. */ public void setMaxHitpoints(int maxHitpoints); /** * Changes the entity's hitpoints by the given amount. * Can take positive, aswell as negative values. * If the new value exceeds the maximum, it will be set to the maximum. * If it falls to or below 0, the entity will die. * * @param amount By how much to change the hitpoints. * * @see Damageable#die() */ public default void changeHitpoints(int amount) { int newHitpoints = getHitpoints() + amount; if(newHitpoints > getMaximumHitpoints()) { newHitpoints = getMaximumHitpoints(); } else if(amount < 0 && getHitCooldownTicks() == 0) { if(newHitpoints <= 0) { setHitpoints(0); die(); } else { setHitpoints(newHitpoints); setHitCooldownTicks(getInvincibilityTicks()); } } } /** * Called if the entity runs out of hitpoints. * * @see Damageable#changeHitpoints(int) */ public void die(); /** * @return The default amount of hit cooldown ticks that will be set. */ public default int getInvincibilityTicks() { return 10; } /** * @return The amount of ticks, till the next hit is possible. * * @see Damageable#changeHitpoints(int) Automatically set on hitpoint change. */ public int getHitCooldownTicks(); /** * @param hitCooldownTicks The new amount of ticks, till the next hit is possible. * * @see Damageable#changeHitpoints(int) Automatically set on hitpoint change. */ public void setHitCooldownTicks(int hitCooldownTicks); } <file_sep>package eu.wauz.upward.entity; import java.awt.Rectangle; import java.util.ArrayList; import eu.wauz.upward.UpWardOptions; import eu.wauz.upward.entity.interfaces.Collidable; /** * A hitbox for collision detection of entities. * * @author Wauzmons */ public class Hitbox { /** * The rectangle, that represents the hitbox size and position. */ Rectangle rectangle; /** * Creates a new hitbox with given size and position. * * @param xPos * @param yPos * @param width * @param height */ public Hitbox(double xPos, double yPos, double width, double height) { resize(xPos, yPos, width, height); } /** * Sets the hitbox size and position. * * @param xPos * @param yPos * @param width * @param height */ public void resize(double xPos, double yPos, double width, double height) { rectangle = new Rectangle((int) (xPos * 10000), (int) (yPos * 10000), (int) (width * 10000), (int) (height * 10000)); } /** * Lets intersecting entities collide. * * @param entity The entity that owns this hitbox. */ public void checkForCollisions(Collidable entity) { for(MovingEntity otherEntity : new ArrayList<>(UpWardOptions.WINDOWS.getMainWindow().getEntities())) { if(!(otherEntity instanceof Collidable)) { continue; } Collidable collidable = ((Collidable) otherEntity); if(!collidable.equals(entity) && collidable.getHitbox().intersects(this)) { entity.collide(collidable); collidable.collide(entity); } } } /** * @param hitbox Another hitbox. * * @return If the hitboxes intersect. */ public boolean intersects(Hitbox hitbox) { return rectangle.intersects(hitbox.getRectangle()); } /** * @return The rectangle, that represents the hitbox size and position. */ public Rectangle getRectangle() { return rectangle; } } <file_sep>package eu.wauz.upward.demo; import java.awt.Color; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.game.doom.DoomMap; import eu.wauz.upward.textures.GameTexture; import eu.wauz.upward.textures.GameTileset; /** * A demo application to show the capabilities of the engine. * Renders a pseudo 3D level from an array by using raycasting. * * @author Wauzmons * * @see DoomMap */ public class DoomDemo implements Runnable { /** * Initializes an array of integers, that represents the game map. * A tileset is created by loading textures from the resources. * The integers correspond to the textures, in the order they have been added. * A 720x480 pixel window with 60 fps is created, to load the map. * A controllable 3D camera and an invisible entity are added to the map. * After setting title and background music, the game is started. * * @see GameWindow */ @Override public void run() { int[][] mapMatrix = { {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1}, {1,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1}, {1,1,1,1,0,0,0,0,0,1,1,2,1,1,0,0,0,1}, {1,1,1,1,0,0,0,0,0,1,1,2,1,1,0,0,0,1}, {1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1}, {3,0,0,0,1,0,0,0,0,0,0,0,0,1,0,2,0,1}, {1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1}, {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {1,1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {1,1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1}, {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} }; GameTileset tileset = new GameTileset(); tileset.add(new GameTexture("images/doom/104.png", 64)); tileset.add(new GameTexture("images/doom/105.png", 64)); tileset.add(new GameTexture(Color.BLACK, 64)); DoomMap map = new DoomMap(mapMatrix, tileset); map.setCeilingColor(Color.ORANGE); GameWindow game = new GameWindow(720, 480, 1); game.setFps(60); game.loadMap(map); game.placeDoomCamera(2, 10); game.placeDoomEntity(2, 15); game.setTitle("WOOM"); game.setBgmPath("sound/doom/d_e1m1.mid"); game.start(); } } <file_sep>package eu.wauz.upward.generation; import eu.wauz.upwardutils.UpWardUtils; /** * A two dimensional cellular automaton. * It saves its cell states in an array of integers. * Can be used for map generation and other things. * * @author Wauzmons */ public class CellularAutomaton { /** * The width of the cell matrix. */ private int width; /** * The height of the cell matrix. */ private int height; /** * The 2D array, to save cell states. */ private int[][] cellMatrix; /** * The chance that a cell starts alive. */ private float chanceToStartAlive = 0.3f; /** * If a dead cell has at least this amount of neighbours, it will be reborn. */ private int birthLimit = 4; /** * If a living cell has less than this amount of neighbours, it will die. */ private int deathLimit = 3; /** * The top space that is guaranteed to start alive. */ private int livingYSpaceTop = 0; /** * The bottom space that is guaranteed to start alive. */ private int livingYSpaceBottom = 0; /** * The left space that is guaranteed to start alive. */ private int livingXSpaceLeft = 0; /** * The right space that is guaranteed to start alive. */ private int livingXSpaceRight = 0; /** * The top space that is guaranteed to start dead. */ private int deadYSpaceTop = 0; /** * The botton space that is guaranteed to start dead. */ private int deadYSpaceBottom = 0; /** * The left space that is guaranteed to start dead. */ private int deadXSpaceLeft = 0; /** * The right space that is guaranteed to start dead. */ private int deadXSpaceRight = 0; /** * Creates a new cellular automaton with given sizes. * * @param width The width of the cell matrix. * @param height The height of the cell matrix. */ public CellularAutomaton(int width, int height) { this.width = width; this.height = height; cellMatrix = new int[width][height]; } /** * Lets the automaton run, to generate the cell matrix. * * @param numberOfSteps How many generations the automaton will go through. */ public void run(int numberOfSteps) { generateCells(); for(int i = 0; i < numberOfSteps; i++) { progressCells(); } } /** * Generates the initial cells for the matrix. */ public void generateCells() { for(int x = 0; x < width; x++) { for(int y = 0; y < height; y++) { boolean alive; if(livingYSpaceTop > y || height - livingYSpaceBottom < y || livingXSpaceLeft > x || width - livingXSpaceRight < x) { alive = true; } else if(deadYSpaceTop > y || height - deadYSpaceBottom < y || deadXSpaceLeft > x || width - deadXSpaceRight < x) { alive = false; } else { alive = UpWardUtils.randomFloat() < chanceToStartAlive; } cellMatrix[x][y] = alive ? 1 : 0; } } } /** * Progresses the cells to the next generation. */ public void progressCells() { int[][] newMatrix = new int[width][height]; for(int x = 0; x < width; x++) { for(int y = 0; y < height; y++) { int neighbourCount = countLivingNeighbours(x, y); boolean wasAlive = cellMatrix[x][y] == 1; if(wasAlive) { newMatrix[x][y] = neighbourCount >= deathLimit ? 1 : 0; } else { newMatrix[x][y] = neighbourCount > birthLimit ? 1 : 0; } } } cellMatrix = newMatrix; } /** * @param x The x coordinate of a cell. * @param y The y coordinate of a cell. * * @return How many living neighbours that cell has. */ public int countLivingNeighbours(int x, int y) { int result = 0; for(int stepX = -1; stepX < 2; stepX++) { for(int stepY = -1; stepY < 2; stepY++) { if(stepX == 0 && stepY == 0) { continue; } int neighbourX = x + stepX; int neighbourY = y + stepY; boolean outsideXBounds = neighbourX < 0 || neighbourX >= width; boolean outsideYBounds = neighbourY < 0 || neighbourY >= height; if(outsideXBounds || outsideYBounds || cellMatrix[neighbourX][neighbourY] == 1) { result++; } } } return result; } /** * @param x The x coordinate of a cell. * @param y The y coordinate of a cell. * @return How many dead neighbours that cell has. */ public int countDeadNeighbours(int x, int y) { return 8 - countLivingNeighbours(x, y); } /** * @return A configured automaton, with a generated cave room. */ public CellularAutomaton withCavePreset() { setChanceToStartAlive(0.46f); setBirthLimit(4); setDeathLimit(4); setLivingYSpaceTop(8); setLivingYSpaceBottom(8); setLivingXSpaceLeft(8); setLivingXSpaceRight(8); run(8); return this; } /** * @return A configured automaton, with a generated terraria style world. */ public CellularAutomaton withTerrariaPreset() { setChanceToStartAlive(0.28f); setBirthLimit(3); setDeathLimit(3); setLivingYSpaceTop(100); setLivingYSpaceBottom(30); setDeadXSpaceLeft(15); setDeadXSpaceRight(15); run(18); return this; } /** * @return The width of the cell matrix. */ public int getWidth() { return width; } /** * @param width The new width of the cell matrix. */ public void setWidth(int width) { this.width = width; } /** * @return The height of the cell matrix. */ public int getHeight() { return height; } /** * @param height The new height of the cell matrix. */ public void setHeight(int height) { this.height = height; } /** * @return The 2D array, to save cell states. */ public int[][] getCellMatrix() { return cellMatrix; } /** * @return The chance that a cell starts alive. */ public float getChanceToStartAlive() { return chanceToStartAlive; } /** * @param chanceToStartAlive The new chance that a cell starts alive. */ public void setChanceToStartAlive(float chanceToStartAlive) { this.chanceToStartAlive = chanceToStartAlive; } /** * @return If a dead cell has at least this amount of neighbours, it will be reborn. */ public int getBirthLimit() { return birthLimit; } /** * @param birthLimit If a dead cell has at least this new amount of neighbours, it will be reborn. */ public void setBirthLimit(int birthLimit) { this.birthLimit = birthLimit; } /** * @return If a living cell has less than this amount of neighbours, it will die. */ public int getDeathLimit() { return deathLimit; } /** * @param deathLimit If a living cell has less than this new amount of neighbours, it will die. */ public void setDeathLimit(int deathLimit) { this.deathLimit = deathLimit; } /** * @return The top space that is guaranteed to start alive. */ public int getLivingYSpaceTop() { return livingYSpaceTop; } /** * @param livingYSpaceTop The new top space that is guaranteed to start alive. */ public void setLivingYSpaceTop(int livingYSpaceTop) { this.livingYSpaceTop = livingYSpaceTop; } /** * @return The bottom space that is guaranteed to start alive. */ public int getLivingYSpaceBottom() { return livingYSpaceBottom; } /** * @param livingYSpaceBottom The new bottom space that is guaranteed to start alive. */ public void setLivingYSpaceBottom(int livingYSpaceBottom) { this.livingYSpaceBottom = livingYSpaceBottom; } /** * @return The left space that is guaranteed to start alive. */ public int getLivingXSpaceLeft() { return livingXSpaceLeft; } /** * @param livingXSpaceLeft The new left space that is guaranteed to start alive. */ public void setLivingXSpaceLeft(int livingXSpaceLeft) { this.livingXSpaceLeft = livingXSpaceLeft; } /** * @return The right space that is guaranteed to start alive. */ public int getLivingXSpaceRight() { return livingXSpaceRight; } /** * @param livingXSpaceRight The new right space that is guaranteed to start alive. */ public void setLivingXSpaceRight(int livingXSpaceRight) { this.livingXSpaceRight = livingXSpaceRight; } /** * @return The top space that is guaranteed to start dead. */ public int getDeadYSpaceTop() { return deadYSpaceTop; } /** * @param deadYSpaceTop The new top space that is guaranteed to start dead. */ public void setDeadYSpaceTop(int deadYSpaceTop) { this.deadYSpaceTop = deadYSpaceTop; } /** * @return The bottom space that is guaranteed to start dead. */ public int getDeadYSpaceBottom() { return deadYSpaceBottom; } /** * @param deadYSpaceBottom The new bottom space that is guaranteed to start dead. */ public void setDeadYSpaceBottom(int deadYSpaceBottom) { this.deadYSpaceBottom = deadYSpaceBottom; } /** * @return The left space that is guaranteed to start dead. */ public int getDeadXSpaceLeft() { return deadXSpaceLeft; } /** * @param deadXSpaceLeft The new left space that is guaranteed to start dead. */ public void setDeadXSpaceLeft(int deadXSpaceLeft) { this.deadXSpaceLeft = deadXSpaceLeft; } /** * @return The right space that is guaranteed to start dead. */ public int getDeadXSpaceRight() { return deadXSpaceRight; } /** * @param deadXSpaceRight The new right space that is guaranteed to start dead. */ public void setDeadXSpaceRight(int deadXSpaceRight) { this.deadXSpaceRight = deadXSpaceRight; } } <file_sep>package eu.wauz.upward.entity.interfaces; import eu.wauz.upward.entity.Hitbox; /** * Allows an entity to collide with others. * * @author Wauzmons */ public interface Collidable { /** * Called when the entity collides with another. * * @param entity The other entity. */ public void collide(Collidable entity); /** * @return The entity's current hitbox. */ public Hitbox getHitbox(); /** * @return The faction (player, enemy) id that this entity belongs to. */ public int getFaction(); } <file_sep>/** * This package contains a collection of util classes. */ package eu.wauz.upwardutils;<file_sep>package eu.wauz.upward.game; import java.awt.Color; import java.awt.Graphics2D; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import java.awt.image.DataBufferInt; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.FloatControl; import eu.wauz.upward.UpWardOptions; import eu.wauz.upward.entity.MovingEntity; import eu.wauz.upward.entity.doom.DoomCamera; import eu.wauz.upward.entity.doom.DoomTestEntity; import eu.wauz.upward.entity.interfaces.Controller; import eu.wauz.upwardutils.UpWardUtils; import eu.wauz.uwt.UFrame; /** * The game window is the most important part of a game. * It displays the map and entities and handles user input. * It lets events run on a fixed framerate. * * @author Wauzmons * * @see UFrame */ public class GameWindow extends UFrame implements Runnable { /** * This element's UUID. */ private static final long serialVersionUID = 5941362699534781057L; /** * The main thread of the game. */ private Thread mainThread = new Thread(this); /** * If the main thread is running. */ private boolean isMainThreadRunning; /** * The width of the game window. */ private int width = 640; /** * The height of the game window. */ private int height = 480; /** * The scale of the window, where 1 is 100 percent. */ private double scale = 1; /** * The size of the top border. */ private int insetTop; /** * The size of the bottom border. */ private int insetBottom; /** * The size of the left border. */ private int insetLeft; /** * The size of the right border. */ private int insetRight; /** * The title of the game window. */ private String title; /** * The text shown in the top of the window. */ private String infoString = ""; /** * The image of the game window. */ private BufferedImage display; /** * The pixels of the image of the game window. */ private int[] pixels; /** * The targeted frames per second. */ private double fps = 30; /** * The current game map. */ private GameMap currentMap; /** * The current game camera. */ private Controller currentCamera; /** * The default listener of the window. */ private GameWindowListener defaultListener; /** * All moving entities, located on the map. */ private List<MovingEntity> entities = new ArrayList<>(); /** * The background music, running in a loop. */ private Clip bgm; /** * The path of the background music resource. */ private String bgmPath; /** * A formatter for making log friendly numbers. */ private static DecimalFormat formatter = new DecimalFormat("#,#00.000"); /** * Initializes a game window with given size. * * @param width The width of the game window. * @param height The height of the game window. * @param scale The size of the window, where 1 is 100 percent. */ public GameWindow(int width, int height, int scale) { this.width = width; this.height = height; this.scale = scale; initialize(); } /** * Initializes an empty game window. */ public GameWindow() { initialize(); } /** * Loads the displayed image, aswell as window listener, size, title, background and visibility. */ private void initialize() { UpWardOptions.WINDOWS.setMainWindow(this); defaultListener = new GameWindowListener(); addKeyListener(defaultListener); display = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); pixels = ((DataBufferInt) display.getRaster().getDataBuffer()).getData(); if(width == 0 || height == 0) { setExtendedState(MAXIMIZED_BOTH); } else { int containerWidth = (int) (width * scale); int containerHeight = (int) (height * scale); setSize(containerWidth, containerHeight); } setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { stop(); dispose(); } }); open(); } /** * Starts the main thread. */ public synchronized void start() { insetTop = getInsets().top; insetBottom = getInsets().bottom; insetLeft = getInsets().left; insetRight = getInsets().right; setSize(getWidth() + insetLeft + insetRight, getHeight() + insetTop + insetBottom); isMainThreadRunning = true; mainThread.start(); System.out.println("Running: " + getTitle()); } /** * Stops the main thread. */ public synchronized void stop() { isMainThreadRunning = false; try { mainThread.join(); if(bgm != null) { bgm.stop(); } System.out.println("Stopped: " + getTitle()); } catch(Exception e) { e.printStackTrace(); } } /** * Lets the main thread run a loop with music and images updates every iteration. * The map and entities are updated at the given framerate. */ @Override public void run() { long lastRun = System.nanoTime(); final double interval = 1000000000.0 / (double) fps; double delta = 0; requestFocus(); try { if(bgmPath != null) { AudioInputStream audioIn; audioIn = AudioSystem.getAudioInputStream(UpWardUtils.getResource(getClass(), bgmPath)); bgm = AudioSystem.getClip(); bgm.open(audioIn); bgm.setLoopPoints(0, -1); FloatControl gainControl = (FloatControl) bgm.getControl(FloatControl.Type.MASTER_GAIN); float range = gainControl.getMaximum() - gainControl.getMinimum(); float gain = (range * 0.75f) + gainControl.getMinimum(); gainControl.setValue(gain); bgm.loop(Clip.LOOP_CONTINUOUSLY); } } catch (Exception e) { e.printStackTrace(); } while(isMainThreadRunning) { long thisRun = System.nanoTime(); delta = delta + ((thisRun - lastRun) / interval); lastRun = thisRun; while (delta >= 1) { long nanos = System.nanoTime(); currentMap.render(this); for(MovingEntity entity : new ArrayList<>(entities)) { entity.updatePosition(currentMap.getMapMatrix()); } delta--; String time = formatter.format((double) (System.nanoTime() - nanos) / 1000000); infoString = "Render-Time: " + time + " / " + formatter.format(1000 / fps); } render(); } } /** * Draws the image onto the window. */ public void render() { try { BufferStrategy bufferStrategy = getBufferStrategy(); if(bufferStrategy == null) { createBufferStrategy(3); bufferStrategy = getBufferStrategy(); return; } Graphics2D graphics = (Graphics2D) bufferStrategy.getDrawGraphics(); graphics.drawImage(display, insetLeft, insetTop, getSize().width - insetRight, getSize().height - insetBottom, 0, 0, display.getWidth(), display.getHeight(), null); if(defaultListener.isShowInfoString()) { graphics.setColor(Color.GREEN); graphics.drawString(infoString, insetLeft + 5, getSize().height - insetBottom - 5); } bufferStrategy.show(); } catch (Exception e) { e.printStackTrace(); } } /** * @param map The new game map. */ public void loadMap(GameMap map) { currentMap = map; } /** * Places a pseudo 3D camera, for doom-like levels. * * @param matrixX The camera's x position on the map matrix. * @param matrixY The camera's y position on the map matrix. */ public void placeDoomCamera(int matrixX, int matrixY) { currentCamera = new DoomCamera(matrixY + 0.5, currentMap.getMapWidth() - (matrixX + 0.5), 1, 0, 0, -0.7); if(currentCamera instanceof MovingEntity) { entities.add((MovingEntity) currentCamera); } addKeyListener(currentCamera); } /** * @param camera The new game camera with key listener. */ public void placeCamera(Controller camera) { removeCamera(); currentCamera = camera; if(currentCamera instanceof MovingEntity) { entities.add((MovingEntity) currentCamera); } addKeyListener(currentCamera); } /** * Removes the current camera and its key listener. */ public void removeCamera() { if(currentCamera == null) { return; } if(currentCamera instanceof MovingEntity) { entities.remove((MovingEntity) currentCamera); } removeKeyListener(currentCamera); } /** * Places an entity, for doom-like levels. * * @param matrixX The entity's x position on the map matrix. * @param matrixY The entity's y position on the map matrix. */ public void placeDoomEntity(int matrixX, int matrixY) { MovingEntity entity = new DoomTestEntity(matrixY + 0.5, currentMap.getMapWidth() - (matrixX + 0.5), 1, 0, 0, -0.7); entities.add(entity); } /** * Places an entity. * * @param entity The entity to place. */ public void placeEntity(MovingEntity entity) { entities.add(entity); } /** * Removes an entity. * * @param entity The entity to remove. */ public void removeEntity(MovingEntity entity) { entities.remove(entity); } /** * @return The width of the game window. */ public int getGameWidth() { return width; } /** * @return The height of the game window. */ public int getGameHeight() { return height; } /** * @return The pixels of the image of the game window. */ public int[] getPixels() { return pixels; } /** * @param pixels The new pixels of the image of the game window. */ public void setPixels(int[] pixels) { this.pixels = pixels; } /** * @return The title of the game window. */ public String getTitle() { return title; } /** * @param The new title of the game window. */ public void setTitle(String title) { this.title = title; super.setTitle(title); } /** * @return The targeted frames per second. */ public double getFps() { return fps; } /** * @param fps The new targeted frames per second. */ public void setFps(double fps) { this.fps = fps; } /** * @return The current game map. */ public GameMap getCurrentMap() { return currentMap; } /** * @return The current game camera. */ public Controller getCurrentCamera() { return currentCamera; } /** * @return All moving entities, located on the map. */ public List<MovingEntity> getEntities() { return entities; } /** * @param All new moving entities, located on the map. */ public void setEntities(List<MovingEntity> entities) { this.entities = entities; } /** * @return The path of the background music resource. */ public String getBgmPath() { return bgmPath; } /** * @param bgmPath The new path of the background music resource. */ public void setBgmPath(String bgmPath) { this.bgmPath = bgmPath; } } <file_sep>package eu.wauz.upward.game.doom; import java.awt.Color; import eu.wauz.upward.game.GameMap; import eu.wauz.upward.game.GameWindow; import eu.wauz.upward.textures.GameTileset; /** * A map for pseudo 3D doom-like levels. * * @author Wauzmons */ public class DoomMap extends GameMap { /** * The renderer, that fills out the pixels of the game window. */ private DoomRenderer renderer = new DoomRenderer(this); /** * Creates a new doom map from the given map matrix. * * @param mapMatrix The game map, values correspond to the textures in the tileset. * @param tileset The tileset to use, for texturing the map. */ public DoomMap(int[][] mapMatrix, GameTileset tileset) { super(mapMatrix, tileset, true); } /** * Runs the renderer, to fill out the window. * * @param window The window, that should be filled with pixels. * * @see DoomRenderer */ @Override public void render(GameWindow window) { renderer.render(window); } /** * @return The color of the level's ceiling. */ public Color getCeilingColor() { return renderer.getCeilingColor(); } /** * @param ceilingColor The new color of the level's ceiling. */ public void setCeilingColor(Color ceilingColor) { renderer.setCeilingColor(ceilingColor); } /** * @return The color of the level's floor. */ public Color getFloorColor() { return renderer.getFloorColor(); } /** * @param floorColor The new color of the level's floor. */ public void setFloorColor(Color floorColor) { renderer.setFloorColor(floorColor); } }
30b11eb3b313f6de625778a8d97502c895b32531
[ "Markdown", "Java" ]
28
Java
SevenDucks/UpWard
ba4b63245862b3db9434e5941549846f27f18191
553323062feee7cec8741902a6ed0d4f67ebb4f2
refs/heads/master
<repo_name>ngohoang291990/vemaybay<file_sep>/COMMOM/Interface/ISetting.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using Model.EF; namespace COMMOM.Interface { public class ISetting { public static string GetSettingValue(string key) { CW_Setting obj = new CW_Setting(); using (var db = new MVCDbContext()) { obj = db.CW_Setting.Where(x => x.SettingKey == key).FirstOrDefault(); if (obj != null) return obj.SettingValue; } return "nothing"; } public static string GetSettingCheckValue(string key) { CW_Setting obj = new CW_Setting(); using (var db = new MVCDbContext()) { obj = db.CW_Setting.Where(x => x.SettingKey == key).FirstOrDefault(); if (obj != null) return obj.SettingValue; else return null; } // return ""; } public static bool CheckMenu(List<CW_Menu> obj, string menucode) { bool flag = false; if (obj.Count > 0) { foreach (CW_Menu item in obj) { if (item.MenuCode.Equals(menucode)) { flag = true; break; } } } return flag; } public static bool CheckKeyIsExist(string key) { bool check = false; using (var db = new MVCDbContext()) { IEnumerable<CW_Setting> objbind = db.CW_Setting.OrderBy(x => x.CreatedDate); foreach (CW_Setting info in objbind) { if (info.SettingKey.Equals(key)) { check = true; break; } } } return check; } public static string SettingValue(string key, string group, string defaultvalue, string settingcomment) { CW_Setting model = new CW_Setting(); model.SettingKey = key; model.SettingValue = defaultvalue; if (group.Equals("")) { model.SettingGroup = "Config"; } else { model.SettingGroup = group; } model.SettingComment = settingcomment; model.CreatedDate = DateTime.Now; using (var db = new MVCDbContext()) { if (!CheckKeyIsExist(key)) { db.Set<CW_Setting>().Add(model); db.SaveChanges(); } else return "Trùng key mất rồi, nhập key khác đi"; } return model.SettingValue; } public static string GetLanguage(string lang) { string rtL = ""; using (var db = new MVCDbContext()) { CW_Language strrtL = db.CW_Language.Where(x => x.LanguageCode.Equals(lang)).FirstOrDefault(); if (strrtL != null) rtL = strrtL.Title; } return rtL; } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/EmailController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class EmailController : BaseController { // // GET: /Admin/Email/ MVCDbContext db=new MVCDbContext(); public ActionResult Index() { var email = db.CW_Email.OrderByDescending(x => x.CreatedDate); return View(email); } [HttpPost] public ActionResult Delete(int id) { var email = db.Set<CW_Email>().Find(id); if (email != null) { var catedelte = db.CW_Email.Attach(email); db.Set<CW_Email>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } } } <file_sep>/Model/Migrations/201608081313573_InitNews.cs namespace Model.Migrations { using System; using System.Data.Entity.Migrations; public partial class InitNews : DbMigration { public override void Up() { DropForeignKey("dbo.CW_Album", "CategoryID", "dbo.CW_Category"); DropForeignKey("dbo.CW_AlbumImages", "AlbumID", "dbo.CW_Album"); DropForeignKey("dbo.CW_Album", "LanguageCode", "dbo.CW_Language"); DropForeignKey("dbo.CW_Category_UpdatePrice", "CategoryID", "dbo.CW_Category"); DropForeignKey("dbo.CW_Category_UpdatePrice", "UpdatePriceID", "dbo.CW_UpdatePrice"); DropForeignKey("dbo.CW_File", "CategoryID", "dbo.CW_Category"); DropForeignKey("dbo.CW_File", "LanguageCode", "dbo.CW_Language"); DropForeignKey("dbo.CW_Product", "CategoryID", "dbo.CW_Category"); DropForeignKey("dbo.CW_FQAProduct", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_Product", "LanguageCode", "dbo.CW_Language"); DropForeignKey("dbo.CW_Option_Rule_SetValue", "OptionRuleID", "dbo.CW_OptionRule"); DropForeignKey("dbo.CW_Option_Rule_SetValue", "ProductOptionSetValueID", "dbo.CW_ProductOptionSetValue"); DropForeignKey("dbo.CW_Product", "ProductOptionID", "dbo.CW_ProductOption"); DropForeignKey("dbo.CW_Product_Option_OptionSet", "ProductOptionID", "dbo.CW_ProductOption"); DropForeignKey("dbo.CW_Product_Option_OptionSet", "ProductOptionSetID", "dbo.CW_ProductOptionSet"); DropForeignKey("dbo.CW_ProductOptionSetValue", "ProductOptionSetID", "dbo.CW_ProductOptionSet"); DropForeignKey("dbo.CW_Option_Rule_Value", "OptionRuleID", "dbo.CW_OptionRule"); DropForeignKey("dbo.CW_Option_Rule_Value", "OptionRuleValueID", "dbo.CW_OptionRuleValue"); DropForeignKey("dbo.CW_OptionRule", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_Message", "UserId", "dbo.CW_Customers"); DropForeignKey("dbo.CW_Order", "UserId", "dbo.UserProfile"); DropForeignKey("dbo.CW_MessageReply", "MessageID", "dbo.CW_Message"); DropForeignKey("dbo.CW_Message", "OrderID", "dbo.CW_Order"); DropForeignKey("dbo.CW_OrderDetail", "OrderID", "dbo.CW_Order"); DropForeignKey("dbo.CW_Order", "OrderStatusID", "dbo.CW_OrderStatus"); DropForeignKey("dbo.CW_OrderDetail", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_ProductField", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_ProductImages", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_ProductTab", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_Reviews", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_Product", "VendorID", "dbo.CW_Vendor"); DropForeignKey("dbo.CW_Wishlist", "ProductID", "dbo.CW_Product"); DropForeignKey("dbo.CW_VideoClip", "CategoryID", "dbo.CW_Category"); DropForeignKey("dbo.CW_VideoClip", "LanguageCode", "dbo.CW_Language"); DropForeignKey("dbo.CW_OpinionAboutUs", "LanguageCode", "dbo.CW_Language"); DropIndex("dbo.CW_Album", new[] { "CategoryID" }); DropIndex("dbo.CW_Album", new[] { "LanguageCode" }); DropIndex("dbo.CW_AlbumImages", new[] { "AlbumID" }); DropIndex("dbo.CW_Category_UpdatePrice", new[] { "UpdatePriceID" }); DropIndex("dbo.CW_Category_UpdatePrice", new[] { "CategoryID" }); DropIndex("dbo.CW_File", new[] { "CategoryID" }); DropIndex("dbo.CW_File", new[] { "LanguageCode" }); DropIndex("dbo.CW_Product", new[] { "CategoryID" }); DropIndex("dbo.CW_Product", new[] { "LanguageCode" }); DropIndex("dbo.CW_Product", new[] { "VendorID" }); DropIndex("dbo.CW_Product", new[] { "ProductOptionID" }); DropIndex("dbo.CW_FQAProduct", new[] { "ProductID" }); DropIndex("dbo.CW_OptionRule", new[] { "ProductID" }); DropIndex("dbo.CW_Option_Rule_SetValue", new[] { "ProductOptionSetValueID" }); DropIndex("dbo.CW_Option_Rule_SetValue", new[] { "OptionRuleID" }); DropIndex("dbo.CW_ProductOptionSetValue", new[] { "ProductOptionSetID" }); DropIndex("dbo.CW_Product_Option_OptionSet", new[] { "ProductOptionID" }); DropIndex("dbo.CW_Product_Option_OptionSet", new[] { "ProductOptionSetID" }); DropIndex("dbo.CW_Option_Rule_Value", new[] { "OptionRuleValueID" }); DropIndex("dbo.CW_Option_Rule_Value", new[] { "OptionRuleID" }); DropIndex("dbo.CW_OrderDetail", new[] { "OrderID" }); DropIndex("dbo.CW_OrderDetail", new[] { "ProductID" }); DropIndex("dbo.CW_Order", new[] { "UserId" }); DropIndex("dbo.CW_Order", new[] { "OrderStatusID" }); DropIndex("dbo.CW_Message", new[] { "OrderID" }); DropIndex("dbo.CW_Message", new[] { "UserId" }); DropIndex("dbo.CW_MessageReply", new[] { "MessageID" }); DropIndex("dbo.CW_ProductField", new[] { "ProductID" }); DropIndex("dbo.CW_ProductImages", new[] { "ProductID" }); DropIndex("dbo.CW_ProductTab", new[] { "ProductID" }); DropIndex("dbo.CW_Reviews", new[] { "ProductID" }); DropIndex("dbo.CW_Wishlist", new[] { "ProductID" }); DropIndex("dbo.CW_VideoClip", new[] { "CategoryID" }); DropIndex("dbo.CW_VideoClip", new[] { "LanguageCode" }); DropIndex("dbo.CW_OpinionAboutUs", new[] { "LanguageCode" }); DropTable("dbo.CW_Album"); DropTable("dbo.CW_AlbumImages"); DropTable("dbo.CW_Category_UpdatePrice"); DropTable("dbo.CW_UpdatePrice"); DropTable("dbo.CW_File"); DropTable("dbo.CW_Product"); DropTable("dbo.CW_FQAProduct"); DropTable("dbo.CW_OptionRule"); DropTable("dbo.CW_Option_Rule_SetValue"); DropTable("dbo.CW_ProductOptionSetValue"); DropTable("dbo.CW_ProductOptionSet"); DropTable("dbo.CW_Product_Option_OptionSet"); DropTable("dbo.CW_ProductOption"); DropTable("dbo.CW_Option_Rule_Value"); DropTable("dbo.CW_OptionRuleValue"); DropTable("dbo.CW_OrderDetail"); DropTable("dbo.CW_Order"); DropTable("dbo.CW_Message"); DropTable("dbo.CW_MessageReply"); DropTable("dbo.CW_OrderStatus"); DropTable("dbo.CW_ProductField"); DropTable("dbo.CW_ProductImages"); DropTable("dbo.CW_ProductTab"); DropTable("dbo.CW_Reviews"); DropTable("dbo.CW_Vendor"); DropTable("dbo.CW_Wishlist"); DropTable("dbo.CW_VideoClip"); DropTable("dbo.CW_OpinionAboutUs"); } public override void Down() { CreateTable( "dbo.CW_OpinionAboutUs", c => new { OpinionAboutUsID = c.Int(nullable: false, identity: true), Title = c.String(nullable: false, maxLength: 300), ByPost = c.String(nullable: false, maxLength: 100), IsActive = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), LanguageCode = c.String(maxLength: 128), }) .PrimaryKey(t => t.OpinionAboutUsID); CreateTable( "dbo.CW_VideoClip", c => new { ItemID = c.Int(nullable: false, identity: true), ClipName = c.String(nullable: false, maxLength: 300), FilterTitle = c.String(nullable: false), CategoryID = c.Int(nullable: false), ClipLink = c.String(nullable: false, maxLength: 300), IsActive = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), SortOrder = c.Int(nullable: false), ClipSource = c.String(), ClipImage = c.String(), Description = c.String(), ViewCount = c.Int(nullable: false), Extentsion = c.String(), TypeVideo = c.String(), VideoSize = c.String(maxLength: 10), LanguageCode = c.String(maxLength: 128), }) .PrimaryKey(t => t.ItemID); CreateTable( "dbo.CW_Wishlist", c => new { ID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), UserName = c.String(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ID); CreateTable( "dbo.CW_Vendor", c => new { VendorID = c.Int(nullable: false, identity: true), VendorName = c.String(nullable: false, maxLength: 200), FilterTitle = c.String(nullable: false, maxLength: 200), Logo = c.String(maxLength: 200), Phone = c.String(maxLength: 12), Address = c.String(maxLength: 300), Email = c.String(maxLength: 100), Description = c.String(maxLength: 300), LanguageCode = c.String(maxLength: 10), IsActive = c.Boolean(nullable: false), SortOrder = c.Int(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.VendorID); CreateTable( "dbo.CW_Reviews", c => new { ReviewsID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), YourName = c.String(nullable: false, maxLength: 100), YourReview = c.String(nullable: false, maxLength: 1000), Rated = c.Int(nullable: false), IsEnable = c.Boolean(nullable: false), IsRead = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ReviewsID); CreateTable( "dbo.CW_ProductTab", c => new { ProductTabID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), TabName = c.String(nullable: false, maxLength: 100), TabValue = c.String(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ProductTabID); CreateTable( "dbo.CW_ProductImages", c => new { ID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), Image = c.String(maxLength: 300), Images = c.String(nullable: false, maxLength: 300), IsDefault = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ID); CreateTable( "dbo.CW_ProductField", c => new { FieldID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), FieldName = c.String(nullable: false, maxLength: 100), FieldValue = c.String(nullable: false, maxLength: 200), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.FieldID); CreateTable( "dbo.CW_OrderStatus", c => new { OrderStatusID = c.Int(nullable: false, identity: true), OrderStatus = c.String(nullable: false, maxLength: 150), }) .PrimaryKey(t => t.OrderStatusID); CreateTable( "dbo.CW_MessageReply", c => new { ReplyMessageID = c.Int(nullable: false, identity: true), MessageID = c.Int(nullable: false), Title = c.String(nullable: false, maxLength: 100), Content = c.String(nullable: false, maxLength: 1000), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ReplyMessageID); CreateTable( "dbo.CW_Message", c => new { MessageID = c.Int(nullable: false, identity: true), OrderID = c.Int(nullable: false), UserId = c.Int(nullable: false), Title = c.String(nullable: false, maxLength: 100), Content = c.String(nullable: false, maxLength: 1000), IsShowed = c.Boolean(nullable: false), IsRead = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.MessageID); CreateTable( "dbo.CW_Order", c => new { OrderID = c.Int(nullable: false, identity: true), OrderCode = c.String(nullable: false, maxLength: 50), UserId = c.Int(), FullnameOrder = c.String(nullable: false, maxLength: 100), SexOrder = c.Boolean(nullable: false), AddressOrder = c.String(maxLength: 200), EmailOrder = c.String(nullable: false, maxLength: 100), PhoneOrder = c.String(nullable: false, maxLength: 12), OtherInfoOrder = c.String(maxLength: 300), FullnameReceived = c.String(maxLength: 100), SexReceived = c.Boolean(nullable: false), AddressReceived = c.String(maxLength: 200), EmailReceived = c.String(maxLength: 100), PhoneReceived = c.String(maxLength: 12), OtherInfoReceived = c.String(maxLength: 300), Shipping = c.Int(nullable: false), TransitTime = c.String(maxLength: 200), Payment = c.Int(nullable: false), TotalPayment = c.Decimal(nullable: false, precision: 18, scale: 2), PriceShipping = c.Decimal(nullable: false, precision: 18, scale: 2), ProductNumber = c.Int(nullable: false), OrderStatusID = c.Int(nullable: false), OnOrder = c.DateTime(nullable: false), IsRead = c.Boolean(nullable: false), }) .PrimaryKey(t => t.OrderID); CreateTable( "dbo.CW_OrderDetail", c => new { OrderID = c.Int(nullable: false), ProductID = c.Int(nullable: false), Number = c.Int(nullable: false), }) .PrimaryKey(t => new { t.OrderID, t.ProductID }); CreateTable( "dbo.CW_OptionRuleValue", c => new { OptionRuleValueID = c.Int(nullable: false, identity: true), OptionRuleValue = c.String(nullable: false, maxLength: 100), OptionRuleType = c.Int(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.OptionRuleValueID); CreateTable( "dbo.CW_Option_Rule_Value", c => new { OptionRuleValueID = c.Int(nullable: false), OptionRuleID = c.Int(nullable: false), SaveOptionRuleValue = c.String(nullable: false, maxLength: 150), }) .PrimaryKey(t => new { t.OptionRuleValueID, t.OptionRuleID }); CreateTable( "dbo.CW_ProductOption", c => new { ProductOptionID = c.Int(nullable: false, identity: true), ProductOptionName = c.String(nullable: false, maxLength: 200), LanguageCode = c.String(maxLength: 10), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ProductOptionID); CreateTable( "dbo.CW_Product_Option_OptionSet", c => new { ProductOptionID = c.Int(nullable: false), ProductOptionSetID = c.Int(nullable: false), }) .PrimaryKey(t => new { t.ProductOptionID, t.ProductOptionSetID }); CreateTable( "dbo.CW_ProductOptionSet", c => new { ProductOptionSetID = c.Int(nullable: false, identity: true), ProductOptionSetName = c.String(nullable: false, maxLength: 200), Datatype = c.Short(nullable: false), DisplayType = c.Short(), LanguageCode = c.String(maxLength: 10), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ProductOptionSetID); CreateTable( "dbo.CW_ProductOptionSetValue", c => new { ProductOptionSetValueID = c.Int(nullable: false, identity: true), ProductOptionSetID = c.Int(nullable: false), ProductOptionSetValueName = c.String(nullable: false, maxLength: 200), ProductOptionSetType = c.Short(), ProductOptionSetValue = c.String(nullable: false, maxLength: 200), LanguageCode = c.String(maxLength: 10), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ProductOptionSetValueID); CreateTable( "dbo.CW_Option_Rule_SetValue", c => new { ProductOptionSetValueID = c.Int(nullable: false), OptionRuleID = c.Int(nullable: false), }) .PrimaryKey(t => new { t.ProductOptionSetValueID, t.OptionRuleID }); CreateTable( "dbo.CW_OptionRule", c => new { OptionRuleID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), IsUse = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.OptionRuleID); CreateTable( "dbo.CW_FQAProduct", c => new { FQAID = c.Int(nullable: false, identity: true), ProductID = c.Int(nullable: false), FullName = c.String(nullable: false, maxLength: 100), Email = c.String(nullable: false, maxLength: 100), Question = c.String(nullable: false, maxLength: 300), Answer = c.String(maxLength: 500), IsActive = c.Boolean(nullable: false), IsRead = c.Boolean(nullable: false), QuestionDate = c.DateTime(nullable: false), AnswerDate = c.DateTime(nullable: false), SearchKey = c.String(maxLength: 500), }) .PrimaryKey(t => t.FQAID); CreateTable( "dbo.CW_Product", c => new { ProductID = c.Int(nullable: false, identity: true), CategoryID = c.Int(nullable: false), ProductName = c.String(nullable: false, maxLength: 200), FilterTitle = c.String(nullable: false), ProductCode = c.String(maxLength: 30), Price = c.Decimal(nullable: false, precision: 18, scale: 2), PriceSaleOff = c.Decimal(nullable: false, precision: 18, scale: 2), Description = c.String(maxLength: 3000), Content = c.String(), ViewCount = c.Int(nullable: false), ImageHover = c.String(maxLength: 300), CreatedBy = c.String(maxLength: 20), CreatedDate = c.DateTime(nullable: false), ModifiedBy = c.String(maxLength: 20), ModifiedDate = c.DateTime(nullable: false), Tag = c.String(), Metatitle = c.String(maxLength: 200), MetaKeywords = c.String(maxLength: 200), MetaDescription = c.String(maxLength: 300), IsActive = c.Boolean(nullable: false), IsHot = c.Boolean(nullable: false), IsNew = c.Boolean(nullable: false), IsFeatured = c.Boolean(nullable: false), IsPromotion = c.Boolean(nullable: false), SortOrder = c.Int(nullable: false), IsAllowPurchase = c.String(maxLength: 20), CallForPricingLabel = c.String(maxLength: 50), LanguageCode = c.String(maxLength: 128), ProductRelateID = c.String(maxLength: 100), KeySearch = c.String(), VendorID = c.Int(), ProductOptionID = c.Int(), }) .PrimaryKey(t => t.ProductID); CreateTable( "dbo.CW_File", c => new { ID = c.Int(nullable: false, identity: true), CategoryID = c.Int(nullable: false), Title = c.String(nullable: false, maxLength: 300), FilterTitle = c.String(nullable: false), PathFile = c.String(nullable: false, maxLength: 300), Images = c.String(maxLength: 300), Description = c.String(maxLength: 1000), Content = c.String(), CountDownload = c.Int(nullable: false), IsActive = c.Boolean(nullable: false), SortOrder = c.Int(nullable: false), LanguageCode = c.String(maxLength: 128), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ID); CreateTable( "dbo.CW_UpdatePrice", c => new { UpdatePriceID = c.Int(nullable: false, identity: true), UpdatePriceType = c.Int(nullable: false), Kind = c.String(), PriceNew = c.Decimal(nullable: false, precision: 18, scale: 2), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.UpdatePriceID); CreateTable( "dbo.CW_Category_UpdatePrice", c => new { UpdatePriceID = c.Int(nullable: false), CategoryID = c.Int(nullable: false), }) .PrimaryKey(t => new { t.UpdatePriceID, t.CategoryID }); CreateTable( "dbo.CW_AlbumImages", c => new { ID = c.Int(nullable: false, identity: true), AlbumID = c.Int(nullable: false), Image = c.String(maxLength: 200), Images = c.String(nullable: false, maxLength: 200), IsDefault = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), }) .PrimaryKey(t => t.ID); CreateTable( "dbo.CW_Album", c => new { AlbumID = c.Int(nullable: false, identity: true), AlbumName = c.String(nullable: false, maxLength: 300), FilterTitle = c.String(nullable: false), CategoryID = c.Int(nullable: false), SortOrder = c.Int(nullable: false), IsActive = c.Boolean(nullable: false), CreatedDate = c.DateTime(nullable: false), Description = c.String(maxLength: 300), LanguageCode = c.String(maxLength: 128), }) .PrimaryKey(t => t.AlbumID); CreateIndex("dbo.CW_OpinionAboutUs", "LanguageCode"); CreateIndex("dbo.CW_VideoClip", "LanguageCode"); CreateIndex("dbo.CW_VideoClip", "CategoryID"); CreateIndex("dbo.CW_Wishlist", "ProductID"); CreateIndex("dbo.CW_Reviews", "ProductID"); CreateIndex("dbo.CW_ProductTab", "ProductID"); CreateIndex("dbo.CW_ProductImages", "ProductID"); CreateIndex("dbo.CW_ProductField", "ProductID"); CreateIndex("dbo.CW_MessageReply", "MessageID"); CreateIndex("dbo.CW_Message", "UserId"); CreateIndex("dbo.CW_Message", "OrderID"); CreateIndex("dbo.CW_Order", "OrderStatusID"); CreateIndex("dbo.CW_Order", "UserId"); CreateIndex("dbo.CW_OrderDetail", "ProductID"); CreateIndex("dbo.CW_OrderDetail", "OrderID"); CreateIndex("dbo.CW_Option_Rule_Value", "OptionRuleID"); CreateIndex("dbo.CW_Option_Rule_Value", "OptionRuleValueID"); CreateIndex("dbo.CW_Product_Option_OptionSet", "ProductOptionSetID"); CreateIndex("dbo.CW_Product_Option_OptionSet", "ProductOptionID"); CreateIndex("dbo.CW_ProductOptionSetValue", "ProductOptionSetID"); CreateIndex("dbo.CW_Option_Rule_SetValue", "OptionRuleID"); CreateIndex("dbo.CW_Option_Rule_SetValue", "ProductOptionSetValueID"); CreateIndex("dbo.CW_OptionRule", "ProductID"); CreateIndex("dbo.CW_FQAProduct", "ProductID"); CreateIndex("dbo.CW_Product", "ProductOptionID"); CreateIndex("dbo.CW_Product", "VendorID"); CreateIndex("dbo.CW_Product", "LanguageCode"); CreateIndex("dbo.CW_Product", "CategoryID"); CreateIndex("dbo.CW_File", "LanguageCode"); CreateIndex("dbo.CW_File", "CategoryID"); CreateIndex("dbo.CW_Category_UpdatePrice", "CategoryID"); CreateIndex("dbo.CW_Category_UpdatePrice", "UpdatePriceID"); CreateIndex("dbo.CW_AlbumImages", "AlbumID"); CreateIndex("dbo.CW_Album", "LanguageCode"); CreateIndex("dbo.CW_Album", "CategoryID"); AddForeignKey("dbo.CW_OpinionAboutUs", "LanguageCode", "dbo.CW_Language", "LanguageCode"); AddForeignKey("dbo.CW_VideoClip", "LanguageCode", "dbo.CW_Language", "LanguageCode"); AddForeignKey("dbo.CW_VideoClip", "CategoryID", "dbo.CW_Category", "ID", cascadeDelete: true); AddForeignKey("dbo.CW_Wishlist", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_Product", "VendorID", "dbo.CW_Vendor", "VendorID"); AddForeignKey("dbo.CW_Reviews", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_ProductTab", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_ProductImages", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_ProductField", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_OrderDetail", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_Order", "OrderStatusID", "dbo.CW_OrderStatus", "OrderStatusID", cascadeDelete: true); AddForeignKey("dbo.CW_OrderDetail", "OrderID", "dbo.CW_Order", "OrderID", cascadeDelete: true); AddForeignKey("dbo.CW_Message", "OrderID", "dbo.CW_Order", "OrderID", cascadeDelete: true); AddForeignKey("dbo.CW_MessageReply", "MessageID", "dbo.CW_Message", "MessageID", cascadeDelete: true); AddForeignKey("dbo.CW_Order", "UserId", "dbo.UserProfile", "UserId"); AddForeignKey("dbo.CW_Message", "UserId", "dbo.CW_Customers", "UserId", cascadeDelete: true); AddForeignKey("dbo.CW_OptionRule", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_Option_Rule_Value", "OptionRuleValueID", "dbo.CW_OptionRuleValue", "OptionRuleValueID", cascadeDelete: true); AddForeignKey("dbo.CW_Option_Rule_Value", "OptionRuleID", "dbo.CW_OptionRule", "OptionRuleID", cascadeDelete: true); AddForeignKey("dbo.CW_ProductOptionSetValue", "ProductOptionSetID", "dbo.CW_ProductOptionSet", "ProductOptionSetID", cascadeDelete: true); AddForeignKey("dbo.CW_Product_Option_OptionSet", "ProductOptionSetID", "dbo.CW_ProductOptionSet", "ProductOptionSetID", cascadeDelete: true); AddForeignKey("dbo.CW_Product_Option_OptionSet", "ProductOptionID", "dbo.CW_ProductOption", "ProductOptionID", cascadeDelete: true); AddForeignKey("dbo.CW_Product", "ProductOptionID", "dbo.CW_ProductOption", "ProductOptionID"); AddForeignKey("dbo.CW_Option_Rule_SetValue", "ProductOptionSetValueID", "dbo.CW_ProductOptionSetValue", "ProductOptionSetValueID", cascadeDelete: true); AddForeignKey("dbo.CW_Option_Rule_SetValue", "OptionRuleID", "dbo.CW_OptionRule", "OptionRuleID", cascadeDelete: true); AddForeignKey("dbo.CW_Product", "LanguageCode", "dbo.CW_Language", "LanguageCode"); AddForeignKey("dbo.CW_FQAProduct", "ProductID", "dbo.CW_Product", "ProductID", cascadeDelete: true); AddForeignKey("dbo.CW_Product", "CategoryID", "dbo.CW_Category", "ID", cascadeDelete: true); AddForeignKey("dbo.CW_File", "LanguageCode", "dbo.CW_Language", "LanguageCode"); AddForeignKey("dbo.CW_File", "CategoryID", "dbo.CW_Category", "ID", cascadeDelete: true); AddForeignKey("dbo.CW_Category_UpdatePrice", "UpdatePriceID", "dbo.CW_UpdatePrice", "UpdatePriceID", cascadeDelete: true); AddForeignKey("dbo.CW_Category_UpdatePrice", "CategoryID", "dbo.CW_Category", "ID", cascadeDelete: true); AddForeignKey("dbo.CW_Album", "LanguageCode", "dbo.CW_Language", "LanguageCode"); AddForeignKey("dbo.CW_AlbumImages", "AlbumID", "dbo.CW_Album", "AlbumID", cascadeDelete: true); AddForeignKey("dbo.CW_Album", "CategoryID", "dbo.CW_Category", "ID", cascadeDelete: true); } } } <file_sep>/COMMOM/Interface/ICommon.cs using Model.EF; using System.Collections.Generic; using System.Web.Mvc; namespace COMMOM.Interface { public class ICommon { private static MVCDbContext db = new MVCDbContext(); [NonAction] public static List<CW_Category> ListCategory(int parent, List<CW_Category> objcate, List<CW_Category> objtemp) { List<CW_Category> objbind = ICategory.catechilby(parent, objcate); if (objbind != null && objbind.Count > 0) { CW_Category objtab = null; for (int i = 0; i < objbind.Count; i++) { objtab = (CW_Category)objbind[i]; objtemp.Add(objtab); ListCategory(objtab.ID, objcate, objtemp); } } return objtemp; } } }<file_sep>/Model/EF/CW_Contact.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { [Table("CW_Contact")] public class CW_Contact { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Required(ErrorMessage = "Yêu cầu nhập họ tên !")] [Display(Name = "Họ tên")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string FullName { get; set; } [Display(Name = "Tên công ty")] [StringLength(150, ErrorMessage = "Bạn chỉ được nhập tối đa 150 ký tự !")] public string Company { get; set; } [Display(Name = "Điện thoại")] [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] [DataType(DataType.PhoneNumber)] public string Phone { get; set; } [DataType(DataType.EmailAddress)] [Required(ErrorMessage = "Email không được để trống !")] [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] [Display(Name = "Email")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string Email { get; set; } [Required(ErrorMessage = "Yêu cầu nhập tiêu đề!")] [Display(Name = "Tiêu đề")] [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] public string Title { get; set; } [Display(Name = "Nội dung")] [AllowHtml] [StringLength(1500, ErrorMessage = "Bạn chỉ được nhập tối đa 1500 ký tự !")] public string Content { get; set; } public bool IsRead { get; set; } public DateTime CreatedDate { get; set; } } } <file_sep>/MVC4.PROJECT/Api/MenuApiController.cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Model.EF; using Newtonsoft.Json.Linq; namespace MVC4.PROJECT.Api { public class MenuApiController : ApiController { MVCDbContext db =new MVCDbContext(); #region "dùng cho việc thêm danh mục vào menu" [HttpGet] public JArray JTreeTableAddCate(int? select, string menucode, string lang) { //var db = new MVCDbContext(); var allitems = from x in db.CW_Category orderby x.Order where x.LanguageCode.Equals(lang) select x; var roots = from x in allitems where x.ParentID == null select x; var menu_cate = from x in db.CW_Menu_Category where x.MenuCode == menucode select x; var jarray = new JArray(); if (menu_cate != null) { foreach (var i in roots) { var selectedcate = false; foreach (var selected in menu_cate) { if (selected.CategoryID == i.ID) { selectedcate = true; } } if (select.HasValue && i.ID == select) continue; var subs = from x in allitems where x.ParentID == i.ID select x; var haschild = false; if (subs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("Parent", null), new JProperty("HasChild", haschild), new JProperty("selectedcate", selectedcate))); if (subs.Count() > 0) SubTreeTableselectedcate(ref jarray, subs, allitems, 1, select, menu_cate); } } else { foreach (var i in roots) { if (select.HasValue && i.ID == select) continue; var subs = from x in allitems where x.ParentID == i.ID select x; var haschild = false; if (subs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("Parent", null), new JProperty("HasChild", haschild), new JProperty("selectedcate", false))); if (subs.Count() > 0) SubTreeTableselectedcate(ref jarray, subs, allitems, 1, select, menu_cate); } } return jarray; } [NonAction] private JArray SubTreeTableselectedcate(ref JArray jarray, IEnumerable<CW_Category> subs, IEnumerable<CW_Category> allitems, int level, int? select, IEnumerable<CW_Menu_Category> menu_cate) { if (menu_cate != null) { foreach (var i in subs) { var selectedcate = false; foreach (var selected in menu_cate) { if (selected.CategoryID == i.ID) { selectedcate = true; } } if (select.HasValue && i.ID == select) continue; var subsubs = from x in allitems where x.ParentID == i.ID orderby x.Order select x; var haschild = false; if (subsubs.ToList().Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("Parent", i.ParentID), new JProperty("HasChild", haschild), new JProperty("selectedcate", selectedcate))); if (subsubs.Count() > 0) SubTreeTableselectedcate(ref jarray, subsubs, allitems, level + 1, select, menu_cate); } } else { foreach (var i in subs) { if (select.HasValue && i.ID == select) continue; var subsubs = from x in allitems where x.ParentID == i.ID orderby x.Order select x; var haschild = false; if (subsubs.ToList().Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("Parent", i.ParentID), new JProperty("HasChild", haschild), new JProperty("selectedcate", false))); if (subsubs.Count() > 0) SubTreeTableselectedcate(ref jarray, subsubs, allitems, level + 1, select, menu_cate); } } return jarray; } #endregion } } <file_sep>/Model/EF/UserProfile.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("UserProfile")] public class UserProfile { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int UserId { get; set; } //[RegularExpression(@"^[a-zA-Z][a-zA-Z0-9]{2,255}$", ErrorMessage = "Định dạng tài khoản không hợp lệ.")] [Display(Name = "Tài khoản")] [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] public string UserName { get; set; } [Display(Name = "Họ và tên")] [Required(ErrorMessage = "Bắt buộc phải nhập!")] [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] public string FullName { get; set; } [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] [Display(Name = "Email")] //[Required(ErrorMessage = "Bắt buộc phải nhập!")] [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] [DataType(DataType.EmailAddress)] public string Email { get; set; } [Display(Name = "Địa chỉ")] [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] public string Address { get; set; } [Display(Name = "Điện thoại")] [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] [DataType(DataType.PhoneNumber)] public string Mobile { get; set; } [Display(Name = "Khóa tài khoản")] public bool IsLock { get; set; } } } <file_sep>/Model/Models/TicketOption.cs namespace Model.Models { public class TicketOption { public virtual string Id { get; set; } public virtual decimal Price { get; set; } public virtual short Stops { get; set; } public virtual string TicketType { get; set; } public virtual decimal TotalPrice { get; set; } public string FareBasis { get; set; } } }<file_sep>/Model/Models/ServerInfo.cs namespace Model.Models { public class ServerInfo { public string ApiServer { get; set; } } }<file_sep>/MVC4.PROJECT/Models/AccountModel.cs  using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Models { //public class MVCDbContext:DbContext //{ // //public DbSet<UserProfile> UserProfiles { get; set; } // protected override void OnModelCreating(DbModelBuilder modelBuilder) // { // modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); // } // public MVCDbContext() // : base("DefaultConnection") // { // } // public DbSet<CW_Category> CW_Category { get; set; } // public DbSet<CW_Article> CW_Article { get; set; } // public DbSet<CW_News> CW_News { get; set; } // public DbSet<CW_Adv> CW_Adv { get; set; } // public DbSet<CW_Contact> CW_Contact { get; set; } // public DbSet<CW_Menu> CW_Menu { get; set; } // public DbSet<CW_Support> CW_Support { get; set; } // public DbSet<CW_Setting> CW_Setting { get; set; } // public DbSet<CW_OrderDetail> CW_OrderDetail { get; set; } // public DbSet<CW_Menu_Category> CW_Menu_Category { get; set; } // public DbSet<CW_Product> CW_Product { get; set; } // public DbSet<CW_ProductImages> CW_ProductImages { get; set; } // public DbSet<CW_File> CW_File { get; set; } // public DbSet<CW_Order> CW_Order { get; set; } // public DbSet<CW_OrderStatus> CW_OrderStatus { get; set; } // public DbSet<CW_VideoClip> CW_VideoClip { get; set; } // public DbSet<CW_Album> CW_Album { get; set; } // public DbSet<CW_AlbumImages> CW_AlbumImages { get; set; } // public DbSet<CW_FQAProduct> CW_FQAProduct { get; set; } // public DbSet<CW_NewsComment> CW_NewsComment { get; set; } // public DbSet<CW_Language> CW_Language { get; set; } // public DbSet<CW_OpinionAboutUs> CW_OpinionAboutUs { get; set; } // public DbSet<CW_Email> CW_Email { get; set; } // public DbSet<CW_Vendor> CW_Vendor { get; set; } // public DbSet<CW_ProductField> CW_ProductField { get; set; } // public DbSet<CW_ProductTab> CW_ProductTab { get; set; } // public DbSet<CW_ProductOption> CW_ProductOption { get; set; } // public DbSet<CW_ProductOptionSet> CW_ProductOptionSet { get; set; } // public DbSet<CW_ProductOptionSetValue> CW_ProductOptionSetValue { get; set; } // public DbSet<CW_Product_Option_OptionSet> CW_Product_Option_OptionSet { get; set; } // public DbSet<CW_OptionRule> CW_OptionRule { get; set; } // public DbSet<CW_OptionRuleValue> CW_OptionRuleValue { get; set; } // public DbSet<CW_Option_Rule_SetValue> CW_Option_Rule_SetValue { get; set; } // public DbSet<CW_Option_Rule_Value> CW_Option_Rule_Value { get; set; } // public DbSet<CW_UpdatePrice> CW_UpdatePrice { get; set; } // public DbSet<CW_Category_UpdatePrice> CW_Category_UpdatePrice { get; set; } // public DbSet<CW_Message> CW_Message { get; set; } // public DbSet<CW_MessageReply> CW_MessageReply { get; set; } // public DbSet<CW_SettingCurrency> CW_SettingCurrency { get; set; } // public DbSet<CW_Reviews> CW_Reviews { get; set; } // // phương thức vận chuyển // public DbSet<CW_ShippingMethods> CW_ShippingMethods { get; set; } // public DbSet<CW_ShippingValues> CW_ShippingValues { get; set; } // // phương thức thanh toán // public DbSet<CW_SettingCommonPayment> CW_SettingCommonPayment { get; set; } // public DbSet<CW_SettingCommonPayment_PaymentMethods> CW_SettingCommonPayment_PaymentMethods { get; set; } // public DbSet<CW_PaymentMethods> CW_PaymentMethods { get; set; } // public DbSet<CW_PaymentAtShop> CW_PaymentAtShop { get; set; } // public DbSet<CW_PaymentBaoKimMerchant> CW_PaymentBaoKimMerchant { get; set; } // public DbSet<CW_PaymentNganLuongMerchant> CW_PaymentNganLuongMerchant { get; set; } // public DbSet<CW_PaymentPayPal> CW_PaymentPayPal { get; set; } // public DbSet<CW_PaymentOnePay> CW_PaymentOnePay { get; set; } // //user model // public DbSet<UserProfile> UserProfiles { get; set; } // public DbSet<CW_Customers> CW_Customers { get; set; } // public DbSet<CW_CustomerGroups> CW_CustomerGroups { get; set; } // public DbSet<WebRole> WebRoles { get; set; } // public DbSet<webpages_Membership> webpages_Memberships { get; set; } // public DbSet<Wishlist> CW_Wishlist { get; set; } //} //[Table("CW_Wishlist")] //public class Wishlist //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // public int ProductID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // public string UserName { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Product CW_Product { get; set; } //} //#region "Product & product relate table model" //[Table("CW_OrderStatus")] //public class CW_OrderStatus //{ // public CW_OrderStatus() // { // this.CW_Order = new HashSet<CW_Order>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int OrderStatusID { get; set; } // [Required] // [StringLength(150, ErrorMessage = "Bạn chỉ được nhập tối đa 150 ký tự !")] // public string OrderStatus { get; set; } // public virtual ICollection<CW_Order> CW_Order { get; set; } //} //[Table("CW_Order")] //public class CW_Order //{ // public CW_Order() // { // this.CW_OrderDetails = new HashSet<CW_OrderDetail>(); // this.CW_Message = new HashSet<CW_Message>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int OrderID { get; set; } // [Required(ErrorMessage = "Yêu cầu nhập mã đơn hàng !")] // [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] // public string OrderCode { get; set; } // public int? UserId { get; set; } // [Required(ErrorMessage = "Yêu cầu nhập họ tên !")] // [Display(Name = "Họ tên người đặt hàng")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string FullnameOrder { get; set; } // public bool SexOrder { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string AddressOrder { get; set; } // [DataType(DataType.EmailAddress)] // [Required(ErrorMessage = "Email không được để trống !")] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // [Display(Name = "Email")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string EmailOrder { get; set; } // [Required(ErrorMessage = "Yêu cầu nhập điện thoại !")] // [Display(Name = "Điện thoại")] // [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] // [DataType(DataType.PhoneNumber)] // public string PhoneOrder { get; set; } // [Display(Name = "Thông tin khác")] // [StringLength(300, ErrorMessage = "Bạn chỉ được nhập tối đa 300 ký tự !")] // public string OtherInfoOrder { get; set; } // [Display(Name = "Họ và tên")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string FullnameReceived { get; set; } // [Display(Name = "Giới tính")] // public bool SexReceived { get; set; } // [Display(Name = "Địa chỉ")] // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string AddressReceived { get; set; } // [DataType(DataType.EmailAddress)] // //[Required(ErrorMessage = "Email không được để trống !")] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // [Display(Name = "Email")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string EmailReceived { get; set; } // //[Required(ErrorMessage = "Yêu cầu nhập điện thoại !")] // [Display(Name = "Điện thoại")] // [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] // [DataType(DataType.PhoneNumber)] // public string PhoneReceived { get; set; } // [Display(Name = "Thông tin khác")] // [StringLength(300, ErrorMessage = "Bạn chỉ được nhập tối đa 300 ký tự !")] // public string OtherInfoReceived { get; set; } // [Display(Name = "Phương thức vận chuyển")] // public int Shipping { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // [Display(Name = "Thêm ghi chú cho đơn hàng")] // public string TransitTime { get; set; } // [Display(Name = "Phương thức thanh toán")] // public int Payment { get; set; } // [Display(Name = "Tổng tiền thanh toán")] // public decimal TotalPayment { get; set; } // [Display(Name = "Phí vận chuyển")] // public decimal PriceShipping { get; set; } // public int ProductNumber { get; set; } // [Required] // public int OrderStatusID { get; set; } // public DateTime OnOrder { get; set; } // public bool IsRead { get; set; } // public virtual ICollection<CW_OrderDetail> CW_OrderDetails { get; set; } // public virtual ICollection<CW_Message> CW_Message { get; set; } // public virtual UserProfile UserProfile { get; set; } // public virtual CW_OrderStatus CW_OrderStatus { get; set; } //} //[Table("CW_OrderDetail")] //public class CW_OrderDetail //{ // [Key, Column(Order = 1)] // public int OrderID { get; set; } // [Key, Column(Order = 2)] // public int ProductID { get; set; } // public int Number { get; set; } // public virtual CW_Order CW_Order { get; set; } // public virtual CW_Product CW_Product { get; set; } //} //[Table("CW_Product")] //public class CW_Product //{ // public CW_Product() // { // this.CW_ProductTab = new HashSet<CW_ProductTab>(); // this.CW_ProductField = new HashSet<CW_ProductField>(); // this.CW_ProductImages = new HashSet<CW_ProductImages>(); // this.CW_FQAProduct = new HashSet<CW_FQAProduct>(); // this.CW_Wishlist = new HashSet<Wishlist>(); // this.CW_OrderDetail = new HashSet<CW_OrderDetail>(); // this.CW_OptionRule = new HashSet<CW_OptionRule>(); // this.CW_Reviews = new HashSet<CW_Reviews>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ProductID { get; set; } // [Display(Name = "Danh mục")] // [Required(ErrorMessage = "Bắt buộc phải chọn danh mục sản phẩm!")] // public int CategoryID { get; set; } // [Display(Name = "Tên sản phẩm")] // [Required(ErrorMessage = "Bắt buộc phải nhập tên sản phẩm!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string ProductName { get; set; } // [Display(Name = "Filter title")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string FilterTitle // { // get; // set; // } // [Display(Name = "Mã sản phẩm")] // [StringLength(30, ErrorMessage = "Bạn chỉ có thể nhập tối đa 30 ký tự !")] // public string ProductCode { get; set; } // [Display(Name = "Giá bán")] // [Required(ErrorMessage = "Bắt buộc phải nhập giá bán, nếu không nhập số 0!")] // [DataType(DataType.Currency)] // //[RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public decimal Price { get; set; } // [Display(Name = "Giá khuyến mãi")] // [Required(ErrorMessage = "Bắt buộc phải nhập giá bán, nếu không nhập số 0!")] // [DataType(DataType.Currency)] // //[RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public decimal PriceSaleOff { get; set; } // [Display(Name = "Mô tả")] // [StringLength(3000)] // public string Description { get; set; } // [Display(Name = "Chi tiết sản phẩm")] // [AllowHtml] // public string Content { get; set; } // [Display(Name = "Lượt xem")] // public int ViewCount { get; set; } // [StringLength(20)] // public string CreatedBy { get; set; } // public DateTime CreatedDate { get; set; } // [StringLength(20)] // public string ModifiedBy { get; set; } // public DateTime ModifiedDate { get; set; } // [AllowHtml] // public string Tag { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string Metatitle { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string MetaKeywords { get; set; } // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string MetaDescription { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // [Display(Name = "Đang hót")] // public bool IsHot { get; set; } // [Display(Name = "Hàng mới về")] // public bool IsNew { get; set; } // [Display(Name = "Sản phẩm nổi bật")] // public bool IsFeatured { get; set; } // [Display(Name = "Sản phẩm khuyến mãi")] // public bool IsPromotion { get; set; } // [Display(Name = "Thứ tự")] // [Range(0, int.MaxValue, ErrorMessage = "Số thứ tự phải nhập vào số dương!")] // [Required(ErrorMessage = "Cần phải nhập số thứ tự!")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int SortOrder { get; set; } // [Display(Name = "Cho phép đặt hàng")] // [StringLength(20, ErrorMessage = "Bạn chỉ có thể nhập tối đa 20 ký tự !")] // public string IsAllowPurchase { get; set; } // [Display(Name = "Chữ hiển thị thay thế")] // [StringLength(50, ErrorMessage = "Bạn chỉ có thể nhập tối đa 50 ký tự !")] // public string CallForPricingLabel { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // [Display(Name = "Sản phẩm liên quan")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string ProductRelateID { get; set; } // [Display(Name = "Dùng để search sản phẩm")] // public string KeySearch { get; set; } // [Display(Name = "Nhà sản xuất")] // public int? VendorID { get; set; } // [Display(Name = "Nhóm tùy chọn")] // public int? ProductOptionID { get; set; } // public virtual CW_Language CW_Language { get; set; } // public virtual CW_Category Category { get; set; } // public virtual CW_ProductOption CW_ProductOption { get; set; } // public virtual CW_Vendor CW_Vendor { get; set; } // public virtual ICollection<CW_ProductTab> CW_ProductTab { get; set; } // public virtual ICollection<CW_ProductField> CW_ProductField { get; set; } // public virtual ICollection<CW_ProductImages> CW_ProductImages { get; set; } // public virtual ICollection<CW_FQAProduct> CW_FQAProduct { get; set; } // public virtual ICollection<Wishlist> CW_Wishlist { get; set; } // public virtual ICollection<CW_OrderDetail> CW_OrderDetail { get; set; } // public virtual ICollection<CW_OptionRule> CW_OptionRule { get; set; } // public virtual ICollection<CW_Reviews> CW_Reviews { get; set; } // public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) // { // if (Price < PriceSaleOff) // { // yield return new ValidationResult("Giá khuyến mãi phải nhỏ hơn giá gốc !"); // } // } //} ////ảnh sản phẩm //[Table("CW_ProductImages")] //public class CW_ProductImages //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải chọn!")] // [Display(Name = "Sản phẩm")] // public int ProductID { get; set; } // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Image { get; set; } // anh nho // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Ảnh sản phẩm")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Images { get; set; }// anh lon // [Display(Name = "Chọn ảnh hiện thị mặc định")] // public bool IsDefault { get; set; }// chon anh hien thi mac dinh // public DateTime CreatedDate { get; set; } // public virtual CW_Product CW_Product { get; set; } //} ////Nhóm tùy chọn //[Table("CW_ProductOption")] //public class CW_ProductOption //{ // public CW_ProductOption() // { // this.CW_Product = new HashSet<CW_Product>(); // this.CW_Product_Option_OptionSet = new HashSet<CW_Product_Option_OptionSet>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ProductOptionID { get; set; } // [Display(Name = "Nhóm tùy chọn")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string ProductOptionName { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Product> CW_Product { get; set; } // public virtual ICollection<CW_Product_Option_OptionSet> CW_Product_Option_OptionSet { get; set; } //} ////Tùy chọn //[Table("CW_ProductOptionSet")] //public class CW_ProductOptionSet //{ // public CW_ProductOptionSet() // { // this.CW_Product_Option_OptionSet = new HashSet<CW_Product_Option_OptionSet>(); // this.CW_ProductOptionSetValue = new HashSet<CW_ProductOptionSetValue>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ProductOptionSetID { get; set; } // [Display(Name = "Tùy chọn")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string ProductOptionSetName { get; set; } // [Display(Name = "Kiểu tùy chọn")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public Int16 Datatype { get; set; } // 1. là kiểu tùy chọn thông thường 2. là kiểu tùy chọn màu sắc // [Display(Name = "Kiểu hiển thị")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public Int16? DisplayType { get; set; } // 1. Rectangle (hình chữ nhật) 2. Radio Box 3. Select Box // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Product_Option_OptionSet> CW_Product_Option_OptionSet { get; set; } // public virtual ICollection<CW_ProductOptionSetValue> CW_ProductOptionSetValue { get; set; } //} ////Bảng kết nối giữa CW_ProductOptionSet và CW_ProductOption //[Table("CW_Product_Option_OptionSet")] //public class CW_Product_Option_OptionSet //{ // [Key, Column(Order = 0)] // public int ProductOptionID { get; set; } // [Key, Column(Order = 1)] // public int ProductOptionSetID { get; set; } // public virtual CW_ProductOption CW_ProductOption { get; set; } // public virtual CW_ProductOptionSet CW_ProductOptionSet { get; set; } //} ////bảng giá trị tùy chọn //[Table("CW_ProductOptionSetValue")] //public class CW_ProductOptionSetValue //{ // public CW_ProductOptionSetValue() // { // this.CW_Option_Rule_SetValue = new HashSet<CW_Option_Rule_SetValue>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ProductOptionSetValueID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int ProductOptionSetID { get; set; } // [Display(Name = "Tên hiển thị")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string ProductOptionSetValueName { get; set; } // [Display(Name = "Kiểu giá trị")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public Int16? ProductOptionSetType { get; set; } // 1. là kiểu màu sắc 2. là kiểu ảnh hiên thị // [Display(Name = "Giá trị")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string ProductOptionSetValue { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_ProductOptionSet CW_ProductOptionSet { get; set; } // public virtual ICollection<CW_Option_Rule_SetValue> CW_Option_Rule_SetValue { get; set; } //} ////nhà sản xuất //[Table("CW_Vendor")] //public class CW_Vendor //{ // public CW_Vendor() // { // this.CW_Product = new HashSet<CW_Product>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int VendorID { get; set; } // [Display(Name = "Nhà sản xuất")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string VendorName { get; set; } // [Display(Name = "Fiiter name")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string FilterTitle { get; set; } // [Display(Name = "Logo")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string Logo { get; set; } // [Display(Name = "Số điện thoại")] // [StringLength(12, ErrorMessage = "Bạn chỉ có thể nhập tối đa 12 ký tự !")] // public string Phone { get; set; } // [Display(Name = "Địa chỉ")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Address { get; set; } // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] // [Display(Name = "Email")] // [DataType(DataType.EmailAddress)] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string Email { get; set; } // [Display(Name = "Mô tả")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Description { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // [Display(Name = "Hiển thị")] // public bool IsActive { get; set; } // [Display(Name = "Thứ tự")] // public int SortOrder { get; set; } // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Product> CW_Product { get; set; } //} //[Table("CW_FQAProduct")] //public class CW_FQAProduct //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int FQAID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải chọn!")] // [Display(Name = "Sản phẩm")] // public int ProductID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "<NAME>")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string FullName { get; set; } // [DataType(DataType.EmailAddress)] // [Required(ErrorMessage = "Email không được để trống !")] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // [Display(Name = "Email")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string Email { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Câu hỏi")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Question { get; set; } // [Display(Name = "Câu trả lời")] // [StringLength(500, ErrorMessage = "Bạn chỉ có thể nhập tối đa 500 ký tự !")] // public string Answer { get; set; } // [Display(Name = "Hiển thị ra ngoài trang")] // public bool IsActive { get; set; } // public bool IsRead { get; set; }// Đã xem câu hỏi hay chưa // public DateTime QuestionDate { get; set; } // public DateTime AnswerDate { get; set; } // [Display(Name = "Full text search")] // [StringLength(500, ErrorMessage = "Bạn chỉ có thể nhập tối đa 500 ký tự !")] // public string SearchKey { get; set; } // public virtual CW_Product CW_Product { get; set; } //} ////thông tin tùy chọn sản phẩm //[Table("CW_ProductField")] //public class CW_ProductField //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int FieldID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải chọn!")] // [Display(Name = "Sản phẩm")] // public int ProductID { get; set; } // [Display(Name = "Tên")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string FieldName { get; set; } // anh nho // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Giá trị")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string FieldValue { get; set; }// anh lon // public DateTime CreatedDate { get; set; } // public virtual CW_Product CW_Product { get; set; } //} ////Tab thông tin sản phẩm //[Table("CW_ProductTab")] //public class CW_ProductTab //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ProductTabID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải chọn!")] // [Display(Name = "Sản phẩm")] // public int ProductID { get; set; } // [Display(Name = "Tên tab hiển thị")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string TabName { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Thông tin hiển thị")] // [AllowHtml] // public string TabValue { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Product CW_Product { get; set; } //} ////Bảng nhóm quy tắc áp dụng cho nhóm tùy chọn của sản phẩm //[Table("CW_OptionRule")] //public class CW_OptionRule //{ // public CW_OptionRule() // { // this.CW_Option_Rule_Value = new HashSet<CW_Option_Rule_Value>(); // this.CW_Option_Rule_SetValue = new HashSet<CW_Option_Rule_SetValue>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int OptionRuleID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải chọn!")] // [Display(Name = "Sản phẩm")] // public int ProductID { get; set; } // [Display(Name = "Sử dụng")] // public bool IsUse { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Product CW_Product { get; set; } // public virtual ICollection<CW_Option_Rule_Value> CW_Option_Rule_Value { get; set; } // public virtual ICollection<CW_Option_Rule_SetValue> CW_Option_Rule_SetValue { get; set; } //} ////Bảng liên kết giữa CW_OptionRule và CW_ProductOptionSetValue //[Table("CW_Option_Rule_SetValue")] //public class CW_Option_Rule_SetValue //{ // [Key, Column(Order = 0)] // public int ProductOptionSetValueID { get; set; } // [Key, Column(Order = 1)] // public int OptionRuleID { get; set; } // public virtual CW_ProductOptionSetValue CW_ProductOptionSetValue { get; set; } // public virtual CW_OptionRule CW_OptionRule { get; set; } //} ////Bảng chứa giá trị quy tắc //[Table("CW_OptionRuleValue")] //public class CW_OptionRuleValue //{ // public CW_OptionRuleValue() // { // this.CW_Option_Rule_Value = new HashSet<CW_Option_Rule_Value>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int OptionRuleValueID { get; set; } // [Display(Name = "Tên quy tắc")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string OptionRuleValue { get; set; } // [Display(Name = "Loại quy tắc")] // public int OptionRuleType { get; set; } // 1. kiểu text nhập 2. kiểu ảnh. // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Option_Rule_Value> CW_Option_Rule_Value { get; set; } //} ////Bảng liên kết giữa bảng CW_OptionRuleValue và CW_OptionRule //[Table("CW_Option_Rule_Value")] //public class CW_Option_Rule_Value //{ // [Key, Column(Order = 0)] // public int OptionRuleValueID { get; set; } // [Key, Column(Order = 1)] // public int OptionRuleID { get; set; } // [Display(Name = "Giá trị")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(150, ErrorMessage = "Bạn chỉ có thể nhập tối đa 150 ký tự !")] // public string SaveOptionRuleValue { get; set; } // public virtual CW_OptionRuleValue CW_OptionRuleValue { get; set; } // public virtual CW_OptionRule CW_OptionRule { get; set; } //} ////cập nhật giá //[Table("CW_UpdatePrice")] //public class CW_UpdatePrice //{ // public CW_UpdatePrice() // { // this.CW_Category_UpdatePrice = new HashSet<CW_Category_UpdatePrice>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int UpdatePriceID { get; set; } // [Display(Name = "Kiểu cập nhật giá")] // public int UpdatePriceType { get; set; } //tăng hoặc giảm giá // [Display(Name = "Kiểu giá")] // public string Kind { get; set; } // VNĐ hoặc % // [Display(Name = "Giá trị thay đổi")] // public decimal PriceNew { get; set; } // [Display(Name = "Giá trị thay đổi")] // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Category_UpdatePrice> CW_Category_UpdatePrice { get; set; } //} //[Table("CW_Category_UpdatePrice")] //public class CW_Category_UpdatePrice //{ // [Key, Column(Order = 0)] // public int UpdatePriceID { get; set; } // [Key, Column(Order = 1)] // public int CategoryID { get; set; } // public virtual CW_Category Category { get; set; } // public virtual CW_UpdatePrice CW_UpdatePrice { get; set; } //} ////tin nhắn đơn hàng //[Table("CW_Message")] //public class CW_Message //{ // public CW_Message() // { // this.CW_MessageReply = new HashSet<CW_MessageReply>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int MessageID { get; set; } // [Display(Name = "Đơn hàng")] // [Required(ErrorMessage = "Bắt buộc phải chọn !")] // public int OrderID { get; set; } // [Display(Name = "Tải khoản")] // [Required(ErrorMessage = "Bắt buộc phải chọn !")] // public int UserId { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string Title { get; set; } // [Display(Name = "Nội dung")] // [Required(ErrorMessage = "Yêu cầu nhập nội dung !")] // [StringLength(1000, ErrorMessage = "Chỉ được nhập tối đa 1000 ký tự !")] // public string Content { get; set; } // public bool IsShowed { get; set; } // public bool IsRead { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Order CW_Order { get; set; } // public virtual CW_Customers CW_Customers { get; set; } // public virtual ICollection<CW_MessageReply> CW_MessageReply { get; set; } //} ////Trả lời tin nhắn đơn hàng //[Table("CW_MessageReply")] //public class CW_MessageReply //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ReplyMessageID { get; set; } // [Display(Name = "Tin nhắn")] // [Required(ErrorMessage = "Bắt buộc phải chọn !")] // public int MessageID { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string Title { get; set; } // [Display(Name = "Nội dung")] // [Required(ErrorMessage = "Yêu cầu nhập nội dung !")] // [StringLength(1000, ErrorMessage = "Chỉ được nhập tối đa 1000 ký tự !")] // public string Content { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Message CW_Message { get; set; } //} ////bảng quản lý phương thức vận chuyển //[Table("CW_ShippingMethods")] //public class CW_ShippingMethods //{ // public CW_ShippingMethods() // { // this.CW_ShippingValues = new HashSet<CW_ShippingValues>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ShippingMethodsID { get; set; } // [Display(Name = "Phương thức vận chuyển")] // [Required(ErrorMessage = "Bắt buộc phải chọn !")] // public int ShppingMethods { get; set; } //1. Miễn phí vận chuyển, 2. Phí cố định, 3. Phí cố định trên một đơn vị sản phẩm, 4. Phí theo giá trị đơn hàng // [Display(Name = "Tên hiển thị")] // [Required(ErrorMessage = "Bắt buộc phải chọn !")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string NameView { get; set; } // [Display(Name = "Thời gian vận chuyển")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string TimeShipping { get; set; } // [Display(Name = "Bật chức năng này")] // public bool IsEnable { get; set; } // [Display(Name = "Thứ tự")] // public int SortOrder { get; set; } // [Display(Name = "Phí vận chuyển")] // public decimal PriceShipping { get; set; } // public virtual ICollection<CW_ShippingValues> CW_ShippingValues { get; set; } //} ////bẳng lưu giá trị khi phương thức vận chuyển được chọn là 4 //[Table("CW_ShippingValues")] //public class CW_ShippingValues //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ShippingValuesID { get; set; } // [Required] // public int ShippingMethodsID { get; set; } // [Display(Name = "Giá mặc định")] // public decimal DefaultPrice { get; set; } // [Display(Name = "Giá đơn hàng nhỏ")] // public decimal LowerRangePriceOrder { get; set; } // giá đơn hàng nhỏ // [Display(Name = "Giá đơn hàng lớn")] // public decimal UpperRangePriceOrder { get; set; } // giá đơn hàng lớn // [Display(Name = "Gía vận chuyển")] // public decimal PriceShippingValue { get; set; } // public virtual CW_ShippingMethods CW_ShippingMethods { get; set; } //} //[Table("CW_SettingCurrency")] //public class CW_SettingCurrency //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int SettingCurrencyID { get; set; } // [Display(Name = "Tiền tệ")] // [Required(ErrorMessage = "Bắt buộc phải nhập !")] // [StringLength(50, ErrorMessage = "Chỉ được nhập tối đa 50 ký tự !")] // public string CurrencyName { get; set; } // [Display(Name = "Mã tiền tệ ")] // [Required(ErrorMessage = "Bắt buộc phải nhập !")] // [StringLength(50, ErrorMessage = "Chỉ được nhập tối đa 50 ký tự !")] // public string CurrencyCode { get; set; } // [Display(Name = "Tỷ giá ")] // [Required(ErrorMessage = "Bắt buộc phải nhập !")] // public string ExchangeRate { get; set; } // [Display(Name = "Ký tự hiển thị ")] // [Required(ErrorMessage = "Bắt buộc phải nhập !")] // [StringLength(50, ErrorMessage = "Chỉ được nhập tối đa 50 ký tự !")] // public string CurrencyString { get; set; } // [Display(Name = "Vị trí ")] // [Required(ErrorMessage = "Bắt buộc phải nhập !")] // [StringLength(50, ErrorMessage = "Chỉ được nhập tối đa 50 ký tự !")] // public string Position { get; set; } // trái phải // [Display(Name = "Mặc định ")] // public bool IsDefault { get; set; } // mặc định là false // [Display(Name = "Kích hoạt sử dụng ")] // public bool IsActive { get; set; } // mặc định là false // [Display(Name = "Ngày cập nhật ")] // public DateTime UpdatedOn { get; set; } // [Display(Name = "Cập nhật từ hệ thống ")] // public bool IsUpdateFromSystem { get; set; } // mặc định là true //} ////Đánh giá sản phẩm //[Table("CW_Reviews")] //public class CW_Reviews //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ReviewsID { get; set; } // [Display(Name = "Sản phẩm")] // [Required(ErrorMessage = "Bắt buộc phải chọn !")] // public int ProductID { get; set; } // [Display(Name = "Họ và tên")] // [Required(ErrorMessage = "Yêu cầu nhập họ và tên !")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string YourName { get; set; } // [Display(Name = "Viết đánh giá")] // [Required(ErrorMessage = "Yêu cầu nhập đánh giá !")] // [StringLength(1000, ErrorMessage = "Chỉ được nhập tối đa 1000 ký tự !")] // public string YourReview { get; set; } // [Display(Name = "Đánh giá")] // public int Rated { get; set; } //1-> 5 // [Display(Name = "Hiện / Ẩn")] // public bool IsEnable { get; set; } // public bool IsRead { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Product CW_Product { get; set; } //} //#endregion //#region "setting payment methods" //// bảng cấu hình chung thanh toán //[Table("CW_SettingCommonPayment")] //public class CW_SettingCommonPayment //{ // public CW_SettingCommonPayment() // { // this.CW_SettingCommonPayment_PaymentMethods = new HashSet<CW_SettingCommonPayment_PaymentMethods>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int SettingCommonPaymentID { get; set; } // [Display(Name = "Nội dung thông báo đặt hàng thành công")] // [StringLength(1000, ErrorMessage = "Chỉ được nhập tối đa 1000 ký tự !")] // [AllowHtml] // public string OrderCompletedNotifications { get; set; } // [Display(Name = "Ưu tiên giao hàng đến địa chỉ khác")] // [StringLength(10, ErrorMessage = "Chỉ được nhập tối đa 10 ký tự !")] // public string AnotherShippingAddressAllow { get; set; } // yes or no // [Display(Name = "Sử dụng quy trình thanh toán rút gọn")] // [StringLength(10, ErrorMessage = "Chỉ được nhập tối đa 10 ký tự !")] // public string QuickPayment { get; set; } // yes or no // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_SettingCommonPayment_PaymentMethods> CW_SettingCommonPayment_PaymentMethods { get; set; } //} ////bảng nối bảng cấu hình thanh toán và bảng phương thức thanh toán //[Table("CW_SettingCommonPayment_PaymentMethods")] //public class CW_SettingCommonPayment_PaymentMethods //{ // [Key, Column(Order = 0)] // public int SettingCommonPaymentID { get; set; } // [Key, Column(Order = 1)] // public int PaymentMethodsID { get; set; } // public virtual CW_SettingCommonPayment CW_SettingCommonPayment { get; set; } // public virtual CW_PaymentMethods CW_PaymentMethods { get; set; } //} //// bảng chứa các phương thức thanh toán //[Table("CW_PaymentMethods")] //public class CW_PaymentMethods //{ // public CW_PaymentMethods() // { // this.CW_SettingCommonPayment_PaymentMethods = new HashSet<CW_SettingCommonPayment_PaymentMethods>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int PaymentMethodsID { get; set; } // [Display(Name = "Tên phương thức thanh toán")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string PaymentMethodsName { get; set; } // public virtual ICollection<CW_SettingCommonPayment_PaymentMethods> CW_SettingCommonPayment_PaymentMethods { get; set; } //} //// bảng chứa cấu hình thanh toán không có cấu hình phức tạp ////3. Thanh toán tại cửa hàng ////4. Thanh toán khi nhận được hàng ////9. Hình thức thanh toán riêng ////8. Thanh toán qua tài khoản ngân hàng //[Table("CW_PaymentAtShop")] //public class CW_PaymentAtShop //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int PaymentAtShopID { get; set; } // [Display(Name = "Tên hiển thị ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập tên hiển thị !")] // public string DisplayName { get; set; } // [Display(Name = "Chỉ dẫn thanh toán ")] // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // [AllowHtml] // public string Instruction { get; set; } // [Display(Name = "Loại thanh toán ")] // public int TypePayment { get; set; } // public DateTime CreatedDate { get; set; } //} //// Tích hợp bảo kim merchant //[Table("CW_PaymentBaoKimMerchant")] //public class CW_PaymentBaoKimMerchant //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int PaymentBaoKimMerchantID { get; set; } // [Display(Name = "Tên hiển thị ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập tên hiển thị !")] // public string DisplayName { get; set; } // [Display(Name = "Email nhận thanh toán ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập email thanh toán !")] // [DataType(DataType.EmailAddress)] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // public string Email { get; set; } // [Display(Name = "Mã website tích hợp ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string MerchantId { get; set; } // [Display(Name = "<NAME> ")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string SecurePass { get; set; } // [Display(Name = "Chế độ ")] // public int TestMode { get; set; } //1. chạy thật 2. chạy thử // [Display(Name = "Chỉ dẫn thanh toán ")] // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // [AllowHtml] // public string Instruction { get; set; } // public DateTime CreatedDate { get; set; } //} //// Tích hợp Ngân Lượng nâng cao //[Table("CW_PaymentNganLuongMerchant")] //public class CW_PaymentNganLuongMerchant //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int PaymentNganLuongMerchantID { get; set; } // [Display(Name = "Tên hiển thị ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập tên hiển thị !")] // public string DisplayName { get; set; } // [Display(Name = "Email nhận thanh toán ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập email thanh toán !")] // [DataType(DataType.EmailAddress)] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // public string Email { get; set; } // [Display(Name = "Mã website tích hợp ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string MerchantId { get; set; } // [Display(Name = "Mã bảo mật ")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string SecurePass { get; set; } // [Display(Name = "Chế độ ")] // public int TestMode { get; set; } //1. chạy thật 2. chạy thử // [Display(Name = "Chỉ dẫn thanh toán ")] // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // [AllowHtml] // public string Instruction { get; set; } // public DateTime CreatedDate { get; set; } //} //// Thanh toán qua paypal //[Table("CW_PaymentPayPal")] //public class CW_PaymentPayPal //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int PaymentPayPalID { get; set; } // [Display(Name = "Tên hiển thị ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập tên hiển thị !")] // public string DisplayName { get; set; } // [Display(Name = "Tài khoản nhận thanh toán ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập tài khoản thanh toán !")] // //[DataType(DataType.EmailAddress)] // //[RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // public string Email { get; set; } // [Display(Name = "<NAME> ")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string SecurePass { get; set; } // [Display(Name = "Chuỗi chữ ký ")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string Signature { get; set; } // [Display(Name = "Chế độ ")] // public int TestMode { get; set; } //1. chạy thật 2. chạy thử // [Display(Name = "Chỉ dẫn thanh toán ")] // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // [AllowHtml] // public string Instruction { get; set; } // public DateTime CreatedDate { get; set; } //} //// Tích hợp thanh toán OnePay //[Table("CW_PaymentOnePay")] //public class CW_PaymentOnePay //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int OnePayID { get; set; } // [Display(Name = "Tên hiển thị ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập tên hiển thị !")] // public string DisplayName { get; set; } // [Display(Name = "Hashcode (SECURE_SECRET)")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập mã Hashcode!")] // public string Hashcode { get; set; } // [Display(Name = "AccessCode")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string AccessCode { get; set; } // [Display(Name = "Tài khoản Merchant ")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string MerchantId { get; set; } // [Display(Name = "Chế độ ")] // public int TestMode { get; set; } //1. chạy thật 2. chạy thử // [Display(Name = "Chỉ dẫn thanh toán ")] // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // [AllowHtml] // public string Instruction { get; set; } // [Display(Name = "Loại thanh toán")] // public int TypePayment { get; set; } // 1. Thanh toán qua thẻ ATM 2. Thanh toán qua thẻ visa, Master,... // public DateTime CreatedDate { get; set; } //} //#endregion //#region "common model" //[Table("CW_Category")] //public class CW_Category //{ // public CW_Category() // { // this.CW_menu_category = new HashSet<CW_Menu_Category>(); // this.CW_articles = new HashSet<CW_Article>(); // this.CW_news = new HashSet<CW_News>(); // //this.Contents = new HashSet<Content>(); // this.CW_products = new HashSet<CW_Product>(); // this.CW_files = new HashSet<CW_File>(); // this.CW_videoclip = new HashSet<CW_VideoClip>(); // this.CW_album = new HashSet<CW_Album>(); // this.CW_Category_UpdatePrice = new HashSet<CW_Category_UpdatePrice>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] // [StringLength(300, ErrorMessage = "Chỉ được nhập tối đa 300 ký tự !")] // public string Title // { // get; // set; // } // [Display(Name = "Kiểu danh mục")] // [Required(ErrorMessage = "Yêu cầu nhập kiểu danh mục !")] // [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] // public string TypeCode // { // get; // set; // } // [Display(Name = "Mã danh mục")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] // public string CategoryCode { get; set; } // [Display(Name = "Mô tả")] // [StringLength(1000, ErrorMessage = "Số ký tự cho phép tối đa là 1000!")] // public string Description { get; set; } // [Display(Name = "Danh mục cha")] // public int? ParentID { get; set; } // [Display(Name = "Thứ tự")] // [Range(0, int.MaxValue, ErrorMessage = "Thứ tự nhập vào phải là số dương")] // public int? Order { get; set; } // [Display(Name = "MetaTitle")] // [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] // public string MetaTitle { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string MetaKeywords { get; set; } // [Display(Name = "MetaDescription")] // [StringLength(700, ErrorMessage = "Chỉ được nhập tối đa 700 ký tự !")] // public string MetaDescription { get; set; } // [Display(Name = "Liên kết")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // public string Link { get; set; } // [Display(Name = "Ảnh đại diện")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // public string Icon { get; set; } // [Display(Name = "Kiểu liên kết")] // [StringLength(50, ErrorMessage = "Chỉ được nhập tối đa 50 ký tự !")] // public string Target { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Chỉ được nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // [ForeignKey("ParentID")] // public virtual ICollection<CW_Category> SubCategories { get; set; } // [StringLength(300, ErrorMessage = "Chỉ được nhập tối đa 300 ký tự !")] // public string KeySearch { get; set; } // public virtual ICollection<CW_Article> CW_articles { get; set; } // public virtual ICollection<CW_News> CW_news { get; set; } // //public virtual ICollection<Content> Contents { get; set; } // public virtual ICollection<CW_Product> CW_products { get; set; } // public virtual ICollection<CW_File> CW_files { get; set; } // public virtual ICollection<CW_VideoClip> CW_videoclip { get; set; } // public virtual ICollection<CW_Album> CW_album { get; set; } // public virtual ICollection<CW_Menu_Category> CW_menu_category { get; set; } // public virtual ICollection<CW_Category_UpdatePrice> CW_Category_UpdatePrice { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_News")] //public class CW_News //{ // public CW_News() // { // this.CW_newscomment = new HashSet<CW_NewsComment>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] // [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] // public string Title // { // get; // set; // } // [Display(Name = "Filter title")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string FilterTitle // { // get; // set; // } // [Display(Name = "Ảnh đại diện")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // public string Image { get; set; } // [Display(Name = "Mô tả")] // [StringLength(1000)] // public string Description { get; set; } // [Display(Name = "Chi tiết tin")] // [AllowHtml] // public string Content { get; set; } // [Display(Name = "Chú thích ảnh")] // [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] // public string ImageNotes { get; set; } // [Display(Name = "Số lượng người đọc")] // public int Read { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // [Display(Name = "Trang chủ")] // public bool IsHome { get; set; } // public DateTime CreatedDate { get; set; } // [Display(Name = "Thứ tự")] // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương!")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Order { get; set; } // [Display(Name = "Danh mục")] // [Required(ErrorMessage = "Cần phải chọn danh mục !")] // public int CategoryID { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Chỉ được nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] // public string MetaTitle { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string MetaKeywords { get; set; } // [StringLength(600, ErrorMessage = "Chỉ được nhập tối đa 600 ký tự !")] // public string MetaDescription { get; set; } // public virtual CW_Category Category { get; set; } // public virtual ICollection<CW_NewsComment> CW_newscomment { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_NewsComment")] //public class CW_NewsComment //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int CommentID { get; set; } // [Display(Name = "Tin tức")] // [Required(ErrorMessage = "Bắt buộc phải nhập trường này !")] // public int ID { get; set; } // [Display(Name = "Bình luận")] // [AllowHtml] // public string Content { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "<NAME>")] // [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] // public string FullName { get; set; } // [DataType(DataType.EmailAddress)] // [Required(ErrorMessage = "Email không được để trống !")] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // [Display(Name = "Email")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string Email { get; set; } // [Display(Name = "Kích hoạt hiển thị")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_News CW_News { get; set; } //} //[Table("CW_Article")] //public class CW_Article //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] // [StringLength(300, ErrorMessage = "Bạn chỉ được nhập tối đa 300 ký tự !")] // public string Title // { // get; // set; // } // [Display(Name = "Filter title")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string FilterTitle // { // get; // set; // } // [Display(Name = "Mô tả")] // [StringLength(1000, ErrorMessage = "Bạn chỉ được nhập tối đa 1000 ký tự")] // public string Description { get; set; } // [Display(Name = "Chi tiết bài viết")] // [AllowHtml] // public string Body { get; set; } // [Display(Name = "Danh mục")] // [Required(ErrorMessage = "Bắt buộc phải chọn danh mục")] // public int CategoryID { get; set; } // [Display(Name = "Thứ tự")] // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Order { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // [StringLength(400, ErrorMessage = "Bạn chỉ được nhập tối đa 400 ký tự !")] // public string MetaTitle { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string MetaKeywords { get; set; } // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // public string MetaDescription { get; set; } // public virtual CW_Category Category { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_Adv")] //public class CW_Adv //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] // [StringLength(400, ErrorMessage = "Bạn chỉ được nhập tối đa 400 ký tự !")] // public string Title // { // get; // set; // } // [Display(Name = "Ảnh")] // [Required(ErrorMessage = "Yêu cầu tải ảnh !")] // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string Image { get; set; } // [Display(Name = "Liên kết")] // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string Link { get; set; } // [Display(Name = "Mô tả")] // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // [AllowHtml] // public string Description { get; set; } // [Display(Name = "Chiểu cao")] // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Height { get; set; } // [Display(Name = "Chiều rộng")] // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Width { get; set; } // [Display(Name = "Vị trí hiển thị")] // [Required(ErrorMessage = "Cần phải chọn vị trí hiển thị !")] // public int Position { get; set; } // [Display(Name = "Kiểu liên kết")] // [StringLength(30, ErrorMessage = "Bạn chỉ được nhập tối đa 30 ký tự !")] // public string Target { get; set; } // [Display(Name = "Kiểu flash")] // public bool IsFlash { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // [Display(Name = "Thứ tự")] // [Range(0, int.MaxValue)] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Order { get; set; } // public DateTime CreatedDate { get; set; } // [StringLength(400, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // public string MetaTitle { get; set; } // [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] // public string MetaDescription { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_Contact")] //public class CW_Contact //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Required(ErrorMessage = "Yêu cầu nhập họ tên !")] // [Display(Name = "<NAME>")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string FullName { get; set; } // [Display(Name = "Tên công ty")] // [StringLength(150, ErrorMessage = "Bạn chỉ được nhập tối đa 150 ký tự !")] // public string Company { get; set; } // [Display(Name = "Điện thoại")] // [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] // [DataType(DataType.PhoneNumber)] // public string Phone { get; set; } // [DataType(DataType.EmailAddress)] // [Required(ErrorMessage = "Email không được để trống !")] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] // [Display(Name = "Email")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string Email { get; set; } // [Required(ErrorMessage = "Yêu cầu nhập tiêu đề!")] // [Display(Name = "Tiêu đề")] // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string Title { get; set; } // [Display(Name = "Nội dung")] // [AllowHtml] // [StringLength(1500, ErrorMessage = "Bạn chỉ được nhập tối đa 1500 ký tự !")] // public string Content { get; set; } // public bool IsRead { get; set; } // public DateTime CreatedDate { get; set; } //} //[Table("CW_Menu")] //public class CW_Menu //{ // public CW_Menu() // { // this.CW_menu_category = new HashSet<CW_Menu_Category>(); // } // [Key] // public string MenuCode { get; set; } // [Required] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string Title // { // get; // set; // } // [Range(0, int.MaxValue)] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Order { get; set; } // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Menu_Category> CW_menu_category { get; set; } //} //[Table("CW_Support")] //public class CW_Support //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Display(Name = "<NAME>")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string NickYahoo // { // get; // set; // } // [Display(Name = "Nick skyper")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string NickSkyper { get; set; } // [Display(Name = "Tiêu đề")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string Title { get; set; } // [Display(Name = "Điện thoại")] // [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] // [DataType(DataType.PhoneNumber)] // public string Phone { get; set; } // [Display(Name = "Mô tả")] // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string Description { get; set; } // [Display(Name = "Thứ tự")] // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int Order { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_Setting")] //public class CW_Setting //{ // [Key] // public string SettingKey { get; set; } // [AllowHtml] // public string SettingValue { get; set; } // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string SettingGroup { get; set; } // public DateTime CreatedDate { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string SettingComment { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_Menu_Category")] //public class CW_Menu_Category //{ // //đây là bảng nhiều, mình cần viết kết nối đến bảng 1 như: public virtual Category Category { get; set; } // [Key, Column(Order = 0)] // public string MenuCode { get; set; } // [Key, Column(Order = 1)] // public int CategoryID { get; set; } // //[RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int SortOrder { get; set; } // public virtual CW_Category Category { get; set; } // public virtual CW_Menu CW_Menu { get; set; } //} //[Table("CW_File")] //public class CW_File //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Display(Name = "Danh mục")] // [Required(ErrorMessage = "Bạn bắt buộc phải chọn danh mục!")] // public int CategoryID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Tiêu đề")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Title { get; set; } // [Display(Name = "Filter title")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string FilterTitle // { // get; // set; // } // [Display(Name = "Link file")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string PathFile { get; set; } // [Display(Name = "Ảnh đại diện")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Images { get; set; } // [Display(Name = "Mô tả")] // [StringLength(1000, ErrorMessage = "Bạn chỉ có thể nhập tối đa 1000 ký tự !")] // public string Description { get; set; } // [Display(Name = "Chi tiết")] // [AllowHtml] // public string Content { get; set; } // [Display(Name = "Số lượt download")] // public int CountDownload { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] // [Display(Name = "Thứ tự")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int SortOrder { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } // public DateTime CreatedDate { get; set; } // public virtual CW_Category Category { get; set; } //} //[Table("CW_VideoClip")] //public class CW_VideoClip //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ItemID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Tiêu đề")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string ClipName { get; set; } // [Display(Name = "Filter title")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string FilterTitle // { // get; // set; // } // [Display(Name = "<NAME>")] // [Required(ErrorMessage = "Bạn bắt buộc phải nhập trường này !")] // public int CategoryID { get; set; } // [Display(Name = "Link video")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // [AllowHtml] // public string ClipLink { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // [Range(0, int.MaxValue)] // [Display(Name = "Thứ tự")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int SortOrder { get; set; } // [Display(Name = "Nguồn video")] // public string ClipSource { get; set; } // [Display(Name = "Ảnh đại diện")] // //[RegularExpression(@"\w+\.(gif|jpg|png)$")] // public string ClipImage { get; set; } // [Display(Name = "Mô tả")] // [AllowHtml] // public string Description { get; set; } // [Display(Name = "Số lượt xem")] // public int ViewCount { get; set; } // [Display(Name = "Loại video")] // public string Extentsion { get; set; } // [Display(Name = "Kiểu video")] // public string TypeVideo { get; set; } // [Display(Name = "Dung lượng")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string VideoSize { get; set; } // public virtual CW_Category Category { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_Album")] //public class CW_Album //{ // public CW_Album() // { // this.CW_AlbumImages = new HashSet<CW_AlbumImages>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int AlbumID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [Display(Name = "Tiêu đề")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string AlbumName { get; set; } // [Display(Name = "Filter title")] // [Required(ErrorMessage = "Yêu cầu nhập trường này !")] // public string FilterTitle // { // get; // set; // } // [Display(Name = "Danh mục")] // [Required(ErrorMessage = "Bắt buộc phải chọn danh mục !")] // public int CategoryID { get; set; } // [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] // [Display(Name = "Thứ tự")] // [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] // public int SortOrder { get; set; } // [Display(Name = "Kích hoạt")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // [Display(Name = "Chi tiết thư viện ảnh")] // [AllowHtml] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Description { get; set; } // [Display(Name = "Ngôn ngữ")] // [StringLength(10, ErrorMessage = "Bạn chỉ có thể nhập tối đa 10 ký tự !")] // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } // public virtual CW_Category Category { get; set; } // public virtual ICollection<CW_AlbumImages> CW_AlbumImages { get; set; } //} //[Table("CW_AlbumImages")] //public class CW_AlbumImages //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int ID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải chọn!")] // [Display(Name = "Album")] // public int AlbumID { get; set; } // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // public string Image { get; set; } // anh nho // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] // [Display(Name = "Ảnh album")] // public string Images { get; set; }// anh lon // [Display(Name = "Chọn ảnh hiện thị mặc định")] // public bool IsDefault { get; set; }// chon anh hien thi mac dinh // public DateTime CreatedDate { get; set; } // public virtual CW_Album CW_Album { get; set; } //} //[Table("CW_Language")] //public class CW_Language //{ // [Key] // public string LanguageCode { get; set; } // public string Title { get; set; } // public virtual ICollection<CW_Category> Category { get; set; } // public virtual ICollection<CW_Adv> CW_Adv { get; set; } // public virtual ICollection<CW_Album> CW_Album { get; set; } // public virtual ICollection<CW_Article> CW_Article { get; set; } // public virtual ICollection<CW_File> CW_File { get; set; } // public virtual ICollection<CW_News> CW_News { get; set; } // public virtual ICollection<CW_Product> CW_Product { get; set; } // public virtual ICollection<CW_Support> CW_Support { get; set; } // public virtual ICollection<CW_VideoClip> CW_VideoClip { get; set; } // public virtual ICollection<CW_OpinionAboutUs> CW_OpinionAboutUs { get; set; } //} //[Table("CW_OpinionAboutUs")] //public class CW_OpinionAboutUs //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int OpinionAboutUsID { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập trường này!")] // [Display(Name = "Ý kiến")] // [StringLength(300, ErrorMessage = "Bạn chỉ có thể nhập tối đa 300 ký tự !")] // public string Title { get; set; } // [Required(ErrorMessage = "Bắt buộc phải nhập trường này!")] // [Display(Name = "Ý kiến của")] // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // public string ByPost { get; set; } // [Display(Name = "Kích hoạt hiển thị")] // public bool IsActive { get; set; } // public DateTime CreatedDate { get; set; } // public string LanguageCode { get; set; } // public virtual CW_Language CW_Language { get; set; } //} //[Table("CW_Email")] //public class CW_Email //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int EmailID { get; set; } // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] // [Display(Name = "Email")] // [DataType(DataType.EmailAddress)] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // public string Email { get; set; } // public DateTime CreatedDate { get; set; } //} //#endregion //#region "user model" //[Table("webpages_Roles")] //public class WebRole //{ // private string _roleName = string.Empty; // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int RoleId { get; set; } // [Required(ErrorMessage = "Yêu cầu nhập tên nhóm")] // [Display(Name = "<NAME>")] // [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] // public string RoleName // { // get { return _roleName.Trim(); } // set { _roleName = value.Trim(); } // } // [Display(Name = "Mô tả")] // [StringLength(440, ErrorMessage = "Bạn chỉ được nhập tối đa 440 ký tự !")] // public string Description { get; set; } //} //[Table("UserProfile")] //public class UserProfile //{ // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int UserId { get; set; } // //[RegularExpression(@"^[a-zA-Z][a-zA-Z0-9]{2,255}$", ErrorMessage = "Định dạng tài khoản không hợp lệ.")] // [Display(Name = "Tài khoản")] // [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] // public string UserName { get; set; } // [Display(Name = "<NAME>")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] // public string FullName { get; set; } // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] // [Display(Name = "Email")] // //[Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] // [DataType(DataType.EmailAddress)] // public string Email { get; set; } // [Display(Name = "Địa chỉ")] // [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] // public string Address { get; set; } // [Display(Name = "Điện thoại")] // [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] // [DataType(DataType.PhoneNumber)] // public string Mobile { get; set; } // [Display(Name = "Khóa tài khoản")] // public bool IsLock { get; set; } // public virtual ICollection<CW_Order> CW_Order { get; set; } //} ////dùng cho thành viên đăng ký //[Table("CW_Customers")] //public class CW_Customers //{ // [Key] // [ForeignKey("UserProfile")] // [HiddenInput(DisplayValue = false)] // public int UserId { get; set; } // [Display(Name = "Tài khoản (Email)")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] // [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] // [DataType(DataType.EmailAddress)] // public string UserNameCustomer { get; set; } // [Display(Name = "Yahoo")] // [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] // public string NickYahoo { get; set; } // [Display(Name = "Skype")] // [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] // public string NickSkype { get; set; } // [Display(Name = "Facebook")] // [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] // public string Facebook { get; set; } // [Display(Name = "Nhóm khách hàng")] // public int? CustomerGroupsID { get; set; } // [Display(Name = "<NAME>")] // public DateTime CreatedDate { get; set; } // public virtual UserProfile UserProfile { get; set; } // public virtual CW_CustomerGroups CW_CustomerGroups { get; set; } // public virtual ICollection<CW_Message> CW_Message { get; set; } //} ////nhóm khách hàng //[Table("CW_CustomerGroups")] //public class CW_CustomerGroups //{ // public CW_CustomerGroups() // { // this.CW_Customers = new HashSet<CW_Customers>(); // } // [Key] // [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] // public int CustomerGroupsID { get; set; } // [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] // [Display(Name = "Tên nhóm")] // [Required(ErrorMessage = "Bắt buộc phải nhập!")] // public string CustomerGroupName { get; set; } // [Display(Name = "Nhóm mặc định")] // public bool IsDefault { get; set; } // public DateTime CreatedDate { get; set; } // public virtual ICollection<CW_Customers> CW_Customers { get; set; } //} //dùng cho việc thêm mới khách hàng public class RegisterCustomersModel { [Required] [StringLength(100, ErrorMessage = "Tài khoản có tố thiểu {2} ký tự.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Mật khẩu")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Nhập lại mật khẩu")] [Compare("Password", ErrorMessage = "Nhập lại mật khẩu không trùng với mật khẩu.")] public string ConfirmPassword { get; set; } public CW_Customers CW_Customers { get; set; } } //[Table("webpages_Membership")] //public class webpages_Membership //{ // [Key] // public int UserId { get; set; } // public DateTime CreateDate { get; set; } // public string ConfirmationToken { get; set; } // public bool IsConfirmed { get; set; } // public DateTime LastPasswordFailureDate { get; set; } // public int PasswordFailuresSinceLastSuccess { get; set; } // public string Password { get; set; } // public DateTime PasswordChangeDate { get; set; } // public string PasswordSalt { get; set; } // public string PasswordVerificationToken { get; set; } // public DateTime PasswordVerificationTokenExpirationDate { get; set; } //} public class RegisterExternalLoginModel { [Required] [Display(Name = "User name")] public string UserName { get; set; } public string ExternalLoginData { get; set; } } public class LocalPasswordModel { [Required] [DataType(DataType.Password)] [Display(Name = "Mật khẩu hiện tại")] public string OldPassword { get; set; } [Required] [StringLength(100, ErrorMessage = "Mật khẩu có tối thiểu 6 ký tự.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Mật khẩu mới")] public string NewPassword { get; set; } [DataType(DataType.Password)] [Display(Name = "Nhập lại mật khẩu mới")] [System.Web.Mvc.Compare("NewPassword", ErrorMessage = "Mật khẩu nhập lại không khớp với mật khẩu mới.")] public string ConfirmPassword { get; set; } } public class LoginModel { [Required(ErrorMessage = "Bắt buộc phải nhập tài khoản.")] [Display(Name = "Tài khoản")] [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] //[RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Tài khoản không đúng định dạng email!")] public string UserName { get; set; } [Required(ErrorMessage = "Bắt buộc phải nhập mật khẩu.")] [DataType(DataType.Password)] [Display(Name = "Password")] [StringLength(100, ErrorMessage = "Mật khẩu có tối thiểu 6 ký tự.", MinimumLength = 6)] public string Password { get; set; } [Display(Name = "Nhớ đăng nhập?")] public bool RememberMe { get; set; } public string LanguageCode { get; set; } } public class RegisterModel { [Required(ErrorMessage = "Bắt buộc phải nhập tài khoản.")] [Display(Name = "Tài khoản")] [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] public string UserName { get; set; } [Required(ErrorMessage = "Bắt buộc phải nhập mật khẩu.")] [StringLength(100, ErrorMessage = "Mật khẩu có tố thiểu {2} ký tự.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Mật khẩu")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Nhập lại mật khẩu")] [System.Web.Mvc.Compare("Password", ErrorMessage = "Nhập lại mật khẩu không trùng với mật khẩu.")] public string ConfirmPassword { get; set; } public UserProfile UserProfile { get; set; } } public class ExternalLogin { public string Provider { get; set; } public string ProviderDisplayName { get; set; } public string ProviderUserId { get; set; } } //#endregion }<file_sep>/MVC4.PROJECT/Global.asax.cs using System; using System.Collections.Generic; using System.IO.Compression; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using Model.EF; using WebMatrix.WebData; namespace MVC4.PROJECT { // Note: For instructions on enabling IIS6 or IIS7 classic mode, // visit http://go.microsoft.com/?LinkId=9394801 public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { //tỷ giá tiền tệ AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); } protected void Application_BeginRequest(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; string acceptEncoding = app.Request.Headers["Accept-Encoding"]; System.IO.Stream prevUncompressedStream = app.Response.Filter; if (acceptEncoding == null || acceptEncoding.Length == 0) return; acceptEncoding = acceptEncoding.ToLower(); if (acceptEncoding.Contains("gzip")) { // gzip app.Response.Filter = new System.IO.Compression.GZipStream(prevUncompressedStream, System.IO.Compression.CompressionMode.Compress); app.Response.AppendHeader("Content-Encoding", "gzip"); } else if (acceptEncoding.Contains("deflate")) { // defalte app.Response.Filter = new System.IO.Compression.DeflateStream(prevUncompressedStream, System.IO.Compression.CompressionMode.Compress); app.Response.AppendHeader("Content-Encoding", "deflate"); } } protected void Application_Error(object sender, EventArgs e) { // Remove any special filtering especially GZip filtering Response.Filter = null; } protected void Application_PreSendRequestHeaders() { // ensure that if GZip/Deflate Encoding is applied that headers are set // also works when error occurs if filters are still active HttpResponse response = HttpContext.Current.Response; if (response.Filter is GZipStream && response.Headers["Content-encoding"] != "gzip") response.AppendHeader("Content-encoding", "gzip"); else if (response.Filter is DeflateStream && response.Headers["Content-encoding"] != "deflate") response.AppendHeader("Content-encoding", "deflate"); } } }<file_sep>/MVC4.PROJECT/asset/admin/js/album.js //update tiêu đề bài viết function updateVal(currentEle, value, idpro) { $(currentEle).html('<input class="thVal" type="text" value="' + value.trim() + '" />'); $(".thVal").focus(); $(".thVal").keyup(function (event) { if (event.keyCode == 13) { $.ajax( { type: "POST", url: '/Admin/Album/UpdateTitle', data: { id: idpro, title: $(".thVal").val().trim() } }) .done(function () { $(currentEle).html($(".thVal").val().trim()); $.gritter.add({ title: 'Thông báo thành công.', text: 'Bạn đã cập nhật tiêu đề album ảnh thành công.', sticky: false, class_name: 'my_class_gritter_success' }); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }); } }); $(".thVal").focusout(function () { $.ajax( { type: "POST", url: '/Admin/Album/UpdateTitle', data: { id: idpro, title: $(".thVal").val().trim() } }) .done(function () { $(currentEle).html($(".thVal").val().trim()); $.gritter.add({ title: 'Thông báo thành công.', text: 'Bạn đã cập nhật tiêu đề album ảnh thành công.', sticky: false, class_name: 'my_class_gritter_success' }); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }) }); } $(document).ready(function () { //alert("OK"); //hiển thị form upload ảnh $("#dialog").dialog({ autoOpen: false, show: "fade", hide: "fade", modal: true, height: '500', width: '700', resizable: true, title: 'Quản lý ảnh album' }); $('.imgproduct').click(function () { var proid = $(this).attr("data-id"); $("#dialog #myIframe").attr("src", "/admin/albumimages/Index?id=" + proid); $('#dialog').dialog('open'); return false; }); //update isactive $("span.active").click(function () { var id = $(this).attr('data-title'); var bool = $(this).attr('data-boo'); if (bool == 'True') { $(this).removeClass("label-success"); $(this).addClass("label-danger"); $(this).removeAttr('data-boo'); $(this).attr("data-boo", "False"); $(this).html("X"); } else { $(this).removeClass("label-danger"); $(this).addClass("label-success"); $(this).removeAttr('data-boo'); $(this).attr("data-boo", "True"); $(this).html("V"); } $.ajax( { type: "POST", url: '/Admin/Album/UpdateIsActive', data: { id: id, isactive: bool } }) }); //checked all $("#title-checkbox").change(function () { var checkedStatus = this.checked; var checkbox = $(this).parents('.box').find('tr td input:checkbox'); checkbox.each(function () { this.checked = checkedStatus; if (this.checked) { checkbox.attr("selected", "checked"); checkbox.parent('span').addClass('checked'); } else { checkbox.attr("selected", ""); checkbox.parent('span').removeClass('checked'); } }); }); //xóa nhiều bản ghi cùng một nút $(".delete").click(function () { var cof = confirm("Bạn có thực sự muốn xóa những bản ghi đã chọn ?"); if (cof == true) { var checkbox = $(this).parents('.box').find('tr td input:checkbox'); var bool = false; checkbox.each(function () { if (this.checked) { bool = true; $.ajax( { type: "POST", url: '/Admin/Album/Delete', beforeSend: function () { $("#rendersearch").html("<div id='dvloading' style=' text-align: center; padding: 20px 0px;'><img src='/Content/themes/website/images/ajax-loader.gif' /></div>"); }, async: false, dataType: "json", data: { id: $(this).val() } }) .fail(function () { alert("cố lỗi xảy ra!!"); }); } }); if (!bool) alert("Bạn vui lòng chọn một bản ghi để xóa!"); else window.location.reload(); } }); //xóa một bản ghi $(".btndelte").click(function () { var id = $(this).attr('data'); $(".deleleoneitem").attr('data', id); $('#myAlert').modal('show'); //showalert("Bạn có thực sự muốn xóa bản ghi này?", "Cảnh báo", true); }); $(".deleleoneitem").click(function () { var id = $(this).attr('data'); $.ajax( { type: "POST", url: '/Album/Delete', data: { id: id } }) .done(function () { $('#myAlert').modal('hide'); $("#trow_" + _id).fadeTo("fast", 0, function () { $(this).slideUp("fast", function () { $(this).remove(); }); }); }) .fail(function () { alert("cố lỗi xảy ra!!"); }); }); $(document).on('focusout', '.txtorder', function () { if (event.which == 13) { alert("nxh"); } else { var value = $(this).val(); var _id = $(this).attr('data-id'); $.ajax({ url: '/Admin/album/UpdateOrder', type: 'POST', dataType: 'json', data: { id: _id, order: value } }) .done(function () { $.gritter.add({ title: 'Thông báo thành công.', text: 'Bạn đã cập nhật thứ tự thành công.', sticky: false, class_name: 'my_class_gritter_success' }); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }); } }); }); <file_sep>/COMMOM/EnumCLass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace COMMOM { public class EnumCLass { public enum AdvPosition { Home=1, Right=2, Left=3, Brand=4, LeftHome=5, ProNoiBat=6, ProKhuyenMai=7 }; } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/NationalController.cs using System; using System.Linq; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class NationalController : BaseController { // // GET: /Admin/National/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var na = db.Nationalities.OrderBy(x => x.SortOrder); return View(na); } public ActionResult Add() { return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add(CW_Nationality model) { model.FilterName = COMMOM.Filter.FilterChar(model.NationalityName); db.Set<CW_Nationality>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } public ActionResult Edit(int id) { var nation = db.Nationalities.Find(id); return View(nation); } [HttpPost] public ActionResult Edit(CW_Nationality model) { model.FilterName = COMMOM.Filter.FilterChar(model.NationalityName); db.Nationalities.Attach(model); db.Entry(model).Property(a => a.NationalityName).IsModified = true; db.Entry(model).Property(a => a.Description).IsModified = true; db.Entry(model).Property(a => a.NationalityCode).IsModified = true; db.Entry(model).Property(a => a.Fee).IsModified = true; db.Entry(model).Property(a => a.Tips).IsModified = true; db.Entry(model).Property(a => a.TimeZoo).IsModified = true; db.Entry(model).Property(a => a.SortOrder).IsModified = true; db.Entry(model).Property(a => a.Requirement).IsModified = true; db.Entry(model).Property(a => a.IsActive).IsModified = true; db.Entry(model).Property(a => a.Icon).IsModified = true; db.Entry(model).Property(a => a.FilterName).IsModified = true; db.Entry(model).Property(a => a.Embassy).IsModified = true; db.SaveChanges(); return RedirectToAction("Index"); } [HttpPost] public ActionResult Delete(int id) { var article = db.Set<CW_Nationality>().Find(id); if (article != null) { var catedelte = db.Nationalities.Attach(article); db.Set<CW_Nationality>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateIsActive(int id, bool isactive) { CW_Nationality art = db.Nationalities.Find(id); if (art != null) { db.Set<CW_Nationality>().Attach(art); if (isactive) { art.IsActive = false; } else { art.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateOrder(int id, int order) { CW_Nationality art = db.Nationalities.Find(id); if (art != null) { db.Set<CW_Nationality>().Attach(art); art.SortOrder = order; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } }<file_sep>/COMMOM/FileExtend.cs using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; namespace COMMOM { public class FileExtend { public static string FormatIconURL(string FilePath) { string strImage = ""; string FileExtension = Path.GetExtension(FilePath); if (FileExtension == ".pdf") strImage = "/Images/icon_file/icon-pdf.png"; else if (FileExtension == ".docx" || FileExtension == ".doc") strImage = "/Images/icon_file/icon-doc.png"; else if (FileExtension == ".rar" || FileExtension == ".zip") strImage = "/Images/icon_file/rar.png"; else if (FileExtension == ".xls" || FileExtension == ".xlsx") strImage = "/Images/icon_file/page_excel.png"; else if (FileExtension == ".ppt" || FileExtension == ".pptx") strImage = "/Images/icon_file/file_ppt.png"; return strImage; } public static void WriteFile(string strFileName) { System.Web.HttpResponse objResponse = System.Web.HttpContext.Current.Response; System.IO.Stream objStream = null; try { // Open the file. objStream = new System.IO.FileStream(strFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read); WriteStream(objResponse, objStream); } catch (Exception ex) { // Trap the error, if any. objResponse.Write("Error : " + ex.Message); } finally { if ((objStream == null) == false) { // Close the file. objStream.Close(); } } } public static string GetContentType(string extension) { string contentType = null; switch (extension.ToLower()) { case "txt": contentType = "text/plain"; break; case "htm": case "html": contentType = "text/html"; break; case "rtf": contentType = "text/richtext"; break; case "jpg": case "jpeg": contentType = "image/jpeg"; break; case "gif": contentType = "image/gif"; break; case "bmp": contentType = "image/bmp"; break; case "mpg": case "mpeg": contentType = "video/mpeg"; break; case "avi": contentType = "video/avi"; break; case "pdf": contentType = "application/pdf"; break; case "doc": case "docx": case "dot": contentType = "application/msword"; break; case "csv": case "xls": case "xlsx": case "xlt": contentType = "application/x-msexcel"; break; default: contentType = "application/octet-stream"; break; } return contentType; } public static string ExtractFileName(string filename) { int i = 0; int iExtension = 0; int iEnd = 0; int iStart = 0; string s = filename; if (!filename.ToLower().StartsWith("http")) { iExtension = s.LastIndexOf("."); iEnd = iExtension - 1; i = iEnd; while (i > 0 & iStart == 0) { if (s.Substring(i, 1) == ".") { iStart = i; } i -= 1; } if (iStart > 0) { s = s.Substring(0, iStart) + s.Substring(iExtension); } } return s; } public static void DownloadFile(string FileLoc) { System.IO.FileInfo objFile = new System.IO.FileInfo(FileLoc); System.Web.HttpResponse objResponse = System.Web.HttpContext.Current.Response; string filename = ExtractFileName(objFile.Name); if (HttpContext.Current.Request.UserAgent.IndexOf("; MSIE ") > 0) { filename = HttpUtility.UrlEncode(filename); } if (objFile.Exists) { objResponse.ClearContent(); objResponse.ClearHeaders(); objResponse.AppendHeader("content-disposition", "attachment; filename=\"" + filename + "\""); objResponse.AppendHeader("Content-Length", objFile.Length.ToString()); objResponse.ContentType = GetContentType(objFile.Extension.Replace(".", "")); WriteFile(objFile.FullName); objResponse.Flush(); objResponse.End(); } } private static void WriteStream(HttpResponse objResponse, Stream objStream) { // Buffer to read 10K bytes in chunk: byte[] bytBuffer = new byte[10001]; // Length of the file: int intLength = 0; // Total bytes to read: long lngDataToRead = 0; try { // Total bytes to read: lngDataToRead = objStream.Length; //objResponse.ContentType = "application/octet-stream" // Read the bytes. while (lngDataToRead > 0) { // Verify that the client is connected. if (objResponse.IsClientConnected) { // Read the data in buffer intLength = objStream.Read(bytBuffer, 0, 10000); // Write the data to the current output stream. objResponse.OutputStream.Write(bytBuffer, 0, intLength); // Flush the data to the HTML output. objResponse.Flush(); bytBuffer = new byte[10001]; // Clear the buffer lngDataToRead = lngDataToRead - intLength; } else { //prevent infinite loop if user disconnects lngDataToRead = -1; } } } catch (Exception ex) { // Trap the error, if any. objResponse.Write("Error : " + ex.Message); } finally { if ((objStream == null) == false) { // Close the file. objStream.Close(); } } } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/NewsController.cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web.Mvc; using Model.EF; using COMMOM.Interface; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class NewsController : BaseController { MVCDbContext db=new MVCDbContext(); public ActionResult Index() { var lang = Session["language"].ToString(); IEnumerable<CW_News> news = db.CW_News.Where(x => x.LanguageCode.Equals(lang)).OrderByDescending(x => x.CreatedDate); List<CW_Category> objLst=new List<CW_Category>(); ViewBag.Select = ICategory.ByTypeCode(null, objLst, "", "tin-tuc", lang); return View(news); } public ActionResult Add() { var lang = Session["language"].ToString(); List<CW_Category> obj = new List<CW_Category>(); ViewBag.Select = new SelectList(ICategory.ByTypeCode(null, obj, "", "tin-tuc", lang), "ID", "Title"); return View(); } /// <summary> /// Them moi tin tuc /// </summary> /// <param name="model"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "")] CW_News model) { if (model.MetaTitle == null) model.MetaTitle = model.Title; model.LanguageCode = Session["language"].ToString(); model.FilterTitle =COMMOM.Filter.FilterChar(model.Title); model.CreatedDate = DateTime.Now; db.Set<CW_News>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } public ActionResult Edit(int id) { var lang = Session["language"].ToString(); List<CW_Category> obj = new List<CW_Category>(); ViewBag.Select = new SelectList(ICategory.ByTypeCode(null, obj, "", "tin-tuc", lang), "ID", "Title"); var cate = db.Set<CW_News>().Find(id); if (cate == null) { return HttpNotFound(); } return View(cate); } [HttpPost] public ActionResult Edit([Bind(Include = "")]CW_News news) { if (news.MetaTitle == null) news.MetaTitle = news.Title; news.FilterTitle = COMMOM.Filter.FilterChar(news.Title); db.CW_News.Attach(news); news.CreatedDate = DateTime.Now; db.Entry(news).Property(a => a.Title).IsModified = true; db.Entry(news).Property(a => a.Image).IsModified = true; db.Entry(news).Property(a => a.Description).IsModified = true; db.Entry(news).Property(a => a.Content).IsModified = true; db.Entry(news).Property(a => a.ImageNotes).IsModified = true; db.Entry(news).Property(a => a.Read).IsModified = true; db.Entry(news).Property(a => a.MetaKeywords).IsModified = true; db.Entry(news).Property(a => a.IsActive).IsModified = true; db.Entry(news).Property(a => a.IsHome).IsModified = true; db.Entry(news).Property(a => a.CreatedDate).IsModified = false; db.Entry(news).Property(a => a.Order).IsModified = true; db.Entry(news).Property(a => a.LanguageCode).IsModified = true; db.Entry(news).Property(a => a.CategoryID).IsModified = true; db.Entry(news).Property(a => a.MetaTitle).IsModified = true; db.Entry(news).Property(a => a.MetaDescription).IsModified = true; db.Entry(news).Property(a => a.LanguageCode).IsModified = false; db.Entry(news).Property(a => a.FilterTitle).IsModified = true; db.SaveChanges(); return RedirectToAction("Index"); } /// <summary> /// Xóa ban ghi /// </summary> /// <param name="id"></param> /// <returns></returns> [HttpPost] public ActionResult Delete(int id) { var cate = db.Set<CW_News>().Find(id); if (cate != null) { var catedelete = db.CW_News.Attach(cate); db.Set<CW_News>().Remove(cate); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } /// <summary> /// hiện thi trang home True and false /// </summary> /// <param name="id"></param> /// <param name="isHome"></param> /// <returns></returns> [HttpPost] public ActionResult UpdateIsHome(int id, bool isHome) { CW_News obj = db.CW_News.Find(id); if (obj != null) { db.Set<CW_News>().Attach(obj); if (isHome) { obj.IsHome = false; } else { obj.IsHome = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } /// <summary> /// Hiện thị hoặc ẩn /// </summary> /// <param name="id"></param> /// <param name="isActive"></param> /// <returns></returns> [HttpPost] public ActionResult UpdateIsActive(int id, bool isActive) { CW_News obj = db.CW_News.Find(id); if (obj != null) { db.Set<CW_News>().Attach(obj); if (isActive) { obj.IsActive = false; } else { obj.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateOrder(int id, int order) { CW_News art = db.CW_News.Find(id); if (art != null) { db.Set<CW_News>().Attach(art); art.Order = order; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } } <file_sep>/Model/Models/PassengerType.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Model.Models { public enum PassengerType:short { Adult = 0, Child = 1, Infant = 2 } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/CustomerGroupsController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class CustomerGroupsController : BaseController { // // GET: /Admin/CustomerGroups/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var cusGroup = db.CW_CustomerGroups.OrderByDescending(x => x.CreatedDate); return View(cusGroup); } public ActionResult Add() { return View(); } /// <summary> /// Thêm mới nhóm khách hàng /// </summary> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "")]CW_CustomerGroups model) { if (model.IsDefault) { CW_CustomerGroups obj = new CW_CustomerGroups(); var lstCg = db.CW_CustomerGroups; if (lstCg != null) { foreach (var item in lstCg) { obj = db.CW_CustomerGroups.Find(item.CustomerGroupsID); db.Set<CW_CustomerGroups>().Attach(obj); obj.IsDefault = false; } } } model.CreatedDate = DateTime.Now; db.Set<CW_CustomerGroups>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } public ActionResult Edit(int id) { CW_CustomerGroups cusg = db.CW_CustomerGroups.Find(id); return View(cusg); } /// <summary> /// Sua nhom khach hang /// </summary> /// <returns></returns> [HttpPost] public ActionResult Edit([Bind(Include = "")]CW_CustomerGroups model) { if (model.IsDefault) { CW_CustomerGroups obj = new CW_CustomerGroups(); var lstCusg = db.CW_CustomerGroups.Where(x => x.CustomerGroupsID != model.CustomerGroupsID); if (lstCusg!=null) { foreach (var item in lstCusg) { obj = db.CW_CustomerGroups.Find(item.CustomerGroupsID); db.Set<CW_CustomerGroups>().Attach(obj); obj.IsDefault = false; } } } db.CW_CustomerGroups.Attach(model); db.Entry(model).Property(x => x.CustomerGroupName).IsModified = true; db.Entry(model).Property(x => x.IsDefault).IsModified = true; db.Entry(model).Property(x => x.CreatedDate).IsModified = false; db.SaveChanges(); return RedirectToAction("Index"); } /// <summary> /// Thay đổi IsDefault /// </summary> /// <param name="id"></param> /// <param name="isDefault"></param> /// <returns></returns> [HttpPost] public ActionResult UpdateIsDefault(int id,bool isDefault) { CW_CustomerGroups obj = db.CW_CustomerGroups.Find(id); if (obj != null) { db.Set<CW_CustomerGroups>().Attach(obj); if (isDefault) { obj.IsDefault = false; } else { obj.IsDefault = true; var lstCusg = db.CW_CustomerGroups.Where(x => x.CustomerGroupsID != id); if (lstCusg!=null) { foreach (var item in lstCusg) { obj = db.CW_CustomerGroups.Find(item.CustomerGroupsID); db.Set<CW_CustomerGroups>().Attach(obj); obj.IsDefault = false; } } } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } /// <summary> /// Xóa bản ghi nhóm /// </summary> /// <param name="item"></param> /// <returns></returns> [HttpPost] public ActionResult Delete(int id) { var cg = db.Set<CW_CustomerGroups>().Find(id); if (cg != null) { var catedelte = db.CW_CustomerGroups.Attach(cg); db.Set<CW_CustomerGroups>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } } <file_sep>/Model/EF/CW_Customers.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { //dùng cho thành viên đăng ký [Table("CW_Customers")] public class CW_Customers { [Key] [ForeignKey("UserProfile")] [HiddenInput(DisplayValue = false)] public int UserId { get; set; } [Display(Name = "Tài khoản (Email)")] [Required(ErrorMessage = "Bắt buộc phải nhập!")] [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] [DataType(DataType.EmailAddress)] public string UserNameCustomer { get; set; } [Display(Name = "Yahoo")] [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] public string NickYahoo { get; set; } [Display(Name = "Skype")] [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] public string NickSkype { get; set; } [Display(Name = "Facebook")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string Facebook { get; set; } [Display(Name = "Nhóm khách hàng")] public int? CustomerGroupsID { get; set; } [Display(Name = "Tham gia")] public DateTime CreatedDate { get; set; } public virtual UserProfile UserProfile { get; set; } public virtual CW_CustomerGroups CW_CustomerGroups { get; set; } } } <file_sep>/Model/EF/CW_AirportRoute.cs using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Model.EF { [Table("CW_AirportRoute")] public class CW_AirportRoute { [Key,Column(Order = 0)] public int AirportID1 { get; set; } [Key,Column(Order = 1)] public int AirportID2 { get; set; } //public List<CW_Airport> Airports { get; set; } } }<file_sep>/MVC4.PROJECT/asset/admin/js/email.js  $(document).ready(function () { //checked all $("#title-checkbox").change(function () { var checkedStatus = this.checked; var checkbox = $(this).parents('.box').find('tr td input:checkbox'); checkbox.each(function () { this.checked = checkedStatus; if (this.checked) { checkbox.attr("selected", "checked"); checkbox.parent('span').addClass('checked'); } else { checkbox.attr("selected", ""); checkbox.parent('span').removeClass('checked'); } }); }); //xóa nhiều bản ghi cùng một nút $(".delete").click(function () { var checkbox = $('.box').find('tr td input:checkbox'); //if (checkbox.attr("selected", "")) { // alert("Bạn chưa chọn bản ghi nào"); //} var conf = confirm("Bạn có thực sự muốn xóa những bản ghi này !"); if (conf == true) { var checkbox = $(this).parents('.box').find('tr td input:checkbox'); var bool = false; checkbox.each(function () { if (this.checked) { bool = true; $.ajax( { type: "POST", url: '/Email/Delete', beforeSend: function () { $("#rendersearch").html("<div id='dvloading' style=' text-align: center; padding: 20px 0px;'><img src='/Content/themes/admin/images/ajax-loader.gif' /></div>"); }, async: false, dataType: "json", data: { id: $(this).val() } }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }); } }); if (!bool) { $.gritter.add({ title: 'Chú ý.', text: 'Bạn vui lòng chọn một bản ghi để xóa!', sticky: false, class_name: 'my_class_gritter_alert' }); } else { window.location.reload(); } } }); //xóa một bản ghi $(".btndelte").click(function () { var id = $(this).attr('data'); $(".deleleoneitem").attr('data', id); //showalert("Bạn có thực sự muốn xóa bản ghi này?", "Cảnh báo", true); }); $(".deleleoneitem").click(function () { var _id = $(this).attr('data'); $.ajax( { type: "POST", url: '/Email/Delete', data: { id: _id } }) .done(function () { $('#myAlert').modal('hide'); $("#trow_" + _id).fadeTo("fast", 0, function () { $(this).slideUp("fast", function () { $(this).remove(); }); }); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }); }); });<file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/AirportController.cs using System.Collections.Generic; using System.Linq; using Model.EF; using System.Web.Mvc; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class AirportController : BaseController { // // GET: /Admin/Airport/ private MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var ariport = db.Airports.OrderBy(x => x.SortOrder); return View(ariport); } public ActionResult View(int id) { var ariport = db.Airports.Find(id); return View(ariport); } public ActionResult Add() { //nhà sản xuất IEnumerable<CW_Airport> objvendors = db.Airports; ViewBag.Airports = objvendors; return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add(CW_Airport model, List<int> lstIdDen) { if (ModelState.IsValid) { db.Set<CW_Airport>().Add(model); if (lstIdDen != null) { for (int i = 0; i < lstIdDen.Count; i++) { if (!lstIdDen[i].ToString().Equals("")) { CW_AirportRoute a = new CW_AirportRoute(); a.AirportID1 = model.Id; a.AirportID2 = lstIdDen[i]; db.Set<CW_AirportRoute>().Add(a); //db.SaveChanges(); } } } db.SaveChanges(); return RedirectToAction("Index"); } else { IEnumerable<CW_Airport> objvendors = db.Airports; ViewBag.Airports = objvendors; return View(model); } } public ActionResult Edit(int id) { var air = db.Airports.Find(id); //IEnumerable<CW_Airport> objvendors = db.Airports; ViewBag.Airports = db.Airports.OrderBy(x => x.Id); List<CW_AirportRoute> selectlist = db.AirportRoutes.OrderBy(x => x.AirportID1).ToList(); if (selectlist.Count > 0) { ViewBag.SelectListItems = selectlist; } return View(air); } [HttpPost] public ActionResult Edit(CW_Airport model, List<int> lstIdDen) { //IEnumerable<CW_Airport> objmenunoselect = db.Airports; if (lstIdDen != null) { var lstAir = db.AirportRoutes.Where(x => x.AirportID1 == model.Id); if (lstAir.Any()) { foreach (var str in lstAir) { var catedelte = db.AirportRoutes.Attach(str); db.AirportRoutes.Remove(catedelte); } } for (int i = 0; i < lstIdDen.Count; i++) { if (!lstIdDen[i].ToString().Equals("")) { CW_AirportRoute a = new CW_AirportRoute(); a.AirportID1 = model.Id; a.AirportID2 = lstIdDen[i]; db.Set<CW_AirportRoute>().Add(a); db.SaveChanges(); } } //foreach (int str in lstIdDen) //{ // var lst = db.AirportRoutes.SingleOrDefault(x => x.AirportID1 == model.Id && x.AirportID2 == str); // if (lst != null) // { // db.AirportRoutes.Remove(lst); // db.SaveChanges(); // } // //IEnumerable<CW_AirportRoute> lstai= from air in db.AirportRoutes // // where air.AirportID1 == model.Id && air.AirportID2.Equals(str) // // select air; // //if (lstai != null) // //{ // // addmenucate = new CW_AirportRoute(); // // addmenucate.AirportID1 = model.Id; // // addmenucate.AirportID2 = str; // // db.Set<CW_AirportRoute>().Add(addmenucate); // // db.SaveChanges(); // //} // //objmenunoselect = objmenunoselect.Where(x => !x.Id.Equals(str)); //} //menu không được chọn nữa, nhưng đang tồn tại trong bảng CW_AirportRoute thì xóa đi //if (lstIdDen != null) //{ // CW_AirportRoute objMenuCategory = null; // foreach (var item in objmenunoselect) // { // objMenuCategory = db.AirportRoutes.Where(x => x.AirportID1 == model.Id && x.AirportID2.Equals(item.Id)).FirstOrDefault(); // if (objMenuCategory != null) // { // db.AirportRoutes.Attach(objMenuCategory); // db.Set<CW_AirportRoute>().Remove(objMenuCategory); // } // } // db.SaveChanges(); //} } //else //{ // IEnumerable<CW_AirportRoute> menucate = (from s in db.AirportRoutes // where s.AirportID1 == model.Id // select s); // foreach (CW_AirportRoute obj in menucate) // { // db.AirportRoutes.Attach(obj); // db.Set<CW_AirportRoute>().Remove(obj); // } // db.SaveChanges(); //} db.Airports.Attach(model); db.Entry(model).Property(a => a.AirportName).IsModified = true; db.Entry(model).Property(a => a.AirportCode).IsModified = true; db.Entry(model).Property(a => a.SortOrder).IsModified = true; db.Entry(model).Property(a => a.IsActive).IsModified = true; db.SaveChanges(); return RedirectToAction("Index"); } [HttpPost] public ActionResult Delete(int id) { var article = db.Set<CW_Airport>().Find(id); if (article != null) { var catedelte = db.Airports.Attach(article); db.Set<CW_Airport>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateIsActive(int id, bool isactive) { CW_Airport art = db.Airports.Find(id); if (art != null) { db.Set<CW_Airport>().Attach(art); if (isactive) { art.IsActive = false; } else { art.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateOrder(int id, int order) { CW_Airport art = db.Airports.Find(id); if (art != null) { db.Set<CW_Airport>().Attach(art); art.SortOrder = order; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } }<file_sep>/Model/Models/FindFlight.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Model.Models { public class FindFlight { public bool RoundTrip { get; set; } public string FromPlace { get; set; } public string ToPlace { get; set; } public DateTime DepartDate { get; set; } public DateTime ReturnDate { get; set; } public string CurrencyType { get; set; } public string FlightType { get; set; } public int Adult { get; set; } public int Child { get; set; } public int Infant { get; set; } public string Sources { get; set; } } } <file_sep>/COMMOM/Utility.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace COMMOM { class Utility { public static string RemoveHtmlTag(string htmlContent) { return Regex.Replace(htmlContent, "<[^>]*>", string.Empty).Replace("&nbsp;", "").Trim(); } } } <file_sep>/MVC4.PROJECT/App_Start/RouteConfig.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace MVC4.PROJECT { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // chi tiết tin tức routes.MapRoute( name: "News_Detail", url: "{categoryname}/{title}/{id}", defaults: new { controller = "News", action = "NewsDetail", categoryname = UrlParameter.Optional, title = UrlParameter.Optional, id = UrlParameter.Optional }, constraints: new { id = @"\d+", }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); // tin tức routes.MapRoute( name: "News_List", url: "muc-{title}", defaults: new { controller = "News", action = "Index", title = UrlParameter.Optional }, //constraints: new { id = @"\d+", }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); routes.MapRoute( name: "Contact", url: "lien-he", defaults: new { controller = "Contact", action = "Index", title = UrlParameter.Optional }, //constraints: new { id = @"\d+", }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); //dang ky routes.MapRoute( name: "Account", url: "dang-ky", defaults: new { controller = "Account", action = "Login"}, //constraints: new { id = @"\d+", }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); routes.MapRoute( name: "Login/Register", url: "dang-nhap", defaults: new { controller = "Account", action = "Login" }, //constraints: new { id = @"\d+", }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); // bài viết routes.MapRoute( name: "Article_List", url: "bai-viet/{title}", defaults: new { controller = "Article", action = "Index", title = UrlParameter.Optional }, //constraints: new { id = @"\d+", }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new[] { "MVC4.PROJECT.Controllers" } ); } } }<file_sep>/Model/Models/Booking.cs using System; using System.Collections.Generic; namespace Model.Models { public class Booking { public int Adult { get; set; } public ICollection<BookingPassenger> BookingPassengers { get; set; } public string Brand { get; set; } public int Child { get; set; } public string CurrencyType { get; set; } public DateTime DepartDate { get; set; } public string FlightNumber { get; set; } public string ReturnFlightNumber { get; set; } public string FromPlaceCode { get; set; } public string ToPlaceCode { get; set; } public int Infant { get; set; } public DateTime ReturnDate { get; set; } public bool RoundTrip { get; set; } public decimal? TicketPrice { get; set; } public decimal? ReturnTicketPrice { get; set; } public string TicketType { get; set; } public string CallBackUrl { get; set; } public string ReturnTicketType { get; set; } public string FareBasis { get; set; } public string ReturnFareBasis { get; set; } } }<file_sep>/Model/Models/PriceSummary.cs namespace Model.Models { public class PriceSummary { public string PassengerType { get; set; } public string Description { get; set; } public string Code { get; set; } public int Quantity { get; set; } public decimal Price { get; set; } public decimal Total { get; set; } } }<file_sep>/Model/EF/CW_Nationality.cs using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Model.EF { [Table("CW_Nationality")] public class CW_Nationality { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Display(Name = "Tên quốc gia")] [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] public string NationalityName { get; set; } [Display(Name = "Mã quốc gia")] public string NationalityCode { get; set; } [Display(Name = "Fee")] public int Fee { get; set; } [Display(Name = "Mô tả")] public string Description { get; set; } [Display(Name = "Hiển thị")] public bool IsActive { get; set; } [Display(Name = "Thứ tự")] public int SortOrder { get; set; } [Display(Name = "TimeZoo")] public string TimeZoo { get; set; } [Display(Name = "Icon")] [StringLength(250, ErrorMessage = "Bạn chỉ được nhập tối đa 250 ký tự !")] public string Icon { get; set; } [Display(Name = "Embassy")] public string Embassy { get; set; } [Display(Name = "Requirement")] public string Requirement { get; set; } public string FilterName { get; set; } [Display(Name = "Tips")] public string Tips { get; set; } } }<file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/ArticleController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using COMMOM.Interface; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class ArticleController : BaseController { // // GET: /Admin/Article/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var lang = Session["language"].ToString(); IEnumerable<CW_Article> article; article = db.CW_Article.Where(x => x.LanguageCode.Equals(lang)).OrderByDescending(x => x.CreatedDate); List<CW_Category> obj = new List<CW_Category>(); ViewBag.Select = ICategory.ByTypeCode(null, obj, "", "bai-viet", lang); return View(article); } public ActionResult Add() { var lang = Session["language"].ToString(); List<CW_Category> obj = new List<CW_Category>(); ViewBag.Select = new SelectList(ICategory.ByTypeCode(null, obj, "", "bai-viet", lang), "ID", "Title"); return View(); } /// <summary> /// thêm bài viết /// </summary> /// <param name="model"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "")]CW_Article model) { if (model.MetaTitle == null) model.MetaTitle = model.Title; model.LanguageCode = Session["language"].ToString(); model.FilterTitle = COMMOM.Filter.FilterChar(model.Title); model.CreatedDate = DateTime.Now; db.Set<CW_Article>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } public ActionResult Edit(int id) { var lang = Session["language"].ToString(); List<CW_Category> obj = new List<CW_Category>(); ViewBag.Select = new SelectList(ICategory.ByTypeCode(null, obj, "", "bai-viet", lang), "ID", "Title"); //var db = new PortalContext(); var cate = db.Set<CW_Article>().Find(id); if (cate == null) { return HttpNotFound(); } return View(cate); } /// <summary> /// Sửa bài viết /// </summary> /// <param name="article"></param> /// <returns></returns> [HttpPost] public ActionResult Edit([Bind(Include = "")]CW_Article article) { if (article.MetaTitle == null) article.MetaTitle = article.Title; article.FilterTitle = COMMOM.Filter.FilterChar(article.Title); db.CW_Article.Attach(article); db.Entry(article).Property(a => a.Title).IsModified = true; db.Entry(article).Property(a => a.Description).IsModified = true; db.Entry(article).Property(a => a.Body).IsModified = true; db.Entry(article).Property(a => a.CategoryID).IsModified = true; db.Entry(article).Property(a => a.Order).IsModified = true; db.Entry(article).Property(a => a.FilterTitle).IsModified = true; db.Entry(article).Property(a => a.MetaKeywords).IsModified = true; db.Entry(article).Property(a => a.IsActive).IsModified = true; db.Entry(article).Property(a => a.CreatedDate).IsModified = false; db.Entry(article).Property(a => a.Description).IsModified = true; db.Entry(article).Property(a => a.MetaTitle).IsModified = true; db.Entry(article).Property(a => a.MetaDescription).IsModified = true; db.Entry(article).Property(a => a.LanguageCode).IsModified = false; db.SaveChanges(); return RedirectToAction("Index"); } [HttpPost] public ActionResult Delete(int id) { var article = db.Set<CW_Article>().Find(id); if (article != null) { var catedelte = db.CW_Article.Attach(article); db.Set<CW_Article>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateIsActive(int id, bool isactive) { CW_Article art = db.CW_Article.Find(id); if (art != null) { db.Set<CW_Article>().Attach(art); if (isactive) { art.IsActive = false; } else { art.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateOrder(int id, int order) { CW_Article art = db.CW_Article.Find(id); if (art != null) { db.Set<CW_Article>().Attach(art); art.Order = order; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateTitle(int id, string title) { CW_Article article = db.CW_Article.Find(id); if (article != null) { db.Set<CW_Article>().Attach(article); article.Title = title; article.FilterTitle = COMMOM.Filter.FilterChar(title); db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } } <file_sep>/MVC4.PROJECT/Controllers/AccountController.cs using DotNetOpenAuth.AspNet; using Microsoft.Web.WebPages.OAuth; using Model.EF; using MVC4.PROJECT.Models; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Transactions; using System.Web.Mvc; using System.Web.Security; using WebMatrix.WebData; namespace MVC4.PROJECT.Controllers { //[Authorize] //[InitializeSimpleMembership] public class AccountController : BaseController { private MVCDbContext db = new MVCDbContext(); // // GET: /Account/Login #region "login & logout & register" [AllowAnonymous] public ActionResult Login(string returnUrl) { if (HttpContext.Request.UrlReferrer != null) { ViewBag.ReturnUrl = HttpContext.Request.UrlReferrer.PathAndQuery; } else ViewBag.ReturnUrl = "/"; return View(); } // // POST: /Account/Login [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) { return RedirectToLocal(returnUrl); } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "Tài khoản hoặc mật khẩu không đúng !"); return View(model); } #endregion "login & logout & register" // // POST: /Account/LogOff [COMMOM.ClientAuthorize] public ActionResult LogOff() { WebSecurity.Logout(); return Redirect(HttpContext.Request.UrlReferrer.PathAndQuery); } [ChildActionOnly] public PartialViewResult _RegisterModule() { return PartialView(); } // // GET: /Account/Register [AllowAnonymous] public ActionResult Register() { return View(); } // // POST: /Account/Register [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public JsonResult Register(RegisterCustomersModel model) { string[] roles = { "customer" }; var respone = new { flag = 0 }; //nhóm khách hàng mặc định var cusgroup = db.CW_CustomerGroups.Where(x => x.IsDefault).FirstOrDefault(); var temp = (from p in db.Set<UserProfile>() where p.UserName.Equals(model.CW_Customers.UserNameCustomer, StringComparison.OrdinalIgnoreCase) select p).FirstOrDefault(); if (temp != null)//tài khoản đã tồn tại { ModelState.AddModelError("", "Tài khoản này đã tồn tại. vui lòng nhập tài khoản khác !"); respone = new { flag = 0 }; } else { WebSecurity.CreateUserAndAccount(model.CW_Customers.UserNameCustomer, model.Password, new { FullName = model.CW_Customers.UserProfile.FullName, Email = model.CW_Customers.UserNameCustomer, Address = model.CW_Customers.UserProfile.Address, Mobile = model.CW_Customers.UserProfile.Mobile, IsLock = model.CW_Customers.UserProfile.IsLock }, false); var userProfile = db.UserProfiles.FirstOrDefault(u => u.UserName == model.CW_Customers.UserNameCustomer); if (userProfile != null) { var users = new CW_Customers { UserProfile = userProfile, UserNameCustomer = model.CW_Customers.UserNameCustomer, NickYahoo = model.CW_Customers.NickYahoo, NickSkype = model.CW_Customers.NickSkype, Facebook = model.CW_Customers.Facebook, CustomerGroupsID = cusgroup.CustomerGroupsID, CreatedDate = DateTime.Now }; db.CW_Customers.Add(users); db.SaveChanges(); } try { Roles.AddUserToRoles(model.CW_Customers.UserNameCustomer, roles); } catch (Exception) { } respone = new { flag = 1 }; } return Json(respone, JsonRequestBehavior.AllowGet); } public ActionResult RegisterComplete() { return View(); } #region "Change & reset password" [COMMOM.ClientAuthorize] public ActionResult ChangePass() { return View(); } [ChildActionOnly] [COMMOM.ClientAuthorize] public PartialViewResult _ChangePass() { return PartialView(); } [HttpPost] [COMMOM.ClientAuthorize] public PartialViewResult _ChangePass([Bind(Exclude = "")]LocalPasswordModel model) { WebSecurity.ChangePassword(WebSecurity.CurrentUserName, model.OldPassword, model.NewPassword); return PartialView(); } [AllowAnonymous] public ActionResult SendPassword() { return View(); } [ChildActionOnly] public PartialViewResult _SendPassword() { return PartialView(); } [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public JsonResult _SendPassword(string UserName) { var respone = new { flag = 0 }; //generate password token var token = WebSecurity.GeneratePasswordResetToken(UserName); //create url with above token var resetLink = "<a href='" + Url.Action("ResetPassword", "Account", new { un = UserName, rt = token }, "http") + "'>Reset Password</a>"; string body = "<b>Hãy nhấn vào link dưới đây để lấy lại mật khẩu của bạn: </b><br/>" + resetLink; //edit it try { var user = db.CW_Customers.Where(x => x.UserNameCustomer.Equals(UserName)).FirstOrDefault(); if (user != null) { COMMOM.Interface.Helper.SendMail("HoangTan", "Cấp lại mật khẩu : " + UserName, body, user.UserNameCustomer); respone = new { flag = 1 }; } else respone = new { flag = 0 }; } catch (Exception ex) { TempData["Message"] = "Error occured while sending email." + ex.Message; } return Json(respone, JsonRequestBehavior.AllowGet); } [AllowAnonymous] [COMMOM.ClientAuthorize] public ActionResult ResetPassword(string un, string rt) { //MVCDbContext db = new MVCDbContext(); //TODO: Check the un and rt matching and then perform following //get userid of received username var userid = (from i in db.UserProfiles where i.UserName == un select i.UserId).FirstOrDefault(); //check userid and token matches bool any = (from j in db.webpages_Memberships where (j.UserId == userid) && (j.PasswordVerificationToken == rt) //&& (j.PasswordVerificationTokenExpirationDate < DateTime.Now) select j).Any(); if (any == true) { //generate random password string newpassword = COMMOM.Extends.GenerateRandomPassword(8); //reset password bool response = WebSecurity.ResetPassword(rt, newpassword); if (response == true) { //get user emailid to send password var emailid = (from i in db.UserProfiles where i.UserName == un select i.Email).FirstOrDefault(); //send email string subject = "Gửi mật khẩu mới"; string body = "<b>Dưới đây là mật khẩu mới của bạn, hãy lưu trữ và đăng nhập bằng mật khẩu này</b><br/>" + newpassword; //edit it try { COMMOM.Interface.Helper.SendMail("HoangTan", subject, body, emailid); TempData["Message"] = "Mail đã được gửi."; } catch (Exception ex) { TempData["Message"] = "Có lỗi xảy ra trong khi gửi mail." + ex.Message; } //display message TempData["Message"] = "Thành công! Mail mới của bạn là " + newpassword; } else { TempData["Message"] = "Không tạo được mật khẩu tự động."; } } else { TempData["Message"] = "Tài khoản hoặc mã không chính xác"; } return View(); } #endregion "Change & reset password" #region "profile" [COMMOM.ClientAuthorize] public ActionResult ProfileUser() { return View(); } [ChildActionOnly] [COMMOM.ClientAuthorize] public PartialViewResult _ProfileUser() { var user = db.CW_Customers.Where(x => x.UserNameCustomer == WebSecurity.CurrentUserName).FirstOrDefault(); return PartialView(user); } [HttpPost] [COMMOM.ClientAuthorize] public PartialViewResult _ProfileUser(CW_Customers user) { user.CreatedDate = DateTime.Now; db.Entry(user).State = EntityState.Modified; db.Entry(user.UserProfile).State = EntityState.Modified; db.SaveChanges(); var users = db.CW_Customers.Where(x => x.UserNameCustomer == WebSecurity.CurrentUserName).FirstOrDefault(); return PartialView("_ProfileUser", users); } #endregion "profile" // // POST: /Account/Disassociate [HttpPost] [ValidateAntiForgeryToken] public ActionResult Disassociate(string provider, string providerUserId) { string ownerAccount = OAuthWebSecurity.GetUserName(provider, providerUserId); ManageMessageId? message = null; // Only disassociate the account if the currently logged in user is the owner if (ownerAccount == User.Identity.Name) { // Use a transaction to prevent the user from deleting their last login credential using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.Serializable })) { bool hasLocalAccount = OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name)); if (hasLocalAccount || OAuthWebSecurity.GetAccountsFromUserName(User.Identity.Name).Count > 1) { OAuthWebSecurity.DeleteAccount(provider, providerUserId); scope.Complete(); message = ManageMessageId.RemoveLoginSuccess; } } } return RedirectToAction("Manage", new { Message = message }); } // // GET: /Account/Manage public ActionResult Manage(ManageMessageId? message) { ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." : ""; ViewBag.HasLocalPassword = OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name)); ViewBag.ReturnUrl = Url.Action("Manage"); return View(); } // // POST: /Account/Manage [HttpPost] [ValidateAntiForgeryToken] public ActionResult Manage(LocalPasswordModel model) { bool hasLocalAccount = OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name)); ViewBag.HasLocalPassword = hasLocalAccount; ViewBag.ReturnUrl = Url.Action("Manage"); if (hasLocalAccount) { if (ModelState.IsValid) { // ChangePassword will throw an exception rather than return false in certain failure scenarios. bool changePasswordSucceeded; try { changePasswordSucceeded = WebSecurity.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword); } catch (Exception) { changePasswordSucceeded = false; } if (changePasswordSucceeded) { return RedirectToAction("Manage", new { Message = ManageMessageId.ChangePasswordSuccess }); } else { ModelState.AddModelError("", "The current password is incorrect or the new password is invalid."); } } } else { // User does not have a local password so remove any validation errors caused by a missing // OldPassword field ModelState state = ModelState["OldPassword"]; if (state != null) { state.Errors.Clear(); } if (ModelState.IsValid) { try { WebSecurity.CreateAccount(User.Identity.Name, model.NewPassword); return RedirectToAction("Manage", new { Message = ManageMessageId.SetPasswordSuccess }); } catch (Exception) { ModelState.AddModelError("", String.Format("Unable to create local account. An account with the name \"{0}\" may already exist.", User.Identity.Name)); } } } // If we got this far, something failed, redisplay form return View(model); } // // POST: /Account/ExternalLogin [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult ExternalLogin(string provider, string returnUrl) { return new ExternalLoginResult(provider, Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl })); } // // GET: /Account/ExternalLoginCallback [AllowAnonymous] public ActionResult ExternalLoginCallback(string returnUrl) { AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl })); if (!result.IsSuccessful) { return RedirectToAction("ExternalLoginFailure"); } if (OAuthWebSecurity.Login(result.Provider, result.ProviderUserId, createPersistentCookie: false)) { return RedirectToLocal(returnUrl); } if (User.Identity.IsAuthenticated) { // If the current user is logged in add the new account OAuthWebSecurity.CreateOrUpdateAccount(result.Provider, result.ProviderUserId, User.Identity.Name); return RedirectToLocal(returnUrl); } else { // User is new, ask for their desired membership name string loginData = OAuthWebSecurity.SerializeProviderUserId(result.Provider, result.ProviderUserId); ViewBag.ProviderDisplayName = OAuthWebSecurity.GetOAuthClientData(result.Provider).DisplayName; ViewBag.ReturnUrl = returnUrl; return View("ExternalLoginConfirmation", new RegisterExternalLoginModel { UserName = result.UserName, ExternalLoginData = loginData }); } } // // POST: /Account/ExternalLoginConfirmation [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult ExternalLoginConfirmation(RegisterExternalLoginModel model, string returnUrl) { string provider = null; string providerUserId = null; if (User.Identity.IsAuthenticated || !OAuthWebSecurity.TryDeserializeProviderUserId(model.ExternalLoginData, out provider, out providerUserId)) { return RedirectToAction("Manage"); } if (ModelState.IsValid) { // Insert a new user into the database using (MVCDbContext db = new MVCDbContext()) { UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == model.UserName.ToLower()); // Check if user already exists if (user == null) { // Insert name into the profile table db.UserProfiles.Add(new UserProfile { UserName = model.UserName }); db.SaveChanges(); OAuthWebSecurity.CreateOrUpdateAccount(provider, providerUserId, model.UserName); OAuthWebSecurity.Login(provider, providerUserId, createPersistentCookie: false); return RedirectToLocal(returnUrl); } else { ModelState.AddModelError("UserName", "User name already exists. Please enter a different user name."); } } } ViewBag.ProviderDisplayName = OAuthWebSecurity.GetOAuthClientData(provider).DisplayName; ViewBag.ReturnUrl = returnUrl; return View(model); } // // GET: /Account/ExternalLoginFailure [AllowAnonymous] public ActionResult ExternalLoginFailure() { return View(); } [AllowAnonymous] [ChildActionOnly] public ActionResult ExternalLoginsList(string returnUrl) { ViewBag.ReturnUrl = returnUrl; return PartialView("_ExternalLoginsListPartial", OAuthWebSecurity.RegisteredClientData); } [ChildActionOnly] public ActionResult RemoveExternalLogins() { ICollection<OAuthAccount> accounts = OAuthWebSecurity.GetAccountsFromUserName(User.Identity.Name); List<ExternalLogin> externalLogins = new List<ExternalLogin>(); foreach (OAuthAccount account in accounts) { AuthenticationClientData clientData = OAuthWebSecurity.GetOAuthClientData(account.Provider); externalLogins.Add(new ExternalLogin { Provider = account.Provider, ProviderDisplayName = clientData.DisplayName, ProviderUserId = account.ProviderUserId, }); } ViewBag.ShowRemoveButton = externalLogins.Count > 1 || OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name)); return PartialView("_RemoveExternalLoginsPartial", externalLogins); } #region Helpers private ActionResult RedirectToLocal(string returnUrl) { if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } else { return RedirectToAction("Index", "Home"); } } public enum ManageMessageId { ChangePasswordSuccess, SetPasswordSuccess, RemoveLoginSuccess, } internal class ExternalLoginResult : ActionResult { public ExternalLoginResult(string provider, string returnUrl) { Provider = provider; ReturnUrl = returnUrl; } public string Provider { get; private set; } public string ReturnUrl { get; private set; } public override void ExecuteResult(ControllerContext context) { OAuthWebSecurity.RequestAuthentication(Provider, ReturnUrl); } } private static string ErrorCodeToString(MembershipCreateStatus createStatus) { // See http://go.microsoft.com/fwlink/?LinkID=177550 for // a full list of status codes. switch (createStatus) { case MembershipCreateStatus.DuplicateUserName: return "User name already exists. Please enter a different user name."; case MembershipCreateStatus.DuplicateEmail: return "A user name for that e-mail address already exists. Please enter a different e-mail address."; case MembershipCreateStatus.InvalidPassword: return "The password provided is invalid. Please enter a valid password value."; case MembershipCreateStatus.InvalidEmail: return "The e-mail address provided is invalid. Please check the value and try again."; case MembershipCreateStatus.InvalidAnswer: return "The password retrieval answer provided is invalid. Please check the value and try again."; case MembershipCreateStatus.InvalidQuestion: return "The password retrieval question provided is invalid. Please check the value and try again."; case MembershipCreateStatus.InvalidUserName: return "The user name provided is invalid. Please check the value and try again."; case MembershipCreateStatus.ProviderError: return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; case MembershipCreateStatus.UserRejected: return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."; default: return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; } } #endregion Helpers } }<file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/RolesController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Security; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class RolesController : Controller { // // GET: /Admin/Roles/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var role = db.WebRoles; return View(role); } public JsonResult GetRoles(string text) { var roles = from x in db.WebRoles select x; if (!string.IsNullOrEmpty(text)) { roles = roles.Where(p => p.RoleName.Contains(text)); } return Json(roles, JsonRequestBehavior.AllowGet); } public ActionResult Add() { return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "RoleId")]WebRole model) { if (ModelState.IsValid) { var temp = (from p in db.Set<WebRole>() where p.RoleName.Equals(model.RoleName, StringComparison.OrdinalIgnoreCase) select p).FirstOrDefault(); if (temp != null) { ModelState.AddModelError("", "Nhóm đã tồn tại."); return View(model); } else { db.Set<WebRole>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } } else { return View(model); } } public ActionResult Edit(int id) { var role = db.Set<WebRole>().Find(id); if (role == null) { return HttpNotFound(); } ViewBag.cRoleName = role.RoleName; return View("Edit", role); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Edit(WebRole model, string cRoleName) { ViewBag.cRoleName = cRoleName; if (ModelState.IsValid) { try { var temp = (from p in db.Set<WebRole>() where p.RoleName.Equals(model.RoleName, StringComparison.OrdinalIgnoreCase) && !p.RoleName.Equals(cRoleName, StringComparison.OrdinalIgnoreCase) select p).FirstOrDefault(); if (temp != null) { ModelState.AddModelError("", "Nhóm đã tồn tại."); return View(model); } else { var roleupdate = new WebRole { RoleId = model.RoleId }; db.WebRoles.Attach(model); db.Entry(model).Property(a => a.RoleName).IsModified = true; db.Entry(model).Property(a => a.RoleId).IsModified = true; db.Entry(model).Property(a => a.Description).IsModified = true; db.SaveChanges(); return RedirectToAction("Index"); } } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return View(model); } } else { return View(model); } } [HttpPost] public ActionResult Delete(int id) { try { var role = db.Set<WebRole>().Find(id); var user = Roles.GetUsersInRole(role.RoleName); if (user != null && user.Count() > 0) { Roles.RemoveUsersFromRole(user, role.RoleName); Roles.DeleteRole(role.RoleName); } else Roles.DeleteRole(role.RoleName); return Json("Delete", JsonRequestBehavior.AllowGet); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); } return Json("Delete", JsonRequestBehavior.AllowGet); } } } <file_sep>/Model/EF/MVCDbContext.cs using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Text; namespace Model.EF { public class MVCDbContext : DbContext { public MVCDbContext() : base("DefaultConnection") { } public DbSet<CW_Category> CW_Category { get; set; } public DbSet<CW_Article> CW_Article { get; set; } public DbSet<CW_News> CW_News { get; set; } public DbSet<CW_Adv> CW_Adv { get; set; } public DbSet<CW_Contact> CW_Contact { get; set; } public DbSet<CW_Menu> CW_Menu { get; set; } public DbSet<CW_Support> CW_Support { get; set; } public DbSet<CW_Setting> CW_Setting { get; set; } public DbSet<CW_NewsComment> CW_NewsComment { get; set; } public DbSet<CW_Language> CW_Language { get; set; } public DbSet<CW_Menu_Category> CW_Menu_Category { get; set; } public DbSet<CW_Email> CW_Email { get; set; } public DbSet<CW_Airport> Airports { get; set; } public DbSet<CW_Nationality> Nationalities { get; set; } public DbSet<CW_Booking> Bookings { get; set; } public DbSet<CW_AirportRoute> AirportRoutes { get; set; } //user model public DbSet<UserProfile> UserProfiles { get; set; } public DbSet<CW_Customers> CW_Customers { get; set; } public DbSet<CW_CustomerGroups> CW_CustomerGroups { get; set; } public DbSet<WebRole> WebRoles { get; set; } public DbSet<webpages_Membership> webpages_Memberships { get; set; } } } <file_sep>/Model/Migrations/201608091526066_Init2.cs namespace Model.Migrations { using System; using System.Data.Entity.Migrations; public partial class Init2 : DbMigration { public override void Up() { CreateTable( "dbo.Airport", c => new { Id = c.Int(nullable: false, identity: true), AirportName = c.String(nullable: false, maxLength: 200), AirportCode = c.String(maxLength: 10), SortOrder = c.Int(nullable: false), IsActive = c.Boolean(nullable: false), }) .PrimaryKey(t => t.Id); CreateTable( "dbo.Booking", c => new { Id = c.Int(nullable: false, identity: true), FullName = c.String(nullable: false, maxLength: 300), Email = c.String(nullable: false), Phone = c.String(), Prequent = c.String(), Message = c.String(), InfoFly = c.String(), InfoCus = c.String(), Payment = c.Int(nullable: false), PayDate = c.DateTime(nullable: false), DateCreated = c.DateTime(nullable: false), Total = c.Decimal(nullable: false, precision: 18, scale: 2), }) .PrimaryKey(t => t.Id); CreateTable( "dbo.Nationality", c => new { Id = c.Int(nullable: false, identity: true), NationalityName = c.String(nullable: false, maxLength: 200), NationalityCode = c.String(), Fee = c.Int(nullable: false), Description = c.String(), IsActive = c.Boolean(nullable: false), SortOrder = c.Int(nullable: false), TimeZoo = c.String(), Icon = c.String(maxLength: 250), Embassy = c.String(), Requirement = c.String(), FilterName = c.String(), Tips = c.String(), }) .PrimaryKey(t => t.Id); } public override void Down() { DropTable("dbo.Nationality"); DropTable("dbo.Booking"); DropTable("dbo.Airport"); } } } <file_sep>/Model/EF/CW_Setting.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { [Table("CW_Setting")] public class CW_Setting { [Key] public string SettingKey { get; set; } [AllowHtml] public string SettingValue { get; set; } [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string SettingGroup { get; set; } public DateTime CreatedDate { get; set; } [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] public string SettingComment { get; set; } [Display(Name = "Ngôn ngữ")] [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] public string LanguageCode { get; set; } public virtual CW_Language CW_Language { get; set; } } } <file_sep>/Model/EF/CW_Booking.cs using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Model.EF { [Table("CW_Booking")] public class CW_Booking { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Display(Name = "<NAME>")] [Required(ErrorMessage = "Yêu cầu nhập họ tên !")] [StringLength(300, ErrorMessage = "Bạn chỉ được nhập tối đa 300 ký tự !")] public string FullName { get; set; } [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] [Display(Name = "Email")] [DataType(DataType.EmailAddress)] [Required(ErrorMessage = "Bắt buộc phải nhập!")] public string Email { get; set; } [Display(Name = "Phone")] public string Phone { get; set; } [Display(Name = "Prequent")] public string Prequent { get; set; } [Display(Name = "Tin nhắn")] public string Message { get; set; } public string InfoFly { get; set; } public string InfoCus { get; set; } public int Payment { get; set; } public DateTime PayDate { get; set; } public DateTime DateCreated { get; set; } public decimal Total { get; set; } } }<file_sep>/Model/EF/CW_CustomerGroups.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { //nhóm khách hàng [Table("CW_CustomerGroups")] public class CW_CustomerGroups { public CW_CustomerGroups() { this.CW_Customers = new HashSet<CW_Customers>(); } [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int CustomerGroupsID { get; set; } [StringLength(100, ErrorMessage = "Bạn chỉ có thể nhập tối đa 100 ký tự !")] [Display(Name = "Tên nhóm")] [Required(ErrorMessage = "Bắt buộc phải nhập!")] public string CustomerGroupName { get; set; } [Display(Name = "Nhóm mặc định")] public bool IsDefault { get; set; } public DateTime CreatedDate { get; set; } public virtual ICollection<CW_Customers> CW_Customers { get; set; } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/SettingController.cs using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class SettingController : BaseLangController { // // GET: /Admin/Setting/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { return View(); } /// <summary> /// lưu cài đặt /// </summary> /// <returns></returns> [ChildActionOnly] public PartialViewResult _SaveSetting() { string lang = Session["language"].ToString(); IEnumerable<CW_Category> cate = db.CW_Category.Where(x => x.ParentID == null && x.LanguageCode.Equals(lang)); ViewBag.ListCate = cate; return PartialView(); } [HttpPost] [ValidateInput(false)] public PartialViewResult _SaveSetting(string SettingTitle, string SettingBanner,string SettingLogo, string SettingBannerWidth, string SettingBannerHeight, string SettingEmail, string SettingFooter, string SettingMetakeyword, string SettingMetadescription, string SettingContact, string SettingHotline,string SettingFanpage, string SettingPayment, string SettingFavicon, string SettingMaps, string SettingGoogleAnalytics, string SettingPageProduct, string SettingPageNews, string SettingGoogleWebmaster, string SettingOffWebsite, string SettingNoticle, string SettingDefaultPage, string SettingBackgroundWebsite, string SettingBackgroundColor, string SettingBackgroundImage, string SettingBackgroundRepeat, string SettingPopupOff, string SettingPopupContent, string SettingAdvLeftRight, string SettingAdvLeft, string SettingAdvRight, string SettingCommentNewsOff) { string lang = Session["language"].ToString(); CW_Setting modelSetting; modelSetting = new CW_Setting(); #region "Bình luận tin tức" if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingCommentNewsOff" + lang) == null) { modelSetting.SettingComment = "Bật tắt chức năng bình luận tin tức"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingCommentNewsOff" + lang; modelSetting.SettingValue = SettingCommentNewsOff; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingCommentNewsOff" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingCommentNewsOff; db.Entry(modelSetting).State = EntityState.Modified; } #endregion #region "Quảng cáo hai bên" modelSetting = new CW_Setting(); //Quảng cáo bên phải if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingAdvRight" + lang) == null) { modelSetting.SettingComment = "Quảng cáo bên phải"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingAdvRight" + lang; modelSetting.SettingValue = SettingAdvRight; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingAdvRight" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingAdvRight; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //Quảng cáo bên trái if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingAdvLeft" + lang) == null) { modelSetting.SettingComment = "Quảng cáo bên trái"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingAdvLeft" + lang; modelSetting.SettingValue = SettingAdvLeft; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingAdvLeft" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingAdvLeft; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //bặt tắt chức năng quảng cáo hai bên if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingAdvLeftRight" + lang) == null) { modelSetting.SettingComment = "Bật tắt chức năng"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingAdvLeftRight" + lang; modelSetting.SettingValue = SettingAdvLeftRight; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingAdvLeftRight" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingAdvLeftRight; db.Entry(modelSetting).State = EntityState.Modified; } #endregion #region "popup website" modelSetting = new CW_Setting(); //nội dung popup if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingPopupContent" + lang) == null) { modelSetting.SettingComment = "nội dung popup"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingPopupContent" + lang; modelSetting.SettingValue = SettingPopupContent; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingPopupContent" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingPopupContent; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //bật tắt if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingPopupOff" + lang) == null) { modelSetting.SettingComment = "Bật tắt popup"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingPopupOff" + lang; modelSetting.SettingValue = SettingPopupOff; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingPopupOff" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingPopupOff; db.Entry(modelSetting).State = EntityState.Modified; } #endregion #region "setting background website" modelSetting = new CW_Setting(); //background repeat if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBackgroundRepeat" + lang) == null) { modelSetting.SettingComment = "Backgorund repeat"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBackgroundRepeat" + lang; modelSetting.SettingValue = SettingBackgroundRepeat; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBackgroundRepeat" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBackgroundRepeat; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //background images if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBackgroundImage" + lang) == null) { modelSetting.SettingComment = "Backgorund image"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBackgroundImage" + lang; modelSetting.SettingValue = SettingBackgroundImage; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBackgroundImage" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBackgroundImage; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //background color if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBackgroundColor" + lang) == null) { modelSetting.SettingComment = "Backgorund color"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBackgroundColor" + lang; modelSetting.SettingValue = SettingBackgroundColor; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBackgroundColor" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBackgroundColor; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //background website if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBackgroundWebsite" + lang) == null) { modelSetting.SettingComment = "Backgorund website"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBackgroundWebsite" + lang; modelSetting.SettingValue = SettingBackgroundWebsite; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBackgroundWebsite" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBackgroundWebsite; db.Entry(modelSetting).State = EntityState.Modified; } #endregion #region "add setting" modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingTitle" + lang) == null) { modelSetting.SettingComment = "Tiêu đề trang"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingTitle" + lang; modelSetting.SettingValue = SettingTitle; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingTitle" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingTitle; db.Entry(modelSetting).State = EntityState.Modified; } //Logo modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingLogo" + lang) == null) { modelSetting.SettingComment = "Logo"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingLogo" + lang; modelSetting.SettingValue = SettingLogo; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingLogo" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingLogo; db.Entry(modelSetting).State = EntityState.Modified; } // modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBanner" + lang) == null) { modelSetting.SettingComment = "Banner"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBanner" + lang; modelSetting.SettingValue = SettingBanner; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBanner" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBanner; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBannerWidth" + lang) == null) { modelSetting.SettingComment = "Chiều rộng banner"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBannerWidth" + lang; modelSetting.SettingValue = SettingBannerWidth; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBannerWidth" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBannerWidth; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingEmail" + lang) == null) { modelSetting.SettingComment = "Email"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingEmail" + lang; modelSetting.SettingValue = SettingEmail; modelSetting.LanguageCode = lang; modelSetting.CreatedDate = DateTime.Now; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingEmail" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingEmail; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingBannerHeight" + lang) == null) { modelSetting.SettingComment = "Chiều cao banner"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingBannerHeight" + lang; modelSetting.SettingValue = SettingBannerHeight; modelSetting.LanguageCode = lang; modelSetting.CreatedDate = DateTime.Now; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingBannerHeight" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingBannerHeight; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingFooter" + lang) == null) { modelSetting.SettingComment = "Thông tin chân trang"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingFooter" + lang; modelSetting.SettingValue = SettingFooter; modelSetting.LanguageCode = lang; modelSetting.CreatedDate = DateTime.Now; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingFooter" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingFooter; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingMetakeyword" + lang) == null) { modelSetting.SettingComment = "Metakeyword"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingMetakeyword" + lang; modelSetting.SettingValue = SettingMetakeyword; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingMetakeyword" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingMetakeyword; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingMetadescription" + lang) == null) { modelSetting.SettingComment = "Metadescription"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingMetadescription" + lang; modelSetting.SettingValue = SettingMetadescription; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingMetadescription" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingMetadescription; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingContact" + lang) == null) { modelSetting.SettingComment = "Thông tin liên hệ"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingContact" + lang; modelSetting.SettingValue = SettingContact; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingContact" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingContact; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingHotline" + lang) == null) { modelSetting.SettingComment = "Hotline"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingHotline" + lang; modelSetting.SettingValue = SettingHotline; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingHotline" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingHotline; db.Entry(modelSetting).State = EntityState.Modified; } //Fanpage modelSetting = new CW_Setting(); if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingFanpage" + lang) == null) { modelSetting.SettingComment = "Fanpage"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingFanpage" + lang; modelSetting.SettingValue = SettingFanpage; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingFanpage" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingFanpage; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //thanh toán if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingPayment" + lang) == null) { modelSetting.SettingComment = "Hướng dẫn thanh toán"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingPayment" + lang; modelSetting.SettingValue = SettingPayment; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingPayment" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingPayment; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //Favicon if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingFavicon" + lang) == null) { modelSetting.SettingComment = "Favicon"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingFavicon" + lang; modelSetting.SettingValue = SettingFavicon; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingFavicon" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingFavicon; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //bản đồ if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingMaps" + lang) == null) { modelSetting.SettingComment = "Bản đồ"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingMaps" + lang; modelSetting.SettingValue = SettingMaps; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingMaps" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingMaps; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //Mã nhúng google analytics if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingGoogleAnalytics" + lang) == null) { modelSetting.SettingComment = "Bản đồ"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingGoogleAnalytics" + lang; modelSetting.SettingValue = SettingGoogleAnalytics; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingGoogleAnalytics" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingGoogleAnalytics; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //phân trang sản phẩm if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingPageProduct" + lang) == null) { modelSetting.SettingComment = "Phân trang sản phẩm"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingPageProduct" + lang; modelSetting.SettingValue = SettingPageProduct; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingPageProduct" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingPageProduct; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //phân trang tin tức if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingPageNews" + lang) == null) { modelSetting.SettingComment = "Phân trang tin tức"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingPageNews" + lang; modelSetting.SettingValue = SettingPageNews; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingPageNews" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingPageNews; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //google webmaster if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingGoogleWebmaster" + lang) == null) { modelSetting.SettingComment = "Google webmaster"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingGoogleWebmaster" + lang; modelSetting.SettingValue = SettingGoogleWebmaster; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingGoogleWebmaster" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingGoogleWebmaster; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //off website if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingOffWebsite" + lang) == null) { modelSetting.SettingComment = "Bật tắt website"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingOffWebsite" + lang; modelSetting.SettingValue = SettingOffWebsite; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingOffWebsite" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingOffWebsite; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //thông báo khi tắt website if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingNoticle" + lang) == null) { modelSetting.SettingComment = "Thông báo khi tắt website"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingNoticle" + lang; modelSetting.SettingValue = SettingNoticle; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingNoticle" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingNoticle; db.Entry(modelSetting).State = EntityState.Modified; } modelSetting = new CW_Setting(); //Cấu hình trang mặc định if (COMMOM.Interface.ISetting.GetSettingCheckValue("SettingDefaultPage" + lang) == null) { modelSetting.SettingComment = "Cấu hình trang mặc định"; modelSetting.SettingGroup = "Config"; modelSetting.SettingKey = "SettingDefaultPage" + lang; modelSetting.SettingValue = SettingDefaultPage; modelSetting.CreatedDate = DateTime.Now; modelSetting.LanguageCode = lang; db.Set<CW_Setting>().Add(modelSetting); } else { modelSetting = db.CW_Setting.Where(x => x.SettingKey == "SettingDefaultPage" + lang).SingleOrDefault(); modelSetting.SettingValue = SettingDefaultPage; db.Entry(modelSetting).State = EntityState.Modified; } #endregion db.SaveChanges(); var cate = db.CW_Category.Where(x => x.ParentID == null); ViewBag.ListCate = cate; return PartialView("_SaveSetting"); } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/AdvController.cs using Model.EF; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class AdvController : BaseController { // // GET: /Admin/Adv/ private MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var lang = Session["language"].ToString(); IEnumerable<CW_Adv> adv; adv = db.CW_Adv.Where(x => x.LanguageCode.Equals(lang)).OrderByDescending(x => x.CreatedDate); return View(adv); } public ActionResult Add() { return View(); } /// <summary> /// thêm quảng cáo /// </summary> /// <param name="model"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "")]CW_Adv model) { if (ModelState.IsValid) { model.CreatedDate = DateTime.Now; model.LanguageCode = Session["language"].ToString(); if (model.MetaTitle == null) { model.MetaTitle = model.Title; } db.Set<CW_Adv>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } else { return View(model); } } public ActionResult Edit(int id) { var cate = db.Set<CW_Adv>().Find(id); if (cate == null) { return HttpNotFound(); } return View(cate); } /// <summary> /// sửa quảng cáo /// </summary> /// <param name="adv"></param> /// <returns></returns> [HttpPost] public ActionResult Edit([Bind(Include = "")]CW_Adv adv) { if (!ModelState.IsValid) { return View("Edit", adv); } else { if (adv.MetaTitle == null) adv.MetaTitle = adv.Title; db.CW_Adv.Attach(adv); db.Entry(adv).Property(a => a.Title).IsModified = true; db.Entry(adv).Property(a => a.Image).IsModified = true; db.Entry(adv).Property(a => a.Link).IsModified = true; db.Entry(adv).Property(a => a.Description).IsModified = true; db.Entry(adv).Property(a => a.Height).IsModified = true; db.Entry(adv).Property(a => a.Width).IsModified = true; db.Entry(adv).Property(a => a.Order).IsModified = true; db.Entry(adv).Property(a => a.Position).IsModified = true; db.Entry(adv).Property(a => a.Target).IsModified = true; db.Entry(adv).Property(a => a.IsFlash).IsModified = true; db.Entry(adv).Property(a => a.IsActive).IsModified = true; db.Entry(adv).Property(a => a.CreatedDate).IsModified = false; db.Entry(adv).Property(a => a.MetaTitle).IsModified = true; db.Entry(adv).Property(a => a.MetaDescription).IsModified = true; db.Entry(adv).Property(a => a.LanguageCode).IsModified = false; db.SaveChanges(); } return RedirectToAction("Index"); } /// <summary> /// xóa quảng cáo /// </summary> /// <param name="id"></param> /// <returns></returns> [HttpPost] public ActionResult Delete(int id) { var article = db.Set<CW_Adv>().Find(id); if (article != null) { var catedelte = db.CW_Adv.Attach(article); db.Set<CW_Adv>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } /// <summary> /// tim kiem theo vi trí /// </summary> /// <param name="position"></param> /// <returns></returns> [HttpGet] public JsonResult Search(int position) { var lang = Session["language"].ToString(); IEnumerable<CW_Adv> adv; adv = db.CW_Adv.Where(x => x.Position == position && x.LanguageCode.Equals(lang)).OrderByDescending(x => x.CreatedDate); var item = adv.Select(x => new { id = x.ID, name = x.Title, images = x.Image }); return Json(item, JsonRequestBehavior.AllowGet); } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } }<file_sep>/Model/EF/CW_Language.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("CW_Language")] public class CW_Language { [Key] public string LanguageCode { get; set; } public string Title { get; set; } public virtual ICollection<CW_Category> Category { get; set; } public virtual ICollection<CW_Adv> CW_Adv { get; set; } public virtual ICollection<CW_Article> CW_Article { get; set; } public virtual ICollection<CW_News> CW_News { get; set; } public virtual ICollection<CW_Support> CW_Support { get; set; } } } <file_sep>/Model/Models/Flight.cs using System; using System.Collections.Generic; namespace Model.Models { public class Flight { public string Airline { get; set; } public string AirlineCode { get; set; } public DateTime DepartTime { get; set; } public string Description { get; set; } public IList<FlightDetail> Details { get; set; } public TimeSpan? FlightDuration { get; set; } public string FromAirport { get; set; } public string FromPlace { get; set; } public string Id { get; set; } public DateTime LandingTime { get; set; } public string FlightNumber { get; set; } public decimal Price { get; set; } public short Stops { get; set; } public string TicketType { get; set; } public string ToAirport { get; set; } public string ToPlace { get; set; } public int FromPlaceId { get; set; } public int ToPlaceId { get; set; } public decimal TotalPrice { get; set; } public string Filter { get; set; } public string Source { get; set; } public string SourceGroup { get; set; } public string FareBasis { get; set; } public IList<TicketOption> TicketOptions { get; set; } public IList<PriceSummary> PriceSummaries { get; set; } public IList<PriceDetail> TicketPriceDetails { get; set; } } }<file_sep>/Model/EF/CW_Support.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("CW_Support")] public class CW_Support { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Display(Name = "Nick yahoo")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string NickYahoo { get; set; } [Display(Name = "Nick skyper")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string NickSkyper { get; set; } [Display(Name = "Tiêu đề")] [Required(ErrorMessage = "Bắt buộc phải nhập!")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string Title { get; set; } [Display(Name = "Điện thoại")] [StringLength(12, ErrorMessage = "Bạn chỉ được nhập tối đa 12 ký tự !")] [DataType(DataType.PhoneNumber)] public string Phone { get; set; } [Display(Name = "Mô tả")] [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] public string Description { get; set; } [Display(Name = "Thứ tự")] [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] public int Order { get; set; } [Display(Name = "Kích hoạt")] public bool IsActive { get; set; } public DateTime CreatedDate { get; set; } [Display(Name = "Ngôn ngữ")] [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] public string LanguageCode { get; set; } public virtual CW_Language CW_Language { get; set; } } } <file_sep>/Model/EF/CW_NewsComment.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { [Table("CW_NewsComment")] public class CW_NewsComment { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int CommentID { get; set; } [Display(Name = "Tin tức")] [Required(ErrorMessage = "Bắt buộc phải nhập trường này !")] public int ID { get; set; } [Display(Name = "Bình luận")] [AllowHtml] public string Content { get; set; } [Required(ErrorMessage = "Bắt buộc phải nhập!")] [Display(Name = "<NAME>")] [StringLength(70, ErrorMessage = "Bạn chỉ được nhập tối đa 70 ký tự !")] public string FullName { get; set; } [DataType(DataType.EmailAddress)] [Required(ErrorMessage = "Email không được để trống !")] [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng!")] [Display(Name = "Email")] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string Email { get; set; } [Display(Name = "Kích hoạt hiển thị")] public bool IsActive { get; set; } public DateTime CreatedDate { get; set; } public virtual CW_News CW_News { get; set; } } } <file_sep>/Model/EF/CW_News.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { [Table("CW_News")] public class CW_News { public CW_News() { this.CW_newscomment = new HashSet<CW_NewsComment>(); } [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Display(Name = "Tiêu đề")] [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] public string Title { get; set; } [Display(Name = "Filter title")] [Required(ErrorMessage = "Yêu cầu nhập trường này !")] public string FilterTitle { get; set; } [Display(Name = "Ảnh đại diện")] [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] public string Image { get; set; } [Display(Name = "Mô tả")] [StringLength(1000)] public string Description { get; set; } [Display(Name = "Chi tiết tin")] [AllowHtml] public string Content { get; set; } [Display(Name = "Chú thích ảnh")] [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] public string ImageNotes { get; set; } [Display(Name = "Số lượng người đọc")] public int Read { get; set; } [Display(Name = "Kích hoạt")] public bool IsActive { get; set; } [Display(Name = "Trang chủ")] public bool IsHome { get; set; } public DateTime CreatedDate { get; set; } [Display(Name = "Thứ tự")] [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương!")] [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] public int Order { get; set; } [Display(Name = "Danh mục")] [Required(ErrorMessage = "Cần phải chọn danh mục !")] public int CategoryID { get; set; } [Display(Name = "Ngôn ngữ")] [StringLength(10, ErrorMessage = "Chỉ được nhập tối đa 10 ký tự !")] public string LanguageCode { get; set; } [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] public string MetaTitle { get; set; } [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] public string MetaKeywords { get; set; } [StringLength(600, ErrorMessage = "Chỉ được nhập tối đa 600 ký tự !")] public string MetaDescription { get; set; } public virtual CW_Category Category { get; set; } public virtual ICollection<CW_NewsComment> CW_newscomment { get; set; } public virtual CW_Language CW_Language { get; set; } } } <file_sep>/Model/EF/CW_Menu_Category.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("CW_Menu_Category")] public class CW_Menu_Category { //đây là bảng nhiều, mình cần viết kết nối đến bảng 1 như: public virtual Category Category { get; set; } [Key, Column(Order = 0)] public string MenuCode { get; set; } [Key, Column(Order = 1)] public int CategoryID { get; set; } //[RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] public int SortOrder { get; set; } public virtual CW_Category Category { get; set; } public virtual CW_Menu CW_Menu { get; set; } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/MenuController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class MenuController : BaseController { // // GET: /Admin/Menu/ MVCDbContext db=new MVCDbContext(); public ActionResult Index(string id) { if (String.IsNullOrEmpty(id)) id = "menu-top"; ViewBag.menucode = id; CW_Menu obj = db.CW_Menu.Where(x => x.MenuCode == id).First(); ViewBag.menutitle = obj.Title; return View(); } [ChildActionOnly] public PartialViewResult _ListCateByMenu(string menucode) { if (String.IsNullOrEmpty(menucode)) menucode = "menu-top"; var menu = db.CW_Menu.OrderBy(x => x.Order); CW_Menu obj = db.CW_Menu.Where(x => x.MenuCode == menucode).First(); ViewBag.menutitle = obj.Title; ViewBag.menucode = menucode; IEnumerable<CW_Category> category = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals(menucode) orderby cate_menu.SortOrder select cate; ViewBag.countcate = category.ToList().Count; return PartialView(menu); } [HttpPost] public PartialViewResult _ListCateByMenu(string menucode, string catetitle) { var menucate = db.CW_Menu_Category.Where(x => x.Category.Title.ToLower().Equals(catetitle)); var menu = db.CW_Menu.OrderBy(x => x.Order); if (menucate == null) { var category = db.CW_Category.Where(x => x.Title.Equals(catetitle)).FirstOrDefault(); CW_Menu_Category obj = new CW_Menu_Category(); obj.MenuCode = menucode; obj.CategoryID = category.ID; obj.SortOrder = 1; db.Set<CW_Menu_Category>().Add(obj); db.SaveChanges(); } else { ViewBag.Message = "Danh mục này đã tồn tại trong menu này !"; } ViewBag.menucode = menucode; return PartialView("_ListCateByMenu", menu); } public JsonResult AutoCompleteCate(string term) { var result = (from r in db.CW_Category where r.Title.ToLower().Contains(term.ToLower()) select new { r.ID, r.Title }).Distinct(); return Json(result, JsonRequestBehavior.AllowGet); } /// <summary> /// theem menu /// </summary> /// <param name="menucode"></param> /// <param name="categoryid"></param> /// <returns></returns> [HttpPost] public ActionResult AddCate(string menucode, int categoryid) { //kiểm tra xem có danh mục trong menu hay chưa? var objtest = db.CW_Menu_Category.Where(x => x.CategoryID == categoryid && x.MenuCode == menucode).FirstOrDefault(); if (objtest == null) { CW_Menu_Category obj = new CW_Menu_Category(); obj.MenuCode = menucode; obj.CategoryID = categoryid; obj.SortOrder = 1; db.Set<CW_Menu_Category>().Add(obj); db.SaveChanges(); ViewBag.menucode = menucode; } return Json("Index", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult DeleteItem(int item, string menu) { var cate = db.Set<CW_Menu_Category>().Where(x => x.CategoryID == item && x.MenuCode == menu).FirstOrDefault(); if (cate != null) { var catedelte = db.CW_Menu_Category.Attach(cate); db.Set<CW_Menu_Category>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateOrder(int item, int order, string menu) { var menucate = db.CW_Menu_Category.Where(x => x.CategoryID == item && x.MenuCode == menu).FirstOrDefault(); if (menucate != null) { db.Set<CW_Menu_Category>().Attach(menucate); menucate.SortOrder = order; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } } <file_sep>/Model/Models/AirlineBrand.cs namespace Model.Models { public class AirlineBrand { public const string JetStar = "JetStar"; public const string VietJetAir = "VietJetAir"; public const string VietnamAirlines = "VietnamAirlines"; } }<file_sep>/MVC4.PROJECT/asset/admin/js/review.js $(document).ready(function () { $('.btnshowanswer').click(function () { var proid = $(this).attr("data-id"); var question = $(this).parent().parent().find("a.containquestion").attr("title"); var answer = $(this).parent().parent().find("p.containanswer").attr("data-answer"); $("#renderquestion").html(question); $("#contenteditor").html(answer); return false; }); //update isenable $("a.IsEnable").click(function () { var id = $(this).attr('title'); var bool = $(this).attr('data-boo'); $.ajax( { type: "POST", url: '/Reviews/UpdateIsEnable', data: { id: id, isactive: bool } }) .done(function () { window.location.reload(); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }) }); //xóa một bản ghi $(".btndelte").click(function () { var id = $(this).attr('data'); $(".deleleoneitem").attr('data', id); //showalert("Bạn có thực sự muốn xóa bản ghi này?", "Cảnh báo", true); }); $(".deleleoneitem").click(function () { var id = $(this).attr('data'); $.ajax( { type: "POST", url: '/Reviews/DeleteMutileItem', data: { item: id } }) .done(function () { $('#myAlert').modal('hide'); window.location.reload(); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }) }); });<file_sep>/Model/Models/FlightDetail.cs using System; namespace Model.Models { public class FlightDetail { public string Airline { get; set; } public string AirlineCode { get; set; } public string FlightDuration { get; set; } public string FlightNumber { get; set; } public string From { get; set; } public string To { get; set; } public DateTime? DepartTime { get; set; } public DateTime? LandingTime { get; set; } } }<file_sep>/Model/EF/CW_Article.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { [Table("CW_Article")] public class CW_Article { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Display(Name = "Tiêu đề")] [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] [StringLength(300, ErrorMessage = "Bạn chỉ được nhập tối đa 300 ký tự !")] public string Title { get; set; } [Display(Name = "Filter title")] [Required(ErrorMessage = "Yêu cầu nhập trường này !")] public string FilterTitle { get; set; } [Display(Name = "Mô tả")] [StringLength(1000, ErrorMessage = "Bạn chỉ được nhập tối đa 1000 ký tự")] public string Description { get; set; } [Display(Name = "Chi tiết bài viết")] [AllowHtml] public string Body { get; set; } [Display(Name = "Danh mục")] [Required(ErrorMessage = "Bắt buộc phải chọn danh mục")] public int CategoryID { get; set; } [Display(Name = "Thứ tự")] [Range(0, int.MaxValue, ErrorMessage = "Chỉ được nhập số dương !")] [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] public int Order { get; set; } [Display(Name = "Ngôn ngữ")] [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] public string LanguageCode { get; set; } [Display(Name = "Kích hoạt")] public bool IsActive { get; set; } public DateTime CreatedDate { get; set; } [StringLength(400, ErrorMessage = "Bạn chỉ được nhập tối đa 400 ký tự !")] public string MetaTitle { get; set; } [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] public string MetaKeywords { get; set; } [StringLength(500, ErrorMessage = "Bạn chỉ được nhập tối đa 500 ký tự !")] public string MetaDescription { get; set; } public virtual CW_Category Category { get; set; } public virtual CW_Language CW_Language { get; set; } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/HomeController.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class HomeController : BaseLangController { // // GET: /Admin/Home/ MVCDbContext db= new MVCDbContext(); protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } public ActionResult Index() { //Số tin tức IEnumerable<CW_News> news = db.CW_News; ViewBag.NewsCount = news.ToList().Count(); //Số bài viết IEnumerable<CW_Article> art = db.CW_Article; ViewBag.ArtCount = art.ToList().Count(); //Commennt var objnewscomment = db.CW_NewsComment.Where(x => x.CreatedDate.Year == DateTime.Today.Year && x.CreatedDate.Month == DateTime.Today.Month && x.CreatedDate.Day == DateTime.Today.Day); ViewBag.TodayCommentCount = objnewscomment.ToList().Count(); //QUảng cao var objfqa = db.CW_Adv.ToList(); ViewBag.AdvCount = objfqa.Count; //Menu var categories = db.CW_Category; ViewBag.CategoriesCount = categories.ToList().Count(); //Ho tro truc tuyen var sup = db.CW_Support; ViewBag.SupCount = sup.ToList().Count(); return View(); } public PartialViewResult _Menutop() { return PartialView(); } [HttpGet] public JsonResult LoadMenutop() { StringBuilder sb = new StringBuilder(); var response = new { message = "", count = 0 }; //đếm số liên hệ mới int countcontact = db.CW_Contact.Where(x => !x.IsRead).Count(); if (countcontact > 0) { sb.Append("<li><a href='/admin/AdminContact' >"); sb.Append(" <span class='label label-primary'>"); sb.Append(" <i class='fa fa-comment'></i> "); sb.Append(" </span>"); sb.Append(" "+@StaticResources.Resources.Youhave+" " + countcontact +" "+ @StaticResources.Resources.newcustomercontact); sb.Append("</a></li>"); } else { sb.Append("<li><a href='/admin/AdminContact' >"); sb.Append(" <span class='label label-primary'>"); sb.Append(" <i class='fa fa-comment'></i> "); sb.Append(" </span>"); sb.Append(" "+@StaticResources.Resources.Younotcontact); sb.Append("</a></li>"); } int total = countcontact; response = new { message = sb.ToString(), count = total }; return Json(response, JsonRequestBehavior.AllowGet); } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/NewsCommentController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class NewsCommentController : BaseController { // // GET: /Admin/NewsComment/ MVCDbContext db = new MVCDbContext(); public ActionResult Index(int? id) { IEnumerable<CW_NewsComment> obj = db.CW_NewsComment.Where(x => x.ID == id).OrderByDescending(x => x.CreatedDate); ViewBag.CountItem = obj.Count(); CW_News objNews = db.CW_News.Where(x => x.ID == id).First(); ViewBag.NewsTitle = objNews.Title; return View(obj); } [HttpPost] public ActionResult DeleteMutileItem(int item) { var newscomment = db.Set<CW_NewsComment>().Find(item); if (newscomment != null) { var catedelte = db.CW_NewsComment.Attach(newscomment); db.Set<CW_NewsComment>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateIsActive(int id, bool isactive) { CW_NewsComment newscomment = db.CW_NewsComment.Find(id); if (newscomment != null) { db.Set<CW_NewsComment>().Attach(newscomment); if (isactive) { newscomment.IsActive = false; } else { newscomment.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } } <file_sep>/MVC4.PROJECT/asset/admin/js/advController.js $(document).ready(function() { $(document).on('change', '#selectpos', function () { //$("#selectpos").change(function () { //$("#frmid").submit(); var id = $(this).val(); var url = "/admin/adv/search"; $.get(url, { position: id }, function (data) { var strhtml = ""; $.each(data, function (i, adv) { strhtml += "<div class='col-sm-4 col-md-2'>"; strhtml += "<div class='form-group box-adv'>"; strhtml += "<a class='thumbnail lightbox_trigger' href='" + adv.images + "'>"; strhtml += "<img src='" + adv.images + "' alt='" + adv.name + "'>"; strhtml += "</a>"; strhtml += "<div class='actions'>"; strhtml += "<a title='Sửa' href='/admin/adv/edit/" + adv.id + "' class='btn btn-mini btn-primary'><i class='fa fa-pencil icon-white'></i></a>"; strhtml += "<a title='Xóa' data='" + adv.id + "' class='btn btn-mini btn-danger btndelte'><i class='fa fa-trash icon-white'></i></a>"; strhtml += "</div>"; strhtml += "</div>"; strhtml += "</div>"; }); $('.box-body .row').html(strhtml); }).done(function () { $.gritter.add({ title: 'Thông báo thành công.', text: 'Cập nhật thành công.', sticky: false, class_name: 'my_class_gritter_success' }); }).fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra.', sticky: false, class_name: 'my_class_gritter_error' }); }); }); //xóa một bản ghi $(document).on('click', '.btndelte', function () { //$(".btndelte").click(function () { var id = $(this).attr('data'); $(".deleleoneitem").attr('data', id); $('#myAlert').modal('show'); //showalert("Bạn có thực sự muốn xóa bản ghi này?", "Cảnh báo", true); }); $(".deleleoneitem").click(function () { var _id = $(this).attr('data'); $.ajax( { type: "POST", url: '/Adv/Delete', data: { id: _id } }) .done(function () { $('#myAlert').modal('hide'); $("#trow_" + _id).fadeTo("fast", 0, function () { $(this).slideUp("fast", function () { $(this).remove(); }); }); }) .fail(function () { $.gritter.add({ title: 'Thông báo lỗi.', text: 'Có lỗi xảy ra trong quá trình cập nhật.', sticky: false, class_name: 'my_class_gritter_error' }); }); }); });<file_sep>/Model/AirBookClient.cs using System; using System.Collections.Generic; using System.Net.Http; using System.Net.Http.Formatting; using System.Net.Http.Headers; using System.Text; using Model.Converts; using Model.Models; using Newtonsoft.Json; namespace Model { public class AirBookClient { private readonly HttpClient httpClient; private AuthenticateInfo auth; public AirBookClient(HttpClient httpClient) { this.httpClient = httpClient; this.httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } public void SetAuthenticate(AuthenticateInfo authenticate) { this.auth = authenticate; } public void SetServerInfo(ServerInfo serverInfo) { this.httpClient.BaseAddress = new Uri(serverInfo.ApiServer); } public IEnumerable<Flight> FindFlight(FindFlight findFlight) { if (this.httpClient.BaseAddress == null) { throw new InvalidOperationException("Must set server info first"); } if (this.auth == null) { throw new NullReferenceException("Authenticate is not set"); } var requestMessage = new HttpRequestMessage(HttpMethod.Post, "oapi/airline/Flights/Find?$expand=TicketPriceDetails,Details,PriceSummaries,TicketOptions"); requestMessage.Content = new ObjectContent(typeof(FindFlight),findFlight,new JsonMediaTypeFormatter()); this.SetAuthenticateHeader(requestMessage); var response = this.httpClient.SendAsync(requestMessage).Result; if (response.IsSuccessStatusCode) { var text = response.Content.ReadAsStringAsync().Result; return JsonConvert.DeserializeObject<ODataWrapper<IEnumerable<Flight>>>( text, new TimeSpanJsonConverter()).Value; } throw new InvalidOperationException(response.Content.ReadAsStringAsync().Result); } public BookingResult BookFlight(Booking booking) { if (this.httpClient.BaseAddress == null) { throw new InvalidOperationException("Must set server info first"); } if (this.auth == null) { throw new NullReferenceException("Authenticate is not set"); } var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/oapi/airline/Bookings"); var json = JsonConvert.SerializeObject(booking, Formatting.None, new DecimalJsonConverter(), new TimeSpanJsonConverter()); var content = new StringContent(json); content.Headers.ContentType.MediaType = "application/json"; requestMessage.Content = content; requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); this.SetAuthenticateHeader(requestMessage); var response = this.httpClient.SendAsync(requestMessage).Result; if (response.IsSuccessStatusCode) { var text = response.Content.ReadAsStringAsync().Result; return JsonConvert.DeserializeObject<BookingResult>( text, new TimeSpanJsonConverter(), new DecimalJsonConverter()); } throw new InvalidOperationException(response.Content.ReadAsStringAsync().Result); } private void SetAuthenticateHeader(HttpRequestMessage requestMessage) { var byteArray = Encoding.ASCII.GetBytes(string.Format("{0}:{1}", this.auth.Username, this.auth.Password)); requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); } } }<file_sep>/Model/Models/BookingPassenger.cs using System; namespace Model.Models { public class BookingPassenger { public string Address { get; set; } public int? Baggage { get; set; } public int? ReturnBaggage { get; set; } public DateTime? BirthDay { get; set; } public int BookingId { get; set; } public string City { get; set; } public string Country { get; set; } public string Email { get; set; } public string FirstName { get; set; } public short Gender { get; set; } public int Id { get; set; } public string LastName { get; set; } public string MiddleName { get; set; } public string MobileNumber { get; set; } public string Nationality { get; set; } public short PassengerType { get; set; } public DateTime? PassportExpired { get; set; } public string PassportNumber { get; set; } public string PhoneNumber { get; set; } public string Province { get; set; } public string Title { get; set; } } }<file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/BaseController.cs using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading; using System.Web; using System.Web.Mvc; using System.Web.Routing; using COMMOM.Interface; namespace MVC4.PROJECT.Areas.Admin.Controllers { public class BaseController : Controller { // // GET: /Admin/Base/ //protected override void ExecuteCore() //{ // string culture = "vi"; // if (this.Session == null || this.Session["language"] == null) // { // //int.TryParse(System.Configuration.ConfigurationManager.AppSettings["Culture"], out culture); // this.Session["language"] = culture; // } // else // { // culture = this.Session["language"].ToString(); // } // if (this.Session == null || this.Session["IsAuthenticated"] == null) // { // Session["IsAuthenticated"] = true; // } // SessionManager.CurrentCulture = culture; // base.ExecuteCore(); //} protected override bool DisableAsyncSupport { get { return true; } } protected override void Initialize(System.Web.Routing.RequestContext requestContext) { base.Initialize(requestContext); if (Session["language"] != null) { Thread.CurrentThread.CurrentCulture = new CultureInfo(Session["language"].ToString()); Thread.CurrentThread.CurrentUICulture = new CultureInfo(Session["language"].ToString()); } else { Session["language"] = "vi"; Thread.CurrentThread.CurrentCulture = new CultureInfo("vi"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("vi"); } } // changing culture public ActionResult ChangeCulture(string ddlCulture, string returnUrl) { Thread.CurrentThread.CurrentCulture = new CultureInfo(ddlCulture); Thread.CurrentThread.CurrentUICulture = new CultureInfo(ddlCulture); Session["language"] = ddlCulture; return Redirect(returnUrl); } //protected override void OnActionExecuting(ActionExecutingContext filterContext) //{ // //var session = (UserLogin)Session[CommonConstants.USER_SESSION]; // if (Session["IsAuthenticated"] == null) // { // filterContext.Result = new RedirectToRouteResult(new // RouteValueDictionary(new { controller = "User", action = "Login", Area = "Admin" })); // } // base.OnActionExecuting(filterContext); //} } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/SupportController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class SupportController : BaseController { // // GET: /Admin/Support/ MVCDbContext db= new MVCDbContext(); public ActionResult Index() { IEnumerable<CW_Support> supp; supp = db.CW_Support.OrderByDescending(x => x.CreatedDate); return View(supp); } public ActionResult Add() { return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "")]CW_Support model) { if (ModelState.IsValid) { model.LanguageCode = Session["language"].ToString(); model.CreatedDate = DateTime.Now; db.Set<CW_Support>().Add(model); db.SaveChanges(); return RedirectToAction("Index"); } else { return View(model); } } public ActionResult Edit(int id) { //var db = new PortalContext(); var cate = db.Set<CW_Support>().Find(id); if (cate == null) { return HttpNotFound(); } return View(cate); } [HttpPost] public ActionResult Edit([Bind(Include = "")]CW_Support support) { if (!ModelState.IsValid) { return View("Edit", support); } else { db.CW_Support.Attach(support); db.Entry(support).Property(a => a.NickYahoo).IsModified = true; db.Entry(support).Property(a => a.NickSkyper).IsModified = true; db.Entry(support).Property(a => a.Title).IsModified = true; db.Entry(support).Property(a => a.Phone).IsModified = true; db.Entry(support).Property(a => a.Description).IsModified = true; db.Entry(support).Property(a => a.Order).IsModified = true; db.Entry(support).Property(a => a.LanguageCode).IsModified = false; db.Entry(support).Property(a => a.IsActive).IsModified = true; db.Entry(support).Property(a => a.CreatedDate).IsModified = false; db.SaveChanges(); } return RedirectToAction("Index"); } [HttpPost] public ActionResult Delete(int id) { var supp = db.Set<CW_Support>().Find(id); if (supp != null) { var catedelte = db.CW_Support.Attach(supp); db.Set<CW_Support>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateIsActive(int id, bool isactive) { CW_Support supp = db.CW_Support.Find(id); if (supp != null) { db.Set<CW_Support>().Attach(supp); if (isactive) { supp.IsActive = false; } else { supp.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateTitle(int id, string title) { CW_Support support = db.CW_Support.Find(id); if (support != null) { db.Set<CW_Support>().Attach(support); support.Title = title; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateNikskyper(int id, string skyper) { CW_Support support = db.CW_Support.Find(id); if (support != null) { db.Set<CW_Support>().Attach(support); support.NickSkyper = skyper; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateNikyahoo(int id, string yahoo) { CW_Support support = db.CW_Support.Find(id); if (support != null) { db.Set<CW_Support>().Attach(support); support.NickYahoo = yahoo; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdatePhone(int id, string phone) { CW_Support support = db.CW_Support.Find(id); if (support != null) { db.Set<CW_Support>().Attach(support); support.Phone = phone; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult UpdateOrder(int id, int order) { CW_Support supp = db.CW_Support.Find(id); if (supp != null) { db.Set<CW_Support>().Attach(supp); supp.Order = order; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/AdminContactController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MVC4.PROJECT.Areas.Admin.Controllers; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class AdminContactController : BaseController { // // GET: /Admin/AdminContact/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { var contact = db.CW_Contact.OrderByDescending(x => x.ID); if (contact == null) { return HttpNotFound(); } return View(contact); } public ActionResult View(int id) { var contact = db.CW_Contact.Find(id); if (contact == null) { return HttpNotFound(); } //cập nhật đã đọc if (contact != null) { db.Set<CW_Contact>().Attach(contact); contact.IsRead = true; db.SaveChanges(); } return View(contact); } [HttpPost] public ActionResult Delete(int id) { var contact = db.Set<CW_Contact>().Find(id); if (contact != null) { var catedelte = db.CW_Contact.Attach(contact); db.Set<CW_Contact>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } } <file_sep>/Model/EF/CW_Menu.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("CW_Menu")] public class CW_Menu { public CW_Menu() { this.CW_menu_category = new HashSet<CW_Menu_Category>(); } [Key] public string MenuCode { get; set; } [Required] [StringLength(100, ErrorMessage = "Bạn chỉ được nhập tối đa 100 ký tự !")] public string Title { get; set; } [Range(0, int.MaxValue)] [RegularExpression(@"[0-9]*$", ErrorMessage = "Bạn phải nhập kiểu số (1->9) ")] public int Order { get; set; } public DateTime CreatedDate { get; set; } public virtual ICollection<CW_Menu_Category> CW_menu_category { get; set; } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/UserController.cs using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Security; using COMMOM.Interface; using MVC4.PROJECT.Models; using WebMatrix.WebData; using CW_Customers = Model.EF.CW_Customers; using MVCDbContext = Model.EF.MVCDbContext; using UserProfile = Model.EF.UserProfile; using WebRole = Model.EF.WebRole; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class UserController : BaseController { // // GET: /Admin/User/ #region "Danh cho tai khoan Quản trị" public ActionResult Index() { var usernames = Roles.GetUsersInRole("administrator"); IEnumerable<UserProfile> users; users = db.UserProfiles.Where(x => usernames.Contains(x.UserName)).OrderByDescending(x => x.UserId); return View(users); } public ActionResult Add() { var roles = from x in db.WebRoles where !x.RoleName.Equals("codeadmin") select x; ViewBag.Roles = roles; return View(); } [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add([Bind(Exclude = "")]RegisterModel model, string[] roles, HttpPostedFileBase image) { ModelState.Remove("UserProfile.UserName"); model.UserProfile.UserName = model.UserName; if (ModelState.IsValid) { //using (PortalContext db = new PortalContext()) //{ var temp = (from p in db.Set<UserProfile>() where p.UserName.Equals(model.UserName, StringComparison.OrdinalIgnoreCase) select p).FirstOrDefault(); if (temp != null) { ModelState.AddModelError("", "Tài khoản này đã tồn tại. Vui lòng nhập tài khoản khác !"); MVCDbContext dbs = new MVCDbContext(); var rolesss = from x in dbs.WebRoles where !x.RoleName.Equals("codeadmin") select x; ViewBag.Roles = rolesss; return View(model); } else { WebSecurity.CreateUserAndAccount(model.UserName, model.Password, new { FullName = model.UserProfile.FullName, Email = model.UserProfile.Email, Address = model.UserProfile.Address, Mobile = model.UserProfile.Mobile, IsLock = model.UserProfile.IsLock }, false); try { Roles.AddUserToRoles(model.UserName, roles); } catch (Exception) { } return RedirectToAction("Index"); } } //} else { return View(model); } } public ActionResult Edit(int id) { var user = db.Set<UserProfile>().Find(id); if (user == null) { return HttpNotFound(); } ViewBag.cUserName = user.UserName; IEnumerable<WebRole> roles = from x in db.WebRoles where !x.RoleName.Equals("codeadmin") select x; string[] lsroles = Roles.GetRolesForUser(user.UserName); var selectedItems = new List<SelectListItem>(); foreach (string obj in lsroles) { foreach (var item in roles) { if (item.RoleName.Equals(obj)) { selectedItems.Add(new SelectListItem() { Text = item.RoleName, Value = item.RoleName, Selected = true }); } else selectedItems.Add(new SelectListItem() { Text = item.RoleName, Value = item.RoleName, Selected = false }); } } ViewBag.SelectList = selectedItems; return View("Edit", user); } [HttpPost] public ActionResult Edit([Bind(Exclude = "")]UserProfile model, string cUserName, string[] roles) { if (ModelState.IsValid) { ViewBag.Roles = roles; db.UserProfiles.Attach(model); db.Entry(model).Property(a => a.UserName).IsModified = false; db.Entry(model).Property(a => a.FullName).IsModified = true; db.Entry(model).Property(a => a.Email).IsModified = true; db.Entry(model).Property(a => a.Mobile).IsModified = true; db.Entry(model).Property(a => a.Address).IsModified = true; db.Entry(model).Property(a => a.IsLock).IsModified = true; db.SaveChanges(); try { foreach (var role in Roles.GetRolesForUser(model.UserName)) { Roles.RemoveUserFromRole(model.UserName, role); } Roles.AddUserToRoles(model.UserName, roles); } catch (Exception) { } return RedirectToAction("Index"); } else { return View(model); } } [HttpPost] public ActionResult Delete(int id) { var user = db.Set<UserProfile>().Find(id); try { if (Roles.GetRolesForUser(user.UserName).Count() > 0) { Roles.RemoveUserFromRoles(user.UserName, Roles.GetRolesForUser(user.UserName)); } ((SimpleMembershipProvider)Membership.Provider).DeleteAccount(user.UserName); ((SimpleMembershipProvider)Membership.Provider).DeleteUser(user.UserName, true); return Json("Index", JsonRequestBehavior.AllowGet); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return View(user); } } #endregion #region "Dành cho thành viên" /// <summary> /// Danh sách khách hàng /// </summary> /// <returns></returns> public ActionResult Customer() { var usernames = Roles.GetUsersInRole("customer"); IEnumerable<CW_Customers> users; users = db.CW_Customers.Where(x => usernames.Contains(x.UserNameCustomer)).OrderByDescending(x => x.UserId); return View(users); } /// <summary> /// Thêm mới khách hàng /// </summary> /// <returns></returns> public ActionResult AddCustomer() { var customergroup = db.CW_CustomerGroups.OrderByDescending(x => x.CreatedDate); ViewBag.CustomerGroup = new SelectList(customergroup, "CustomerGroupsID", "CustomerGroupName"); return View(); } /// <summary> /// Thêm mới /// </summary> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult AddCustomer([Bind(Exclude = "")]RegisterCustomersModel model) { ModelState.Remove("UserProfile.UserName"); string[] roles = { "customer" }; if (ModelState.IsValid) { var temp = (from x in db.Set<UserProfile>() where x.UserName.Equals(model.CW_Customers.UserNameCustomer, StringComparison.OrdinalIgnoreCase) select x).FirstOrDefault(); if (temp != null) { ModelState.AddModelError("", "Tài khoản đã tồn tại"); return View(model); } else { WebSecurity.CreateUserAndAccount(model.CW_Customers.UserNameCustomer, model.Password, new { FullName = model.CW_Customers.UserProfile.FullName, Email = model.CW_Customers.UserNameCustomer, Address = model.CW_Customers.UserProfile.Address, Mobile = model.CW_Customers.UserProfile.Mobile, IsLock = model.CW_Customers.UserProfile.IsLock }, false); var userProfile = db.UserProfiles.FirstOrDefault(x => x.UserName == model.CW_Customers.UserNameCustomer); if (userProfile != null) { var users = new CW_Customers { UserProfile = userProfile, UserNameCustomer = model.CW_Customers.UserNameCustomer, NickYahoo = model.CW_Customers.NickYahoo, NickSkype = model.CW_Customers.NickSkype, Facebook = model.CW_Customers.Facebook, CustomerGroupsID = model.CW_Customers.CustomerGroupsID, CreatedDate = DateTime.Now }; db.CW_Customers.Add(users); db.SaveChanges(); } try { Roles.AddUserToRoles(model.CW_Customers.UserNameCustomer, roles); } catch (Exception) { } return RedirectToAction("Customer"); } } else { return View(model); } } public ActionResult EditCustomer(int id) { var customergroup = db.CW_CustomerGroups.OrderByDescending(x => x.CreatedDate); ViewBag.CustomerGroup = new SelectList(customergroup, "CustomerGroupsID", "CustomerGroupName"); var customer = db.CW_Customers.Find(id); return View(customer); } /// <summary> /// Sửa khách hàng /// </summary> /// <param name="model"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult EditCustomer([Bind(Exclude = "")]CW_Customers model) { if (ModelState.IsValid) { //CW_Customers obj = new CW_Customers(); model.CreatedDate = DateTime.Now; //db.CW_Customers.Attach(model); //db.Entry(model).Property(x => x.UserNameCustomer).IsModified = false; //db.Entry(model).Property(x => x.UserProfile.FullName).IsModified = true; //db.Entry(model).Property(x => x.UserProfile.Email).IsModified = true; //db.Entry(model).Property(x => x.UserProfile.Address).IsModified = true; //db.Entry(model).Property(x => x.UserProfile.Email).IsModified = true; //db.Entry(model).Property(x => x.UserProfile.Mobile).IsModified = true; //db.Entry(model).Property(x => x.UserProfile.IsLock).IsModified = false; //db.Entry(model).Property(x => x.NickYahoo).IsModified = true; //db.Entry(model).Property(x => x.NickSkype).IsModified = true; //db.Entry(model).Property(x => x.Facebook).IsModified = true; db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Customer"); } else { return View(model); } } public ActionResult resetpassword(string id) { ViewBag.Username = id; return View(); } [HttpPost] public ActionResult resetpassword(string username, string newpass) { var token = WebSecurity.GeneratePasswordResetToken(username); WebSecurity.ResetPassword(token, newpass); return RedirectToAction("Customer"); } public ActionResult ResetPasswordCustomer(string id) { ViewBag.Username = id; return View(); } /// <summary> /// Reset lại mật khẩu của khách hàng /// </summary> /// <param name="username"></param> /// <param name="newpass"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult ResetPasswordCustomer(string username, string newpass) { var token = WebSecurity.GeneratePasswordResetToken(username); WebSecurity.ResetPassword(token, newpass); return RedirectToAction("Customer"); } /// <summary> /// Xóa khách hàng /// </summary> /// <param name="id"></param> /// <returns></returns> [HttpPost] public ActionResult CusDelete(int id) { var userpro = db.Set<UserProfile>().Find(id); var user = db.Set<CW_Customers>().Find(id); try { var catedelte = db.CW_Customers.Attach(user); db.Set<CW_Customers>().Remove(catedelte); db.SaveChanges(); if (Roles.GetRolesForUser(userpro.UserName).Count() > 0) { Roles.RemoveUserFromRoles(userpro.UserName, Roles.GetRolesForUser(userpro.UserName)); } ((SimpleMembershipProvider)Membership.Provider).DeleteAccount(userpro.UserName); ((SimpleMembershipProvider)Membership.Provider).DeleteUser(userpro.UserName, true); return Json("Index", JsonRequestBehavior.AllowGet); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return View(user); } } #endregion #region "đăng nhập, đăng xuất" [AllowAnonymous] public ActionResult Login(string returnUrl) { //var lang = db.CW_Language.OrderByDescending(x => x.LanguageCode); //ViewBag.Language = new SelectList(lang, "LanguageCode", "Title"); //ViewBag.ReturnUrl = returnUrl; return View(); } [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) { //SessionManager.CurrentCulture = model.LanguageCode; //Session["language"] = model.LanguageCode; Session["IsAuthenticated"] = true; return RedirectToLocal(returnUrl); } //var lang = db.CW_Language.OrderByDescending(x => x.LanguageCode); //ViewBag.Language = new SelectList(lang, "LanguageCode", "Title"); ModelState.AddModelError("", "Tài khoản hoặc mật khẩu bạn nhập không chính xác."); return View(model); } public ActionResult LogOff() { Session.Abandon(); WebSecurity.Logout(); return RedirectToAction("Index", "Home"); } #endregion #region "helper" private ActionResult RedirectToLocal(string returnUrl) { if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } else { return RedirectToAction("Index", "Home"); } } #endregion #region "Profile" public ActionResult ViewProfile() { return View(); } /// <summary> /// Thông tin cá nhân /// </summary> /// <returns></returns> [ChildActionOnly] public PartialViewResult _ViewProfile() { var user = db.UserProfiles.Where(x => x.UserName == WebSecurity.CurrentUserName).First(); return PartialView(user); } /// <summary> /// Thay doi thông tin cấ nhân /// </summary> /// <param name="user"></param> /// <returns></returns> [HttpPost] public PartialViewResult _ViewProfile(UserProfile user) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return PartialView("_ViewProfile"); } public ActionResult ChangePassCurrentUserName() { return View(); } [ChildActionOnly] public PartialViewResult _ChangePassCurrentUserName() { return PartialView(); } /// <summary> /// Thay doi mat khau /// </summary> /// <returns></returns> [HttpPost] public PartialViewResult _ChangePassCurrentUserName([Bind(Exclude = "")]LocalPasswordModel model) { WebSecurity.ChangePassword(WebSecurity.CurrentUserName, model.OldPassword, model.NewPassword); return PartialView("_ChangePassCurrentUserName"); } #endregion MVCDbContext db = new MVCDbContext(); protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } } <file_sep>/COMMOM/Filter.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace COMMOM { public class Filter { private static readonly string strCheck = "áàạảãâấầậẩẫăắằặẳẵÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴéèẹẻẽêếềệểễÉÈẸẺẼÊẾỀỆỂỄ" + "óòọỏõôốồộổỗơớờợởỡÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠúùụủũưứừựửữÚÙỤỦŨƯỨỪỰỬỮíìịỉĩÍÌỊỈĨđĐýỳỵỷỹÝỲỴỶỸ~!@#$%^&*()-[{]}|\\/'\"\\.,><;:"; private static readonly string[] VietNamChar = new string[] { "aAeEoOuUiIdDyY", "áàạảãâấầậẩẫăắằặẳẵ", "ÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴ", "éèẹẻẽêếềệểễ", "ÉÈẸẺẼÊẾỀỆỂỄ", "óòọỏõôốồộổỗơớờợởỡ", "ÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠ", "úùụủũưứừựửữ", "ÚÙỤỦŨƯỨỪỰỬỮ", "íìịỉĩ", "ÍÌỊỈĨ", "đ", "Đ", "ýỳỵỷỹ", "ÝỲỴỶỸ" }; public static string FilterChar(string str) { str = str.Trim(); for (int i = 1; i < VietNamChar.Length; i++) { for (int j = 0; j < VietNamChar[i].Length; j++) { str = str.Replace(VietNamChar[i][j], VietNamChar[0][i - 1]); } } str = str.Replace(" ", "-"); str = str.Replace("--", "-"); str = str.Replace("?", ""); str = str.Replace("&", ""); str = str.Replace(",", ""); str = str.Replace(":", ""); str = str.Replace("!", ""); str = str.Replace("'", ""); str = str.Replace("\"", ""); str = str.Replace("%", ""); str = str.Replace("#", ""); str = str.Replace("$", ""); str = str.Replace("*", ""); str = str.Replace("`", ""); str = str.Replace("~", ""); str = str.Replace("@", ""); str = str.Replace("^", ""); str = str.Replace(".", ""); str = str.Replace("/", ""); str = str.Replace(">", ""); str = str.Replace("<", ""); str = str.Replace("[", ""); str = str.Replace("]", ""); str = str.Replace(";", ""); str = str.Replace("+", ""); return str.ToLower(); } public static string ChuyenCoDauThanhKhongDau(string str) { str = str.Trim(); for (int i = 1; i < VietNamChar.Length; i++) { for (int j = 0; j < VietNamChar[i].Length; j++) { str = str.Replace(VietNamChar[i][j], VietNamChar[0][i - 1]); } } //str = str.Replace(" ", "-"); str = str.Replace("--", "-"); str = str.Replace("?", ""); str = str.Replace("&", ""); str = str.Replace(",", ""); str = str.Replace(":", ""); str = str.Replace("!", ""); str = str.Replace("'", ""); str = str.Replace("\"", ""); str = str.Replace("%", ""); str = str.Replace("#", ""); str = str.Replace("$", ""); str = str.Replace("*", ""); str = str.Replace("`", ""); str = str.Replace("~", ""); str = str.Replace("@", ""); str = str.Replace("^", ""); str = str.Replace(".", ""); str = str.Replace("/", ""); str = str.Replace(">", ""); str = str.Replace("<", ""); str = str.Replace("[", ""); str = str.Replace("]", ""); str = str.Replace(";", ""); str = str.Replace("+", ""); return str.ToLower(); } public static string Money(string str) { StringBuilder sb = new StringBuilder(); if (str.Equals("")) { sb.Append("0"); } else { int count = str.Length / 3; int index = 0; sb.Append(str); for (int i = 0; i < count; i++) { index = index + 3; sb.Insert(str.Length - index, "."); } sb.Replace(".", "", 0, 1); } return sb.ToString(); } } } <file_sep>/COMMOM/Interface/Helper.cs using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Mail; using System.Text; using System.Web.SessionState; using Model.EF; namespace COMMOM.Interface { public class Helper { public static string RenderURL(string TypeCode, int Categoryid, string filterCategoryname, string link) { string strurl = ""; if (TypeCode.Equals("bai-viet")) { strurl = "/bai-viet/" + filterCategoryname; } else if (TypeCode.Equals("tin-tuc")) { strurl = "/muc-" + filterCategoryname; } else if (TypeCode.Equals("san-pham")) { strurl = "/" + filterCategoryname + "-" + Categoryid.ToString(); } else if (TypeCode.Equals("lien-ket")) { strurl = link; } else if (TypeCode.Equals("file")) { strurl = "/file/" + filterCategoryname + "-" + Categoryid.ToString(); } else if (TypeCode.Equals("album")) { strurl = "/album/" + filterCategoryname + "-" + Categoryid.ToString(); } else if (TypeCode.Equals("video")) { strurl = "/video/" + filterCategoryname + "-" + Categoryid.ToString(); } return strurl; } public static string RenderBackgroundWebsite(string lang) { string bw = ISetting.GetSettingValue("SettingBackgroundWebsite" + lang); string bc = ISetting.GetSettingValue("SettingBackgroundColor" + lang); string bi = ISetting.GetSettingValue("SettingBackgroundImage" + lang); string br = ISetting.GetSettingValue("SettingBackgroundRepeat" + lang); if (bw.Equals("color")) { return "background: " + bc; } else if (bw.Equals("image")) { if (br.Equals("repeat")) { return "background: url(" + bi + ") center top " + br; } else if (br.Equals("fix")) { return "background: url(" + bi + ") center top; background-attachment: fixed;"; } } return ""; } public static string GetFullNameCustomer(int userid) { var db = new MVCDbContext(); var cus = db.CW_Customers.Find(userid); if (cus != null) { return cus.UserProfile.FullName; } return "admin"; } public static string Template(string path) { string strTemplate = ""; string strFile = System.Web.HttpContext.Current.Server.MapPath(path); if (File.Exists(strFile)) { TextReader txtreader = null; txtreader = new StreamReader(strFile); strTemplate = txtreader.ReadToEnd(); txtreader.Close(); } return strTemplate; } public static bool SendMail(string name, string subject, string content, string toMail) { bool rs = false; try { MailMessage message = new MailMessage(); var smtp = new System.Net.Mail.SmtpClient(); { smtp.Host = "smtp.gmail.com"; //host name smtp.Port = 587; //port number smtp.EnableSsl = true; //whether your smtp server requires SSL smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; smtp.Credentials = new NetworkCredential("<EMAIL>", "29089090"); smtp.Timeout = 20000; } MailAddress fromAddress = new MailAddress("<EMAIL>", name); message.From = fromAddress; message.To.Add(toMail); message.Subject = subject; message.IsBodyHtml = true; message.Body = content; smtp.Send(message); rs = true; } catch (Exception) { rs = false; } return rs; } } } <file_sep>/Model/EF/WebRole.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("webpages_Roles")] public class WebRole { private string _roleName = string.Empty; [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int RoleId { get; set; } [Required(ErrorMessage = "Yêu cầu nhập tên nhóm")] [Display(Name = "Nhóm quyền")] [StringLength(50, ErrorMessage = "Bạn chỉ được nhập tối đa 50 ký tự !")] public string RoleName { get { return _roleName.Trim(); } set { _roleName = value.Trim(); } } [Display(Name = "Mô tả")] [StringLength(440, ErrorMessage = "Bạn chỉ được nhập tối đa 440 ký tự !")] public string Description { get; set; } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/BookingController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class BookingController : BaseController { // // GET: /Admin/Booking/ MVCDbContext db =new MVCDbContext(); public ActionResult Index() { var booking = db.Bookings.OrderByDescending(x => x.DateCreated); return View(booking); } public ActionResult View(int id) { var lstBook = db.Bookings.Find(id); return View(lstBook); } } } <file_sep>/Model/EF/CW_Email.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("CW_Email")] public class CW_Email { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int EmailID { get; set; } [RegularExpression(@"[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}", ErrorMessage = "Email không đúng định dạng")] [Display(Name = "Email")] [DataType(DataType.EmailAddress)] [Required(ErrorMessage = "Bắt buộc phải nhập!")] public string Email { get; set; } public DateTime CreatedDate { get; set; } } } <file_sep>/MVC4.PROJECT/Api/CategoriesApiController.cs using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Model.EF; namespace MVC4.PROJECT { public class CategoriesApiController : ApiController { MVCDbContext db = new MVCDbContext(); #region "tìm kiếm danh mục" [NonAction] public List<CW_Category> catechil(int? parent, List<CW_Category> objcate) { List<CW_Category> objbind = new List<CW_Category>(); foreach (CW_Category info in objcate) { if (info.ParentID == parent) { objbind.Add(info); } } return objbind; } [NonAction] public List<CW_Category> GetAllCategory(int? parent, List<CW_Category> objcate, string lang, List<CW_Category> objaddcate) { List<CW_Category> objbind = catechil(parent, objcate); if (objbind != null && objbind.Count > 0) { CW_Category objtab = null; for (int i = 0; i < objbind.Count; i++) { objtab = (CW_Category)objbind[i]; objaddcate.Add(objtab); GetAllCategory(objtab.ID, objcate, lang, objaddcate); } } return objaddcate; } [HttpGet] public JArray JTreeTableSearch(int? select, string title, int parent, string typecode, string lang) { int? tempParentid = null; IEnumerable<CW_Category> allitems = from x in db.CW_Category orderby x.Order where x.LanguageCode.Equals(lang) select x; if (title != null) { allitems = allitems.Where(x => x.KeySearch.ToLower().Contains(title.ToLower())); } if (typecode != "--") { allitems = allitems.Where(x => x.TypeCode.Equals(typecode)); } if (parent != 0) { List<CW_Category> objtemp = new List<CW_Category>(); allitems = GetAllCategory(parent, allitems.ToList(), lang, objtemp); tempParentid = parent; } var jarray = new JArray(); foreach (var i in allitems.Where(x => x.ParentID == tempParentid)) { if (select.HasValue && i.ID == select) continue; var subs = from x in allitems where x.ParentID == i.ID select x; var haschild = false; if (subs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("CreatedDate", i.CreatedDate.ToShortDateString()), new JProperty("Title", i.Title), new JProperty("MetaTitle", i.MetaTitle), new JProperty("MetaDescription", i.MetaDescription), new JProperty("Parent", null), new JProperty("IsActive", i.IsActive), new JProperty("HasChild", haschild))); if (subs.Count() > 0) SubTreeTableSearch(ref jarray, subs, allitems, 1, select); } return jarray; } [NonAction] private JArray SubTreeTableSearch(ref JArray jarray, IEnumerable<CW_Category> subs, IEnumerable<CW_Category> allitems, int level, int? select) { foreach (var i in subs) { if (select.HasValue && i.ID == select) continue; var subsubs = from x in allitems where x.ParentID == i.ID orderby x.Order select x; var haschild = false; if (subsubs.ToList().Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("CreatedDate", i.CreatedDate.ToShortDateString()), new JProperty("Title", i.Title), new JProperty("MetaTitle", i.MetaTitle), new JProperty("MetaDescription", i.MetaDescription), new JProperty("Parent", i.ParentID), new JProperty("IsActive", i.IsActive), new JProperty("HasChild", haschild))); if (subsubs.Count() > 0) SubTreeTableSearch(ref jarray, subsubs, allitems, level + 1, select); } return jarray; } #endregion #region "Danh cho quản lý danh mục" [HttpGet] public JArray JTreeTable(int? select, string lang) { var allitems = from x in db.CW_Category orderby x.Order where x.LanguageCode.Equals(lang) select x; var roots = from x in allitems where x.ParentID == null select x; var jarray = new JArray(); foreach (var i in roots) { if (select.HasValue && i.ID == select) continue; var subs = from x in allitems where x.ParentID == i.ID select x; var haschild = false; if (subs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("CreatedDate", i.CreatedDate.ToShortDateString()), new JProperty("Title", i.Title), new JProperty("MetaTitle", i.MetaTitle), new JProperty("MetaDescription", i.MetaDescription), new JProperty("Parent", null), new JProperty("IsActive", i.IsActive), new JProperty("HasChild", haschild))); if (subs.Count() > 0) SubTreeTable(ref jarray, subs, allitems, 1, select); } return jarray; } [NonAction] private JArray SubTreeTable(ref JArray jarray, IEnumerable<CW_Category> subs, IEnumerable<CW_Category> allitems, int level, int? select) { foreach (var i in subs) { if (select.HasValue && i.ID == select) continue; var subsubs = from x in allitems where x.ParentID == i.ID orderby x.Order select x; var haschild = false; if (subsubs.ToList().Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("CreatedDate", i.CreatedDate.ToShortDateString()), new JProperty("MetaTitle", i.MetaTitle), new JProperty("Parent", i.ParentID), new JProperty("IsActive", i.IsActive), new JProperty("HasChild", haschild))); if (subsubs.Count() > 0) SubTreeTable(ref jarray, subsubs, allitems, level + 1, select); } return jarray; } #endregion #region "dành cho menu" [HttpGet] public JArray JTreeTableByMenu(int? select, string menucode, string lang) { var db = new MVCDbContext(); var allitems = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals(menucode) && cate.LanguageCode.Equals(lang) orderby cate_menu.SortOrder select cate; var roots = from x in allitems where x.ParentID == null select x; var jarray = new JArray(); foreach (var i in roots) { if (select.HasValue && i.ID == select) continue; var subs = from x in allitems where x.ParentID == i.ID select x; var ordercatemenu = db.CW_Menu_Category.Where(x => x.CategoryID == i.ID && x.MenuCode == menucode).FirstOrDefault(); var haschild = false; if (subs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("CreatedDate", i.CreatedDate), new JProperty("SortOrder", ordercatemenu.SortOrder), new JProperty("Parent", null), new JProperty("HasChild", haschild))); if (subs.Count() > 0) SubTreeTableByMenu(ref jarray, subs, allitems, 1, select, menucode); } return jarray; } [NonAction] private JArray SubTreeTableByMenu(ref JArray jarray, IEnumerable<CW_Category> subs, IEnumerable<CW_Category> allitems, int level, int? select, string menucode) { var db = new MVCDbContext(); IEnumerable<CW_Category> subsubs = null; CW_Menu_Category ordercatemenu = null; bool haschild = false; foreach (var i in subs) { if (select.HasValue && i.ID == select) continue; subsubs = from x in allitems join cate_menu in db.CW_Menu_Category on x.ID equals cate_menu.CategoryID where x.ParentID == i.ID orderby cate_menu.SortOrder select x; ordercatemenu = db.CW_Menu_Category.Where(x => x.CategoryID == i.ID && x.MenuCode == menucode).FirstOrDefault(); if (subsubs.ToList().Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Level", 0), new JProperty("Title", i.Title), new JProperty("CreatedDate", i.CreatedDate), new JProperty("SortOrder", ordercatemenu.SortOrder), new JProperty("Parent", i.ParentID), new JProperty("HasChild", haschild))); if (subsubs.Count() > 0) SubTreeTableByMenu(ref jarray, subsubs, allitems, level + 1, select, menucode); } return jarray; } #endregion public JArray Get() { var allitems = from x in db.CW_Category orderby x.Order select x; var roots = allitems.Where(x => x.ParentID == null); var jarray = new JArray(); foreach (var i in roots) { var subs = allitems.Where(x => x.ParentID == i.ID).ToList(); ; var haschild = false; if (subs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Title", i.Title), new JProperty("MetaTitle", i.MetaTitle), new JProperty("Parent", null), new JProperty("HasChild", haschild), new JProperty("Child", GetJArraySub(subs, allitems)))); } return jarray; } [NonAction] private JArray GetJArraySub(IEnumerable<CW_Category> subs, IEnumerable<CW_Category> allitems) { var jarray = new JArray(); if (subs.Count() > 0) { foreach (var i in subs) { var subsubs = allitems.Where(x => x.ParentID == i.ID).ToList(); ; var haschild = false; if (subsubs.Count() > 0) haschild = true; jarray.Add(new JObject(new JProperty("ID", i.ID), new JProperty("Title", i.Title), new JProperty("MetaTitle", i.MetaTitle), new JProperty("Parent", null), new JProperty("HasChild", haschild), new JProperty("Child", GetJArraySub(subsubs, allitems)))); } } return jarray; } // GET api/<controller>/5 public string Get(int id) { return "value"; } // POST api/<controller> public void Post([FromBody]string value) { } // PUT api/<controller>/5 public void Put(int id, [FromBody]string value) { } // DELETE api/<controller>/5 public void Delete(int id) { } } } <file_sep>/Model/EF/CW_Airport.cs using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Model.EF { [Table("CW_Airport")] public class CW_Airport { //public CW_Airport() //{ // this.CW_AirportRoutes = new HashSet<CW_AirportRoute>(); //} [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Display(Name = "Tên sân bay")] [Required(ErrorMessage = "Yêu cầu nhập tên sân bay !")] [StringLength(200, ErrorMessage = "Bạn chỉ được nhập tối đa 200 ký tự !")] public string AirportName { get; set; } [Display(Name = "Mã <NAME>")] [StringLength(10, ErrorMessage = "Bạn chỉ được nhập tối đa 10 ký tự !")] public string AirportCode { get; set; } [Display(Name = "Thứ tự")] public int SortOrder { get; set; } [Display(Name = "Hiển thị")] public bool IsActive { get; set; } //public virtual ICollection<CW_AirportRoute> CW_AirportRoutes { get; set; } //public virtual Nationality Nationality { get; set; } } }<file_sep>/Model/EF/CW_Category.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; namespace Model.EF { [Table("CW_Category")] public class CW_Category { public CW_Category() { this.CW_menu_category = new HashSet<CW_Menu_Category>(); this.CW_articles = new HashSet<CW_Article>(); this.CW_news = new HashSet<CW_News>(); //this.Contents = new HashSet<Content>(); //this.CW_products = new HashSet<CW_Product>(); //this.CW_files = new HashSet<CW_File>(); //this.CW_videoclip = new HashSet<CW_VideoClip>(); //this.CW_album = new HashSet<CW_Album>(); //this.CW_Category_UpdatePrice = new HashSet<CW_Category_UpdatePrice>(); } [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Display(Name = "Tiêu đề")] [Required(ErrorMessage = "Yêu cầu nhập tiêu đề !")] [StringLength(300, ErrorMessage = "Chỉ được nhập tối đa 300 ký tự !")] public string Title { get; set; } [Display(Name = "Kiểu danh mục")] [Required(ErrorMessage = "Yêu cầu nhập kiểu danh mục !")] [StringLength(100, ErrorMessage = "Chỉ được nhập tối đa 100 ký tự !")] public string TypeCode { get; set; } [Display(Name = "Mã danh mục")] [Required(ErrorMessage = "Yêu cầu nhập trường này !")] [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] public string CategoryCode { get; set; } [Display(Name = "Mô tả")] [StringLength(1000, ErrorMessage = "Số ký tự cho phép tối đa là 1000!")] public string Description { get; set; } [Display(Name = "Danh mục cha")] public int? ParentID { get; set; } [Display(Name = "Thứ tự")] [Range(0, int.MaxValue, ErrorMessage = "Thứ tự nhập vào phải là số dương")] public int? Order { get; set; } [Display(Name = "MetaTitle")] [StringLength(400, ErrorMessage = "Chỉ được nhập tối đa 400 ký tự !")] public string MetaTitle { get; set; } [StringLength(200, ErrorMessage = "Bạn chỉ có thể nhập tối đa 200 ký tự !")] public string MetaKeywords { get; set; } [Display(Name = "MetaDescription")] [StringLength(700, ErrorMessage = "Chỉ được nhập tối đa 700 ký tự !")] public string MetaDescription { get; set; } [Display(Name = "Liên kết")] [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] public string Link { get; set; } [Display(Name = "Ảnh đại diện")] [StringLength(200, ErrorMessage = "Chỉ được nhập tối đa 200 ký tự !")] public string Icon { get; set; } [Display(Name = "Kiểu liên kết")] [StringLength(50, ErrorMessage = "Chỉ được nhập tối đa 50 ký tự !")] public string Target { get; set; } [Display(Name = "Kích hoạt")] public bool IsActive { get; set; } public DateTime CreatedDate { get; set; } [Display(Name = "Ngôn ngữ")] [StringLength(10, ErrorMessage = "Chỉ được nhập tối đa 10 ký tự !")] public string LanguageCode { get; set; } [ForeignKey("ParentID")] public virtual ICollection<CW_Category> SubCategories { get; set; } [StringLength(300, ErrorMessage = "Chỉ được nhập tối đa 300 ký tự !")] public string KeySearch { get; set; } public virtual ICollection<CW_Article> CW_articles { get; set; } public virtual ICollection<CW_News> CW_news { get; set; } //public virtual ICollection<Content> Contents { get; set; } public virtual ICollection<CW_Menu_Category> CW_menu_category { get; set; } public virtual CW_Language CW_Language { get; set; } } } <file_sep>/COMMOM/Interface/ICategory.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Mvc; using Model.EF; namespace COMMOM.Interface { public class ICategory { static MVCDbContext db = new MVCDbContext(); public static CW_Category objCate = null; public static List<CW_Category> listCategory = new List<CW_Category>(); public static bool AirportChecked(List<CW_AirportRoute> obj, int attId,int id2) { bool flag = false; if (obj != null) { if (obj.Count > 0) { foreach (CW_AirportRoute item in obj) { if (item.AirportID1 == attId) { if (item.AirportID2==id2) { flag = true; break; } } } } } return flag; } #region "list categoryby" [NonAction] public static List<CW_Category> catechilby(int? parent, List<CW_Category> objcate) { List<CW_Category> objbind = new List<CW_Category>(); foreach (CW_Category info in objcate) { if (info.ParentID == parent) { objbind.Add(info); } } return objbind; } [NonAction] public static List<CW_Category> ByTypeCode(int? parent, List<CW_Category> objcate, string space, string typecode, string lang) { //typecode = ""; IEnumerable<CW_Category> objtemp = db.CW_Category.Where(x => x.TypeCode == typecode && x.LanguageCode.Equals(lang)).OrderBy(x => x.Order); List<CW_Category> objbind = catechilby(parent, objtemp.ToList()); if (objbind != null && objbind.Count > 0) { CW_Category objtab = null; for (int i = 0; i < objbind.Count; i++) { objtab = (CW_Category)objbind[i]; objtab.Title = objtab.Title.Replace("--- ", ""); objtab.Title = space + objtab.Title; objcate.Add(objtab); if (objbind[i].SubCategories.Count() > 0) { ByTypeCode(objtab.ID, objcate, space + "--- ", typecode, lang); } } } return objcate; } #endregion #region "return list<int> category" public static IEnumerable<int> ListCategoryID(IEnumerable<CW_Category> objcate) { List<int> obj = new List<int>(); if (objcate.Count() > 0) { foreach (var item in objcate) { if (item.SubCategories.Count() > 0) { foreach (var subitem in item.SubCategories) { obj.Add(subitem.ID); } ListCategoryID(item.SubCategories); } } } return obj; } #endregion public static int? GetRoot(int? CategoryID) { if (CategoryID == null || CategoryID == -1) return -1; CW_Category ydto = new CW_Category(); ydto.ParentID = null; int? cate = CategoryID; for (int? i = CategoryID; i != 0; i = ydto.ParentID) { ydto = db.CW_Category.Where(x => x.ID == i).FirstOrDefault(); if (ydto == null) return -1; if (ydto.ParentID == null) { cate = ydto.ID; return cate; } } return cate; } #region "render breadcrumb website" //breadcumbs public static CW_Category GetCurentCategory(List<CW_Category> objCate, int? CategoryID) { foreach (CW_Category obj in objCate) { if (CategoryID == obj.ID) { return obj; } } return null; } public static List<CW_Category> GetTabsList(List<CW_Category> lstCategory, int? CategoryID) { objCate = new CW_Category(); objCate = GetCurentCategory(lstCategory, CategoryID); if (objCate != null) { listCategory.Add(objCate); GetTabsList(lstCategory, objCate.ParentID); } return listCategory; } public static string GetURL(string typecode, string categoryname, int id, string link) { string url = ""; string filter = Filter.FilterChar(categoryname); switch (typecode) { case "bai-viet": url = "/bv/" + filter + "-" + id.ToString(); break; case "tin-tuc": url = "/ds-" + filter + "-" + id.ToString(); break; case "san-pham": url = "/" + filter + "-" + id.ToString(); break; case "lien-ket": url = link; break; } return url; } public static string Renderbreadcrumb(int? CategoryID) { var Objcate = db.CW_Category.Find(CategoryID); IEnumerable<CW_Category> category = db.CW_Category.OrderBy(x => x.Order); CW_Category obj = null; StringBuilder sb = new StringBuilder(); sb.Append("<div class='breadcrumb'>"); sb.Append("<div class='breadcrumb-inner'>"); sb.Append("<ul class='list-inline list-unstyled'>"); sb.Append("<li><a href='/' title='Trang chủ'>Trang chủ <i class='fa fa-angle-double-right'></i></a></li>"); if (Objcate != null) { if (GetRoot(CategoryID) == null) { sb.Append("<li class='active'>" + Objcate.Title + " <i class='fa fa-angle-double-right'></i></li>"); } else { List<CW_Category> ObjcateRoot = GetTabsList(category.ToList(), CategoryID); for (int i = ObjcateRoot.Count - 1; i >= 0; i--) { obj = (CW_Category)ObjcateRoot[i]; if (i == 0) { sb.Append("<li class='active'>" + obj.Title + "</li>"); } else sb.Append("<li><a href='" + GetURL(obj.TypeCode, obj.Title, obj.ID, obj.Link) + "' title='" + obj.Title + "' >" + obj.Title + " <i class='fa fa-angle-double-right'></i></a></li>"); } } } sb.Append("</ul>"); sb.Append("</div>"); sb.Append("</div>"); listCategory = new List<CW_Category>(); return sb.ToString(); } #endregion #region"render menu" public static string RenderMenu(string menu, string lang, int? categoryid) { StringBuilder sb = new StringBuilder(); IEnumerable<CW_Category> category = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals(menu) && cate.ParentID == null && cate.LanguageCode.Equals(lang) orderby cate_menu.SortOrder select cate; if (category != null) { sb.Append("<ul class='nav navbar-nav'>"); foreach (var item in category) { if (item.ID == categoryid) { sb.Append("<li class='active'>"); sb.Append("<a href='" + Helper.RenderURL(item.TypeCode, item.ID, item.CategoryCode, item.Link) + "' title='" + item.Title + "'>" + item.Title + "</a>"); sb.Append(RenderSubMenu(item.ID, category.ToList())); sb.Append("</li>"); } else { sb.Append("<li>"); sb.Append("<a href='" + Helper.RenderURL(item.TypeCode, item.ID, item.CategoryCode, item.Link) + "' title='" + item.Title + "'>" + item.Title + "</a>"); sb.Append(RenderSubMenu(item.ID, category.ToList())); sb.Append("</li>"); } } sb.Append("</ul>"); } return sb.ToString(); } public static string RenderMenuLeft(int parent, string lang, int? categoryid) { StringBuilder sb = new StringBuilder(); IEnumerable<CW_Category> category = db.CW_Category.Where(x => x.ParentID == parent && x.LanguageCode.Equals(lang)); if (category != null) { sb.Append("<ul class='list-unstyled list-cat'>"); foreach (var item in category) { sb.Append("<li>" + item.Title); sb.Append("<a href='" + Helper.RenderURL(item.TypeCode, item.ID, item.CategoryCode, item.Link) + "' title='" + item.Title + "'></a>"); sb.Append(RenderSubMenu(item.ID, category.ToList())); sb.Append("</li>"); } sb.Append("</ul>"); } return sb.ToString(); } public static string RenderSubMenu(int parentid, List<CW_Category> obj) { var objparent = db.CW_Category.Where(x => x.ParentID == parentid); StringBuilder sb = new StringBuilder(); if (objparent != null && objparent.Count() > 0) { sb.Append("<ul>"); foreach (var item in objparent) { sb.Append("<li>"); sb.Append("<a href='" + Helper.RenderURL(item.TypeCode, item.ID, item.CategoryCode, item.Link) + "' title='" + item.Title + "'>" + item.Title + "</a>"); sb.Append(RenderSubMenu(item.ID, obj)); sb.Append("</li>"); } sb.Append("</ul>"); } return sb.ToString(); } public static string RenderMenuBottom(string lang, int? categoryid) { StringBuilder sb = new StringBuilder(); IEnumerable<CW_Category> category = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals("menu-bottom") && cate.ParentID == null && cate.LanguageCode.Equals(lang) orderby cate_menu.SortOrder select cate; if (category != null) { sb.Append("<ul class='list-unstyled'>"); foreach (var item in category) { sb.Append("<li>"); sb.Append("<a href='" + Helper.RenderURL(item.TypeCode, item.ID, item.CategoryCode, item.Link) + "' title='" + item.Title + "'>" + item.Title + "</a>"); sb.Append("</li>"); } sb.Append("</ul>"); } return sb.ToString(); } //Menu tren menu footer public static string RenderMenuBottomFooter(string lang, int? categoryid) { StringBuilder sb = new StringBuilder(); IEnumerable<CW_Category> category = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals("menu-middle") && cate.ParentID == null && cate.LanguageCode.Equals(lang) orderby cate_menu.SortOrder select cate; if (category != null) { sb.Append("<ul class='list-unstyled'>"); foreach (var item in category) { sb.Append("<li>"); sb.Append("<a href='" + Helper.RenderURL(item.TypeCode, item.ID, item.CategoryCode, item.Link) + "' title='" + item.Title + "'>" + item.Title + "</a>"); sb.Append("</li>"); } sb.Append("</ul>"); } return sb.ToString(); } #endregion } } <file_sep>/Model/EF/CW_Adv.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Web.Mvc; namespace Model.EF { [Table("CW_Adv")] public class CW_Adv { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Display(Name = "Title", ResourceType = typeof(StaticResources.Resources))] [Required(ErrorMessageResourceName = "EntryRequirementstitle",ErrorMessageResourceType = typeof(StaticResources.Resources))] [StringLength(400, ErrorMessageResourceName = "Error_400",ErrorMessageResourceType = typeof(StaticResources.Resources))] public string Title { get; set; } [Display(Name = "Image", ResourceType = typeof(StaticResources.Resources))] [Required(ErrorMessageResourceName = "Error_Imageenter", ErrorMessageResourceType = typeof(StaticResources.Resources))] [StringLength(200, ErrorMessageResourceName = "Error_200", ErrorMessageResourceType = typeof(StaticResources.Resources))] public string Image { get; set; } [Display(Name = "Link", ResourceType = typeof(StaticResources.Resources))] [StringLength(200, ErrorMessageResourceName = "Error_200", ErrorMessageResourceType = typeof(StaticResources.Resources))] public string Link { get; set; } [Display(Name = "Description", ResourceType = typeof(StaticResources.Resources))] [StringLength(500, ErrorMessageResourceName = "Error_500", ErrorMessageResourceType = typeof(StaticResources.Resources))] [AllowHtml] public string Description { get; set; } [Display(Name = "Height", ResourceType = typeof(StaticResources.Resources))] [Range(0, int.MaxValue, ErrorMessageResourceName = "Error_Number_positive", ErrorMessageResourceType = typeof(StaticResources.Resources))] [RegularExpression(@"[0-9]*$", ErrorMessageResourceName = "Number_1_9", ErrorMessageResourceType = typeof(StaticResources.Resources))] public int Height { get; set; } [Display(Name = "Width", ResourceType = typeof(StaticResources.Resources))] [Range(0, int.MaxValue, ErrorMessageResourceName = "Error_Number_positive", ErrorMessageResourceType = typeof(StaticResources.Resources))] [RegularExpression(@"[0-9]*$", ErrorMessageResourceName = "Number_1_9", ErrorMessageResourceType = typeof(StaticResources.Resources))] public int Width { get; set; } [Display(Name = "Position", ResourceType = typeof(StaticResources.Resources))] [Range(0, int.MaxValue, ErrorMessageResourceName = "Error_Number_positive", ErrorMessageResourceType = typeof(StaticResources.Resources))] [RegularExpression(@"[0-9]*$", ErrorMessageResourceName = "Number_1_9", ErrorMessageResourceType = typeof(StaticResources.Resources))] public int Position { get; set; } [Display(Name = "Linktype", ResourceType = typeof(StaticResources.Resources))] [StringLength(30, ErrorMessageResourceName = "Error_position", ErrorMessageResourceType = typeof(StaticResources.Resources))] public string Target { get; set; } [Display(Name = "Flashtype", ResourceType = typeof(StaticResources.Resources))] public bool IsFlash { get; set; } [Display(Name = "Active", ResourceType = typeof(StaticResources.Resources))] public bool IsActive { get; set; } [Display(Name = "Orders", ResourceType = typeof(StaticResources.Resources))] [Range(0, int.MaxValue)] [RegularExpression(@"[0-9]*$", ErrorMessageResourceName = "Number_1_9", ErrorMessageResourceType = typeof(StaticResources.Resources))] public int Order { get; set; } public DateTime CreatedDate { get; set; } [StringLength(400, ErrorMessageResourceName = "Error_400", ErrorMessageResourceType = typeof(StaticResources.Resources))] public string MetaTitle { get; set; } [StringLength(500, ErrorMessageResourceName = "Error_500", ErrorMessageResourceType = typeof(StaticResources.Resources))] public string MetaDescription { get; set; } [Display(Name = "Language", ResourceType = typeof(StaticResources.Resources))] [StringLength(10, ErrorMessageResourceName = "Error_10", ErrorMessageResourceType = typeof(StaticResources.Resources))] public string LanguageCode { get; set; } public virtual CW_Language CW_Language { get; set; } } } <file_sep>/MVC4.PROJECT/Controllers/HomeController.cs using Model.EF; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Web.Mvc; using Model; using Model.Models; namespace MVC4.PROJECT.Controllers { public class HomeController : BaseController { private AirBookClient sut; public HomeController() { var htpClientHandler = new HttpClientHandler(); //htpClientHandler.UseProxy = true; //htpClientHandler.Proxy = new WebProxy("http://localhost:8888/", false); var httpClient = new HttpClient(htpClientHandler); this.sut = new AirBookClient(httpClient); this.sut.SetAuthenticate(new AuthenticateInfo() { Username = "vnairlines.org", Password = "<PASSWORD>" }); this.sut.SetServerInfo(new ServerInfo() { ApiServer = "http://api.atvietnam.vn" }); } public ActionResult Index() { //var lang = Session["culture"].ToString(); //int cateid = int.Parse(COMMOM.Interface.ISetting.GetSettingValue("SettingDefaultPage" + lang)); //var cateobj = db.CW_Category.Find(cateid); //if (!cateobj.CategoryCode.Equals("trang-chu") && !cateobj.CategoryCode.Equals("home")) //{ // return Redirect(COMMOM.Interface.Helper.RenderURL(cateobj.TypeCode, cateobj.ID, cateobj.CategoryCode, cateobj.Link)); //} //ViewBag.CateID = 1; return View(); } // Adv --------------------------------------------- [ChildActionOnly] public PartialViewResult _AdvSlider() { var lang = Session["culture"].ToString(); var advs = db.CW_Adv.Where(m => m.Position == 1 && m.LanguageCode.Equals(lang) && m.IsActive).OrderBy(m => m.Order); return PartialView(advs); } // Menu -------------------------------------------- [ChildActionOnly] public PartialViewResult _MenuMain() { var lang = Session["culture"].ToString(); IEnumerable<CW_Category> categories = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals("menu-top") && cate.ParentID == null && cate.LanguageCode.Equals(lang) && cate.IsActive orderby cate_menu.SortOrder select cate; return PartialView(categories); } [ChildActionOnly] public PartialViewResult _MenuFooter() { var lang = Session["culture"].ToString(); IEnumerable<CW_Category> categories = from cate in db.CW_Category join cate_menu in db.CW_Menu_Category on cate.ID equals cate_menu.CategoryID where cate_menu.MenuCode.Equals("menu-bottom") && cate.ParentID == null && cate.LanguageCode.Equals(lang) && cate.IsActive orderby cate_menu.SortOrder select cate; return PartialView(categories); } // Data -------------------------------------------- private MVCDbContext db = new MVCDbContext(); protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } }<file_sep>/COMMOM/Extends.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace COMMOM { public class Extends { static Random rand = new Random(); public const string Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; public static string GenerateString(int size) { char[] chars = new char[size]; for (int i = 0; i < size; i++) { chars[i] = Alphabet[rand.Next(Alphabet.Length)]; } return new string(chars); } public static string SubString(string str, int size) { if (str.Length > size) { string rs = str.Substring(0, size); return rs.Substring(0, rs.LastIndexOf(' ')) + "Content/themes/Admin."; } else return str; } public static string GenerateRandomPassword(int length) { string allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789!@$?_-*&#+"; char[] chars = new char[length]; Random rd = new Random(); for (int i = 0; i < length; i++) { chars[i] = allowedChars[rd.Next(0, allowedChars.Length)]; } return new string(chars); } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/AirportRouteController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class AirportRouteController : BaseController { // // GET: /Admin/AirportRoute/ MVCDbContext db = new MVCDbContext(); public ActionResult Index(int id) { var air = db.AirportRoutes.Find(id); return View(air); } } } <file_sep>/MVC4.PROJECT/Areas/Admin/Controllers/CategoriesController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Model.EF; namespace MVC4.PROJECT.Areas.Admin.Controllers { [Authorize(Roles = "administrator, codeadmin")] public class CategoriesController : BaseLangController { // // GET: /Admin/Categories/ MVCDbContext db = new MVCDbContext(); public ActionResult Index() { List<CW_Category> objbind = new List<CW_Category>(); ViewBag.ListCateEdit = GetTreeTable(null, objbind, "",null); IEnumerable<CW_Category> cate = db.CW_Category; ViewBag.CountCate = cate.ToList().Count(); return View(); } public ActionResult Add() { List<CW_Category> objbind = new List<CW_Category>(); ViewBag.ListCateEdit = new SelectList(GetTreeTable(null, objbind, "",null), "ID", "Title"); ViewBag.SelectListItems = new MultiSelectList(db.CW_Menu.ToList<CW_Menu>(), "MenuCode", "Title"); return View(); } /// <summary> /// them moi danh muc /// </summary> /// <param name="model"></param> /// <param name="lstmenu"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult Add(CW_Category model, List<string> lstmenu) { if (lstmenu != null) { lstmenu.ForEach(x => model.CW_menu_category.Add( new CW_Menu_Category() { MenuCode = x.ToString(), SortOrder = 1 } )); } if (model.MetaTitle == null) model.MetaTitle = model.Title; model.CategoryCode = COMMOM.Filter.FilterChar(model.Title); model.CreatedDate = DateTime.Now; model.LanguageCode = Session["language"].ToString(); model.KeySearch = model.Title + " , " + COMMOM.Filter.FilterChar(model.Title); db.Set<CW_Category>().Add(model); db.SaveChanges(); ViewBag.SelectListItems = new MultiSelectList(db.CW_Menu.ToList<CW_Menu>(), "MenuCode", "Title"); return RedirectToAction("Index"); } /// <summary> /// Thu muc con /// </summary> /// <param name="parent"></param> /// <param name="objcate"></param> /// <returns></returns> [NonAction] public List<CW_Category> catechil(int? parent, List<CW_Category> objcate, int? idCate) { List<CW_Category> objbind = new List<CW_Category>(); foreach (CW_Category info in objcate) { if (info.ParentID == parent && info.ID != idCate) { objbind.Add(info); } } return objbind; } /// <summary> /// Muc cha /// </summary> /// <param name="parent"></param> /// <param name="objcate"></param> /// <param name="space"></param> /// <returns></returns> [NonAction] public List<CW_Category> GetTreeTable(int? parent, List<CW_Category> objcate, string space, int? idCate) { var lang = Session["language"].ToString(); IEnumerable<CW_Category> objtemp = db.CW_Category.Where(x => x.LanguageCode.Equals(lang)).OrderBy(x => x.Order); List<CW_Category> objbind = catechil(parent, objtemp.ToList(),idCate); if (objbind != null && objbind.Count > 0) { CW_Category objtab = null; for (int i = 0; i < objbind.Count; i++) { objtab = (CW_Category)objbind[i]; objtab.Title = space + objtab.Title; objcate.Add(objtab); GetTreeTable(objtab.ID, objcate, space + "--- ",idCate); } } return objcate; } public ActionResult Edit(int id) { //danh mục cha List<CW_Category> objbind = new List<CW_Category>(); var cate = db.Set<CW_Category>().Find(id); if (cate != null) { ViewBag.ListCateEdit = new SelectList(GetTreeTable(null, objbind, "", id), "ID", "Title"); cate.Title = cate.Title.Replace("--- ", ""); #region "kiểu danh mục" //tất cả menu ViewBag.AllSelectListItems = new MultiSelectList(db.CW_Menu.ToList<CW_Menu>(), "MenuCode", "Title"); //menu được chọn List<CW_Menu> selectlist = new List<CW_Menu>(); IEnumerable<CW_Menu_Category> listcatemenu = db.CW_Menu_Category.Where(a => a.CategoryID == id); foreach (CW_Menu_Category item in listcatemenu) { var menu = db.Set<CW_Menu>().Find(item.MenuCode); if (menu != null) { selectlist.Add((CW_Menu)menu); } } if (selectlist.Count > 0) { ViewBag.SelectListItems = selectlist; } #endregion return View(cate); } else { return HttpNotFound(); } } /// <summary> /// sua danh muc /// </summary> /// <param name="category"></param> /// <param name="lstmenuedit"></param> /// <returns></returns> [HttpPost] [ValidateAntiForgeryToken] public ActionResult Edit([Bind(Include = "")]CW_Category category, List<string> lstmenuedit) { //lấy ra menu không được chọn IEnumerable<CW_Menu> objmenunoselect = db.CW_Menu; //Nếu có menu muốn edit if (lstmenuedit != null) { //đối tượng để kiểm tra sự tồn tại của menu được chọn trong data hay chưa CW_Menu_Category obj = null; //đối tượng dùng để thêm mới menu và data. CW_Menu_Category addmenucate = null; foreach (string str in lstmenuedit) { obj = db.CW_Menu_Category.Where(x => x.CategoryID == category.ID && x.MenuCode.Equals(str)).FirstOrDefault(); if (obj == null) //chưa có menu này thì thêm vào { addmenucate = new CW_Menu_Category(); addmenucate.CategoryID = category.ID; addmenucate.MenuCode = str; addmenucate.SortOrder = 1; db.Set<CW_Menu_Category>().Add(addmenucate); db.SaveChanges(); } objmenunoselect = objmenunoselect.Where(x => !x.MenuCode.Equals(str)); } //menu không được chọn nữa, nhưng đang tồn tại trong bảng CW_Menu_Category thì xóa đi if (objmenunoselect != null) { CW_Menu_Category objMenuCategory = null; foreach (var item in objmenunoselect) { objMenuCategory = db.CW_Menu_Category.Where(x => x.CategoryID == category.ID && x.MenuCode.Equals(item.MenuCode)).FirstOrDefault(); if (objMenuCategory != null) { db.CW_Menu_Category.Attach(objMenuCategory); db.Set<CW_Menu_Category>().Remove(objMenuCategory); } } db.SaveChanges(); } } else //xóa bản ghi ở bảng CW_Menu_Category { IEnumerable<CW_Menu_Category> menucate = (from s in db.CW_Menu_Category where s.CategoryID == category.ID select s); foreach (CW_Menu_Category obj in menucate) { db.CW_Menu_Category.Attach(obj); db.Set<CW_Menu_Category>().Remove(obj); } db.SaveChanges(); } category.MetaTitle = category.Title; category.CategoryCode = COMMOM.Filter.FilterChar(category.Title); category.KeySearch = category.Title + " , " + COMMOM.Filter.FilterChar(category.Title); db.CW_Category.Attach(category); db.Entry(category).Property(a => a.Title).IsModified = true; db.Entry(category).Property(a => a.TypeCode).IsModified = true; db.Entry(category).Property(a => a.CategoryCode).IsModified = true; db.Entry(category).Property(a => a.Description).IsModified = true; db.Entry(category).Property(a => a.ParentID).IsModified = true; db.Entry(category).Property(a => a.Order).IsModified = false; db.Entry(category).Property(a => a.MetaTitle).IsModified = true; db.Entry(category).Property(a => a.MetaDescription).IsModified = true; db.Entry(category).Property(a => a.KeySearch).IsModified = true; db.Entry(category).Property(a => a.Link).IsModified = true; db.Entry(category).Property(a => a.Icon).IsModified = true; db.Entry(category).Property(a => a.Target).IsModified = true; db.Entry(category).Property(a => a.IsActive).IsModified = true; db.Entry(category).Property(a => a.CreatedDate).IsModified = false; db.Entry(category).Property(a => a.LanguageCode).IsModified = false; db.SaveChanges(); return RedirectToAction("Index"); } /// <summary> /// xoa tung danh muc 1 /// </summary> /// <param name="item"></param> /// <returns></returns> [HttpPost] public ActionResult DeleteOneItem(int item) { //xóa cấp con trước var chil = db.CW_Category.Where(x => x.ParentID == item); if (chil != null && chil.Count() > 0) { foreach (var items in chil) { var catedeltes = db.CW_Category.Attach(items); db.Set<CW_Category>().Remove(catedeltes); } db.SaveChanges(); } var cate = db.Set<CW_Category>().Find(item); if (cate != null) { var catedelte = db.CW_Category.Attach(cate); db.Set<CW_Category>().Remove(catedelte); db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } /// <summary> /// xoa nhieu danh muc /// </summary> /// <param name="id"></param> /// <returns></returns> [HttpPost] public ActionResult Delete(string id) { if (!id.Equals("")) { CW_Category obj = new CW_Category(); int cateid = 0; string[] arr = id.Split(','); for (int i = 0; i < arr.Count() - 1; i++) { cateid = int.Parse(arr[i].ToString()); obj = db.CW_Category.Find(cateid); if (obj != null) { var catedelte = db.CW_Category.Attach(obj); db.Set<CW_Category>().Remove(catedelte); } } db.SaveChanges(); } return Json("Delete", JsonRequestBehavior.AllowGet); } /// <summary> /// update trang thai /// </summary> /// <param name="id"></param> /// <param name="isactive"></param> /// <returns></returns> [HttpPost] public ActionResult UpdateIsActive(int id, bool isactive) { CW_Category category = db.CW_Category.Find(id); if (category != null) { db.Set<CW_Category>().Attach(category); if (isactive) { category.IsActive = false; } else { category.IsActive = true; } db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } /// <summary> /// update ten danh muc /// </summary> /// <param name="id"></param> /// <param name="title"></param> /// <returns></returns> [HttpPost] public ActionResult UpdateTitle(int id, string title) { CW_Category cate = db.CW_Category.Find(id); if (cate != null) { db.Set<CW_Category>().Attach(cate); cate.Title = title; db.SaveChanges(); } return Json("chamara", JsonRequestBehavior.AllowGet); } } }
1adc6b89a14e1e70383de06f68b68b1eec34605e
[ "JavaScript", "C#" ]
73
C#
ngohoang291990/vemaybay
eeeed77be6edf705e41d6038a190bcc040dfde94
3215497a9074dbf516b941c9a30b917b0dd79550
refs/heads/master
<repo_name>fahad-30/Snake.py<file_sep>/snake.py import pygame,sys,random,time import tkinter as tk from tkinter import messagebox pygame.init() width = 600 row = 30 cellw = width//row display = pygame.display.set_mode((width,width)) pygame.display.set_caption('Snake') crash = pygame.mixer.Sound('data/crash.wav') pygame.mixer.music.load('data/Game_Plan.mp3') eat1 = pygame.mixer.Sound('data/food1.wav') eat2 = pygame.mixer.Sound('data/food2.wav') def eat(i): if i==0: return eat1 else: return eat2 white = (255,255,255) black = (0,0,0) green = (0,255,0) red = (255,0,0) class snake(object): body = [] turns ={} def __init__(self,color,pos): self.color = color self.head = cube(pos) self.body.append(self.head) self.dirx = 0 self.diry = 1 def move(self): for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() elif event.type == pygame.KEYDOWN: if event.key==pygame.K_LEFT: self.dirx=-1 self.diry=0 self.turns[self.head.pos[:]]= [self.dirx,self.diry] elif event.key==pygame.K_RIGHT: self.dirx=1 self.diry=0 self.turns[self.head.pos[:]]= [self.dirx,self.diry] elif event.key==pygame.K_UP: self.dirx=0 self.diry=-1 self.turns[self.head.pos[:]]= [self.dirx,self.diry] elif event.key==pygame.K_DOWN: self.dirx=0 self.diry=1 self.turns[self.head.pos[:]]= [self.dirx,self.diry] elif event.type == pygame.KEYUP: pass for i,c in enumerate(self.body): p = c.pos[:] if p in self.turns: turn =self.turns[p] c.move(turn[0],turn[1]) if i==len(self.body)-1: self.turns.pop(p) else: if c.dirx==-1 and c.pos[0]<=0: c.pos=(c.rows-1,c.pos[1]) elif c.dirx==1 and c.pos[0]>=c.rows-1: c.pos=(0,c.pos[1]) elif c.diry==-1 and c.pos[1]<=0: c.pos=(c.pos[0],c.rows-1) elif c.diry==1 and c.pos[1]>=c.rows-1: c.pos=(c.pos[0],0) else: c.move(c.dirx,c.diry) def draw(self): for i,c in enumerate(self.body): if i==0: c.draw(1) else: c.draw(0) def addCube(self): tail = self.body[-1] dx,dy = tail.dirx, tail.diry if dx==1 and dy==0: self.body.append(cube((tail.pos[0]-1,tail.pos[1]))) elif dx==-1 and dy==0: self.body.append(cube((tail.pos[0]+1,tail.pos[1]))) elif dx==0 and dy==1: self.body.append(cube((tail.pos[0],tail.pos[1]-1))) elif dx==0 and dy==-1: self.body.append(cube((tail.pos[0],tail.pos[1]+1))) self.body[-1].dirx=dx self.body[-1].diry=dy def reset(self,pos): self.head = cube(pos) self.body=[] self.body.append(self.head) self.turns={} self.dirx=0 self.diry=1 pygame.mixer.music.unpause() class cube(object): rows=row def __init__(self,start,dirx=1,diry=0,color = green): self.pos =start self.dirx=1 self.diry=0 self.color=color def move(self,dirx,diry): self.dirx=dirx self.diry=diry self.pos = (self.pos[0]+self.dirx,self.pos[1]+self.diry) def draw(self,eyes): i = self.pos[0] j = self.pos[1] pygame.draw.rect(display,self.color,(i*cellw+1,j*cellw+1,cellw-1 ,cellw-1)) if eyes==1: centre = cellw//2 radius = 3 mid1 = (i*cellw +centre - radius,j*cellw+8) mid2 = (i*cellw +centre + radius,j*cellw+8) pygame.draw.circle(display,black,mid1,3) pygame.draw.circle(display,black,mid2,3 ) def food(item): positions = item.body while True: x = random.randrange(row) y = random.randrange(row) if len(list(filter(lambda z :z.pos ==(x,y),positions)))>0: continue else: break return(x,y) def drawGrid(): x=0 y=0 for j in range(row+1): pygame.draw.line(display,white,(x,0),(x,width)) pygame.draw.line(display,white,(0,y),(width,y)) y+= cellw x+= cellw def message_box(subject,content): root=tk.Tk() root.attributes("-topmost",True) root.withdraw() messagebox.showinfo(subject,content) try: root.destroy() except : pass def redraw_window(): global s,snack global score display.fill((0,0,0)) drawGrid() s.draw() snack.draw(0) pygame.display.flip() def main(): global s,snack,score pygame.mixer.music.play(-1) s = snake(green,(10,10)) flag =True clock = pygame.time.Clock() snack = cube(food(s),color = red) while flag: clock.tick(10) s.move() if s.body[0].pos == snack.pos: s.addCube() snack = cube(food(s),color = red) pygame.mixer.Sound.play(eat(len(s.body)%2)) for x in range(len(s.body)): if s.body[x].pos in list(map(lambda z: z.pos,s.body[x+1:])): score = len(s.body) pygame.mixer.Sound.play(crash) time.sleep(1) pygame.mixer.music.pause() message_box('You lost',"Play again \n Score: {}".format(score)) s.reset((10,10)) break redraw_window() main()<file_sep>/.github/workflows/Add_Card/Add_Card.py import requests import issues import sys name = issues.titles desc = issues.body url = "https://api.trello.com/1/cards" key = sys.argv[1] # token = sys.argv[1] query = { 'name':name, 'desc':desc, 'idList':'5e95c3a80d601f5535eb4259', 'key':key, 'token':'<KEY>' } # headers ={ "Accept": "application/json"} response = requests.request( "POST", url, params=query ) print(response.text) ##'idList':'5e95c3a80d601f5535eb4259', # 'name':'trial4', # 'desc':'trial with jenkins', <file_sep>/README.md # Snake.py A python file, when runned, makes you play a snake game with the help of pygame module. <file_sep>/.github/workflows/Add_Card/issues.py import requests url = "https://api.github.com/repos/fahad-30/Snake.py/issues" response = requests.request("GET",url) # print(response.text) response= response.json() dict1= response[0] titles = dict1["title"] body = dict1["body"]
beaf32615dbce271cde338c790e5ee65df251bbb
[ "Markdown", "Python" ]
4
Python
fahad-30/Snake.py
9801e3f3c9203add14178e14dd54015f4fbb1b36
b08a469082a129cec5d635dd132158744ebf2020
refs/heads/master
<file_sep># bluetooth-module-indicator [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Ubuntu debian package deployment of a Menubar indicator for direct display of bluetooth modules' transparent app registers. Compatible with generic modules such as JDY-16, HC-08. ## Installation ``` sudo add-apt-repository ppa:mihaigalos/ppa sudo apt-get update sudo apt install bluetooth-module-indicator netatmo-indicator & ``` ## Removal ``` sudo apt remove --purge bluetooth-module-indicator ``` ## Screenshots ![alt text](screenshots/BluetoothModuleIndicator.png) ###### Sources ``` git clone --recursive https://github.com/mihaigalos/bluetooth-module-indicator.git ``` <file_sep>#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Author: <NAME> # Date: November 7 , 2018 # Purpose: indicator for the Netatmo Weather Station # Tested on: Ubuntu 16.04 LTS # # # Licensed under The MIT License (MIT). # See included LICENSE file or the notice below. # # Copyright (c) 2018 <NAME> # # 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. import os import shutil import appindicator import gtk import glib import datetime from Drivers.Bluetooth.bluetooth import BluetoothModule current_version = "v0.1-12" default_update_interval_msec = 30 * 1000 homepage_location = "https://github.com/mihaigalos/bluetooth-module-indicator" timeout_no_connection_seconds = 5 * 60 class AboutDialog: def __init__(self): self.dialog = gtk.Dialog("About", None, gtk.DIALOG_DESTROY_WITH_PARENT) self.dialog.set_default_size(150, 100) author = gtk.Label("(c) <NAME> 2018.") self.dialog.vbox.add(author) author.show() version = gtk.Label(current_version) self.dialog.vbox.add(version) version.show() homepage = gtk.Label() homepage.set_markup( "<a href=\"" + homepage_location + "\">" + homepage_location + "</a>") self.dialog.vbox.add(homepage) homepage.show() self.ok_button = gtk.Button("Ok") self.ok_button.connect("pressed", self.on_ok_button_pressed) self.dialog.vbox.pack_start(self.ok_button, False, False, 1) self.ok_button.show() self.dialog.run() def on_ok_button_pressed(self, *args): self.dialog.destroy() class Menu: def __init__(self): self.create_menu() self.menu.show() def create_about_item(self): img = gtk.Image() img.set_from_stock(gtk.STOCK_HELP, 1) about_item = gtk.ImageMenuItem("About") about_item.set_image(img) about_item.set_always_show_image(True) about_item.connect("activate", self.on_about_clicked) about_item.show() self.menu.append(about_item) def create_menu(self): self.menu = gtk.Menu() self.create_timediff_item() self.create_separator() self.create_about_item() self.create_quit_item() def create_quit_item(self): img = gtk.Image() img.set_from_stock(gtk.STOCK_QUIT, 1) quit_item = gtk.ImageMenuItem("Quit") quit_item.set_image(img) quit_item.set_always_show_image(True) quit_item.connect("activate", self.quit) quit_item.show() self.menu.append(quit_item) def create_separator(self): separator = gtk.SeparatorMenuItem() separator.show() self.menu.append(separator) def create_timediff_item(self): img = gtk.Image() img.set_from_stock(gtk.STOCK_DIALOG_INFO, 1) self.timediff_item = gtk.ImageMenuItem("--") self.timediff_item.set_image(img) self.timediff_item.set_always_show_image(True) self.timediff_item.show() self.menu.append(self.timediff_item) def on_about_clicked(self, *args): about = AboutDialog() def set_diff_time_item_label(self, new_label): self.timediff_item.set_label(new_label) def quit(self, widget): gtk.main_quit() class BluetoothModuleIndicator: def __init__(self, bluetooth_address, timeout_interval_msec=default_update_interval_msec): self.last_timestamp = datetime.datetime.now() self.timeout_interval_msec = timeout_interval_msec self.setup_bluetooth(bluetooth_address) self.setup_window() self.setup_menu() self.setup_update() self.update_diff_time_item_label() def compute_timestamp_diff(self): timestamp = datetime.datetime.now() time_diff = timestamp - self.last_timestamp self.last_timestamp = datetime.datetime.now() diff_seconds = time_diff.total_seconds() if(diff_seconds > timeout_no_connection_seconds): diff_seconds = "--" else: diff_seconds = str(int(diff_seconds)) return diff_seconds def get_timediff_label(self): return 'Retrieved ' + self.compute_timestamp_diff() + "s ago." def on_update(self): self.update_diff_time_item_label() glib.timeout_add(self.timeout_interval_msec, self.on_update) def update_diff_time_item_label(self): self.menu.set_diff_time_item_label(self.get_timediff_label()) def setup_bluetooth(self, bluetooth_address): try: self.bluetooth_module = BluetoothModule(bluetooth_address) self.label = self.bluetooth_module.read(once=True) except: self.label = str("No reply from " + bluetooth_address) pass def setup_menu(self): self.menu = Menu() self.indicator.set_menu(self.menu.menu) def setup_update(self): glib.timeout_add(self.timeout_interval_msec, self.on_update) def setup_window(self): self.indicator = appindicator.Indicator("sample-ind", "bluetooth-active", appindicator.CATEGORY_APPLICATION_STATUS) self.indicator.set_status(appindicator.STATUS_ACTIVE) self.indicator.set_label(self.label) def main(): gtk.main() return 0 if __name__ == "__main__": indicator = BluetoothModuleIndicator("3C:A5:39:90:BB:B1") main()
293c34335426c56affa399cb8a85cb9c952ca252
[ "Markdown", "Python" ]
2
Markdown
mihaigalos/bluetooth-module-indicator
3a7c523d50a8f1a84e164c04f8ffe2c68ef35444
9615c5d3f395fd55c62e996b4041a6ff77320c1e
refs/heads/master
<repo_name>boydfd/java-collection-operator<file_sep>/src/main/java/com/thoughtworks/collection/Add.java package com.thoughtworks.collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; public class Add { public int getSumOfEvens(int leftBorder, int rightBorder) { int bigNumber = Math.max(leftBorder, rightBorder); int smallNumber = Math.min(leftBorder, rightBorder); int sum = 0; for (int i = smallNumber; i <= bigNumber; i++) { if (i % 2 == 0) { sum += i; } } return sum; } public int getSumOfOdds(int leftBorder, int rightBorder) { int bigNumber = Math.max(leftBorder, rightBorder); int smallNumber = Math.min(leftBorder, rightBorder); int sum = 0; for (int i = smallNumber; i <= bigNumber; i++) { if (i % 2 != 0) { sum += i; } } return sum; } public int getSumTripleAndAddTwo(List<Integer> arrayList) { return arrayList.stream().reduce(0, (sum, item) -> sum + (item * 3 + 2)); } public List<Integer> getTripleOfOddAndAddTwo(List<Integer> arrayList) { return arrayList.stream().map(item -> { if (item % 2 != 0) { return item * 3 + 2; } return item; }).collect(Collectors.toList()); } public int getSumOfProcessedOdds(List<Integer> arrayList) { return arrayList.stream().filter(item -> item % 2 != 0) .map(item -> item * 3 + 5) .reduce(0, (sum, item) -> sum + item); } public List<Integer> getProcessedList(List<Integer> arrayList) { List<Integer> resultList = new LinkedList<>(); //List不可以被实例化,抽象类 for (int i = 1; i < arrayList.size(); i++) { //无法用map获取元素index resultList.add((arrayList.get(i - 1) + arrayList.get(i)) * 3); } return resultList; } public double getMedianOfEvenIndex(List<Integer> arrayList) { List list = arrayList.stream() .filter(item -> item % 2 == 0) .sorted() .collect(Collectors.toList()); int count = list.size(); if (count % 2 == 0) { int right = (int) list.get(count / 2); int left = (int) list.get(count / 2 - 1); return (right + left) / 2; } return (double) list.get(count / 2); } public double getAverageOfEvenIndex(List<Integer> arrayList) { long count = arrayList.stream().filter(item -> item % 2 == 0).count(); return arrayList.stream() .filter(item -> item % 2 == 0) .reduce(0, (sum, item) -> sum + item) / count; } public boolean isIncludedInEvenIndex(List<Integer> arrayList, Integer specialElment) { return arrayList.stream() .filter(item -> item % 2 == 0) .collect(Collectors.toList()) .contains(specialElment); } public List<Integer> getUnrepeatedFromEvenIndex(List<Integer> arrayList) { return arrayList.stream().filter(item -> item % 2 == 0) .distinct() .collect(Collectors.toList()); } public List<Integer> sortByEvenAndOdd(List<Integer> arrayList) { List evenList = arrayList.stream().filter(item -> item % 2 == 0).sorted().collect(Collectors.toList()); List oddList = arrayList.stream().filter(item -> item % 2 != 0).sorted().collect(Collectors.toList()); Collections.reverse(oddList); evenList.addAll(oddList); return evenList; } }
9cb4284497edb6666d3a57dab53655455ce1eecc
[ "Java" ]
1
Java
boydfd/java-collection-operator
bec1ddcac5be32988dc4f821865782764aae8496
112097d952ee007b3b1263eba27c17cbe8eca7a4
refs/heads/master
<repo_name>marqoms17/githhub-remote<file_sep>/django/django-project/blog/urls.py # ini urls.py blog from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index') ] <file_sep>/django/django-project/blog/views.py # views blog from django.shortcuts import render def index(request): context = { 'judul': 'Marqoms Website', 'subjudul': 'Selamat Datang di Blog ini' } return render(request, 'blog/index.html', context) <file_sep>/Python/mycalculator.py from os import system def header(): print("="*40) salam = "My_calculator" print(salam.center(41, ' ')) print("="*40) def tambah(a, b): return a+b def kurang(a, b): return a-b def bagi(a, b): return a/b def kali(a, b): return a*b while True: system('clear') header() print("\nHai bro! Selamat datang di My_calculator") print('\nPilih operasi : \n') print('1. Penjumlahan') print('2. Pengurangan') print('3. Perkalian') print('4. Pembagian') print('0. Keluar') pilih = input('\nPilihan Anda : ') if pilih == '0': print('\n\t\t---END---') break elif pilih in ('1', '2', '3', '4'): num1 = float(input('Masukan angka pertama = ')) num2 = float(input('Masukan angka kedua = ')) if pilih == '1': print(f'{num1} + {num2} = ', tambah(num1, num2)) elif pilih == '2': print(f'{num1} - {num2} = ', kurang(num1, num2)) elif pilih == '3': print(f'{num1} * {num2} = ', kali(num1, num2)) elif pilih == '4': print(f'{num1} / {num2} = ', bagi(num1, num2)) else: print('Pilihan yang anda masukkan salah!') input('\n----Tekan Enter untuk melanjutkan----') <file_sep>/Python/GUI/grid.py from tkinter import * root = Tk() myLabel1 = Label(root, text='NAME') myLabel2 = Label(root, text='\tADDRESS\t') myLabel3 = Label(root, text='\tAGE\t') myLabel4 = Label(root, text='Marqoms') myLabel5 = Label(root, text='\tJakarta\t') myLabel6 = Label(root, text='\t 28\t') myLabel1.grid(row=0, column=0) myLabel2.grid(row=0, column=1) myLabel3.grid(row=0, column=2) myLabel4.grid(row=1, column=0) myLabel5.grid(row=1, column=1) myLabel6.grid(row=1, column=2) root.mainloop() <file_sep>/Python/GUI/button.py from tkinter import * root = Tk() def myClick(): myLabel = Label(root, text='Tombol apa tu man? ini tombol puyoh!!') myLabel.pack() myButton = Button(root, text='Click Disini!', command=myClick, fg='#000', bg='sky blue') myButton.pack() root.mainloop() <file_sep>/Wedding_Project/Index.html <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Bad+Script&family=Poppins:wght@200&family=Sacramento&family=Satisfy&display=swap" rel="stylesheet"> <link rel="stylesheet" href="styles.css"> <title>Miracle Wedding</title> </head> <body id="page-top"> <!-- Navbar --> <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top" id="mainNav"> <div class="container"> <a class="navbar-brand txt1" href="#page-top">Miracle Wedding</a> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav ml-auto"> <li class="nav-item active"> <a class="nav-link js-scroll-trigger txt2" href="#">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger txt2" href="#">About</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger txt2" href="#">Order</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger txt2" href="#">Contact</a> </li> </ul> </div> </div> </nav> <!-- end Navbar --> <!-- jumbotron --> <div class="jumbotron"> <div class="container"> <br> <h1 class="display-3 font-weight text-white font-weight-bold">Miracle Wedding</h1> <p class="p1 text-white">Jasa Desain Digital Wedding Invitation</p> <br><hr class="my-4"><br> <br> <h5 class="p1 text-white">Cara Hemat & Cepat Sebarkan Undangan<br>Pernikahan Anda</h5> <a class="btn btn-success btn-lg text-dark" href="#" role="button">Selengkapnya</a> </div> </div> <!-- end jumbotron --> <!-- content1 --> <div class="content"> <div class="container"> <h2 class="font-weight-bold text-secondary">Kenapa Undangan Digital?</h2><br><br> <div class="d-flex bd-highlight"> <div class="p-2 flex-fill bd-highlight"><span class="txt1"><strong>Simple</strong></span><br> Sederhana tanpa harus membuat banyak halaman desain.</div> <div class="p-2 flex-fill bd-highlight"><span class="txt1"><strong>Cepat</strong></span><br> Desain cepat, pengiriman juga cepat cukup via Smartphone.</div> <div class="p-2 flex-fill bd-highlight"><span class="txt1"><strong>Hemat</strong></span><br> Jauh lebih hemat dibandingkan cetak ribuan undangan.</div> <div class="p-2 flex-fill bd-highlight"><span class="txt1"><strong>Silaturahim</strong></span><br> Menjalin & menjaga tali silaturahim dengan sanak saudara</div> </div> </div> </div> <!-- end content1 --> <!-- content2 --> <div class="content2"> <h2 class="font-weight-bold text-secondary pt-5">Template Desain Undangan</h2> <p class="txt1">Pilih desainmu sekarang</p> <br> <div class="container"> <div class="row"> <div class="col"> <div class="text-center"> <img class="imgsz rounded shadow-sm"src="Assets/img/ud6.jpg" alt="undangan1"> </div> <p class="txt2">MD-001</p> </div> <div class="col"> <div class="text-center"> <img class="imgsz rounded shadow-sm" src="Assets/img/ud3.jpg" alt="..."> </div> <p class="txt2">MD-002</p> </div> <div class="col"> <div class="text-center"> <img class="imgsz rounded shadow-sm" src="Assets/img/ud4.jpg"alt="..."> </div> <p class="txt2">MD-003</p> </div> <div class="col"> <div class="text-center"> <img class="imgsz rounded shadow-sm" src="Assets/img/ud1.jpg" alt="..."> </div> <p class="txt2">MD-004</p> </div> </div> </div> </div> <!-- end content2 --> <!-- content3 --> <div class="content3"> <h2 class="font-weight-bold text-secondary pt-5">CARA PESAN E-INVITATION</h2> <p class="txt1">Dengan 6 langkah mudah :</p> <br> <div class="container"> <div class="row"> <div class="col-sm"> <img class="imgsz2" src="Assets/img/choose.png" alt="pilih"><p class="p2 font-weight-bold">1. Pilih paket desain</p> </div> <div class="col-sm"> <img class="imgsz2" src="Assets/img/brief.png" alt="brief"><p class="p2 font-weight-bold">2. Isi Brief & Materi</p> </div> <div class="col-sm"> <img class="imgsz2" src="Assets/img/buy.png" alt="bayar"> <p class="p2 font-weight-bold">3. Pembayaran</p> </div> </div> <br> <br> </div> <div class="container"> <div class="row"> <div class="col-sm"> <img class="imgsz2" src="Assets/img/working.png" alt="pengerjaan desain"> <p class="p2 font-weight-bold">4. Pengerjaan Desain</p> </div> <div class="col-sm"> <img class="imgsz2" src="Assets/img/feedback.png" alt="feedback"> <p class="p2 font-weight-bold">5. Feedback Anda</p> </div> <div class="col-sm"> <img class="imgsz2" src="Assets/img/sendfile.png" alt="kirim file"> <p class="p2 font-weight-bold">6. Selesai & Kirim File</p> </div> </div> </div> <br> <br> <button type="button" class="btn btn-success btn-sm">Pesan Undangan Digital</button> </div> <!-- end content3 --> <!-- content 4 --> <div class="content4"> <div class="container"> <h2 class="py-5 font-weight-bold text-center text-secondary">TAK PERLU REPOT CETAK UNDANGAN</h2> <div class="row"> <div class="col"> <p>Sekarang Anda tidak perlu repot-repot lagi untuk mencetak undangannya.</p> <br> <p>Karena Anda hanya tinggal kirim undangan digital ini melalui akun media sosial yang Anda punya atau aplikasi <br> pesan instan seperti : <ol> <li> Whatsapp</li> <li> Instagram</li> <li> Facebook & Messenger </li> <li> Line </li> <li> Telegram, dll.</li> </ol> <p>Sangat cocok untuk Anda yang mau mengundang teman-teman, sahabat, dan keluarga terdekat dengan cara <br> yang unik, kekinian dan berbeda.</p> </p> </div> </div> </div> </div> <!-- end content 4 --> <!-- content 5 --> <div class="content5"> <div class="container"> <h2 class="py-5 font-weight-bold text-center text-secondary"> FUNGSI & MANFAAT E-INVITATION </h2> <div class="row"> <div class="col"> <p> Manfaat undangan digital cukup menarik bagi kami. </p> <br> <p> Berikut daftar manfaat/fungsi undangan digital : </p> <br> <ol class="text-white"> <li> Hemat – Tak perlu biaya cetak.</li> <li> Mudah & Cepat – Hanya tinggal kirim melalui media sosial atau aplikasi perpesanan.</li> <li> Efisien & Efektif – Pasti sampai ke orang yang menerimanya.</li> <li> Memangkas jarak & waktu – Khususnya untuk rekan yang berada diluar kota, pulau, hingga di negara lain.</li> <li> Desain Custom – Desain, ukuran, warna, & font disesuaikan dengan kebutuhan & keinginan Anda.</li> </ol> </div> </div> </div> </div> <!-- end content 5 --> <!-- content 6 --> <div class="content6"> <div class="container"> <h2 class="py-5 font-weight-bold text-center text-secondary"> HIMBAUAN </h2> <div class="row"> <div class="col"> <p> Kami harus adil dan tidak egois hanya demi keuntungan yang kecil. </p> <p> Maka dari itu kami menyarankan untuk menggunakan undangan digital ini kepada orang-orang yang sangat <br> dekat dengan Anda. </p> <p> E-invitation ini tidak kami sarankan untuk dilakukan atau diberikan kepada calon undangan yang sifatnya <br> mature atau dewasa,formal, dan sejenisnya. </p> <p> Jadi desain undangan digital ini bisa dikatakan cocok untuk kesesama teman, sahabat, rekan kerja yang<br> sifatnya sudah akrab. </p> </div> </div> </div> </div> <!-- end content 6 --> <!-- footer --> <div class="card"> <div class="card-header"> <div class="container py-3 footer-bg"> <div class="row"> <div class="col-sm"> <h4 class="ftxt font-weight-bold">Tentang</h4> <p>Miracle Wedding adalah sebuah website layanan jasa desain grafis online pembuatan undangan pernikahan digital.</p> </div> <div class="col-sm"> <h4 class="ftxt text-center font-weight-bold">Dukungan</h4> <a href="" class="text-center"><p>Promo</p></a> <a href="" class="text-center"><p>Kontak</p></a> <a href=""></a> </div> <div class="col-sm"> <h4 class="text-right ftxt font-weight-bold">Hubungi Kami</h4> <p class="text-right">email : <EMAIL></p> <p class="text-right">phone : +62 821 1118 1885</p> </div> </div> </div> </div> <!-- footer --> <div class="card-body footer"> <blockquote class="blockquote mb-0"> <p class = "text-center">Hak Cipta © 2021 Miracle Wedding | Layanan Jasa Desain Grafis</p> </blockquote> </div> </div> <!-- Optional JavaScript; choose one of the two! --> <!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="<KEY>" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script> </body> </html>
b5f3bf3732f8f13e4d2f9c775bcb4e5ffca29ebf
[ "Python", "HTML" ]
6
Python
marqoms17/githhub-remote
9b86f0c336e4b4d61e48fce6cec7d79792fbb147
de05539428b2ab744562b27fb98469de1cf3c2a3
refs/heads/master
<repo_name>Cesar947/EzDeal<file_sep>/AnunciApp/Data/Interfaces/IRepositorioCRUD.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Data.Interfaces { public interface IRepositorioCRUD<T> { bool Insertar(T t); bool Actualizar(T t); bool Eliminar(int id); List<T> Listar(); T ListarPorId(int? id); } } <file_sep>/AnunciApp/Business/Interfaces/IServicioSolicitud.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Business.InterfacesServicio { public interface IServicioSolicitud : IServicioCRUD<Solicitud> { } } <file_sep>/AnunciApp/Data/Interfaces/IRepositorioUsuario.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Data.Interfaces { public interface IRepositorioUsuario : IRepositorioCRUD<Usuario> { List<Usuario> ListarCliente(); List<Usuario> ListarAnunciante(); bool InsertarCliente(Usuario c); bool InsertarAnunciante(Usuario a); //bool EliminarCliente(int id); //bool EliminarAnunciante(int id); bool ActualizarCliente(Usuario c); bool ActualizarAnunciante(Usuario a); } } <file_sep>/AnunciApp/Business/Interfaces/IServicioPublicacion.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Business.InterfacesServicio { public interface IServicioPublicacion : IServicioCRUD<Publicacion> { List<Publicacion> findByServicio(int codigo_servicio); } } <file_sep>/AnunciApp/Business/Interfaces/IServicioServicio.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Business.InterfacesServicio; namespace Business.InterfacesServicio { public interface IServicioServicio : IServicioCRUD<Servicio> { } } <file_sep>/AnunciApp/Business/Implementaciones/ServicioSolicitud.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Data.Interfaces; using Data.Implementacion; using Business.InterfacesServicio; namespace Business.Implementaciones { public class ServicioSolicitud : IServicioSolicitud { private IRepositorioSolicitud repositorioSolicitud = new RepositorioSolicitud(); public bool Insertar(Solicitud t) { return repositorioSolicitud.Insertar(t); } public bool Actualizar(Solicitud t) { return repositorioSolicitud.Actualizar(t); } public bool Eliminar(int id) { return repositorioSolicitud.Eliminar(id); } public List<Solicitud> Listar() { return repositorioSolicitud.Listar(); } public Solicitud ListarPorId(int? id) { return repositorioSolicitud.ListarPorId(id); } } } <file_sep>/AnunciApp/Business/Interfaces/IServicioResena.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Business.InterfacesServicio; namespace Business.InterfacesServicio { public interface IServicioResena : IServicioCRUD <Resena> { //bool InsertarResena(Resena nuevaResena, Usuario clienteRemitente, Publicacion publicacionObjetivo); } } <file_sep>/AnunciApp/Entity/Publicacion.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Entity { public class Publicacion { public int codigoPublicacion { get; set; } public Usuario codigoPublicista { get; set; } [Required(ErrorMessage = "Por favor, ingrese un titulo")] [DisplayName("Titulo")] public string titulo { get; set; } [Required(ErrorMessage = "Por favor, ingrese un descripcion")] [DisplayName("Descripcion")] public string descripcion { get; set; } [Required(ErrorMessage = "Por favor, ingrese un costo estimado")] [DisplayName("Costo")] public int costoServicio { get; set; } [Required(ErrorMessage = "Por favor, seleccione un servicio")] [DisplayName("Servicio")] public Servicio codigoServicio { get; set; } public int estaHabilitado { get; set; } } } <file_sep>/AnunciApp/AnunciApp/Controllers/PublicacionController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Entity; using Business.InterfacesServicio; using Business.Implementaciones; namespace webAppServicios.Controllers { public class PublicacionController : Controller { private IServicioPublicacion servicioPublicacion = new ServicioPublicacion(); private IServicioServicio servicioServicio = new ServicioServicio(); // GET: Publicacion public ActionResult Index() { return View(servicioPublicacion.Listar()); } public ActionResult Edit(int? id) { if (id == null) { return HttpNotFound(); } Publicacion publicacion = servicioPublicacion.ListarPorId(id); return View(publicacion); } public ActionResult FiltradoPorServicio(int codigo_servicio) { return View(servicioPublicacion.findByServicio(codigo_servicio)); } public ActionResult CreatePublicacion() { ViewBag.servicio = servicioServicio.Listar(); return View(); } public ActionResult Solicitar() { return View("~/Views/Solicitud/CreateSolicitud.cshtml"); } public ActionResult EditPublicacion(int id) { //if (!ModelState.IsValid) //{ // return View(); //} //bool rptaEdit = servicioPublicacion.Actualizar(publicacion); //if (rptaEdit) //{ // return RedirectToAction("Index"); //} var publicacion = servicioPublicacion.ListarPorId(id); ViewBag.servicio = servicioServicio.Listar(); return View(publicacion); } [HttpPost] public ActionResult EditPublicacion(Publicacion publicacion) { bool rptaEdit = servicioPublicacion.Actualizar(publicacion); if (rptaEdit) return RedirectToAction("Index"); return View(publicacion); } [HttpPost] public ActionResult CreatePublicacion(Publicacion publicacion) { bool rptaInsert = servicioPublicacion.Insertar(publicacion); if (rptaInsert) { return RedirectToAction("Index"); } return View(); } public ActionResult DeletePublicacion(int id) { servicioPublicacion.Eliminar(id); return RedirectToAction("Index"); } } }<file_sep>/AnunciApp/Business/Interfaces/IServicioUsuario.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Business.InterfacesServicio { public interface IServicioUsuario : IServicioCRUD<Usuario> { List<Usuario> ListarCliente(); List<Usuario> ListarAnunciante(); bool InsertarCliente(Usuario c); bool InsertarAnunciante(Usuario a); bool ActualizarCliente(Usuario c); bool ActualizarAnunciante(Usuario a); } } <file_sep>/AnunciApp/Entity/Solicitud.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Entity { public class Solicitud { public int codigoSolicitud { get; set; } public Publicacion codigoPublicacion { get; set; } public Usuario codigoCliente { get; set; } [Required(ErrorMessage = "Por favor, ingrese el contenido de su solicitud")] [DisplayName("Contenido de la solicitud")] public string mensajeSolicitud { get; set; } } } <file_sep>/AnunciApp/Entity/Distrito.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Entity { public class Distrito { public int codigoDistrito { get; set; } public string nombre { get; set; } } } <file_sep>/AnunciApp/AnunciApp/Controllers/ResenaController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Entity; using Business.Implementaciones; using Business.InterfacesServicio; using System.Dynamic; namespace webAppServicios.Controllers { public class ResenaController : Controller { private IServicioResena servicioResena = new ServicioResena(); private IServicioPublicacion servicioPublicacion = new ServicioPublicacion(); private IServicioUsuario servicioCliente = new ServicioUsuario(); // GET: Resena public ActionResult Index() { return View(servicioResena.Listar()); } public ActionResult CreateResena() { ViewBag.publicacion = servicioPublicacion.Listar(); ViewBag.cliente = servicioCliente.ListarCliente(); return View(); } [HttpPost] public ActionResult CreateResena(Resena resena) { ViewBag.publicacion = servicioPublicacion.Listar(); ViewBag.cliente = servicioCliente.ListarCliente(); bool rptainsert = servicioResena.Insertar(resena); if (rptainsert) { return RedirectToAction("Index"); } return View(); } public ActionResult EditResena(int id) { //ViewBag.resenas = servicioResena.Listar(); var resena = servicioResena.ListarPorId(id); return View(resena); } [HttpPost] public ActionResult EditResena(Resena resena) { //ViewBag.resenas = servicioResena.Listar(); bool rptaEdit = servicioResena.Actualizar(resena); if (rptaEdit) return RedirectToAction("Index"); return View(resena); } public ActionResult DeleteResena(int id) { servicioResena.Eliminar(id); return RedirectToAction("Index"); } } }<file_sep>/AnunciApp/AnunciApp/Controllers/SolicitudController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Entity; using Business.Implementaciones; using Business.InterfacesServicio; namespace webAppServicios.Controllers { public class SolicitudController : Controller { public IServicioSolicitud servicioSolicitud = new ServicioSolicitud(); public IServicioPublicacion servicioPublicacion = new ServicioPublicacion(); // GET: Solicitud public ActionResult IndexSolicitud() { return View(servicioSolicitud.Listar()); } //public ActionResult CreateSolicitud(int id) //{ // var publicacion = servicioPublicacion.Listar(). // Where(p => p.codigoPublicacion == id).FirstOrDefault(); // return View(publicacion); //} //[HttpPost] //public ActionResult CreateSolicitud(Solicitud s, Publicacion pub) //{ // s.codigoPublicacion = pub; // bool rptaInsert = servicioSolicitud.Insertar(s); // if (rptaInsert) // { // return RedirectToAction("IndexSolicitud"); // } // return View(); //} public ActionResult CreateSolicitud() { return View(); } [HttpPost] public ActionResult CreateSolicitud(Solicitud s) { bool rptaInsert = servicioSolicitud.Insertar(s); if (rptaInsert) { return RedirectToAction("IndexSolicitud"); } return View(); } } }<file_sep>/AnunciApp/Data/Interfaces/IRepositorioPublicacion.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Data.Interfaces { public interface IRepositorioPublicacion : IRepositorioCRUD<Publicacion> { List<Publicacion> findByServicio(int codigo_servicio); } } <file_sep>/AnunciApp/Data/Interfaces/IRepositorioSolicitud.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Data.Interfaces { public interface IRepositorioSolicitud : IRepositorioCRUD<Solicitud> { } } <file_sep>/AnunciApp/Data/Implementaciones/RepositorioDistrito.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using Entity; using Data.Interfaces; namespace Data.Implementacion { public class RepositorioDistrito : IRepositorioDistrito { public bool Eliminar(int id) { throw new NotImplementedException(); } public List<Distrito> Listar() { var distritos = new List<Distrito>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("SELECT * FROM Distrito", conexion); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var distrito = new Distrito(); distrito.codigoDistrito = Convert.ToInt32(dr["codigo_distrito"]); distrito.nombre = dr["Nombre"].ToString(); distritos.Add(distrito); } } } } catch (Exception ex) { throw; } return distritos; } public Distrito ListarPorId(int? id) { throw new NotImplementedException(); } public bool Actualizar(Distrito s) { throw new NotImplementedException(); } public bool Insertar(Distrito s) { throw new NotImplementedException(); } } } <file_sep>/AnunciApp/Data/Implementaciones/RepositorioResena.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using Entity; using Data.Interfaces; namespace Data.Implementacion { public class RepositorioResena : IRepositorioResena { public bool Insertar(Resena nuevaResena) { bool respuesta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("INSERT INTO Resena(contenido, valoracion, codigo_publicacion, codigo_cliente) VALUES(@contenido, @calificacion, @codigoPublicacion, @codigoClienteRemitente)", conexion); query.Parameters.AddWithValue("@codigoPublicacion", nuevaResena.codigoPublicacion.codigoPublicacion); query.Parameters.AddWithValue("@codigoClienteRemitente", nuevaResena.codigoCliente.codigoUsuario); query.Parameters.AddWithValue("@contenido", nuevaResena.contenido); query.Parameters.AddWithValue("@calificacion", nuevaResena.valoracion); query.ExecuteNonQuery(); respuesta = true; } } catch (Exception ex) { throw ex; } return respuesta; } /* public bool InsertarResena(Resena nuevaResena, Usuario clienteRemitente, Publicacion publicacionObjetivo) { throw new NotImplementedException(); }*/ public bool Actualizar(Resena resenaSeleccionada) { bool respuesta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("UPDATE Resena SET valoracion = @valoracion, contenido = @contenido where codigo_resena = @codigoResenaSeleccionada", conexion); query.Parameters.AddWithValue("@codigoResenaSeleccionada", resenaSeleccionada.codigoResena); query.Parameters.AddWithValue("@contenido", resenaSeleccionada.contenido); query.Parameters.AddWithValue("@valoracion", resenaSeleccionada.valoracion); query.ExecuteNonQuery(); respuesta = true; } } catch (Exception ex) { throw ex; } return respuesta; } public bool Eliminar(int resenaID) { bool respuesta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("DELETE FROM Resena where codigo_resena = @codigoResenaSeleccionada", conexion); query.Parameters.AddWithValue("@codigoResenaSeleccionada", resenaID); query.ExecuteNonQuery(); respuesta = true; } } catch (Exception ex) { throw ex; } return respuesta; } public List<Resena> Listar() { var resenas = new List<Resena>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("SELECT r.codigo_resena as Codigo, p.titulo, c.nombre as Nombre,"+ " c.apellidos as Apellidos, r.contenido as Contenido, r.valoracion as Valoracion" + " FROM Resena r, Usuario c, Publicacion p where c.codigo_usuario = r.codigo_cliente AND"+ " p.codigo_publicacion = r.codigo_publicacion", conexion); using (var dataReader = query.ExecuteReader()) { while (dataReader.Read()) { var resena = new Resena(); var cliente = new Usuario(); var publicacion = new Publicacion(); resena.codigoResena = Convert.ToInt32(dataReader["Codigo"]); resena.codigoCliente = cliente; resena.codigoCliente.nombre = dataReader["Nombre"].ToString(); resena.codigoCliente.apellidos = dataReader["Apellidos"].ToString(); resena.codigoPublicacion = publicacion; resena.codigoPublicacion.titulo = dataReader["Titulo"].ToString(); resena.contenido = dataReader["Contenido"].ToString(); resena.valoracion = Convert.ToInt32(dataReader["Valoracion"]); resenas.Add(resena); } } } return resenas; } catch (Exception ex) { throw; } } public Resena ListarPorId(int? id) { var resena = new Resena(); var cliente = new Usuario(); var publicacion = new Publicacion(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("SELECT * FROM Resena r where r.codigo_resena = @id", conexion); query.Parameters.AddWithValue("@id", id); using (var dr = query.ExecuteReader()) { while (dr.Read()) { resena.codigoResena = Convert.ToInt32(dr["codigo_resena"]); resena.codigoCliente = cliente; resena.codigoCliente.codigoUsuario = Convert.ToInt32(dr["codigo_cliente"]); resena.codigoPublicacion = publicacion; resena.codigoPublicacion.codigoPublicacion = Convert.ToInt32(dr["codigo_publicacion"]); resena.contenido = dr["contenido"].ToString(); resena.valoracion = Convert.ToInt32(dr["valoracion"]); } } } return resena; } catch(Exception ex) { throw; } } } } <file_sep>/AnunciApp/Business/Implementaciones/ServicioUsuario.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Data.Implementacion; using Data.Interfaces; using Business.InterfacesServicio; namespace Business.Implementaciones { public class ServicioUsuario : IServicioUsuario { IRepositorioUsuario repositorioUsuario = new RepositorioUsuario(); public List<Usuario> ListarCliente() { return repositorioUsuario.ListarCliente(); } public List<Usuario> ListarAnunciante() { return repositorioUsuario.ListarAnunciante(); } public bool InsertarCliente(Usuario c) { return repositorioUsuario.InsertarCliente(c); } public bool InsertarAnunciante(Usuario a) { return repositorioUsuario.InsertarAnunciante(a); } public bool ActualizarCliente(Usuario c) { return repositorioUsuario.ActualizarCliente(c); } public bool ActualizarAnunciante(Usuario a) { return repositorioUsuario.ActualizarAnunciante(a); } public bool Eliminar(int id) { return repositorioUsuario.Eliminar(id); } public bool Insertar(Usuario u) { throw new NotImplementedException(); } public bool Actualizar(Usuario u) { throw new NotImplementedException(); } public List<Usuario> Listar() { return repositorioUsuario.Listar(); } public Usuario ListarPorId(int? id) { return repositorioUsuario.ListarPorId(id); } } } <file_sep>/AnunciApp/Business/Implementaciones/ServicioServicio.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Data.Interfaces; using Data.Implementacion; using Business.InterfacesServicio; namespace Business.Implementaciones { public class ServicioServicio : IServicioServicio { private IRepositorioServicio repositorioServicio = new RepositorioServicio(); public bool Insertar(Servicio t) { return repositorioServicio.Insertar(t); } public bool Actualizar(Servicio t) { return repositorioServicio.Actualizar(t); } public bool Eliminar(int id) { return repositorioServicio.Eliminar(id); } public List<Servicio> Listar() { return repositorioServicio.Listar(); } public Servicio ListarPorId(int? id) { return repositorioServicio.ListarPorId(id); } } } <file_sep>/AnunciApp/Data/Implementaciones/RepositorioSolicitud.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using Entity; using Data.Interfaces; namespace Data.Implementacion { public class RepositorioSolicitud : IRepositorioSolicitud { public bool Insertar(Solicitud s) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Insert into Solicitud values (@codigoPublicacion, @codigoCliente, @mensaje)", conexion); query.Parameters.AddWithValue("@codigoPublicacion", s.codigoPublicacion.codigoPublicacion); query.Parameters.AddWithValue("@codigoCliente", s.codigoCliente.codigoUsuario); query.Parameters.AddWithValue("@mensaje", s.mensajeSolicitud); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool Actualizar(Solicitud s) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("UPDATE Solicitud set codigo_publicacion = @codigoPublicacion, codigo_cliente = @codigoCliente, mensaje_solicitud = @mensaje", conexion); query.Parameters.AddWithValue("@codigoPublicacion", s.codigoPublicacion.codigoPublicacion); query.Parameters.AddWithValue("@codigoCliente", s.codigoCliente.codigoUsuario); query.Parameters.AddWithValue("@mensaje", s.mensajeSolicitud); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool Eliminar(int id) { throw new NotImplementedException(); } public List<Solicitud> Listar() { var solicitudes = new List<Solicitud>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Select s.codigo_solicitud, p.titulo as titulo , u.nombre as nombre_cliente, s.mensaje_solicitud as mensaje " + "FROM Solicitud s join Usuario u on s.codigo_cliente = u.codigo_usuario join Publicacion p on s.codigo_publicacion = p.codigo_publicacion", conexion); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var solicitud = new Solicitud(); var publicacion = new Publicacion(); var usuario = new Usuario(); solicitud.codigoSolicitud = Convert.ToInt32(dr["codigo_solicitud"]); solicitud.codigoCliente = usuario; solicitud.codigoCliente.nombre = dr["nombre_cliente"].ToString(); solicitud.codigoPublicacion = publicacion; solicitud.codigoPublicacion.titulo = dr["titulo"].ToString(); solicitud.mensajeSolicitud = dr["mensaje"].ToString(); solicitudes.Add(solicitud); } } } return solicitudes; } catch(Exception ex) { throw; } } public Solicitud ListarPorId(int? id) { throw new NotImplementedException(); } } } <file_sep>/AnunciApp/Entity/Servicio.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Entity { public class Servicio { public int codigoServicio { get; set; } [Required(ErrorMessage = "Ingrese nombre de servicio")] [DisplayName("Nombre de servicio")] public string nombre { get; set; } [Required(ErrorMessage = "Por favor, ingrese descripcion de servicio")] [DisplayName("Escriba una descripicion...")] public string descripcion { get; set; } } } <file_sep>/AnunciApp/Data/Implementaciones/RepositorioServicio.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using Entity; using Data.Interfaces; namespace Data.Implementacion { public class RepositorioServicio : IRepositorioServicio { public bool Eliminar(int id) { throw new NotImplementedException(); } public List<Servicio> Listar() { var servicios = new List<Servicio>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("SELECT * FROM Servicio", conexion); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var servicio = new Servicio(); servicio.codigoServicio = Convert.ToInt32(dr["codigo_servicio"]); servicio.nombre = dr["Nombre"].ToString(); servicios.Add(servicio); } } } } catch (Exception ex) { throw; } return servicios; } public Servicio ListarPorId(int? id) { throw new NotImplementedException(); } public bool Actualizar(Servicio s) { throw new NotImplementedException(); } public bool Insertar(Servicio s) { throw new NotImplementedException(); } } } <file_sep>/AnunciApp/AnunciApp/Controllers/UsuarioController.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Entity; using Business.Implementaciones; using Business.InterfacesServicio; namespace webAppServicios.Controllers { public class UsuarioController : Controller { public IServicioUsuario servicioUsuario = new ServicioUsuario(); public IServicioDistrito servicioDistrito = new ServicioDistrito(); public ActionResult IndexCliente() { return View(servicioUsuario.ListarCliente()); } public ActionResult IndexAnunciante() { return View(servicioUsuario.ListarAnunciante()); } public ActionResult Publicar() { return View("~/Views/Publicacion/CreatePublicacion.cshtml"); } public ActionResult CreateCliente() { ViewBag.distrito = servicioDistrito.Listar(); return View(); } [HttpPost] public ActionResult CreateCliente(Usuario c) { ViewBag.distrito = servicioDistrito.Listar(); bool rptaInsert = servicioUsuario.InsertarCliente(c); if (rptaInsert) { return RedirectToAction("IndexCliente"); } return View(); } public ActionResult CreateAnunciante() { ViewBag.distrito = servicioDistrito.Listar(); return View(); } [HttpPost] public ActionResult CreateAnunciante(Usuario c) { ViewBag.distrito = servicioDistrito.Listar(); bool rptaInsert = servicioUsuario.InsertarAnunciante(c); if (rptaInsert) { return RedirectToAction("IndexAnunciante"); } return View(); } public ActionResult EditCliente(int id) { //var cliente = servicioUsuario.ListarCliente(). // Where(c => c.codigoUsuario == id).FirstOrDefault(); //return View(cliente); var usuario = servicioUsuario.ListarPorId(id); ViewBag.distrito = servicioDistrito.Listar(); return View(usuario); } [HttpPost] public ActionResult EditCliente(Usuario cliente) { //var c = cliente.codigoUsuario > 0 ? servicioUsuario.ActualizarCliente(cliente) : // servicioUsuario.InsertarCliente(cliente); //if (!c) //{ // ViewBag.Message = "Ocurrio un error inesperado"; // return View("~/Views/Shared/Error.cshtml"); //} //return RedirectToAction("IndexCliente"); bool rptaEdit = servicioUsuario.ActualizarCliente(cliente); if (rptaEdit) return RedirectToAction("IndexCliente"); return View(cliente); } public ActionResult EditAnunciante(int id) { var anunciante = servicioUsuario.ListarAnunciante(). Where(a => a.codigoUsuario == id).FirstOrDefault(); ViewBag.distrito = servicioDistrito.Listar(); return View(anunciante); } [HttpPost] public ActionResult EditAnunciante(Usuario anunciante) { var a = anunciante.codigoUsuario > 0 ? servicioUsuario.ActualizarCliente(anunciante) : servicioUsuario.InsertarCliente(anunciante); if (!a) { ViewBag.Message = "Ocurrio un error inesperado"; return View("~/Views/Shared/Error.cshtml"); } return RedirectToAction("IndexAnunciante"); } public ActionResult DeleteCliente(int id) { bool respuesta = servicioUsuario.Eliminar(id); return RedirectToAction("IndexCliente"); } public ActionResult DeleteAnunciante(int id) { bool respuesta = servicioUsuario.Eliminar(id); return RedirectToAction("IndexAnunciante"); } } }<file_sep>/AnunciApp/Business/Implementaciones/ServicioDistrito.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Data.Interfaces; using Data.Implementacion; using Business.InterfacesServicio; namespace Business.Implementaciones { public class ServicioDistrito : IServicioDistrito { private IRepositorioDistrito repositorioDistrito = new RepositorioDistrito(); public bool Insertar(Distrito t) { return repositorioDistrito.Insertar(t); } public bool Actualizar(Distrito t) { return repositorioDistrito.Actualizar(t); } public bool Eliminar(int id) { return repositorioDistrito.Eliminar(id); } public List<Distrito> Listar() { return repositorioDistrito.Listar(); } public Distrito ListarPorId(int? id) { return repositorioDistrito.ListarPorId(id); } } } <file_sep>/AnunciApp/Entity/Usuario.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Entity { public class Usuario { public int codigoUsuario { get; set; } [Required(ErrorMessage = "Por favor, ingrese correo UPC")] [RegularExpression(@"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", ErrorMessage = "Por favor ingrese un email valido")] public string email { get; set; } [Required(ErrorMessage = "Por favor, ingrese contraseña creativa")] [DisplayName("Contraseña")] public string contrasena { get; set; } [Required(ErrorMessage = "Por favor, ingrese nombre")] [DisplayName("Nombre de publicista")] public string nombre { get; set; } [Required(ErrorMessage = "Por favor, ingrese apellido")] [DisplayName("Apellido de publicista")] public string apellidos { get; set; } [Required(ErrorMessage = "Por favor, ingrese link de contacto(FB, WEB, etc)")] [DisplayName("Link contacto")] public string urlContacto { get; set; } [Required(ErrorMessage = "Por favor, ingrese telefono")] [DisplayName("Telefono")] public string telefono { get; set; } [Required(ErrorMessage = "Por favor, ingrese su distrito")] [DisplayName("Distrito")] public Distrito codigoDistrito { get; set; } public int rol { get; set; } } }<file_sep>/AnunciApp/Data/Interfaces/IRepositorioDistrito.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Data.Interfaces { public interface IRepositorioDistrito : IRepositorioCRUD<Distrito> { } } <file_sep>/AnunciApp/Data/Interfaces/IRepositorioServicio.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Data.Interfaces { public interface IRepositorioServicio : IRepositorioCRUD<Servicio> { } } <file_sep>/AnunciApp/Data/Implementaciones/RepositorioPublicacion.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using Entity; using Data.Interfaces; namespace Data.Implementacion { public class RepositorioPublicacion : IRepositorioPublicacion { public bool Insertar(Publicacion t) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Insert into Publicacion values (@publicista, @titulo, @descripcion, @costo, @servicio, @estaHabilitado)", conexion); query.Parameters.AddWithValue("@publicista", t.codigoPublicista.codigoUsuario); query.Parameters.AddWithValue("@titulo", t.titulo); query.Parameters.AddWithValue("@descripcion", t.descripcion); query.Parameters.AddWithValue("@costo", t.costoServicio); query.Parameters.AddWithValue("@servicio", t.codigoServicio.codigoServicio); query.Parameters.AddWithValue("@estaHabilitado", 1); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool Actualizar(Publicacion t) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); //var publicacionSeleccionada = ListarPorId(id) var query = new SqlCommand("UPDATE Publicacion set titulo = @titulo, descripcion = @descripcion, costo_servicio = @costo, codigo_servicio = @servicio where codigo_publicacion = @publicacionID", conexion); query.Parameters.AddWithValue("@publicacionID", t.codigoPublicacion); query.Parameters.AddWithValue("@titulo", t.titulo); query.Parameters.AddWithValue("@descripcion", t.descripcion); query.Parameters.AddWithValue("@costo", t.costoServicio); query.Parameters.AddWithValue("@servicio", t.codigoServicio.codigoServicio); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool Eliminar(int id) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Delete from Publicacion where codigo_publicacion = @id", conexion); query.Parameters.AddWithValue("@id", id); query.ExecuteNonQuery(); rpta = true; } } catch(Exception ex) { throw; } return rpta; } public List<Publicacion> findByServicio(int codigo_servicio) { var publicaciones = new List<Publicacion>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Select p.codigo_publicacion as Codigo, u.nombre as nombre_publicista, p.codigo_publicista, p.titulo, p.descripcion as descripcion, p.costo_servicio, p.codigo_servicio, s.nombre as servicio" + "FROM Publicacion p join Usuario u on p.codigo_publicista = u.codigo_usuario join Servicio s on s.codigo_servicio = p.codigo_Servicio" + "where s.codigo_servicio = @codigo_servicio", conexion); query.Parameters.AddWithValue("@codigo_servicio", codigo_servicio); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var publicacion = new Publicacion(); var usuario = new Usuario(); var servicio = new Servicio(); publicacion.codigoPublicacion = Convert.ToInt32(dr["codigo_publicacion"]); publicacion.codigoPublicista = usuario; publicacion.codigoPublicista.codigoUsuario = Convert.ToInt32(dr["codigo_publicista"]); publicacion.codigoPublicista.nombre = dr["nombre_publicista"].ToString(); publicacion.titulo = dr["titulo"].ToString(); publicacion.descripcion = dr["descripcion"].ToString(); publicacion.costoServicio = Convert.ToInt32(dr["costo_servicio"]); publicacion.codigoServicio = servicio; publicacion.codigoServicio.codigoServicio = codigo_servicio; publicacion.codigoServicio.nombre = dr["servicio"].ToString(); publicaciones.Add(publicacion); } } } } catch (Exception ex) { throw; } return publicaciones; } public List<Publicacion> Listar() { var anuncios = new List<Publicacion>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Select p.codigo_publicacion, u.nombre as nombre_publicista, p.codigo_publicista, p.titulo, p.descripcion as descripcion, p.costo_servicio, p.codigo_servicio, s.nombre as servicio" + " FROM Publicacion p join Usuario u on p.codigo_publicista = u.codigo_usuario join Servicio s on s.codigo_servicio = p.codigo_Servicio ", conexion); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var publicacion = new Publicacion(); var usuario = new Usuario(); var servicio = new Servicio(); publicacion.codigoPublicacion = Convert.ToInt32(dr["codigo_publicacion"]); publicacion.codigoPublicista = usuario; publicacion.codigoPublicista.codigoUsuario = Convert.ToInt32(dr["codigo_publicista"]); publicacion.codigoPublicista.nombre = dr["nombre_publicista"].ToString(); publicacion.titulo = dr["titulo"].ToString(); publicacion.descripcion = dr["descripcion"].ToString(); publicacion.costoServicio = Convert.ToInt32(dr["costo_servicio"]); publicacion.codigoServicio = servicio; publicacion.codigoServicio.codigoServicio = Convert.ToInt32(dr["codigo_servicio"]); publicacion.codigoServicio.nombre = dr["servicio"].ToString(); anuncios.Add(publicacion); } } } } catch(Exception ex) { throw; } return anuncios; } public Publicacion ListarPorId(int? id) { Publicacion publicacion = new Publicacion(); Usuario usuario = new Usuario(); Servicio servicio = new Servicio(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Select * from Publicacion Where codigo_publicacion = @id", conexion); query.Parameters.AddWithValue("@id", id); using (var dr = query.ExecuteReader()) { while (dr.Read()) { publicacion.codigoPublicacion = Convert.ToInt32(dr["codigo_publicacion"]); publicacion.codigoPublicista = usuario; publicacion.codigoPublicista.codigoUsuario = Convert.ToInt32(dr["codigo_publicista"]); publicacion.titulo = dr["titulo"].ToString(); publicacion.descripcion = dr["descripcion"].ToString(); publicacion.costoServicio = Convert.ToInt32(dr["costo_servicio"]); publicacion.codigoServicio = servicio; publicacion.codigoServicio.codigoServicio = Convert.ToInt32(dr["codigo_servicio"]); } } } } catch (Exception ex) { throw; } return publicacion; } } } <file_sep>/AnunciApp/Data/Interfaces/IRepositorioResena.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; namespace Data.Interfaces { public interface IRepositorioResena : IRepositorioCRUD<Resena> { //bool InsertarResena(Resena nuevaResena, Usuario clienteRemitente, Publicacion publicacionObjetivo); } } <file_sep>/AnunciApp/Data/Implementaciones/RepositorioUsuario.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using Entity; using Data.Interfaces; namespace Data.Implementacion { public class RepositorioUsuario : IRepositorioUsuario { public bool InsertarAnunciante(Usuario nuevoAnunciante) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("INSERT INTO Usuario Values( @contrasena,@email, @nombre, @apellidos," + "@url_contacto, @telefono, @codigoDistrito, @rol)", conexion); query.Parameters.AddWithValue("@email", nuevoAnunciante.email); query.Parameters.AddWithValue("@contrasena", nuevoAnunciante.contrasena); query.Parameters.AddWithValue("@nombre", nuevoAnunciante.nombre); query.Parameters.AddWithValue("@apellidos", nuevoAnunciante.apellidos); query.Parameters.AddWithValue("@telefono", nuevoAnunciante.telefono); query.Parameters.AddWithValue("@url_contacto", nuevoAnunciante.urlContacto); query.Parameters.AddWithValue("@codigoDistrito", nuevoAnunciante.codigoDistrito.codigoDistrito); query.Parameters.AddWithValue("@rol", 1); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool InsertarCliente(Usuario nuevoCliente) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); //Cliente gileeees no se olviden var query = new SqlCommand("INSERT INTO Usuario Values(@contrasena, @email, @nombre, @apellidos, null, null," + " @codigoDistrito, @rol)", conexion); query.Parameters.AddWithValue("@email", nuevoCliente.email); query.Parameters.AddWithValue("@contrasena", nuevoCliente.contrasena); query.Parameters.AddWithValue("@nombre", nuevoCliente.nombre); query.Parameters.AddWithValue("@apellidos", nuevoCliente.apellidos); query.Parameters.AddWithValue("@codigoDistrito", nuevoCliente.codigoDistrito.codigoDistrito); query.Parameters.AddWithValue("@rol", '0'); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool Insertar(Usuario u) { throw new NotImplementedException(); } public bool Actualizar(Usuario u) { throw new NotImplementedException(); } public bool ActualizarAnunciante(Usuario anunciante) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("UPDATE Usuario set email = @Email, contrasena = @Contrasena, " + "nombre = @Nombre, apellidos = @Apellidos, url_contacto = @Contacto, telefono = @Telefono," + " codigo_Distrito = @Distrito where coidgo_usuario = @Id" , conexion); query.Parameters.AddWithValue("@Id", anunciante.codigoUsuario); query.Parameters.AddWithValue("@Email", anunciante.email); query.Parameters.AddWithValue("@Contrasena", anunciante.contrasena); query.Parameters.AddWithValue("@Nombre", anunciante.nombre); query.Parameters.AddWithValue("@Apellidos", anunciante.apellidos); query.Parameters.AddWithValue("@Contacto", anunciante.urlContacto); query.Parameters.AddWithValue("@Telefono", anunciante.telefono); query.Parameters.AddWithValue("@Distrito", anunciante.codigoDistrito); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool ActualizarCliente(Usuario cliente) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("UPDATE Usuario set email = @Email, contrasena = @Contrasena, " + "nombre = @Nombre, apellidos = @Apellidos, codigo_Distrito = @Distrito where codigo_usuario = @Id" , conexion); query.Parameters.AddWithValue("@Id", cliente.codigoUsuario); query.Parameters.AddWithValue("@Email", cliente.email); query.Parameters.AddWithValue("@Contrasena", cliente.contrasena); query.Parameters.AddWithValue("@Nombre", cliente.nombre); query.Parameters.AddWithValue("@Apellidos", cliente.apellidos); query.Parameters.AddWithValue("@Distrito", cliente.codigoDistrito.codigoDistrito); //query.Parameters.AddWithValue("@Rol", cliente.rol); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public bool Eliminar(int id) { bool rpta = false; try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Delete from Usuario where codigo_usuario = @id", conexion); query.Parameters.AddWithValue("@id", id); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw; } return rpta; } public List<Usuario> Listar() { throw new NotImplementedException(); } public Usuario ListarPorId(int? id) { Usuario usuario = new Usuario(); Distrito distrito = new Distrito(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("Select * from Usuario Where codigo_usuario = @id", conexion); query.Parameters.AddWithValue("@id", id); using (var dr = query.ExecuteReader()) { while (dr.Read()) { usuario.codigoUsuario = Convert.ToInt32(dr["codigo_usuario"]); distrito.codigoDistrito = Convert.ToInt32(dr["codigo_distrito"]); usuario.contrasena = Convert.ToString(dr["contrasena"]); usuario.email = Convert.ToString(dr["email"]); usuario.nombre = Convert.ToString(dr["nombre"]); usuario.apellidos = Convert.ToString(dr["apellidos"]); usuario.urlContacto = Convert.ToString(dr["url_contacto"]); usuario.telefono = Convert.ToString(dr["telefono"]); usuario.rol = Convert.ToInt32(dr["rol"]); usuario.codigoDistrito = distrito; } } } } catch (Exception ex) { throw; } return usuario; } public List<Usuario> ListarCliente() { var clientes = new List<Usuario>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("SELECT u.codigo_usuario as Codigo, u.email as Email, u.nombre as Nombre," + " u.apellidos as Apellidos, d.nombre as Distrito" + " FROM Usuario u join Distrito d on d.codigo_distrito = u.codigo_Distrito where u.rol = 0", conexion); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var cliente = new Usuario(); var distrito = new Distrito(); cliente.codigoUsuario = Convert.ToInt32(dr["Codigo"]); cliente.email = dr["Email"].ToString(); cliente.nombre = dr["Nombre"].ToString(); cliente.apellidos = dr["Apellidos"].ToString(); cliente.codigoDistrito = distrito; cliente.codigoDistrito.nombre = dr["Distrito"].ToString(); clientes.Add(cliente); } } } } catch (Exception ex) { throw; } return clientes; } public List<Usuario> ListarAnunciante() { var anunciantes = new List<Usuario>(); try { using (var conexion = new SqlConnection(ConfigurationManager.ConnectionStrings["servicioUPCDB"].ToString())) { conexion.Open(); var query = new SqlCommand("SELECT u.codigo_usuario as Codigo, u.email as Email, u.nombre as Nombre, " + "u.apellidos as Apellidos, u.url_contacto as Contacto, u.telefono as Telefono, d.nombre as Distrito " + "FROM Usuario u, Distrito d where u.rol = 1 and d.codigo_distrito = u.codigo_distrito", conexion); using (var dr = query.ExecuteReader()) { while (dr.Read()) { var anunciante = new Usuario(); var distrito = new Distrito(); anunciante.codigoUsuario = Convert.ToInt32(dr["Codigo"]); anunciante.email = dr["Email"].ToString(); anunciante.nombre = dr["Nombre"].ToString(); anunciante.apellidos = dr["Apellidos"].ToString(); anunciante.urlContacto = dr["Contacto"].ToString(); anunciante.telefono = dr["Telefono"].ToString(); anunciante.codigoDistrito = distrito; anunciante.codigoDistrito.nombre = dr["Distrito"].ToString(); anunciantes.Add(anunciante); } } } } catch (Exception ex) { throw; } return anunciantes; } } } <file_sep>/AnunciApp/Entity/Resena.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Entity { public class Resena { public int codigoResena { get; set; } public Publicacion codigoPublicacion { get; set; } public Usuario codigoCliente { get; set; } [Required(ErrorMessage = "Por favor, ingrese el cuerpo de su resena")] [DisplayName("Contenido de la reseña")] public string contenido { get; set; } public float valoracion { get; set; } } }<file_sep>/AnunciApp/Business/Implementaciones/ServicioPublicacion.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Data.Interfaces; using Data.Implementacion; using Business.InterfacesServicio; namespace Business.Implementaciones { public class ServicioPublicacion : IServicioPublicacion { private IRepositorioPublicacion repositorioPublicacion = new RepositorioPublicacion(); public bool Insertar(Publicacion t) { return repositorioPublicacion.Insertar(t); } public bool Actualizar(Publicacion t) { return repositorioPublicacion.Actualizar(t); } public bool Eliminar(int id) { return repositorioPublicacion.Eliminar(id); } public List<Publicacion> Listar() { return repositorioPublicacion.Listar(); } public Publicacion ListarPorId(int? id) { return repositorioPublicacion.ListarPorId(id); } public List<Publicacion> findByServicio(int codigo_servicio) { return repositorioPublicacion.findByServicio(codigo_servicio); } } } <file_sep>/AnunciApp/Business/Implementaciones/ServicioResena.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Entity; using Business.InterfacesServicio; using Business.Implementaciones; using Data.Implementacion; using Data.Interfaces; namespace Business.Implementaciones { public class ServicioResena : IServicioResena { private IRepositorioResena repositorioResena = new RepositorioResena(); /* public bool InsertarResena(Resena nuevaResena, Usuario clienteRemitente, Publicacion publicacionObjetivo) { throw new NotImplementedException(); }*/ public bool Insertar(Resena nuevaResena) { return repositorioResena.Insertar(nuevaResena); } public bool Actualizar(Resena resenaSeleccionada) { return repositorioResena.Actualizar(resenaSeleccionada); } public bool Eliminar(int resenaID) { return repositorioResena.Eliminar(resenaID); } public List<Resena> Listar() { return repositorioResena.Listar(); } public Resena ListarPorId(int? id) { return repositorioResena.ListarPorId(id); } } }
3627f7b94aad12b5d722f5ed7c6a1e75f3fdbaac
[ "C#" ]
34
C#
Cesar947/EzDeal
ff9f48bd59187a75d4b2afe96910e60dd3969fc7
4a58207c4ea6ec9bc4d21562d96526e03d933207
refs/heads/master
<repo_name>mahmuda9326/Blood-Donate-App<file_sep>/README.md # Blood-Donate-App ANdroid Base App <file_sep>/Search_Doner.java package com.example.mitu.bloodbd; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class Search_Doner extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search__doner); } } <file_sep>/Profile.java package com.example.mitu.bloodbd; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.widget.EditText; public class Profile extends AppCompatActivity { private EditText name,bloodtype,age,weight,phone,email,address,date; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_profile); name = (EditText) findViewById(R.id.pptextId); bloodtype = (EditText) findViewById(R.id.bloodviewId); age = (EditText) findViewById(R.id.ageviewId); weight = (EditText) findViewById(R.id.weightviewId); phone = (EditText) findViewById(R.id.phonenumberviewId); email = (EditText) findViewById(R.id.emailviewId); address = (EditText) findViewById(R.id.addressviewId); date = (EditText) findViewById(R.id.lastdonateviewId); // Bundle bu; // bu = getIntent().getExtras(); // //String str = intent.getStringExtra("name"); // name.setText(bu.getString("name")); // bloodtype.setText(bu.getString("bloodgroup")); // age.setText(bu.getString("age")); // weight.setText(bu.getString("weight")); // phone.setText(bu.getString("phonenumber")); // email.setText(bu.getString("email")); // address.setText(bu.getString("address")); // date.setText(bu.getString("date")); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.profile,menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item){ switch (item.getItemId()){ case R.id.mainId: Intent intent = new Intent(Profile.this,Content_main.class); startActivity(intent); } switch (item.getItemId()){ case R.id.settingId: Intent intent = new Intent(Profile.this,Settings.class); startActivity(intent); } switch (item.getItemId()){ case R.id.aboutId: Intent intent = new Intent(Profile.this,About.class); startActivity(intent); } return super.onOptionsItemSelected(item); } } <file_sep>/SearchResult.java package com.example.mitu.bloodbd; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.widget.EditText; import android.widget.Spinner; public class SearchResult extends AppCompatActivity /*implements AdapterView.OnItemSelectedListener*/{ private EditText displayCity,displayBloodType; private Spinner spinner1,spinner2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search_result); displayCity = (EditText) findViewById(R.id.citynameviewId); displayBloodType = (EditText) findViewById(R.id.bloodtypeviewId); Bundle b; b = getIntent().getExtras(); //cityname = intent.getStringExtra("cityname"); displayCity.setText(b.getString("cityname")); displayBloodType.setText(b.getString("bloodgroup")); //displayTable = String.valueOf(spinner1.getSelectedItem(); /*bloodgroup = intent.getStringExtra("bloodtype"); displayTable = (TextView) findViewById(R.id.resultviewId); displayTable.setText(bloodgroup);*/ } /*@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Spinner spinner1=(Spinner)parent; Spinner spinner2=(Spinner)parent; if (spinner1.getId()==R.id.cityId) { String item = parent.getItemAtPosition(position).toString(); displayTable.setText(item); } if (spinner2.getId()==R.id.bloodGroupId) { String item = parent.getItemAtPosition(position).toString(); displayTable.setText(item); } } public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub }*/ @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.menu_options,menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item){ switch (item.getItemId()){ case R.id.profileId: Intent intent = new Intent(SearchResult.this,Profile.class); startActivity(intent); } switch (item.getItemId()){ case R.id.settingId: Intent intent = new Intent(SearchResult.this,Settings.class); startActivity(intent); } switch (item.getItemId()){ case R.id.aboutId: Intent intent = new Intent(SearchResult.this,Settings.class); startActivity(intent); } return super.onOptionsItemSelected(item); } }
afe9ee28c81b44995f0a97afefae159d4331c2a4
[ "Markdown", "Java" ]
4
Markdown
mahmuda9326/Blood-Donate-App
8200b87c9417b68f2c969d18c3d97188d98de418
2fbe930a63d66b2c1c3488a18aee166d679533cf
refs/heads/main
<repo_name>Twanet/CourseraIBM<file_sep>/testchild.py ### Add file to child branch print("I am inside the child branch") <file_sep>/README.md # CourseraIBM Just for the related MOOC This is a test, I am new to programming!
e04b218e991882fecbf3996f6cb61ceacf8e5043
[ "Markdown", "Python" ]
2
Python
Twanet/CourseraIBM
4a18d275b93e1c908f703bfa4727b599c102fc80
fa39de03706684a3b14dd6c3e6f6cca45cf8a526
refs/heads/master
<file_sep># -*- coding: utf-8 -*- class ApplicationController < ActionController::Base before_filter :authenticate_user! protect_from_forgery helper_method :all_schools, :all_categories private def check_profile if user_signed_in? redirect_to :new_profile if !current_user.profile if current_user.profile redirect_to edit_profile_path(current_user.profile) if !current_user.profile.mail or !current_user.school end end end def all_categories categories = Category.all end def all_schools schools = School.all new_school = School.new(:id => 0, :name => "全ての学校") new_school.id = 0 schools << new_school end end <file_sep>class Alert < ActiveRecord::Base belongs_to :commodity belongs_to :user end <file_sep>FactoryGirl.define do factory :school, aliases: [:homeschool] do name "tsukuba" city "tsukuba" region "ibaraki" end factory :user do sequence :email do |n| "<EMAIL>" end password "<PASSWORD>" token "<PASSWORD>" provider "facebook" havemessage false school end factory :category do name "book" end factory :commodity do name "book" num 5 desc "my book!!" price 123 photo "/a.png" place "school" user end factory :commoditycate, :class => CommodityCate do commodity category end factory :popular do commodity end end <file_sep># -*- coding: utf-8 -*- require 'spec_helper' describe HomeController do describe "GET index" do it "has no null instance" do get :index expect(assigns(:populars)).to_not eq(nil) expect(assigns(:categories)).to_not eq(nil) expect(assigns(:schools)).to_not eq(nil) end it "assigns all populars to @populars" do popular = FactoryGirl.create(:popular) get :index expect(assigns(:populars)).to eq([popular]) end it "assigns all categories to @categories" do category = FactoryGirl.create(:category) get :index expect(assigns(:categories)).to eq([category]) end it "assigns all shools to @schools" do school = FactoryGirl.create(:school) get :index expect(assigns(:schools)).to eq([school]) end it "get new commodities" do commodities = FactoryGirl.create_list(:commodity, 20) get :index expect(assigns(:new).length).to be < 20 end end describe "GET search" do it "can search iterm" do pending("search") end end end <file_sep># coding: utf-8 class User module OmniauthCallbacks ["facebook","google","twitter"].each do |provider| define_method "find_or_create_for_#{provider}" do |response| token = nil if provider == "facebook" token = response[:credentials][:token] end uid = response["uid"] data = response["info"] if user = User.includes(:authorizations).where("authorizations.provider" => provider , "authorizations.uid" => uid).first if token != nil and token != user.token user.token = token user.save end user elsif user = User.find_by_email(data["email"]) user.bind_service(response) if token != nil and token != user.token user.token = token user.save end user else user = User.new_from_provider_data(provider,uid,data,token) if user.save(:validate => false) user.authorizations << Authorization.new(:provider => provider, :uid => uid ) return user else Rails.logger.warn("User.create_from_hash 失败,#{user.errors.inspect}") return nil end end end end def new_from_provider_data(provider, uid, data, token) user = User.new user.provider = provider user.token = token user.email = data["email"] user.profile = Profile.new user.profile.name = data["name"] user.profile.nickname = data["nickname"] if provider == "twitter" user.email = "<EMAIL>+#{<EMAIL>" elsif provider == "facebook" user.profile.mail = data["email"] end user.password = Devise.friendly_token[0,20] return user end end end <file_sep>class School < ActiveRecord::Base has_many :users def commodities c = users.inject([]) do |commodities, user| commodities + user.commodities end c.sort do |a, b| b.created_at <=> a.created_at end end def self.regions self.select(:region).uniq.map{|i| i.region} end def self.region(region) self.where(region: region) end end <file_sep># -*- coding: utf-8 -*- class Profile < ActiveRecord::Base validates_presence_of :user_id validates_length_of :name, :in => (2..20) validates_each :mail, :allow_nil => false do |record, attr, value| if !(value =~ /^.+@.+$/) record.errors.add attr, ":正しいメールアドレスを入力してください" end end belongs_to :user end <file_sep>class CreatePopulars < ActiveRecord::Migration def change create_table :populars do |t| t.references :commodity t.timestamps end add_index :populars, :commodity_id end end <file_sep>class CommoditiesController < ApplicationController before_filter :check_profile skip_before_filter :authenticate_user!, :only => ['show'] # GET /commodities # GET /commodities.json def index @categories = Category.all @commodities = current_user.commodities.order("created_at desc") @selled = @commodities.where(:num => 0).page(params[:page]).per(15) @selling = @commodities.where("num > ?", 0).page(params[:page]).per(15) respond_to do |format| format.html # index.html.erb format.json { render json: @commodities } end end # GET /commodities/1 # GET /commodities/1.json def show @categories = Category.all @commodity = Commodity.find(params[:id]) @comment = Comment.new @comment.commodity = @commodity @order = Order.new respond_to do |format| format.html # show.html.erb format.json { render json: @commodity } end end # GET /commodities/new # GET /commodities/new.json def new @commodity = Commodity.new old_commodity = Commodity.find(params[:id]) if params[:id] if old_commodity @commodity.name = old_commodity.name @commodity.desc = old_commodity.desc @commodity.price = old_commodity.price @category = old_commodity.categories.first end @category = Category.first if @category == nil redirect_to commodities_path else respond_to do |format| format.html # new.html.erb format.json { render json: @commodity } end end end # GET /commodities/1/edit def edit @commodity = Commodity.find(params[:id]) @category = Category.first end # POST /commodities # POST /commodities.json def create @category = Category.first @commodity = Commodity.new(params[:commodity]) @commodity.user = current_user category = Category.find(params[:category]) size = 0 size = params[:commodity][:photo].size if params[:commodity][:photo] respond_to do |format| if size > 2000000 @commodity.errors[:base] << "Photo size should < 2MB" format.html { render action: "new" } format.json { render json: @commodity.errors, status: :unprocessable_entity } else if @commodity.save if category @commodity.commodity_cates.create(:category => category) end format.html { redirect_to @commodity, notice: 'Commodity was successfully created.' } format.json { render json: @commodity, status: :created, location: @commodity } else format.html { render action: "new" } format.json { render json: @commodity.errors, status: :unprocessable_entity } end end end end # PUT /commodities/1 # PUT /commodities/1.json def update @category = Category.first @commodity = Commodity.find(params[:id]) size = 0 size = params[:commodity][:photo].size if params[:commodity][:photo] respond_to do |format| if size > 2000000 @commodity.errors[:base] << "Photo size should < 2MB" format.html { render action: "new" } format.json { render json: @commodity.errors, status: :unprocessable_entity } else if @commodity.update_attributes(params[:commodity]) format.html { redirect_to @commodity, notice: 'Commodity was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @commodity.errors, status: :unprocessable_entity } end end end end # DELETE /commodities/1 # DELETE /commodities/1.json def destroy @commodity = Commodity.find(params[:id]) @commodity.num = 0 respond_to do |format| if @commodity.save format.html { redirect_to commodities_url, notice: 'Commodity was successfully canceled.' } format.json { render json: @commodity, status: :created, location: @commodity } end end end end <file_sep>class Popular < ActiveRecord::Base belongs_to :commodity end <file_sep>class AddPlaceToCommodity < ActiveRecord::Migration def change add_column :commodities, :place, :string end end <file_sep>#! ruby -Ku # -*- coding: utf-8 -*- class HomeController < ApplicationController before_filter :check_profile skip_before_filter :authenticate_user! def index @populars = Popular.joins(:commodity).where("commodities.num > ?", 0).order("created_at desc").limit(5) @categories = Category.all @schools = School.all @new = Commodity.order("created_at desc").limit(10) respond_to do |format| format.html # index.html.erb format.json { render json: @commodities } end end def search keyword = params[:keyword] if keyword == '' or keyword == nil return @result end keywords = keyword.gsub(/ /," ").gsub(/,/," ").gsub(/\v/," ").split(nil) if params[:school] != '0' school = School.find(params[:school]) user_ids = school.users.map!{|i| i.id} @result = Commodity.search(keywords).where(:user_id => user_ids).order("created_at desc").page(params[:page]).per(15) else @result = Commodity.search(keywords).order("created_at desc").page(params[:page]).per(15) end end end <file_sep>ActiveAdmin.register Commodity do end <file_sep>require 'spec_helper' describe Commodity do it "search title by keywords" do book1 = Commodity.create!(:name => "book1", :num => 10, :desc => "rails book", :price => 100, :user_id => 1) book2 = Commodity.create!(:name => "book2", :num => 10, :desc => "rails book", :price => 100, :user_id => 1) expect(Commodity.search(["book1", "book2"])).to eq([book1, book2]) expect(Commodity.search("book2")).to eq([book2]) expect(Commodity.search(["nokeyword"])).to be_empty end end <file_sep>require 'test_helper' class PopularsHelperTest < ActionView::TestCase end <file_sep>require 'test_helper' class PopularsControllerTest < ActionController::TestCase setup do @popular = populars(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:populars) end test "should get new" do get :new assert_response :success end test "should create popular" do assert_difference('Popular.count') do post :create, popular: @popular.attributes end assert_redirected_to popular_path(assigns(:popular)) end test "should show popular" do get :show, id: @popular assert_response :success end test "should get edit" do get :edit, id: @popular assert_response :success end test "should update popular" do put :update, id: @popular, popular: @popular.attributes assert_redirected_to popular_path(assigns(:popular)) end test "should destroy popular" do assert_difference('Popular.count', -1) do delete :destroy, id: @popular end assert_redirected_to populars_path end end <file_sep>ActiveAdmin.register Comment, :as => "PostComment" do end <file_sep>class Category < ActiveRecord::Base has_many :commodity_cates has_many :commodities, :through => :commodity_cates end <file_sep># -*- coding: utf-8 -*- require 'spec_helper' describe School do before :each do @s1 = School.create!(name: 'tsukuba u', city: 'tsuskuba', region: '関東') @s2 = School.create!(name: 'tokyo u', city: 'tokyo', region: '関東') @s3 = School.create!(name: 'kyoto u', city: 'kyoto', region: '関西') end it 'get all commodities' do user1 = User.create!(email: '<EMAIL>', password: '<PASSWORD>') user1.school = @s1 user1.save user2 = User.create!(email: '<EMAIL>', password: '<PASSWORD>') user2.school = @s1 user2.save c1 = Commodity.create!(name: 'aaa', num: 2, desc: 'aaa', price: 100, user: user1, place: 'school') c2 = Commodity.create!(name: 'bbb', num: 2, desc: 'bbb', price: 100, user: user2, place: 'school') c3 = Commodity.create!(name: 'ccc', num: 2, desc: 'ccc', price: 100, user: user1, place: 'school') c4 = Commodity.create!(name: 'ddd', num: 2, desc: 'ddd', price: 100, user: user1, place: 'school') expect(@s1.commodities).to eq([c4, c3, c2, c1]) end it 'can get all regions' do expect(School.regions).to eq([@s1.region, @s3.region]) end it "can get region's school" do expect(School.region('関東')).to eq([@s1, @s2]) end end <file_sep>class Commodity < ActiveRecord::Base mount_uploader :photo, PhotoUploader validates :photo, :file_size => { :maximum => 0.5.megabytes.to_i } validates_length_of :name, :in => (2..40) validates :num, :price, :numericality => { :greater_than_or_equal_to => 0 } validates_numericality_of :num, :user_id, :only_integer => true validates_numericality_of :price has_many :commodity_cates has_many :categories, :through => :commodity_cates has_many :alerts has_many :orders has_many :comments belongs_to :user def self.search(keywords) @keywords = keywords.class == String ? [keywords] : keywords sql = @keywords.inject("") do |sql, keyword| sql = sql == "" ? sql + "name like '%#{keyword}%' " : sql + "or name like '%#{keyword}%' " end sql += "AND num > 0" where(sql) end end <file_sep>module ApplicationHelper def whoami?(user, commodity) whoami = 'guest' if user_signed_in? if commodity.user == user whoami = "seller" else user.orders.each{ |order| return 'buyer' if commodity.orders.include?(order) } end end return whoami end def title(page_title, options={}) content_for(:title, page_title.to_s) return content_tag(:h1, page_title, options) end end <file_sep>class CommodityCate < ActiveRecord::Base belongs_to :commodity belongs_to :category end <file_sep>class AddStateToAlert < ActiveRecord::Migration def change add_column :alerts, :state, :boolean end end <file_sep>class AlertsController < ApplicationController before_filter :check_profile # GET /alerts # GET /alerts.json def index current_user.havemessage = 0 current_user.save @alerts = current_user.alerts.order("created_at DESC").page(params[:page]).per(15) respond_to do |format| format.html # index.html.erb format.json { render json: @alerts } end end def destroy @alert = Alert.find(params[:id]) @alert.destroy respond_to do |format| format.html { redirect_to alerts_url } format.json { head :no_content } end end end <file_sep>require 'spec_helper' describe "/home/search" do before(:each) do assign(:result, Kaminari.paginate_array(FactoryGirl.create_list(:commodity, 5, :name => "text book")).page(1)) end it "renders attributes in <p>" do render expect(rendered).to include("text book") # Run the generator again with the --webrat flag if you want to use webrat matchers end end <file_sep># -*- coding: utf-8 -*- class OrdersController < ApplicationController before_filter :check_profile # GET /orders # GET /orders.json def index if params[:mode] == "new" @orders = current_user.orders.where("state is NULL or state = 'false'").order("created_at DESC").page(params[:page]).per(15) elsif params[:mode] == "old" @orders = current_user.orders.where(:state => true).order("created_at DESC").page(params[:page]).per(15) else @orders = current_user.orders.order("created_at DESC").page(params[:page]).per(15) end respond_to do |format| format.html # index.html.erb format.json { render json: @orders } end end # GET /orders/1 # GET /orders/1.json def show @order = Order.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @order } end end # GET /orders/new # GET /orders/new.json def new @order = Order.new respond_to do |format| format.html # new.html.erb format.json { render json: @order } end end # GET /orders/1/edit def edit @order = Order.find(params[:id]) end # POST /orders # POST /orders.json def create @commodity = Commodity.find(params[:commodity_id]) @order = Order.new(params["order"["price"]]) @order.user = current_user @order.name = Time.now.to_i @order.price = @commodity.price @order.state = 0 respond_to do |format| if @order.save alert = Alert.new alert.commodity = @commodity alert.user = @commodity.user alert.info = "#{current_user.profile.name}が商品を買いたいです" alert.user.havemessage = 1 alert.user.save alert.save @commodity.orders << @order @commodity.save format.html { redirect_to @order, notice: 'Order was successfully created.' } format.json { render json: @order, status: :created, location: @order } format.js else format.html { render action: "new" } format.json { render json: @order.errors, status: :unprocessable_entity } end end end def deal @order = Order.find(params[:id]) if @order.commodity.num > 0 @order.commodity.num -=1 return nil if !@order.commodity.save if @order.update_attributes(params[:order]) alert = Alert.new alert.commodity = @order.commodity alert.user = @order.user alert.info = "購入成功" alert.user.havemessage = 1 alert.user.save alert.save respond_to do |format| format.js end end end end # PUT /orders/1 # PUT /orders/1.json def update @order = Order.find(params[:id]) respond_to do |format| #Fix Me:must be changed at same time if @order.update_attributes(params[:order]) @order.commodities.each { |commodity| commodity.num -= 1 commodity.save } # format.html { redirect_to @order, notice: 'Order was successfully updated.' } # format.json { head :no_content } # else # format.html { render action: "edit" } # format.json { render json: @order.errors, status: :unprocessable_entity } end end end # DELETE /orders/1 # DELETE /orders/1.json def destroy @order = Order.find(params[:id]) @order.destroy respond_to do |format| format.html { redirect_to orders_url } format.json { head :no_content } end end end
c0f128fc238607d3585c29e18b24ecc49f82c670
[ "Ruby" ]
26
Ruby
guofei/cb
f014c7d905e1aac8f5cb43a2538b8e91bfda0a37
5f3e2f4c1fd7e29bfa9f47fce7790185d6fa79cd
refs/heads/main
<repo_name>OConnellErin/CS261_Stacks<file_sep>/stack.py # Stack: A stack. # Your implementation should pass the tests in stack.py. # <NAME> class Stack: def __init__(self): self.next_index = 0 self.data = [] pass def is_empty(self): if self.next_index == 0: return True else: return False def pop(self): self.next_index -= 1 if self.next_index < 0: raise IndexError return self.data[self.next_index] def peek(self): if self.next_index == 0: raise IndexError return self.data[self.next_index-1] def push(self,value): # if number > self.next_index or number < 0: # raise IndexError self.data.append(value) self.next_index += 1 <file_sep>/test_stack.py # DO NOT MODIFY THIS FILE # Run me via: python3 -m unittest test_stack import unittest import time from stack import Stack class TestStack(unittest.TestCase): def test_instantiation(self): """ A Stack exists. """ try: Stack() except NameError: self.fail("Could not instantiate Stack.") def test_initially_empty(self): """ A stack is initially empty. """ s = Stack() self.assertTrue(s.is_empty()) def test_initial_pop(self): """ Popping from an empty stack raises IndexError. """ s = Stack() self.assertRaises(IndexError, s.pop) def test_initial_peek(self): """ Peeking at an empty stack raises IndexError. """ s = Stack() self.assertRaises(IndexError, s.peek) def test_initial_push(self): """ Pushing a value onto the stack means the stack is no longer empty. """ s = Stack() s.push('fee') self.assertFalse(s.is_empty()) def test_peek_one(self): """ A value pushed onto the stack can be peeked at. """ s = Stack() s.push('fee') self.assertEqual('fee', s.peek()) def test_pop_one(self): """ A value pushed onto the stack can be popped. """ s = Stack() s.push('fee') self.assertEqual('fee', s.pop()) def test_peek_two(self): """ Peeking at a stack with two values returns the last pushed value. """ s = Stack() s.push('fee') s.push('fi') self.assertEqual('fi', s.peek()) def test_peek_state(self): """ Peeking doesn't mutate the stack. """ s = Stack() s.push('fee') s.push('fi') self.assertEqual('fi', s.peek()) self.assertEqual('fi', s.peek()) def test_pop_two(self): """ Popping from a stack with two values returns the last pushed value. """ s = Stack() first_value = fake_value() second_value = fake_value() s.push(first_value) s.push(second_value) self.assertEqual(second_value, s.pop()) def test_pop_state(self): """ Popping removes the last pushed value from the stack. """ s = Stack() first_value = fake_value() second_value = fake_value() s.push(first_value) s.push(second_value) self.assertEqual(second_value, s.pop()) self.assertEqual(first_value, s.pop()) self.assertTrue(s.is_empty()) def fake_value(): return f"FAKE {time.time()}" if __name__ == '__main__': unittest.main()
4bd73328c5fece02c645765a7d4e883dabc1e2d1
[ "Python" ]
2
Python
OConnellErin/CS261_Stacks
d1ad48c0b48e5b4d759c9e53b189f893e84c70a9
0b555967cdef37ff893d7b1c82f4e22730bc88f5
refs/heads/master
<repo_name>sodastereo87/TriviaGame<file_sep>/assets/javascript/app.js // javascript var panel = $('#quiz-area'); var countStartNumber = 30; // on-click functions for the buttons, to start the game, // answer questions and to play again when game is over $(document).on('click', '#start-over', function (e) { game.reset(); }); $(document).on('click', '.answer-button', function (e) { game.clicked(e); }); $(document).on('click', '#start', function (e) { $('#submain').prepend('<h2>Time Remaining: <span id="counter-number">30</span> Seconds</h2>'); game.loadQuestion(); }); // questions, answers and images function var questions = [{ question: "What is the duration of the movie?", answers: ["3 hours", "1 hour", "2 hours", "15 mins"], correctAnswer: "3 hours", image: "assets/images/question_1.gif" }, { question: "What is the real name of the main actor?", answers: ["<NAME>", "<NAME>", "<NAME>", "Selena"], correctAnswer: "Leonardo DiCaprio", image: "assets/images/question_2.gif" }, { question: "What is the name of the main character of the story?", answers: ["Goku", "<NAME>", "<NAME>", "<NAME>"], correctAnswer: "<NAME>", image: "assets/images/question_3.gif" }, { question: "What was the budget for the movie ?", answers: ["100 millions", "2 millions", "1 million", "50 millions"], correctAnswer: "100 millions", image: "assets/images/question_4.gif" }, { question: "How much money did <NAME> get pay for this movie?", answers: ["25 millions", "1 million", "10 millions", "10 dollars"], correctAnswer: "25 millions", image: "assets/images/question_6.gif" }, { question: "How many Oscars nominations did the movie have?", answers: ["1", "2", "5", "10"], correctAnswer: 5, image: "assets/images/question_5.gif" }, { question: "How old was <NAME> when he began to work in Wall Street?", answers: ["31 years old", "50 years old", " 18 years old", "22 years old"], correctAnswer: "22 years old", image: "assets/images/question_7.gif" }, { question: "What is the name of the second wife in the movie?", answers: ["<NAME>", "<NAME>", "<NAME>", "<NAME>"], correctAnswer: "Na<NAME>lia", image: "assets/images/question_8.gif" }]; var game = { questions: questions, currentQuestion: 0, counter: countStartNumber, correct: 0, incorrect: 0, // targets the counter and when time gets to 0 seconds, //logs time up to the console countdown: function () { game.counter--; $('#counter-number').html(game.counter); if (game.counter === 0) { console.log('TIME UP'); game.timeUp(); } }, loadQuestion: function () { timer = setInterval(game.countdown, 1000); panel.html('<h2>' + questions[this.currentQuestion].question + '</h2>'); for (var i = 0; i < questions[this.currentQuestion].answers.length; i++) { panel.append('<button class="answer-button" id="button"' + 'data-name="' + questions[this.currentQuestion].answers[i] + '">' + questions[this.currentQuestion].answers[i] + '</button>'); } }, nextQuestion: function () { game.counter = countStartNumber; $('#counter-number').html(game.counter); game.currentQuestion++; game.loadQuestion(); }, // sets the function when the timer is over, shows message "You are out of time!", shows the right answer and image, // then goes to the next question timeUp: function () { clearInterval(timer); $('#counter-number').html(game.counter); panel.html('<h2>You are out of time!</h2>'); panel.append('<h3>The Correct Answer was: ' + questions[this.currentQuestion].correctAnswer); panel.append('<img src="' + questions[this.currentQuestion].image + '" />'); if (game.currentQuestion === questions.length - 1) { setTimeout(game.results, 3 * 1000); } else { setTimeout(game.nextQuestion, 3 * 1000); } }, // function targeting the results and the counter, // shows game reuslts results: function () { clearInterval(timer); panel.html('<h2>All done, here is how you did!</h2>'); $('#counter-number').html(game.counter); panel.append('<h3>Correct Answers: ' + game.correct + '</h3>'); panel.append('<h3>Incorrect Answers: ' + game.incorrect + '</h3>'); panel.append('<h3>Unanswered: ' + (questions.length - (game.incorrect + game.correct)) + '</h3>'); panel.append('<br><button id="start-over">Start Over?</button>'); }, clicked: function (e) { clearInterval(timer); if ($(e.target).data("name") === questions[this.currentQuestion].correctAnswer) { this.answeredCorrectly(); } else { this.answeredIncorrectly(); } }, // activates message "Wrong!" if answer is incorrect // shows right answer and sets timer for next question answeredIncorrectly: function () { game.incorrect++; clearInterval(timer); panel.html('<h2>Wrong!</h2>'); panel.append('<h3>The Correct Answer was: ' + questions[game.currentQuestion].correctAnswer + '</h3>'); panel.append('<img src="' + questions[game.currentQuestion].image + '" />'); if (game.currentQuestion === questions.length - 1) { setTimeout(game.results, 3 * 1000); } else { setTimeout(game.nextQuestion, 3 * 1000); } }, // activates message "correct!" if answer is correct // showa image and sets timer for next question answeredCorrectly: function () { clearInterval(timer); game.correct++; panel.html('<h2>Correct!</h2>'); panel.append('<img src="' + questions[game.currentQuestion].image + '" />'); if (game.currentQuestion === questions.length - 1) { setTimeout(game.results, 3 * 1000); } else { setTimeout(game.nextQuestion, 3 * 1000); } }, reset: function () { this.currentQuestion = 0; this.counter = countStartNumber; this.correct = 0; this.incorrect = 0; this.loadQuestion(); } };
f2b03e16ccecaaa5873140616a5ce6c24ac64bee
[ "JavaScript" ]
1
JavaScript
sodastereo87/TriviaGame
bf59df19a4e525c3667569789ef9ec50ef66fef8
faa8357290f5327d4b6715b78c6e329a775239fd
refs/heads/master
<file_sep># JavaScript weather app. Hi, I present a simple weather app that I made just for training. It provides weather info based on the user's location or specified city name using OpenWeatherMap API. ![demo](http://i.imgur.com/DI2baIE.gif) <file_sep>document.addEventListener('DOMContentLoaded', function () { var name = document.getElementById('cityName'); var t = document.getElementById('temperature'); var icon = document.getElementById('icon'); var weather = document.getElementById('weather'); var btnGeoloc = document.getElementById('btn-geoloc'); var btnCity = document.getElementById('btn-city'); var inputBox = document.getElementById('citySearch'); var apiKey = '<KEY>'; var form = document.getElementById('form1'); //loading screen function loading() { name.innerHTML = '<i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>'; t.innerHTML = ''; icon.innerHTML = ''; weather.innerHTML = ''; inputBox.value = ''; }; //displaying results from openweatherapi function view(results) { name.innerHTML = results.name; var temp = results.main.temp.toFixed(0); t.innerHTML = temp + '&deg;C'; icon.innerHTML = '<img src="http://openweathermap.org/img/w/' + results.weather[0].icon + '.png" width = "90px">' weather.innerHTML = results.weather[0].main; }; //getting data using geolocalisation function getByGeoloc() { loading(); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { name.innerHTML = 'your browser doesn\'t support geolocation'; } function showPosition(position) { fetch('http://api.openweathermap.org/data/2.5/weather?lat=' + position.coords.latitude + '&lon=' + position.coords.longitude + '&units=metric&appid=' + apiKey).then(function(response) { if (response.status !== 200) { console.log('problem: ' + response.status); } response.json().then(function(data) { view(data); }); }).catch(function(err) { console.log('fetch error: ', err); }); } }; //getting data using city name from input box function getByCityName() { var search = inputBox.value; loading(); fetch('http://api.openweathermap.org/data/2.5/weather?q=' + search + '&units=metric&appid=' + apiKey).then(function(response) { if (response.status !== 200) { console.log('problem: ' + response.status); console.log('try again.'); t.innerHTML = '<p>Wrong city name.</p>'; } response.json().then(function(data) { view(data); }); }).catch(function(err) { console.log('fetch error: ', err); }); }; //actions performed when button is clicked or enter pressed btnGeoloc.addEventListener('click', getByGeoloc, false); btnCity.addEventListener('click', getByCityName, false); form.addEventListener('keypress', function(event) { if (event.keyCode == 13) { getByCityName(); } }); }, false);
c8824657a740d031b35f9caa1f152e3f8e49b91b
[ "Markdown", "JavaScript" ]
2
Markdown
bartlwojcik/weatherapp
2ee71edd29c0c11d6f05f14f1ac00ec3357cb066
05ac9cb0f81dc2362ebc19c1ba280ab8e760366a
refs/heads/main
<repo_name>lapis42/boj<file_sep>/boj11505_segment_tree.py import sys import math input = sys.stdin.readline r = 1000000007 def build(idx, i, j): if i == j: st[idx] = arr[i] else: mid = i + (j - i) // 2 st[idx] = (build(2 * idx + 1, i, mid) *\ build(2 * idx + 2, mid + 1, j)) % r return st[idx] def query(qi, qj, idx, i, j): if qi <= i and qj >= j: return st[idx] if j < qi or i > qj: return 1 mid = i + (j - i) // 2 return query(qi, qj, 2 * idx + 1, i, mid) *\ query(qi, qj, 2 * idx + 2, mid + 1, j) % r def update(pos, val, idx, i, j): if pos < i or pos > j: return if i == j: st[idx] = val return mid = i + (j - i) // 2 update(pos, val, 2 * idx + 1, i, mid) update(pos, val, 2 * idx + 2, mid + 1, j) st[idx] = st[2 * idx + 1] * st[2 * idx + 2] % r n, m, k = map(int, input().split()) arr = [int(input()) for _ in range(n)] n_st = int(2**(math.ceil(math.log2(n)) + 1)) - 1 st = [1] * n_st build(0, 0, n - 1) for _ in range(m + k): a, b, c = map(int, input().split()) if a == 1: update(b - 1, c, 0, 0, n - 1) else: print(query(b - 1, c - 1, 0, 0, n - 1)) <file_sep>/boj1753_dijkstra.py import sys, heapq input = sys.stdin.readline max_dist = 200000 def dijkstra(edges, start): n_node = len(edges) dist = [max_dist] * n_node dist[start] = 0 queue = [] heapq.heappush(queue, (dist[start], start)) while queue: dist_now, node_now = heapq.heappop(queue) if dist[node_now] < dist_now: continue for node_next, dist_edge in edges[node_now]: dist_next = dist_now + dist_edge if dist_next < dist[node_next]: dist[node_next] = dist_next heapq.heappush(queue, (dist_next, node_next)) return dist def main(): n_node, n_edge = map(int, input().split()) start = int(input()) - 1 edges = [[] for _ in range(n_node)] for _ in range(n_edge): u, v, w = map(int, input().split()) edges[u - 1].append((v-1, w)) distance = dijkstra(edges, start) for d in distance: if d == max_dist: print("INF") else: print(d) if __name__ == "__main__": main() <file_sep>/boj1450_knapsack_meet_in_the_middle.py """BOJ145 O(n * 2**(n/2)) """ from bisect import bisect def calc_combination(x): n = len(x) arr = [0] * (2**n) for i in range(1, 2**n): for j in range(n): if i >> j & 1: arr[i] += x[j] return arr def main(): n, c = map(int, input().split()) x = list(map(int, input().split())) # 2 * 2**(n/2) * (n/2) = n * 2**(n/2) arr_left = calc_combination(x[:n // 2]) arr_right = calc_combination(x[n // 2:]) arr_right.sort() # 2**(n/2) * log2(2**(n/2)) = n/2 * 2**(n/2) cnt = 0 for i in arr_left: if c - i >= 0: cnt += bisect(arr_right, c - i) print(cnt) if __name__ == "__main__": main() <file_sep>/boj11659_cumsum.py import sys input = sys.stdin.readline n, m = map(int, input().split()) x = list(map(int, input().split())) cumsum = [0] * (n + 1) for i in range(n): cumsum[i + 1] = cumsum[i] + x[i] for _ in range(m): i, j = map(int, input().split()) print(cumsum[j] - cumsum[i - 1]) <file_sep>/boj9345_segment_tree.py import sys from operator import xor input = sys.stdin.readline class SegmentTree(): def __init__(self, arr): self.arr = arr self.n = len(arr) self.t_min = [10**5] * (2 * self.n) self.t_max = [0] * (2 * self.n) self.t_min[self.n:] = arr self.t_max[self.n:] = arr for i in range(self.n - 1, 0, -1): self.t_min[i] = min(self.t_min[i << 1], self.t_min[i << 1 | 1]) self.t_max[i] = max(self.t_max[i << 1], self.t_max[i << 1 | 1]) def query(self, l, r): l_old, r_old = l, r ans_min, ans_max = 10**5, 0 l += self.n r += self.n + 1 while l < r: if l & 1: ans_min = min(ans_min, self.t_min[l]) ans_max = max(ans_max, self.t_max[l]) l += 1 if r & 1: r -= 1 ans_min = min(ans_min, self.t_min[r]) ans_max = max(ans_max, self.t_max[r]) l >>= 1 r >>= 1 return ans_min == l_old and ans_max == r_old def update(self, pos, val): self.t_min[pos + self.n] = val self.t_max[pos + self.n] = val pos += self.n while pos > 1: self.t_min[pos >> 1] = min(self.t_min[pos], self.t_min[xor(pos, 1)]) self.t_max[pos >> 1] = max(self.t_max[pos], self.t_max[xor(pos, 1)]) pos >>= 1 def value(self, pos): return self.t_min[pos + self.n] for _ in range(int(input())): n, k = map(int, input().split()) t = SegmentTree(list(range(n))) for _ in range(k): q, a, b = map(int, input().split()) if q: print('YES' if t.query(a, b) else 'NO') else: val_b = t.value(b) val_a = t.value(a) t.update(a, val_b) t.update(b, val_a) <file_sep>/boj2170_sweeping.py import sys input = sys.stdin.readline arr = [list(map(int, input().split())) for _ in range(int(input()))] arr.sort() ans = 0 l, r = arr[0] for x, y in arr[1:]: if x > r: ans += r - l l, r = x, y elif y > r: r = y ans += r - l print(ans) <file_sep>/boj11657_bellman_ford.py import sys input = sys.stdin.readline max_distance = 500 * 10000 def bellman_ford(edges, n_node): distance = [max_distance] * (n_node + 1) distance[1] = 0 for _ in range(n_node): for a, b, c in edges: if distance[a] < max_distance and distance[a] + c < distance[b]: distance[b] = distance[a] + c for a, b, c in edges: if distance[a] < max_distance and distance[b] > distance[a] + c: return [] return distance[2:] def main(): n_node, n_edge = map(int, input().split()) edges = [list(map(int, input().split())) for _ in range(n_edge)] dist = bellman_ford(edges, n_node) if dist: for i in dist: if i < max_distance: print(i) else: print(-1) else: print(-1) if __name__ == "__main__": main() <file_sep>/boj2213_tree_independent_set.py import sys sys.setrecursionlimit(1000000) input = sys.stdin.readline def dfs(i, parent, include_self): if include_self: # you can either include or exclude self if dp[i][1] == -1: ans = w[i] group = [i] for j in graph[i]: if j == parent: continue cnt, g = dfs(j, i, 0) ans += cnt group += g dp[i][1] = ans s[i][1] = group if dp[i][0] == -1: ans = 0 group = [] for j in graph[i]: if j == parent: continue cnt, g = dfs(j, i, 1) ans += cnt group += g dp[i][0] = ans s[i][0] = group if dp[i][0] > dp[i][1]: return dp[i][0], s[i][0] else: return dp[i][1], s[i][1] else: # exclude self if dp[i][0] == -1: ans = 0 group = [] for j in graph[i]: if j == parent: continue cnt, g = dfs(j, i, 1) ans += cnt group += g dp[i][0] = ans s[i][0] = group return dp[i][0], s[i][0] n = int(input()) w = [0] + list(map(int, input().split())) graph = [[] for _ in range(n + 1)] for _ in range(n - 1): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) dp = [[-1] * 2 for _ in range(n + 1)] s = [[[] for _ in range(2)] for _ in range(n + 1)] ans, group = dfs(1, -1, 1) print(ans) print(*sorted(group)) <file_sep>/boj1517_bubble_sort.py import sys input = sys.stdin.readline def merge_sort(start, end): global ans if start == end: return mid = (start + end) // 2 merge_sort(start, mid) merge_sort(mid + 1, end) temp = [] i, j = start, mid + 1 while i <= mid and j <= end: if arr[i] <= arr[j]: temp.append(arr[i]) i += 1 else: temp.append(arr[j]) j += 1 ans += mid + 1 - i while i <= mid: temp.append(arr[i]) i += 1 while j <= end: temp.append(arr[j]) j += 1 arr[start:end + 1] = temp n = int(input()) arr = list(map(int, input().split())) ans = 0 merge_sort(0, n - 1) print(ans) <file_sep>/boj16975_fenwich_tree.py import sys input = sys.stdin.readline def get(i): ans = a[i - 1] while i > 0: ans += t[i] i -= i & -i return ans def update(i, v): while i < n + 1: t[i] += v i += i & -i n = int(input()) a = list(map(int, input().split())) t = [0] * (n + 1) for _ in range(int(input())): q, *x = map(int, input().split()) if q == 1: update(x[0], x[2]) if x[1] < n: update(x[1] + 1, -x[2]) else: print(get(x[0])) <file_sep>/boj5670_cellphone_typing_trie.py import sys input = sys.stdin.readlines xall = input() n = len(xall) i = 0 while i < n: m = int(xall[i]) trie = {} for j in range(m): x = xall[i + j + 1].rstrip() node = trie for k in range(len(x)): if x[k] not in node: node[x[k]] = {} node = node[x[k]] node['.'] = {} cnt = [1] * m for j in range(m): x = xall[i + j + 1].rstrip() node = trie[x[0]] for k in range(1, len(x)): if len(node) > 1: cnt[j] += 1 node = node[x[k]] print('{:0.2f}'.format(sum(cnt) / m)) i += m + 1 <file_sep>/boj7869_two_circle.py import math x1, y1, r1, x2, y2, r2 = map(float, input().split()) d = ((x1 - x2)**2 + (y1 - y2)**2)**0.5 if r1 > r2: r1, r2 = r2, r1 ans = 0 if d < r1 + r2: if d < r2 - r1: ans = math.pi * r1**2 else: rad1 = math.acos((d**2 + r1**2 - r2**2) / (2 * d * r1)) rad2 = math.acos((d**2 + r2**2 - r1**2) / (2 * d * r2)) sector1 = r1**2 * rad1 sector2 = r2**2 * rad2 triangle1 = r1**2 * math.cos(rad1) * math.sin(rad1) triangle2 = r2**2 * math.cos(rad2) * math.sin(rad2) ans = sector1 + sector2 - triangle1 - triangle2 print('{:0.3f}'.format(ans)) <file_sep>/boj14003_LIS_5.py """BOJ14002: longest increasing subsequence 4 """ import sys from bisect import bisect_left input = sys.stdin.readline n = int(input()) a = list(map(int, input().split())) x = [a[0]] arr = [0] * n cnt = 0 for i in range(1, n): if a[i] > x[-1]: cnt += 1 x.append(a[i]) arr[i] = cnt else: idx = bisect_left(x, a[i]) x[idx] = a[i] arr[i] = idx ans = [0] * (cnt + 1) for i in range(n-1, -1, -1): if arr[i] == cnt: ans[cnt] = a[i] cnt -= 1 print(len(ans)) print(*ans) <file_sep>/boj11725_tree.py import sys from collections import deque input = sys.stdin.readline def bfs(edges, n_node): tree = [0] * (n_node + 1) Q = deque([1]) while Q: parent = Q.popleft() for child in edges[parent]: if tree[child] == 0: tree[child] = parent Q.append(child) return tree n_node = int(input()) edges = [[] for _ in range(n_node + 1)] for _ in range(n_node - 1): a, b = map(int, input().split()) edges[a].append(b) edges[b].append(a) tree = bfs(edges, n_node) print(*tree[2:]) <file_sep>/boj2166_shoelace.py import sys input = sys.stdin.readline shoelace = lambda a, b: a[0] * b[1] - a[1] * b[0] n = int(input()) pts = [list(map(int, input().split())) for _ in range(n)] ans = shoelace(pts[-1], pts[0]) for i in range(n - 1): ans += shoelace(pts[i], pts[i + 1]) print("{:0.1f}".format(abs(ans / 2))) <file_sep>/boj4803_check_tree.py import sys from collections import deque input = sys.stdin.readline def visit(node): visited[node] = 1 Q = deque([(node, 0)]) while Q: node_now, parent = Q.popleft() for node_next in graph[node_now]: if not visited[node_next]: visited[node_next] = 1 Q.append((node_next, node_now)) elif node_next != parent: return 0 return 1 case = 1 while True: n_node, n_edge = map(int, input().split()) if n_node == n_edge == 0: break graph = [[] for _ in range(n_node + 1)] for _ in range(n_edge): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) visited = [0] * (n_node + 1) cnt = 0 for node in range(1, n_node + 1): if not visited[node]: cnt += visit(node) if cnt > 1: print('Case {}: A forest of {} trees.'.format(case, cnt)) elif cnt == 1: print('Case {}: There is one tree.'.format(case)) else: print('Case {}: No trees.'.format(case)) case += 1 <file_sep>/boj2098_tsp.py import sys input = sys.stdin.readline n = int(input()) c = [list(map(int, input().split())) for _ in range(n)] dp = [[0] * n] + [[10**8] * n for _ in range(2**n - 1)] # Start from 0. Should return to 0 (check dp[-1][0]) for i in range(n): if c[0][i]: dp[1 << i][i] = c[0][i] for idx in range(1, 2**n): for j in range(n): # to j city if not (idx & 1 << j): # if haven't visited j city for i in range(n): # start from i city if c[i][j] and (idx & 1 << i): # road available & visited before dp[idx | 1 << j][j] = min(dp[idx | 1 << j][j], dp[idx][i] + c[i][j]) print(dp[-1][0]) <file_sep>/boj16975_segment_tree_v2.py import sys from operator import xor input = sys.stdin.readline def get(r): ans = a[r - 1] l = n r += n while l < r: if l & 1: ans += t[l] l += 1 if r & 1: r -= 1 ans += t[r] l >>= 1 r >>= 1 return ans def update(i, v): i += n t[i] += v while i > 1: t[i >> 1] = t[i] + t[xor(i, 1)] i >>= 1 n = int(input()) a = list(map(int, input().split())) t = [0] * (2 * n) for _ in range(int(input())): q, *x = map(int, input().split()) if q == 1: update(x[0] - 1, x[2]) if x[1] < n: update(x[1], -x[2]) else: print(get(x[0])) <file_sep>/boj1509_palindrome_seperation.py def ispalindrome(i, j): if cache[i][j] == -1: if s[i] == s[j] and (j - i < 2 or ispalindrome(i + 1, j - 1)): cache[i][j] = 1 else: cache[i][j] = 0 return cache[i][j] s = __import__('sys').stdin.readline().rstrip() n = len(s) cache = [[-1] * (n + 1) for _ in range(n + 1)] dp = [0] * (n + 1) dp[1] = 1 for i in range(2, n + 1): dp[i] = dp[i - 1] + 1 for j in range(1, i): if ispalindrome(j - 1, i - 1): dp[i] = min(dp[i], dp[j - 1] + 1) print(dp[-1]) <file_sep>/boj4196_tsort_scc_domino.py import sys from collections import deque sys.setrecursionlimit(10**9) input = sys.stdin.readline def dfs(i): if not visited[i]: visited[i] = 1 for j in graph[i]: if not visited[j]: dfs(j) stack.append(i) def bfs(i): visited[i] = 1 queue = deque([i]) while queue: i = queue.popleft() for j in graph[i]: if not visited[j]: visited[j] = 1 queue.append(j) for _ in range(int(input())): n, m = map(int, input().split()) graph = [[] for _ in range(n + 1)] for _ in range(m): x, y = map(int, input().split()) graph[x].append(y) stack = [] visited = [0] * (n + 1) for i in range(1, n + 1): dfs(i) cnt = 0 visited = [0] * (n + 1) for i in stack[::-1]: if not visited[i]: bfs(i) cnt += 1 print(cnt) <file_sep>/boj1168_fenwick_tree.py def build(): for i in range(1, n + 1): t[i] = i & -i def pop(v): idx = 0 for i in reversed(range(17)): j = idx + (1 << i) if j < n + 1: if t[j] < v: idx = j v -= t[j] else: t[j] -= 1 return idx + 1 n, k = map(int, __import__('sys').stdin.readline().split()) t = [0] * (n + 1) build() ans = [] idx = 1 for i in range(n, 0, -1): idx = (idx + k - 2) % i + 1 ans.append(pop(idx)) print('<', end='') print(*ans, sep=', ', end='') print('>') <file_sep>/boj17435_lca.py import sys import math input = sys.stdin.readline m = int(input()) f = [0] + list(map(int, input().split())) fs = [f] for i in range(int(math.log2(500000))): ftemp = [0] for j in range(1, m + 1): ftemp.append(fs[i][fs[i][j]]) fs.append(ftemp) q = int(input()) for _ in range(q): n, x = map(int, input().split()) i = n j = x while i > 0: idx = int(math.log2(i)) i -= 2**idx j = fs[idx][j] print(j) <file_sep>/boj2042_fenwick_tree.py import sys input = sys.stdin.readline def update(i, diff): while i < n + 1: tree[i] += diff i += (i & -i) def get(i): ans = 0 while i > 0: ans += tree[i] i -= (i & -i) return ans n, m, k = map(int, input().split()) arr = [0] * (n + 1) tree = [0] * (n + 1) for i in range(1, n + 1): arr[i] = int(input()) update(i, arr[i]) for _ in range(m + k): a, b, c = map(int, input().split()) if a == 1: diff = c - arr[b] arr[b] = c update(b, diff) else: print(get(c) - get(b - 1)) <file_sep>/boj2836_sweeping.py import sys input = sys.stdin.readline n, m = map(int, input().split()) arr = [] for _ in range(n): a, b = map(int, input().split()) if a > b: arr.append((b, a)) arr.sort() l, r = arr[0] ans = m for x, y in arr[1:]: if x > r: ans += 2 * (r - l) l, r = x, y elif y > r: r = y ans += 2 * (r - l) print(ans) <file_sep>/boj1012_bfs.py import sys input = sys.stdin.readline dx, dy = [-1, 1, 0, 0], [0, 0, -1, 1] def dfs(x, y): data[x][y] = 0 for k in range(4): nx = x + dx[k] ny = y + dy[k] if 0 <= nx < n and 0 <= ny < m and data[nx][ny]: dfs(nx, ny) def bfs(x, y): cue = [(x, y)] while cue: x, y = cue.pop(0) if data[x][y]: data[x][y] = 0 for k in range(4): nx = x + dx[k] ny = y + dy[k] if 0 <= nx < n and 0 <= ny < m and data[nx][ny]: cue.append((nx, ny)) t = int(input()) for _ in range(t): m, n, k = map(int, input().split()) data = [[0] * m for _ in range(n)] for _ in range(k): x, y = map(int, input().split()) data[y][x] = 1 cnt = 0 for i in range(n): for j in range(m): if data[i][j]: cnt += 1 bfs(i, j) print(cnt) <file_sep>/boj1655_heap_median.py import sys from heapq import heappush,heappop input=sys.stdin.readline minheap=[] maxheap=[] for i in range(int(input())): x=int(input()) if not maxheap: heappush(maxheap,-x) elif len(maxheap)>len(minheap): if x>-maxheap[0]: heappush(minheap,x) else: heappush(maxheap,-x) heappush(minheap,-heappop(maxheap)) else: if x<minheap[0]: heappush(maxheap,-x) else: heappush(minheap,x) heappush(maxheap,-heappop(minheap)) print(-maxheap[0]) <file_sep>/boj3176_lca_min_max.py import sys import math from collections import deque input = sys.stdin.readline n = int(input()) graph = [[] for _ in range(n + 1)] for _ in range(n - 1): a, b, c = map(int, input().split()) graph[a].append((b, c)) graph[b].append((a, c)) dp = [[0] * (n + 1)] min_dp = [[sys.maxsize] * (n + 1)] max_dp = [[0] * (n + 1)] queue = deque([(1, 1)]) depth = [0] * (n + 1) depth[1] = 1 while queue: i, d = queue.popleft() for j, c in graph[i]: if not depth[j]: dp[0][j] = i min_dp[0][j] = c max_dp[0][j] = c depth[j] = d + 1 queue.append((j, d + 1)) k = int(math.log2(max(depth) - 1)) for i in range(1, k + 1): temp = [0] * (n + 1) min_temp = [sys.maxsize] * (n + 1) max_temp = [0] * (n + 1) for j in range(1, n + 1): a = dp[-1][j] temp[j] = dp[-1][a] min_temp[j] = min(min_dp[-1][j], min_dp[-1][a]) max_temp[j] = max(max_dp[-1][j], max_dp[-1][a]) dp.append(temp) min_dp.append(min_temp) max_dp.append(max_temp) for _ in range(int(input())): d, e = map(int, input().split()) if depth[d] > depth[e]: d, e = e, d diff = depth[e] - depth[d] min_d = min_e = sys.maxsize max_d = max_e = 0 while diff: m = int(math.log2(diff)) min_e = min(min_e, min_dp[m][e]) max_e = max(max_e, max_dp[m][e]) e = dp[m][e] diff -= 2**m if d == e: print(min_e, max_e) continue i = 0 j = depth[d] - 1 while i < j: m = int(math.log2(j - i)) td = dp[m][d] te = dp[m][e] if td == te: i = j - 2**m + 1 else: j -= 2**m min_d = min(min_d, min_dp[m][d]) max_d = max(max_d, max_dp[m][d]) min_e = min(min_e, min_dp[m][e]) max_e = max(max_e, max_dp[m][e]) d = td e = te min_ans = min(min_d, min_e, min_dp[0][d], min_dp[0][e]) max_ans = max(max_d, max_e, max_dp[0][d], max_dp[0][e]) print(min_ans, max_ans) <file_sep>/boj1697_bfs.py import sys from collections import deque input = sys.stdin.readline def bfs(n, k): count = [0] * 100001 queue = deque() queue.append(n) while queue: now = queue.popleft() if now == k: return count[now] after = [now - 1, now + 1, 2 * now] for i in after: if 0 <= i <= 100000 and count[i] == 0: queue.append(i) count[i] = count[now] + 1 return -1 n, k = map(int, input().split()) print(bfs(n, k)) <file_sep>/boj4013_atm_scc.py import sys from collections import deque sys.setrecursionlimit(10**6) input = sys.stdin.readline def dfs(i): visited[i] = 1 for j in g[i]: if not visited[j]: dfs(j) stack.append(i) def dfs_rev(i): global cnt ans = cash[i] visited[i] = cnt for j in gr[i]: if not visited[j]: ans += dfs_rev(j) return ans def dfs_cash(i): global dp if dp[i] == -1: temp = 0 for j in g_scc[i]: temp = max(temp, dfs_cash(j)) if temp == 0 and not r_scc[i]: dp[i] = 0 else: dp[i] = sums[i] + temp return dp[i] # input n, m = map(int, input().split()) g = [[] for _ in range(n + 1)] gr = [[] for _ in range(n + 1)] for _ in range(m): a, b = map(int, input().split()) g[a].append(b) gr[b].append(a) cash = [0] + [int(input()) for _ in range(n)] s, p = map(int, input().split()) restaurant = list(map(int, input().split())) # Kosaraju's algorithm cnt = 0 stack = [] visited = [0] * (n + 1) for i in range(1, n + 1): if not visited[i]: cnt += 1 dfs(i) cnt = 0 visited = [0] * (n + 1) sums = [] for i in reversed(stack): if not visited[i]: cnt += 1 sums.append(dfs_rev(i)) # graph between sccs g_scc = [set() for _ in range(cnt)] r_scc = [0] * cnt for i in range(1, n + 1): for j in g[i]: if visited[i] != visited[j]: g_scc[visited[i] - 1].add(visited[j] - 1) if i in restaurant: r_scc[visited[i] - 1] = 1 # search dp = [-1] * cnt print(dfs_cash(visited[s] - 1)) <file_sep>/boj1197_kruskal_mst.py import sys from heapq import heappush, heappop input = sys.stdin.readline def find(idx, i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(idx, x, y): xset = find(idx, x) yset = find(idx, y) if xset != yset: idx[xset] = yset return True else: return False def kruskal(graph, n_node): idx = list(range(n_node + 1)) weight = 0 cnt = n_node - 1 while cnt > 0: c, a, b = heappop(graph) if union(idx, a, b): weight += c cnt -= 1 return weight def main(): n_node, n_edge = map(int, input().split()) graph = [] for _ in range(n_edge): a, b, c = map(int, input().split()) heappush(graph, (c, a, b)) print(kruskal(graph, n_node)) if __name__ == "__main__": main() <file_sep>/boj1956_dijkstra_return_not_an_answer.py import sys import heapq input = sys.stdin.readline dist_max = sys.maxsize def dijkstra_return(edges, n_node): dist = [dist_max] * (n_node + 1) queue = [] for node_next, dist_next in edges[1]: dist[node_next] = dist_next heapq.heappush(queue, (dist_next, node_next)) print(queue, dist) while queue: dist_now, node_now = heapq.heappop(queue) if node_now == 1: return dist_now if dist_now > dist[node_now]: continue for node_next, dist_next in edges[node_now]: dist_next += dist_now if dist_next < dist[node_next]: dist[node_next] = dist_next heapq.heappush(queue, (dist_next, node_next)) print(queue, dist) return -1 def main(): n_node, n_edge = map(int, input().split()) edges = [[] for _ in range(n_node + 1)] for _ in range(n_edge): u, v, d = map(int, input().split()) edges[u].append((v, d)) print(dijkstra_return(edges, n_node)) if __name__ == "__main__": main() <file_sep>/boj4013_atm_scc_3.cpp #include <bits/stdc++.h> using namespace std; const int max_n = 500000; int t, n, m, cnt, s, p; int visited[max_n], cash[max_n], restaurant[max_n], r_scc[max_n], dp[max_n]; vector<int> st, sum_scc; vector<vector<int>> g(max_n), gr(max_n); vector<set<int>> g_scc(max_n); void dfs(int i) { visited[i] = 1; for (int j : g[i]) if (!visited[j]) dfs(j); st.push_back(i); } int dfs_rev(int i) { int ans = cash[i]; visited[i] = cnt; for (int j : gr[i]) if (!visited[j]) ans += dfs_rev(j); return ans; } int dfs_cash(int *dp, int i) { if (dp[i] == -1) { int temp = 0; for (int j : g_scc[i]) temp = max(dfs_cash(dp, j), temp); if ((temp == 0) && (r_scc[i] == 0)) dp[i] = 0; else { dp[i] = sum_scc[i] + temp; } } return dp[i]; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); // input cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; g[a - 1].push_back(b - 1); gr[b - 1].push_back(a - 1); } for (int i = 0; i < n; i++) cin >> cash[i]; cin >> s >> p; for (int i = 0; i < p; i++) { int c; cin >> c; restaurant[c - 1] = 1; } // Kosaraju's algorithm for (int i = 0; i < n; i++) { if (!visited[i]) { dfs(i); } } memset(visited, 0, sizeof(visited)); for (int i = n - 1; i > -1; i--) { if (!visited[st[i]]) { cnt++; sum_scc.push_back(dfs_rev(st[i])); } } // graph between scc for (int i = 0; i < n; i++) { for (int j : g[i]) if (visited[i] != visited[j]) g_scc[visited[i] - 1].insert(visited[j] - 1); if (restaurant[i]) r_scc[visited[i] - 1] = 1; } memset(dp, -1, sizeof(dp)); cout << dfs_cash(dp, visited[s - 1] - 1) << endl; return 0; } <file_sep>/boj17404_rgb2.py import sys input = sys.stdin.readline n = int(input()) x = [list(map(int, input().split())) for _ in range(n)] ans = [] for s in range(3): dp = [[2000] * 3 for _ in range(n)] dp[0][s] = x[0][s] for i in range(1, n): for j in range(3): dp[i][j] = min(dp[i - 1][j - 1], dp[i - 1][j - 2]) + x[i][j] ans.append(min(dp[-1][s - 1], dp[-1][s - 2])) print(min(ans)) <file_sep>/boj15681_tree_dp.py import sys sys.setrecursionlimit(1000000) input = sys.stdin.readline def dfs(i, parent): if dp[i] == 0: ans = 1 for j in graph[i]: if j == parent: continue ans += dfs(j, i) dp[i] = ans return dp[i] n, r, q = map(int, input().split()) graph = [[] for _ in range(n + 1)] for _ in range(n - 1): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) dp = [0] * (n + 1) dfs(r, 0) for _ in range(q): print(dp[int(input())]) <file_sep>/boj5639_bt.py import sys input = sys.stdin.readlines def push(arr, x): idx = 0 while idx in arr: if x < arr[idx]: idx = 2 * idx + 1 else: idx = 2 * idx + 2 arr[idx] = x def postorder(arr, idx): if idx in arr: postorder(arr, 2 * idx + 1) postorder(arr, 2 * idx + 2) print(arr[idx]) preorder = list(map(int, input())) arr = {} for x in preorder: push(arr, x) postorder(arr, 0) <file_sep>/boj1311_hungarian_notdone.py # Hungarian method import sys r=sys.stdin.readline # read data n=int(r()) cost=[list(map(int,r().split())) for i in range(n)] def solve(c): from functools import reduce from operator import mul # function for matrix manipulation transpose = lambda x: list(map(list, zip(*x))) normalize_row = lambda x: [[j-min(i) for j in i] for i in x] normalize_col = lambda x: transpose(normalize_row(transpose(x))) mark_zero = lambda x: [[1 if j==0 else 0 for j in i] for i in x] choice_row = lambda c: [i for i,v in enumerate(c) if sum(v)==0] choice_col = lambda c: choice_col n = len(cost) c = [[0]*n for i in range(n)] # choices # reduced to 0's by subtraction x = normalize_row(cost) x = normalize_col(x) k = 0 while k < n: # choose a maximal indepedent set of k zeros and a minimal cover of k lines z = mark_zero(x) k = cover(z) # choose a maximal indepedent set of k zeros and a minimal cover of k lines def cover(z,c): row=set() col=set() # mark all rows in which no choice has been made row.add(choice_row(c)) if not row: return n while True: # mark all columns not already marked which have zeros in marked rows c = mark_col(z) <file_sep>/boj5639_bt_v2.py import sys from bisect import bisect sys.setrecursionlimit(100000) input = sys.stdin.readlines def postorder(s, e): if s == e: return d = preorder[s] idx = bisect(preorder, d, s, e) postorder(s + 1, idx) postorder(idx, e) print(d) preorder = list(map(int, input())) postorder(0, len(preorder)) <file_sep>/boj1005_acmcraft_tsort.py import sys from heapq import heappush, heappop input = sys.stdin.readline for _ in range(int(input())): n, k = map(int, input().split()) d = [0] + list(map(int, input().split())) graph = [[] for _ in range(n + 1)] for _ in range(k): a, b = map(int, input().split()) graph[a].append(b) degree = [0] * (n + 1) for i in range(1, n + 1): for j in graph[i]: degree[j] += 1 queue = [] for i in range(1, n + 1): if degree[i] == 0: heappush(queue, [d[i], i]) ans = [sys.maxsize] * (n + 1) while queue: [cost, node] = heappop(queue) if ans[node] > cost: ans[node] = cost for i in graph[node]: degree[i] -= 1 if degree[i] == 0: heappush(queue, [cost + d[i], i]) print(ans[int(input())]) <file_sep>/boj1976_union_find.py import sys input = sys.stdin.readline def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset = find(x) yset = find(y) idx[xset] = yset n, m = int(input()), int(input()) idx = list(range(n + 1)) for i in range(1, n + 1): x = list(map(int, input().split())) for j in range(i + 1, n + 1): if x[j - 1]: union(i, j) t = list(map(int, input().split())) gx = find(t[0]) doable = True for i in range(1, m): if find(t[i]) != gx: doable = False break print('YES' if doable else 'NO') <file_sep>/boj11003_sliding_min.py import sys from collections import deque read = lambda: map(int, sys.stdin.readline().split()) n, l = read() a = list(read()) ans = [] q = deque() for i, v in enumerate(a): while q and v < q[-1]: q.pop() q.append(v) ans.append(q[0]) if i >= l - 1 and a[i - l + 1] == q[0]: q.popleft() print(*ans) <file_sep>/boj1110_while.cpp #include <iostream> using namespace std; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int N, temp, count = 0; cin >> N; temp = N; do { temp = temp % 10 * 10 + (temp / 10 + temp % 10) % 10; count++; } while (temp != N); cout << count << endl; return 0; } <file_sep>/boj18870_idx_sorting.py import sys r = sys.stdin.readline r() x = list(map(int, r().split())) idx = {v: i for i, v in enumerate(sorted(set(x)))} print(*[idx[v] for v in x]) <file_sep>/boj20040_cycle_union_find.py import sys input = sys.stdin.readline def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset = find(x) yset = find(y) if xset == yset: return True else: idx[xset] = yset return False n, m = map(int, input().split()) idx = list(range(n)) ans = 0 for i in range(m): a, b = map(int, input().split()) if ans == 0: done = union(a, b) if done: ans = i + 1 done = False print(ans) <file_sep>/boj11779_dijkstra_track.py import sys from heapq import heappush, heappop input = sys.stdin.readline # input n_node, n_edge = int(input()), int(input()) edges = [[] for _ in range(n_node + 1)] for _ in range(n_edge): a, b, c = map(int, input().split()) edges[a].append((c, b)) start, end = map(int, input().split()) # variables dist = [sys.maxsize] * (n_node + 1) track = [0] * (n_node + 1) # dijkstra Q = [(0, start)] # dist / start while Q: dist_now, node_now = heappop(Q) if dist_now > dist[node_now]: continue for dist_next, node_next in edges[node_now]: dist_next += dist_now if dist_next < dist[node_next]: dist[node_next] = dist_next track[node_next] = node_now heappush(Q, (dist_next, node_next)) # backward i = end ans = [end] while i != start: i = track[i] ans.append(i) # output print(dist[end]) print(len(ans)) print(*ans[::-1]) <file_sep>/boj11012_fenwick_tree_v2.py import sys import bisect input = sys.stdin.readline t_size = 10**5 + 2 def update(x, y): while x < t_size: tree[x].append(y) x += x & -x def insort(): for i in range(1, t_size): tree[i].sort() def get(i, b, t): ans = 0 while i > 0: r = bisect.bisect(tree[i], t) l = bisect.bisect_left(tree[i], b) ans += r - l i -= i & -i return ans for _ in range(int(input())): n, m = map(int, input().split()) tree = [[] for _ in range(t_size)] for _ in range(n): x, y = map(int, input().split()) update(x + 1, y) insort() ans = 0 for _ in range(m): l, r, b, t = map(int, input().split()) ans += get(r + 1, b, t) - get(l, b, t) print(ans) <file_sep>/boj1707_bipartite_graph.py import sys from collections import deque, defaultdict input = sys.stdin.readline def bfs(edge, start, visited): visited[start] = 1 queue = deque([(start, 1)]) # index / group while queue: now, group = queue.popleft() for i in edge[now]: if visited[i] == 0: queue.append((i, -group)) visited[i] = -group elif visited[i] == group: return 1 return 0 def main(): K = int(input()) for _ in range(K): V, E = map(int, input().split()) edge = defaultdict(set) for _ in range(E): a, b = map(int, input().split()) edge[a - 1].add(b - 1) edge[b - 1].add(a - 1) visited = [0] * V fail = False for i in edge.keys(): if visited[i] == 0: if bfs(edge, i, visited): fail = True break if fail: print('NO') else: print('YES') if __name__ == '__main__': main() <file_sep>/boj3648_scc_idol.py import sys sys.setrecursionlimit(10**6) input = sys.stdin.readlines def dfs(i): visited[i] = 1 for j in g[i]: if not visited[j]: dfs(j) stack.append(i) def dfs_rev(i): component[i] = cnt for j in gr[i]: if component[j] == -1: dfs_rev(j) x = input() n_x = len(x) i_x = 0 while i_x < n_x: n, m = map(int, x[i_x].split()) g = [set() for _ in range(2 * n + 1)] gr = [set() for _ in range(2 * n + 1)] for i in range(m): a, b = map(int, x[i_x + i + 1].split()) g[-a].add(b) g[-b].add(a) gr[b].add(-a) gr[a].add(-b) g[-1].add(1) gr[1].add(-1) stack = [] visited = [0] * (2 * n + 1) for i in range(-n, n + 1): if i and not visited[i]: dfs(i) cnt = 0 component = [-1] * (2 * n + 1) for i in reversed(stack): if component[i] == -1: dfs_rev(i) cnt += 1 issatisfiable = True for i in range(1, n + 1): if component[i] == component[-i]: issatisfiable = False break if issatisfiable: print('yes') else: print('no') i_x += m + 1 <file_sep>/boj4354_string_multiple.py import sys input = sys.stdin.readline while True: x = input().rstrip() if x == '.': break n = len(x) j = 0 m = 1 for i in range(1, n): if x[i] == x[j]: j += 1 if j == m: j = 0 else: if j > 0 and x[i] == x[0]: m = i j = 1 else: m = i + 1 j = 0 ans, r = divmod(n, m) if r: print(1) else: print(ans) <file_sep>/boj16367_tv_show_scc_2sat.py import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline def dfs(i): visited[i] = 1 for j in g[i]: if not visited[j]: dfs(j) stack.append(i) def dfs_rev(i): component[i] = cnt for j in gr[i]: if component[j] == -1: dfs_rev(j) f = lambda l, c: int(l) if c == 'R' else -int(l) n, m = map(int, input().split()) g = [set() for _ in range(2 * n + 1)] gr = [set() for _ in range(2 * n + 1)] for i in range(m): l0, c0, l1, c1, l2, c2 = input().split() a, b, c = f(l0, c0), f(l1, c1), f(l2, c2) g[-a].add(b) g[-a].add(c) g[-b].add(a) g[-b].add(c) g[-c].add(a) g[-c].add(b) gr[a].add(-b) gr[a].add(-c) gr[b].add(-a) gr[b].add(-c) gr[c].add(-a) gr[c].add(-b) stack = [] visited = [0] * (2 * n + 1) for i in range(-n, n + 1): if i and not visited[i]: dfs(i) cnt = 0 component = [-1] * (2 * n + 1) for i in reversed(stack): if component[i] == -1: dfs_rev(i) cnt += 1 issatisfiable = True ans = ['' for _ in range(n)] for i in range(1, n + 1): if component[i] == component[-i]: issatisfiable = False break ans[i - 1] = 'R' if component[i] > component[-i] else 'B' if issatisfiable: print(''.join(ans)) else: print(-1) <file_sep>/boj4386_star_mst.py import sys from heapq import heappush, heappop input = sys.stdin.readline def dist(nodes, a, b): return ((nodes[a][0] - nodes[b][0])**2 + (nodes[a][1] - nodes[b][1])**2)**0.5 def find(idx, i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(idx, x, y): xset = find(idx, x) yset = find(idx, y) if xset != yset: idx[xset] = yset return True else: return False def kruskal(graph, n_node): idx = list(range(n_node + 1)) weight = 0 cnt = n_node - 1 while cnt > 0: c, a, b = heappop(graph) if union(idx, a, b): weight += c cnt -= 1 return weight def main(): n_node = int(input()) nodes = [] for _ in range(n_node): a, b = map(float, input().split()) nodes.append((a, b)) graph = [] for i in range(n_node): for j in range(i): heappush(graph, (dist(nodes, i, j), i, j)) print(kruskal(graph, n_node)) if __name__ == "__main__": main() <file_sep>/boj9019_dslr_bfs.py from collections import deque for _ in range(int(input())): a, b = map(int, input().split()) visited = [0] * 10000 track = [0] * 10000 method = [0] * 10000 cmd_name = ['D', 'S', 'L', 'R'] Q = deque([a]) while Q: now = Q.popleft() if now == b: break cmds = [(2 * now) % 10000, (now - 1) if now > 0 else 9999, now % 1000 * 10 + now // 1000, now % 10 * 1000 + now // 10] for i, c in enumerate(cmds): if visited[c] == 0: visited[c] = 1 track[c] = now method[c] = i Q.append(c) # backward i = b ans = '' while i != a: ans += cmd_name[method[i]] i = track[i] print(ans[::-1]) <file_sep>/boj2533_sns.py import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def dfs(i): visited[i] = 1 dp[i] = [0, 1] for j in graph[i]: if not visited[j]: dfs(j) dp[i][0] += dp[j][1] dp[i][1] += min(dp[j]) n = int(input()) graph = [[] for _ in range(n + 1)] for _ in range(n - 1): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) dp = [[0, 0] for _ in range(n + 1)] visited = [0] * (n + 1) dfs(1) print(min(dp[1])) <file_sep>/boj1086_num_combination_modulo.py import sys import math input = sys.stdin.readline def check_length(idx): cnt = 0 for i in range(n): if idx >> i & 1: cnt += x_length[i] return cnt # input n = int(input()) x = [int(input()) for _ in range(n)] k = int(input()) x_length = [len(str(i)) for i in x] x_modulo = [[(j * 10**i) % k for i in range(sum(x_length))] for j in x] dp = [[0] * k for _ in range(2**n)] dp[0][0] = 1 '''dp[i][j]: count of (i) combination with j modulo i: bitmask j: modulo answer will be dp[-1][0] / n! ''' for idx in range(2**n): for m in range(k): # previous modulo if dp[idx][m] == 0: continue for i in range(n): # next component to pick if (idx & 1 << i): continue # pass if already picked next_m = (x_modulo[i][check_length(idx)] + m) % k dp[idx | 1 << i][next_m] += dp[idx][m] N = math.factorial(n) d = math.gcd(dp[-1][0], N) print('{}/{}'.format(dp[-1][0] // d, N // d)) <file_sep>/boj9345.py import sys from math import ceil, log2 input = sys.stdin.readline class SegmentTree(arr, f): def __init__(self, arr): self.arr = arr self.n = len(arr) t = [0] * (2 * n) self.init() def init(): for _ in range(int(input())): n, k = map(int, input().split()) arr = list(range(n)) n_st = (1 << ceil(log2(n) + 1)) - 1 st_min = [n] * n_st st_max = [0] * n_st build(st_min, 0, 0, n - 1, min) build(st_max, 0, 0, n - 1, max) for _ in range(k): q, a, b = map(int, input().split()) if q: min_val = query(st_min, a, b, 0, 0, n - 1, min) max_val = query(st_max, a, b, 0, 0, n - 1, max) if a == min_val and b == max_val: print('YES') else: print('NO') else: val_b = arr[b] val_a = arr[a] update(a, val_b, st_min, 0, 0, n - 1, min) update(a, val_b, st_max, 0, 0, n - 1, max) update(b, val_a, st_min, 0, 0, n - 1, min) update(b, val_a, st_max, 0, 0, n - 1, max) <file_sep>/boj1991_tree_v2.py def transversal(mode, node='A'): l_node, r_node = tree[node] d = [node] l = transversal(mode, l_node) if l_node != '.' else [] r = transversal(mode, r_node) if r_node != '.' else [] if mode == 0: ans = d + l + r elif mode == 1: ans = l + d + r else: ans = l + r + d return ans tree = {} for i in range(int(input())): d, l, r = input().split() tree[d] = (l, r) print(*transversal(0), sep='') print(*transversal(1), sep='') print(*transversal(2), sep='') <file_sep>/boj3273_two_pointer.py import sys input = sys.stdin.readline n = int(input()) a = sorted(list(map(int, input().split()))) x = int(input()) i = 0 j = n - 1 cnt = 0 while i < j: if a[i] + a[j] == x: cnt += 1 i += 1 elif a[i] + a[j] > x: j -= 1 else: i += 1 print(cnt) <file_sep>/boj11727_dp.py n = int(input()) dp = [1, 1, 3] for i in range(3, n + 1): j = i % 3 dp[j] = (dp[j - 1] + 2 * dp[j - 2]) % 10007 print(dp[n % 3]) <file_sep>/boj2470_two_pointer_sum.py import sys input = sys.stdin.readline n = int(input()) a = sorted(list(map(int, input().split()))) i = 0 j = n - 1 min_abs = int(2E9) ans = [a[i], a[j]] while i < j: if abs(a[i] + a[j]) < min_abs: min_abs = abs(a[i] + a[j]) ans = [a[i], a[j]] if min_abs == 0: break if a[i] + a[j] > 0: j -= 1 else: i += 1 print(*ans) <file_sep>/boj13511_lca_3_v2.py import sys import math from collections import deque input = sys.stdin.readline n = int(input()) graph = [[] for _ in range(n + 1)] for _ in range(n - 1): a, b, c = map(int, input().split()) graph[a].append((b, c)) graph[b].append((a, c)) dp = [[0] * (n + 1)] cost_dp = [[0] * (n + 1)] queue = deque([(1, 1)]) depth = [0] * (n + 1) depth[1] = 1 while queue: i, d = queue.popleft() for j, c in graph[i]: if not depth[j]: dp[0][j] = i cost_dp[0][j] = c depth[j] = d + 1 queue.append((j, d + 1)) m = int(math.log2(max(depth) - 1)) for i in range(1, m + 1): temp = [0] * (n + 1) cost_temp = [sys.maxsize] * (n + 1) for j in range(1, n + 1): k = dp[-1][j] temp[j] = dp[-1][k] cost_temp[j] = cost_dp[-1][j] + cost_dp[-1][k] dp.append(temp) cost_dp.append(cost_temp) for _ in range(int(input())): q, a, b, *x = map(int, input().split()) if depth[a] > depth[b]: d, e = a, b else: d, e = b, a diff = depth[d] - depth[e] cost = 0 while diff: m = int(math.log2(diff)) cost += cost_dp[m][d] d = dp[m][d] diff -= 2**m if d != e: i = 1 j = depth[e] while i < j: m = int(math.log2(j - i)) td = dp[m][d] te = dp[m][e] if td == te: i = j - 2**m + 1 else: j -= 2**m cost += cost_dp[m][d] + cost_dp[m][e] d = td e = te cost += cost_dp[0][d] + cost_dp[0][e] else: j = depth[e] + 1 if q == 1: print(cost) else: len_a = depth[a] - (j - 1) len_b = depth[b] - (j - 1) if x[0] - 1 <= len_a: diff = x[0] - 1 while diff: m = int(math.log2(diff)) a = dp[m][a] diff -= 2**m print(a) else: diff = len_a + len_b - x[0] + 1 while diff: m = int(math.log2(diff)) b = dp[m][b] diff -= 2**m print(b) <file_sep>/boj2533_sns.cpp #include <iostream> #include <vector> using namespace std; const int max_n = 1000001; int n, dp[max_n][2]; bool visited[max_n]; vector<int> graph[max_n]; void dfs(int i) { visited[i] = true; dp[i][0] = 0; dp[i][1] = 1; for (int j : graph[i]) { if (!visited[j]) { dfs(j); dp[i][0] += dp[j][1]; dp[i][1] += min(dp[j][0], dp[j][1]); } } } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; for (int i = 1; i < n; i++) { int a, b; cin >> a >> b; graph[a].push_back(b); graph[b].push_back(a); } dfs(1); cout << min(dp[1][0], dp[1][1]) << endl; return 0; } <file_sep>/boj1774_kruskal_mst.py import sys from heapq import heappush, heappop input = sys.stdin.readline def dist(a, b): return ((nodes[a][0] - nodes[b][0])**2 + (nodes[a][1] - nodes[b][1])**2)**0.5 def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset = find(x) yset = find(y) if xset != yset: idx[xset] = yset return True else: return False n_node, n_connected = map(int, input().split()) nodes = [list(map(int, input().split())) for _ in range(n_node)] idx = list(range(n_node)) for _ in range(n_connected): a, b = map(int, input().split()) union(a - 1, b - 1) graph = [] for i in range(n_node): for j in range(i): heappush(graph, (dist(i, j), i, j)) ans = 0 while graph: c, a, b = heappop(graph) if union(a, b): ans += c print("%0.2f" % ans) <file_sep>/boj2357_segment_tree_min_max.py import sys from math import log2, ceil input = sys.stdin.readline def build(st, idx, i, j, f): if i == j: st[idx] = arr[i] else: mid = i + (j - i) // 2 a = build(st, 2 * idx + 1, i, mid, f) b = build(st, 2 * idx + 2, mid + 1, j, f) st[idx] = f(a, b) return st[idx] def query(st, qi, qj, idx, i, j, f): if qi <= i and qj >= j: return st[idx] if j < qi or i > qj: if f == min: return 10**9 else: return 0 mid = i + (j - i) // 2 a = query(st, qi, qj, 2 * idx + 1, i, mid, f) b = query(st, qi, qj, 2 * idx + 2, mid + 1, j, f) return f(a, b) n, m = map(int, input().split()) arr = [int(input()) for _ in range(n)] n_st = (1 << ceil(log2(n) + 1)) - 1 st_min = [0] * n_st st_max = [0] * n_st build(st_min, 0, 0, n - 1, min) build(st_max, 0, 0, n - 1, max) for _ in range(m): a, b = map(int, input().split()) print(query(st_min, a - 1, b - 1, 0, 0, n - 1, min),\ query(st_max, a - 1, b - 1, 0, 0, n - 1, max)) <file_sep>/boj12852_dp.py n = int(input()) cnt = [n] * (n + 1) cnt[1] = 0 path = [[] for _ in range(n + 1)] path[1] = [1] for i in range(2, n + 1): temp = [cnt[i - 1]] ptemp = [path[i - 1]] if i % 3 == 0: temp.append(cnt[i // 3]) ptemp.append(path[i // 3]) if i % 2 == 0: temp.append(cnt[i // 2]) ptemp.append(path[i // 2]) min_temp = min(temp) cnt[i] = min_temp + 1 path[i] = [i] + ptemp[temp.index(min_temp)] print(cnt[-1]) print(*path[-1]) <file_sep>/boj14425_string_match_trie.py import sys input = sys.stdin.readline trie = {} n, m = map(int, input().split()) for _ in range(n): x = list(input().rstrip()) node = trie for i in range(len(x)): if x[i] not in node: node[x[i]] = {} node = node[x[i]] node['.'] = {} cnt = 0 for _ in range(m): x = list(input().rstrip()) node = trie done = True for i in range(len(x)): if x[i] in node: node = node[x[i]] else: done = False break if done and '.' in node: cnt += 1 print(cnt) <file_sep>/boj7662_double_queue.py import sys from heapq import heappush, heappop input = sys.stdin.readline def flush(t): if t > 0: while q_max and d_max and d_max[0] == q_max[0]: heappop(q_max) heappop(d_max) else: while q_min and d_min and d_min[0] == q_min[0]: heappop(q_min) heappop(d_min) for _ in range(int(input())): q_min, q_max = [], [] d_min, d_max = [], [] for _ in range(int(input())): c, v = input().split() x = int(v) if c == 'I': heappush(q_min, x) heappush(q_max, -x) elif c == 'D': flush(x) if x == 1: if q_max: heappush(d_min, -heappop(q_max)) else: if q_min: heappush(d_max, -heappop(q_min)) flush(1) flush(-1) if q_min and q_max: print(-q_max[0], q_min[0]) else: print('EMPTY') <file_sep>/boj1717_union_find.py import sys input = sys.stdin.readline def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset = find(x) yset = find(y) idx[xset] = yset n, m = map(int, input().split()) idx = list(range(n + 1)) for _ in range(m): c, a, b = map(int, input().split()) if c: if find(a) == find(b): print('YES') else: print('NO') else: union(a, b) <file_sep>/boj1806_two_pointer.py import sys input = sys.stdin.readline n, s = map(int, input().split()) x = list(map(int, input().split())) sij = x[0] j = 0 ans = sys.maxsize for i in range(n): while sij < s and j < n - 1: j += 1 sij += x[j] if sij >= s: ans = min(ans, j - i + 1) sij -= x[i] else: break if ans == sys.maxsize: print(0) else: print(ans) <file_sep>/boj3977_scc_2.py import sys from collections import deque sys.setrecursionlimit(10**9) input = sys.stdin.readline def dfs(g, i, ans): global cnt visited[i] = cnt for j in g[i]: if not visited[j]: dfs(g, j, ans) ans.append(i) t = int(input()) for i_t in range(t): n, m = map(int, input().split()) g = [[] for _ in range(n)] gr = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) g[a].append(b) gr[b].append(a) cnt = 0 stack = [] visited = [0] * n for i in range(n): if not visited[i]: cnt += 1 dfs(g, i, stack) cnt = 0 visited = [0] * n for i in reversed(stack): if not visited[i]: cnt += 1 dfs(gr, i, []) indegree = [0] * cnt for i in range(n): for j in g[i]: if visited[i] != visited[j]: indegree[visited[j] - 1] += 1 if indegree.count(0) != 1: print('Confused') else: idx = indegree.index(0) + 1 for i in range(n): if visited[i] == idx: print(i) print() if i_t < t - 1: input() <file_sep>/boj20149_line_cross.py def det(i, j, k, l): a = pts[i][0] - pts[j][0] b = pts[i][1] - pts[j][1] c = pts[k][0] - pts[l][0] d = pts[k][1] - pts[l][1] return a * d - b * c def inrange(i, j, k): if pts[i][0] <= pts[j][0]: xmin, xmax = pts[i][0], pts[j][0] else: xmin, xmax = pts[j][0], pts[i][0] if pts[i][1] <= pts[j][1]: ymin, ymax = pts[i][1], pts[j][1] else: ymin, ymax = pts[j][1], pts[i][1] return xmin <= pts[k][0] <= xmax and ymin <= pts[k][1] <= ymax pts = [] for _ in range(2): a, b, c, d = map(int, input().split()) pts += [(a, b), (c, d)] d1 = det(0, 1, 2, 1) d2 = det(0, 1, 3, 1) d3 = det(2, 3, 0, 3) d4 = det(2, 3, 1, 3) c1 = d1 * d2 < 0 and d3 * d4 < 0 c2 = d1 == 0 and inrange(0, 1, 2) c3 = d2 == 0 and inrange(0, 1, 3) c4 = d3 == 0 and inrange(2, 3, 0) c5 = d4 == 0 and inrange(2, 3, 1) if c1 or c2 or c3 or c4 or c5: print(1) if c1: k = det(3, 1, 3, 2) / det(0, 1, 3, 2) print(k * pts[0][0] + (1 - k) * pts[1][0], k * pts[0][1] + (1 - k) * pts[1][1]) if (c2 and c3) or (c4 and c5): pass elif c2: print(*pts[2]) elif c3: print(*pts[3]) elif c4: print(*pts[0]) elif c5: print(*pts[1]) else: print(0) <file_sep>/boj2206_bfs.py import sys from collections import deque input = sys.stdin.readline dx, dy = [-2, -2, -1, -1, 1, 1, 2, 2], [-1, 1, -2, 2, -2, 2, -1, 1] def bfs(start, goal, size): count = [[0] * size for _ in range(size)] queue = deque([start]) while queue: x, y = queue.popleft() if (x, y) == goal: return count[x][y] for ix, iy in zip(dx, dy): nx, ny = x + ix, y + iy if 0 <= nx < size and 0 <= ny < size and count[nx][ny] == 0: queue.append((nx, ny)) count[nx][ny] = count[x][y] + 1 return -1 T = int(input()) for _ in range(T): size = int(input()) start = tuple(map(int, input().split())) goal = tuple(map(int, input().split())) print(bfs(start, goal, size)) <file_sep>/boj11404_floyd_warshall.py import sys input = sys.stdin.readline max_distance = 10000000 def floyd_warshall(n_node, d): for m in range(n_node): for s in range(n_node): for e in range(n_node): if d[s][e] > d[s][m] + d[m][e]: d[s][e] = d[s][m] + d[m][e] def main(): n_node = int(input()) n_edge = int(input()) d = [[max_distance] * n_node for _ in range(n_node)] for i in range(n_node): d[i][i] = 0 for _ in range(n_edge): a, b, c = map(int, input().split()) if d[a - 1][b - 1] > c: d[a - 1][b - 1] = c floyd_warshall(n_node, d) for i in d: for j in i: if j < max_distance: print(j, end=' ') else: print(0, end=' ') print() if __name__ == '__main__': main() <file_sep>/boj11286_heap_abs.py #used the standard library heapq import sys input = sys.stdin.readline def push(heap,item): heap.append(item) pos=len(heap)-1 while pos>0: parentpos=(pos-1)//2 parent=heap[parentpos] if abs(item)<abs(parent) or (abs(item)==abs(parent) and item<parent): heap[pos]=parent pos=parentpos else: break heap[pos]=item def pop(heap): item=heap.pop() if heap: returnitem=heap[0] pos=0 child=1 while child<len(heap): child2=child+1 if child2<endpos and (abs(heap[child2])<abs(heap[child]) or (abs(heap[child2]==heap[child]) and child2<child)): child=child2 heap[pos]=heap[child] pos=child child=2*pos+1 heap[pos]=item while pos>0: parentpos=(pos-1)//2 parent=heap[parentpos] if abs(item)<abs(parent) or (abs(item)==abs(parent) and item<parent): heap[pos]=parent pos=parentpos else: break heap[pos]=item return returnitem return item heap=[] n=int(input()) for i in range(n): x=int(input()) if x: push(heap,x) elif heap: print(pop(heap)) else: print(0) <file_sep>/boj1786_kmp.py def kmp_table(p): pos = 1 cnd = 0 T = [-1] * (len(p) + 1) while pos < len(p): if p[pos] == p[cnd]: T[pos] = T[cnd] else: T[pos] = cnd while cnd >= 0 and p[pos] != p[cnd]: cnd = T[cnd] pos += 1 cnd += 1 T[pos] = cnd return T def kmp_search(t, p): T = kmp_table(p) j = k = 0 idx = [] while j < len(t): if p[k] == t[j]: j += 1 k += 1 if k == len(p): idx.append(j - k + 1) k = T[k] else: k = T[k] if k < 0: j += 1 k += 1 return idx t = input() p = input() idx = kmp_search(t, p) print(len(idx)) print(*idx) <file_sep>/boj12899_data_structure_v1.py import sys from math import ceil, log2 sys.setrecursionlimit(10**7) input = sys.stdin.readline n = 2000000 tree = [0] * (1 << 22) def add(index, node=1, start=0, end=n - 1): if index < start or index > end: return if start == end: tree[node] = 1 else: tree[node] += 1 mid = (start + end) // 2 add(index, node * 2, start, mid) add(index, node * 2 + 1, mid + 1, end) def pop(value, node=1, start=0, end=n - 1): if start == end: tree[node] = 0 return start + 1 tree[node] -= 1 mid = (start + end) // 2 if value > tree[node * 2]: return pop(value - tree[node * 2], node * 2 + 1, mid + 1, end) else: return pop(value, node * 2, start, mid) for _ in range(int(input())): t, x = map(int, input().split()) if t == 1: add(x - 1) else: print(pop(x)) <file_sep>/boj11438_lca_2.py import math import sys from collections import deque input = sys.stdin.readline n = int(input()) graph = [[] for _ in range(n + 1)] for i in range(n - 1): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) # bfs dp = [[0] * (n + 1)] queue = deque([(1, 1)]) depth = [0] * (n + 1) depth[1] = 1 while queue: i, d = queue.popleft() for j in graph[i]: if not depth[j]: queue.append((j, d + 1)) dp[0][j] = i depth[j] = d + 1 # sparse dp k = int(math.log2(max(depth) - 1)) for i in range(1, k + 1): temp = [0] * (n + 1) for j in range(1, n + 1): temp[j] = dp[i - 1][dp[i - 1][j]] dp.append(temp) for _ in range(int(input())): a, b = map(int, input().split()) if depth[a] < depth[b]: a, b = b, a # matching depth d = depth[a] - depth[b] for i in range(k, -1, -1): if d & 1 << i: a = dp[i][a] d -= 1 << i if a == b: print(a) continue # trace parents i = 0 j = depth[b] - 1 while i < j: m = int(math.log2(j - i)) ta = dp[m][a] tb = dp[m][b] if ta == tb: i = j - 2**m + 1 else: j -= 2**m a = ta b = tb print(dp[0][a]) <file_sep>/boj1644_prime_sum_two_pointer.py # BOJ1644 def prime(n): arr = [0] * 2 + [1] * (n - 1) for i in range(2, int(n**0.5) + 1): if arr[i]: for j in range(2 * i, n + 1, i): arr[j] = 0 return [i for i in range(2, n + 1) if arr[i]] def main(): n = int(input()) if n==1: print(0) return arr = prime(n) n_prime = len(arr) j = 0 s = arr[0] cnt = 0 for i in range(n_prime): while s < n and j < n_prime - 1: j += 1 s += arr[j] if s < n: break elif s == n: cnt += 1 s -= arr[i] print(cnt) if __name__ == "__main__": main() <file_sep>/boj7569_bfs.py import sys from collections import deque input = sys.stdin.readline dx, dy, dz = [-1, 1, 0, 0, 0, 0], [0, 0, -1, 1, 0, 0], [0, 0, 0, 0, -1, 1] def bfs(arr): h, n, m = len(arr), len(arr[0]), len(arr[0][0]) queue = deque() cnt = [[[0] * m for _ in range(n)] for _ in range(h)] for i in range(h): for j in range(n): for k in range(m): if arr[i][j][k] == 1: queue.append((i, j, k)) while queue: x, y, z = queue.popleft() for ix, iy, iz in zip(dx, dy, dz): nx, ny, nz = x + ix, y + iy, z + iz if 0 <= nx < h and 0 <= ny < n and \ 0 <= nz < m and arr[nx][ny][nz] == 0: arr[nx][ny][nz] = 1 cnt[nx][ny][nz] = cnt[x][y][z] + 1 queue.append((nx, ny, nz)) max_cnt = 0 for i in range(h): for j in range(n): if 0 in arr[i][j]: return -1 else: max_cnt = max(max_cnt, max(cnt[i][j])) return max_cnt m, n, h = map(int, input().split()) arr = [[list(map(int, input().split())) for _ in range(n)] for _ in range(h)] print(bfs(arr)) <file_sep>/boj14002_LIS_4.py import sys from bisect import bisect_left input = sys.stdin.readline n = int(input()) d = list(map(int, input().split())) x = [d[0]] arr = [0] * n for i in range(1, n): if d[i] > x[-1]: x.append(d[i]) arr[i] = len(x) - 1 else: idx = bisect_left(x, d[i]) x[idx] = d[i] arr[i] = idx ans = [] k = len(x) - 1 for i in reversed(range(n)): if k == arr[i]: ans.append(d[i]) k -= 1 print(len(x)) print(*reversed(ans)) <file_sep>/boj2618_police_car.py """BOJ2618: Shortest path""" import sys input = sys.stdin.readline def d(i, j): if i > 0 and j > 0: return abs(case[i - 1][0] - case[j - 1][0]) + abs(case[i - 1][1] - case[j - 1][1]) elif j == 0: # a is moving return abs(case[i - 1][0] - 1) + abs(case[i - 1][1] - 1) else: # b is moving return abs(case[j - 1][0] - n) + abs(case[j - 1][1] - n) def my_min(f, i, axis): idx = 0 if axis == 0: # column m = f[0][i] + d(i + 1, 0) for j in range(1, i): if m > f[j][i] + d(i + 1, j): m = f[j][i] + d(i + 1, j) idx = j else: m = f[i][0] + d(0, i + 1) for j in range(1, i): if m > f[i][j] + d(j, i + 1): m = f[i][j] + d(j, i + 1) idx = j return m, idx n = int(input()) w = int(input()) case = [list(map(int, input().split())) for _ in range(w)] f = [[sys.maxsize] * (w + 1) for _ in range(w + 1)] f[0][0] = 0 f[1][0] = d(1, 0) f[0][1] = d(0, 1) fwhere = [[0] * (w + 1) for _ in range(w + 1)] # forward for i in range(w + 1): for j in range(w + 1): if (i < 2 and j < 2) or i == j: continue if j > i: if j == i + 1: f[i][j], fwhere[i][j] = my_min(f, i, 1) else: f[i][j] = f[i][j - 1] + d(j - 1, j) fwhere[i][j] = j - 1 else: if i == j + 1: f[i][j], fwhere[i][j] = my_min(f, j, 0) else: f[i][j] = f[i - 1][j] + d(i, i - 1) fwhere[i][j] = i - 1 # backward m_a = min(f[-1]) idx_a = f[-1].index(m_a) m_b = f[0][-1] idx_b = 0 for i in range(1, w + 1): if m_b > f[i][-1]: m_b = f[i][-1] idx_b = i choice = [0] * (w + 1) if m_a < m_b: choice[-1] = 1 a = w b = idx_a ans = m_a else: choice[-1] = 2 a = idx_b b = w ans = m_b i = w while i > 0: if a > b: a = fwhere[a][b] choice[i] = 1 else: b = fwhere[a][b] choice[i] = 2 i -= 1 print(ans) print(*choice[1:], sep='\n') <file_sep>/boj2169_dp.py import sys input = sys.stdin.readline n, m = map(int, input().split()) v = [list(map(int, input().split())) for _ in range(n)] dp = [[[-10**5] * 2 for _ in range(m)] for _ in range(n)] dp[0][0][0] = v[0][0] for i in range(1, m): dp[0][i][0] = dp[0][i - 1][0] + v[0][i] for i in range(1, n): dp[i][0][0] = max(dp[i - 1][0]) + v[i][0] dp[i][-1][1] = max(dp[i - 1][-1]) + v[i][-1] for j in range(1, m): dp[i][j][0] = max(max(dp[i - 1][j]), dp[i][j - 1][0]) + v[i][j] for j in reversed(range(m - 1)): dp[i][j][1] = max(max(dp[i - 1][j]), dp[i][j + 1][1]) + v[i][j] print(max(dp[-1][-1])) <file_sep>/boj17387_line_cross.py def det(i, j, k): a = pts[i][0] - pts[j][0] b = pts[i][1] - pts[j][1] c = pts[k][0] - pts[j][0] d = pts[k][1] - pts[j][1] return a * d - b * c def inrange(i, j, k): if pts[i][0] <= pts[j][0]: xmin, xmax = pts[i][0], pts[j][0] else: xmin, xmax = pts[j][0], pts[i][0] if pts[i][1] <= pts[j][1]: ymin, ymax = pts[i][1], pts[j][1] else: ymin, ymax = pts[j][1], pts[i][1] return xmin <= pts[k][0] <= xmax and ymin <= pts[k][1] <= ymax pts = [] for _ in range(2): a, b, c, d = map(int, input().split()) pts += [(a, b), (c, d)] d1 = det(0, 1, 2) d2 = det(0, 1, 3) d3 = det(2, 3, 0) d4 = det(2, 3, 1) c1 = d1 * d2 < 0 and d3 * d4 < 0 c2 = d1 == 0 and inrange(0, 1, 2) c3 = d2 == 0 and inrange(0, 1, 3) c4 = d3 == 0 and inrange(2, 3, 0) c5 = d4 == 0 and inrange(2, 3, 1) if c1 or c2 or c3 or c4 or c5: print(1) else: print(0) <file_sep>/boj3584_lca.py import sys input = sys.stdin.readline for _ in range(int(input())): n = int(input()) graph = [0] * (n + 1) for _ in range(n - 1): a, b = map(int, input().split()) graph[b] = a x, y = map(int, input().split()) x_parents = set() i = x while i: x_parents.add(i) i = graph[i] j = y while j: if j in x_parents: break j = graph[j] print(j) <file_sep>/boj15678_segment_tree.py import sys from operator import xor r = sys.stdin.readline def update(i, v): i += n dp[i] = v while i > 1: j = xor(i, 1) dp[i >> 1] = max(dp[i], dp[j]) i >>= 1 def get(i, j): ans = -10**9 i += n j += n while i < j: if i & 1: ans = max(ans, dp[i]) i += 1 if j & 1: j -= 1 ans = max(ans, dp[j]) i >>= 1 j >>= 1 return ans n, d = map(int, r().split()) k = list(map(int, r().split())) dp = [-10**9] * (2 * n) for i in range(n): update(i, k[i] + max(get(max(i - d, 0), i), 0)) print(get(0, n)) <file_sep>/boj16928.py import sys from collections import deque r = lambda: map(int, sys.stdin.readline().split()) def bfs(): x = 1 q = deque([[0, x]]) visited = [0] * 101 while q: n, x = q.popleft() if x == 100: return n for ix in range(6): ix += x + 1 if ix <= 100 and not visited[ix]: visited[ix] = 1 q.append([n + 1, graph[ix]]) return 0 n, m = r() graph = list(range(101)) for _ in range(n + m): a, b = r() graph[a] = b print(bfs()) <file_sep>/boj2482_color_selection.py import sys import math input = sys.stdin.readline n = int(input()) k = int(input()) d = 1000000003 dp = [[0] * (k + 1) for _ in range(n + 1)] for i in range(n + 1): dp[i][1] = i for i in range(2, k + 1): for j in range(2 * i, n + 1): dp[j][i] = (dp[j - 1][i] + dp[j - 2][i - 1]) % d print(dp[n][k]) <file_sep>/boj2887_kruskal_mst.py import sys from heapq import heappop, heappush input = sys.stdin.readline def dist(a, b, i): return abs(nodes[a][i] - nodes[b][i]) def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset, yset = find(x), find(y) if xset != yset: idx[xset] = yset return True else: return False n_node = int(input()) nodes = [list(map(int, input().split())) + [i] for i in range(n_node)] graph = [] for i in range(3): nodes.sort(key=lambda x: x[i]) for j in range(n_node - 1): heappush(graph, (dist(j, j + 1, i), nodes[j][3], nodes[j + 1][3])) idx = list(range(n_node)) cnt = 0 ans = 0 while cnt < n_node - 1: d, x, y = heappop(graph) if union(x, y): ans += d cnt += 1 print(ans) <file_sep>/boj1956_floyd_warshall_return.py import sys input = sys.stdin.readline dist_max = sys.maxsize def floyd_warshall(d, n_node): for m in range(n_node): for s in range(n_node): for e in range(n_node): if d[s][e] > d[s][m] + d[m][e]: d[s][e] = d[s][m] + d[m][e] def main(): n_node, n_edge = map(int, input().split()) d = [[dist_max] * n_node for _ in range(n_node)] for _ in range(n_edge): a, b, c = map(int, input().split()) if c < d[a - 1][b - 1]: d[a - 1][b - 1] = c floyd_warshall(d, n_node) min_d = dist_max for i in range(n_node): if d[i][i] < min_d: min_d = d[i][i] if min_d == dist_max: print(-1) else: print(min_d) if __name__ == "__main__": main() <file_sep>/boj11403_floyd_warshall.py import sys r = sys.stdin.readline n = int(r()) d = [list(map(int, r().split())) for _ in range(n)] for m in range(n): for s in range(n): for e in range(n): if d[s][m] and d[m][e]: d[s][e] = 1 for i in d: print(*i) <file_sep>/boj11758_ccw_v2.py import sys input = sys.stdin.readline pts = [list(map(int, input().split())) for _ in range(3)] a, b = pts[0][0] - pts[1][0], pts[0][1] - pts[1][1] c, d = pts[2][0] - pts[1][0], pts[2][1] - pts[1][1] ans = a * d - b * c if ans > 0: print(-1) elif ans < 0: print(1) else: print(0) <file_sep>/boj2150_strongly_connected_component.py import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def dfs(i): if not visited[i]: visited[i] = 1 for j in graph[i]: if not visited[j]: dfs(j) stack.append(i) def dfs_backwards(i): if not visited[i]: ans = [i] visited[i] = 1 for j in graph_backwards[i]: if not visited[j]: ans += dfs_backwards(j) return ans return [] v, e = map(int, input().split()) graph = [[] for _ in range(v + 1)] graph_backwards = [[] for _ in range(v + 1)] for _ in range(e): a, b = map(int, input().split()) graph[a].append(b) graph_backwards[b].append(a) stack = [] visited = [0] * (v + 1) for i in range(1, v + 1): dfs(i) ans = [] visited = [0] * (v + 1) for i in stack[::-1]: temp = dfs_backwards(i) if temp: ans.append(sorted(temp)) ans.sort() print(len(ans)) for i in ans: print(*sorted(i), -1) <file_sep>/boj12899_fenwick_tree_pop.py import sys input = sys.stdin.readline def pop(v): idx = 0 for i in reversed(range(21)): j = idx + (1 << i) if j < n: if t[j] < v: idx = j v -= t[j] else: t[j] -= 1 return idx + 1 def add(i): while i < n: t[i] += 1 i += i & -i n = 2000001 t = [0] * n for _ in range(int(input())): q, x = map(int, input().split()) if q == 1: add(x) else: print(pop(x)) <file_sep>/boj17131_sweeping_segment_tree_v2.py import sys input = sys.stdin.readline m = 10**9 + 7 def get(t, i): ans = 0 while i > 0: ans += t[i] i -= i & -i return ans def update(t, i, v): while i < n + 1: t[i] += v i += i & -i n = int(input()) x = [] y = [] for _ in range(n): nx, ny = map(int, input().split()) x.append(nx) y.append(ny) a = [list(map(int, input().split())) for _ in range(n)] a.sort() t = [0] * (n + 1) update(t, 1, 1) b = [[a[0][1], -1]] for i in range(1, n): if a[i][0] == a[i - 1][0]: j = b[-1][1] else: j = -(i + 1) b.append([a[i][1], j]) update(t, -j, 1) b.sort() ans = 0 prev = -3 * 10**5 for i in range(n): if b[i][0] != prev: prev = b[i][0] j = i while j < n and b[j][0] == b[i][0]: update(t, -b[j][1], -1) j += 1 l = get(t, -b[i][1] - 1) r = get(t, n) - get(t, -b[i][1]) ans = (ans + l * r) % m print(ans) <file_sep>/boj2261_min_dist.py import sys r=sys.stdin.readline dist = lambda x,y: (x[0]-y[0])**2 + (x[1]-y[1])**2 def bisect_right(p,x): lo=0 hi=len(p) while lo < hi: mid = (lo+hi)//2 if x < p[mid][0]: hi = mid else: lo = mid + 1 return lo def bisect_left(p,x): lo=0 hi=len(p) while lo < hi: mid = (lo+hi)//2 if p[mid][0] < x: lo = mid+1 else: hi = mid return lo def min_dist(p,a,b): n=b-a if n==2: return dist(p[a],p[a+1]) elif n==3: return min(dist(p[a],p[a+1]),dist(p[a+1],p[a+2]),dist(p[a+2],p[a])) mid=(a+b)//2 ans=min(min_dist(p,a,mid),min_dist(p,mid,b)) if ans==0: return 0 bound=int(ans**0.5) border=p[mid][0] left=bisect_left(p[a:b],border-bound)+a right=bisect_right(p[a:b],border+bound)+a np=right-left if np>=2: ptemp=sorted(p[left:right],key=lambda x:x[1]) for i in range(np): for j in range(i+1,np): if ptemp[j][1]-ptemp[i][1]>bound: break elif ptemp[i][0]<border and ptemp[j][0]<border: continue elif ptemp[i][0]>border and ptemp[j][0]>border: continue d=dist(ptemp[i],ptemp[j]) if d<ans: ans=d return ans n=int(r()) d=[list(map(int,r().split())) for i in range(n)] d.sort() print(min_dist(d,0,len(d))) <file_sep>/boj1167_tree_diameter.py import sys from collections import deque input = sys.stdin.readline def bfs(graph, n_node, start): visited = [0] * (n_node + 1) visited[start] = 1 max_dist = 0 max_node = start Q = deque([(start, 0)]) while Q: node_now, dist_now = Q.popleft() for node_next, dist_next in graph[node_now]: if visited[node_next] == 0: dist_next += dist_now visited[node_next] = 1 Q.append((node_next, dist_next)) if max_dist < dist_next: max_dist = dist_next max_node = node_next return max_node, max_dist def dfs(graph, visited, node_now, dist_now = 0): visited[node_now] = 1 dists = [dist_now] for node_next, dist_next in graph[node_now]: if not visited[node_next]: dist_next += dist_now dists.append(dfs(graph, visited, node_next, dist_next) - dist_now) dists.sort() if len(dists) == 1: return dists[-1] return dists[-1] + dists[-2] def main(): n_node = int(input()) graph = [[] for _ in range(n_node + 1)] for _ in range(n_node): a, *b = map(int, input().split()) for i in range(len(b) // 2): graph[a].append(b[2 * i:2 * i + 2]) #start, _ = bfs(graph, n_node, 1) #_, max_dist = bfs(graph, n_node, start) visited = [0] * (n_node + 1) max_dist = dfs(graph, visited, 1, 0) print(max_dist) if __name__ == "__main__": main() <file_sep>/boj7626_square_segment_tree.py import sys from bisect import bisect_left input = sys.stdin.readline def update_range(i, start, end, left, right, diff): if left > end or right < start: return if left <= start and end <= right: cnt[i] += diff else: mid = (start + end) // 2 update_range(2*i + 1, start, mid, left, right, diff) update_range(2*i + 2, mid + 1, end, left, right, diff) if cnt[i]: t[i] = ys[end + 1] - ys[start] else: if start != end: t[i] = t[2*i + 1] + t[2*i + 2] else: t[i] = 0 n = int(input()) a = [] ys = set() for _ in range(n): x1, x2, y1, y2 = map(int, input().split()) a.append([x1, y1, y2, 1]) a.append([x2, y1, y2, -1]) ys.update({y1, y2}) a.sort() ys = sorted(ys) n_ys = len(ys) - 1 p2 = 1 while p2 < n_ys: p2 <<= 1 M = 2 * p2 - 1 t = [0] * M cnt = [0] * M ans = 0 px = a[0][0] for x, y1, y2, diff in a: ans += (x - px) * t[0] px = x left = bisect_left(ys, y1) right = bisect_left(ys, y2) - 1 update_range(0, 0, n_ys - 1, left, right, diff) print(ans) <file_sep>/boj16975_segment_tree.py import sys from operator import xor input = sys.stdin.readline class SegmentTree(): def __init__(self, arr): self.arr = arr self.n = len(arr) self.t = [0] * (2 * self.n) def query(self, r): idx = r - 1 l = self.n r += self.n ans = 0 while l < r: if l & 1: ans += self.t[l] l += 1 if r & 1: r -= 1 ans += self.t[r] l >>= 1 r >>= 1 return ans + t.arr[idx] def update(self, pos_a, pos_b, val): pos_a += self.n - 1 self.t[pos_a] += val while pos_a > 1: self.t[pos_a >> 1] = self.t[pos_a] + self.t[xor(pos_a, 1)] pos_a >>= 1 pos_b += self.n if pos_b < 2 * self.n: self.t[pos_b] -= val while pos_b > 1: self.t[pos_b >> 1] = self.t[pos_b] + self.t[xor(pos_b, 1)] pos_b >>= 1 n = int(input()) arr = list(map(int, input().split())) t = SegmentTree(arr) for _ in range(int(input())): q, *x = map(int, input().split()) if q == 1: t.update(x[0], x[1], x[2]) else: print(t.query(x[0])) <file_sep>/boj2293_dynamic_programming.py import sys input = sys.stdin.readline n, k = map(int, input().split()) x = [int(input()) for _ in range(n)] dp = [1] + [0] * k for i in x: for j in range(1, k + 1): if j - i >= 0: dp[j] += dp[j - i] print(dp[k]) <file_sep>/boj1766_topological_sort.py import sys from heapq import heappush, heappop input = sys.stdin.readline n, m = map(int, input().split()) graph = [[] for _ in range(n + 1)] degree = [0] * (n + 1) for i in range(m): a, b = map(int, input().split()) graph[a].append(b) degree[b] += 1 queue = [] for i in range(1, n + 1): if degree[i] == 0: heappush(queue, i) ans = [] while queue: i = heappop(queue) ans.append(i) for j in graph[i]: degree[j] -= 1 if degree[j] == 0: heappush(queue, j) print(*ans) <file_sep>/boj13913_bfs_4.py from collections import deque n, k = map(int, input().split()) cnt = [0] * 100001 track = [0] * 100001 q = deque([n]) while q: now = q.popleft() if now == k: break after = [now - 1, now + 1, 2 * now] for i in after: if 0 <= i <= 100000 and cnt[i] == 0: cnt[i] = cnt[now] + 1 track[i] = now q.append(i) # backtracking ans = [k] i = k while i != n: i = track[i] ans.append(i) print(cnt[k]) print(*ans[::-1]) <file_sep>/boj9252_lcs_2.py """BOJ9252: Longest Common Subsequence (LCS) 2""" a, b = input(), input() na, nb = len(a), len(b) f = [[0] * nb for _ in range(na)] arr = [[''] * nb for _ in range(na)] for i in range(na): for j in range(nb): if a[i] == b[j]: if i > 0 and j > 0: arr[i][j] = arr[i - 1][j - 1] + a[i] else: arr[i][j] += a[i] else: if i > 0: if j > 0: if len(arr[i - 1][j]) > len(arr[i][j -1]): arr[i][j] = arr[i - 1][j] else: arr[i][j] = arr[i][j - 1] else: arr[i][j] = arr[i - 1][j] elif j > 0: arr[i][j] = arr[i][j - 1] print(len(arr[-1][-1])) if arr[-1][-1]: print(arr[-1][-1]) <file_sep>/boj2166_polygon_area.py import sys input = sys.stdin.readline area = lambda a, b, c: (a[0] * (b[1] - c[1]) + b[0] * (c[1] - a[1]) + c[0] * (a[1] - b[1])) / 2 n = int(input()) pts = [list(map(int, input().split())) for _ in range(n)] ans = 0 for i in range(2, n): ans += area(pts[0], pts[i-1], pts[i]) print("{:0.1f}".format(abs(ans))) <file_sep>/boj3665_tsort_2.py import sys from collections import deque input = sys.stdin.readline for _ in range(int(input())): n = int(input()) t = list(map(int, input().split())) graph = [set() for _ in range(n + 1)] degree = [0] * (n + 1) degree[t[-1]] = n - 1 for i in range(n - 2, -1, -1): graph[t[i]] = graph[t[i + 1]].copy() graph[t[i]].add(t[i + 1]) degree[t[i]] = i m = int(input()) isfail = False for i in range(m): a, b = map(int, input().split()) if b in graph[a]: graph[a].remove(b) graph[b].add(a) degree[a] += 1 degree[b] -= 1 elif a in graph[b]: graph[a].add(b) graph[b].remove(a) degree[a] -= 1 degree[b] += 1 else: isfail = True queue = deque() isexact = True cnt = [0] * n for i in range(1, n + 1): if degree[i] == 0: queue.append(i) cnt[degree[i]] += 1 if cnt[degree[i]] > 1: isexact = False ans = [] cnt = len(queue) while queue: node = queue.popleft() ans.append(node) for i in graph[node]: degree[i] -= 1 if degree[i] == 0: queue.append(i) cnt += 1 if cnt != n or isfail: print('IMPOSSIBLE') elif not isexact: print('?') else: print(*ans) <file_sep>/boj11280_2_sat_3.py import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline def dfs(i): visited[i] = 0 for j in g[i]: if visited[j]: dfs(j) stack.append(i) def dfs_rev(i): visited[i] = cnt for j in gr[i]: if not visited[j]: dfs_rev(j) # Input n, m = map(int, input().split()) g = [set() for _ in range(2 * n + 1)] gr = [set() for _ in range(2 * n + 1)] for _ in range(m): a, b = map(int, input().split()) g[-a].add(b) g[-b].add(a) gr[b].add(-a) gr[a].add(-b) # Kosaraju's algorithm stack = [] visited = [1] * (2 * n + 1) for i in range(-n, n + 1): if i and visited[i]: dfs(i) cnt = 0 for i in reversed(stack): if not visited[i]: cnt += 1 dfs_rev(i) # Check 2-Satisfiability issatisfiable = 1 for i in range(1, n + 1): if visited[i] == visited[-i]: issatisfiable = 0 break print(issatisfiable) <file_sep>/boj2252_topological_sort.py import sys from collections import deque input = sys.stdin.readline n, m = map(int, input().split()) graph = [[] for _ in range(n + 1)] for _ in range(m): a, b = map(int, input().split()) graph[a].append(b) degree = [0] * (n + 1) for i in range(1, n + 1): for j in graph[i]: degree[j] += 1 queue = deque() for i in range(1, n + 1): if degree[i] == 0: queue.append(i) ans = [] while queue: node = queue.popleft() ans.append(node) for i in graph[node]: degree[i] -= 1 if degree[i] == 0: queue.append(i) print(*ans) <file_sep>/boj4195_union_find_size.py import sys input = sys.stdin.readline def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset = find(name_idx[x]) yset = find(name_idx[y]) if xset != yset: idx[xset] = yset size[yset] += size[xset] print(size[yset]) for _ in range(int(input())): f = int(input()) cnt = 0 idx = list(range(2 * f)) size = [1] * (2 * f) name_idx = {} for _ in range(f): a, b = input().split() if a not in name_idx: name_idx[a] = cnt cnt += 1 if b not in name_idx: name_idx[b] = cnt cnt += 1 union(a, b) <file_sep>/boj17386_line_cross_v2.py import sys input = sys.stdin.readline pts = [] for _ in range(2): a, b, c, d = map(int, input().split()) if a <= c: pts += [(a, b), (c, d)] else: pts += [(c, d), (a, b)] det = lambda pts, i, j, k: (pts[i][0] - pts[j][0]) * (pts[k][1] - pts[j][ 1]) - (pts[i][1] - pts[j][1]) * (pts[k][0] - pts[j][0]) d1 = det(pts, 0, 1, 2) d2 = det(pts, 0, 1, 3) d3 = det(pts, 2, 3, 0) d4 = det(pts, 2, 3, 1) c1 = d1 * d2 < 0 and d3 * d4 < 0 c2 = d1 == 0 and pts[0][0] <= pts[2][0] <= pts[1][0] c3 = d2 == 0 and pts[0][0] <= pts[3][0] <= pts[1][0] if c1 or c2 or c3: print(1) else: print(0) <file_sep>/boj9345_dvd_segment_tree_v2.py import sys from operator import xor input = sys.stdin.readline def build(): for i in reversed(range(1, n)): m[i] = min(m[2 * i], m[2 * i + 1]) M[i] = max(M[2 * i], M[2 * i + 1]) def get(l, r): ans = [10**5, 0] l += n r += n while l < r: if l & 1: ans[0] = min(ans[0], m[l]) ans[1] = max(ans[1], M[l]) l += 1 if r & 1: r -= 1 ans[0] = min(ans[0], m[r]) ans[1] = max(ans[1], M[r]) l >>= 1 r >>= 1 return ans def update(i, v): i += n m[i] = M[i] = v while i > 1: j = xor(i, 1) m[i >> 1] = min(m[i], m[j]) M[i >> 1] = max(M[i], M[j]) i >>= 1 for _ in range(int(input())): n, k = map(int, input().split()) a = list(range(n)) m = [10**5] * n + a M = [0] * n + a build() for _ in range(k): q, a, b = map(int, input().split()) if q: print('YES' if [a, b] == get(a, b + 1) else 'NO') else: va, vb = m[a + n], m[b + n] update(a, vb) update(b, va) <file_sep>/boj10217_dijkstra_constrained.py import sys import heapq input = sys.stdin.readline dist_max = sys.maxsize def dijkstra_constrained(edges, n_node, cost_max): dist = [[dist_max] * (cost_max + 1) for _ in range(n_node + 1)] dist[1][0] = 0 queue = [(0, 0, 1)] while queue: dist_now, cost_now, node_now = heapq.heappop(queue) if node_now == n_node: return dist_now if dist_now > dist[node_now][cost_now]: continue for node_next, cost_next, dist_next in edges[node_now]: cost_next += cost_now dist_next += dist_now if cost_next > cost_max or dist_next >= dist[node_next][cost_next]: continue for c in range(cost_next, cost_max + 1): if dist[node_next][c] > dist_next: dist[node_next][c] = dist_next else: break heapq.heappush(queue, (dist_next, cost_next, node_next)) return -1 for _ in range(int(input())): n_node, cost_max, n_edge = map(int, input().split()) edges = [[] for _ in range(n_node + 1)] for _ in range(n_edge): u, v, c, d = map(int, input().split()) if c > cost_max: continue edges[u].append((v, c, d)) dist = dijkstra_constrained(edges, n_node, cost_max) if dist == -1: print('Poor KCM') else: print(dist) <file_sep>/boj11281_sat_4.py import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline def dfs(i): visited[i] = 1 for j in g[i]: if not visited[j]: dfs(j) stack.append(i) def dfs_rev(i): component[i] = cnt for j in gr[i]: if component[j] == -1: dfs_rev(j) # Input n, m = map(int, input().split()) g = [set() for _ in range(2 * n + 1)] gr = [set() for _ in range(2 * n + 1)] for _ in range(m): a, b = map(int, input().split()) g[-a].add(b) g[-b].add(a) gr[b].add(-a) gr[a].add(-b) # Kosaraju's algorithm stack = [] visited = [0] * (2 * n + 1) for i in range(-n, n + 1): if i and not visited[i]: dfs(i) cnt = 0 component = [-1] * (2 * n + 1) for i in reversed(stack): if component[i] == -1: dfs_rev(i) cnt += 1 # Check 2-Satisfiability issatisfiable = 1 assignment = [0] * (n + 1) for i in range(1, n + 1): if component[i] == component[-i]: issatisfiable = 0 break assignment[i] = int(component[i] > component[-i]) print(issatisfiable) if issatisfiable: print(*assignment[1:]) <file_sep>/boj2162_line_groups.py import sys from collections import deque input = sys.stdin.readline def dets(i, j): a = pts[i][0] - pts[i][2] b = pts[i][1] - pts[i][3] c = pts[j][0] - pts[i][2] d = pts[j][1] - pts[i][3] e = pts[j][2] - pts[i][2] f = pts[j][3] - pts[i][3] return ((a * d - b * c), (a * f - b * e)) def inrange(i, j): if pts[i][0] <= pts[i][2]: xmin, xmax = pts[i][0], pts[i][2] else: xmin, xmax = pts[i][2], pts[i][0] if pts[i][1] <= pts[i][3]: ymin, ymax = pts[i][1], pts[i][3] else: ymin, ymax = pts[i][3], pts[i][1] inr1 = xmin <= pts[j][0] <= xmax and ymin <= pts[j][1] <= ymax inr2 = xmin <= pts[j][2] <= xmax and ymin <= pts[j][3] <= ymax return inr1, inr2 def cross(i, j): d1, d2 = dets(i, j) d3, d4 = dets(j, i) if d1 * d2 < 0 and d3 * d4 < 0: return True inr1, inr2 = inrange(i, j) inr3, inr4 = inrange(j, i) if d1 == 0 and inr1: return True if d2 == 0 and inr2: return True if d3 == 0 and inr3: return True if d4 == 0 and inr4: return True return False def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i def union(x, y): xset, yset = find(x), find(y) idx[xset] = yset n = int(input()) pts = [list(map(int, input().split())) for _ in range(n)] idx = list(range(n)) for i in range(n): for j in range(i): if cross(i, j): union(i, j) ans = {} for i in range(n): temp = find(i) if temp not in ans: ans[temp] = 1 else: ans[temp] += 1 print(len(ans)) print(max(ans.values())) <file_sep>/boj17472_kruskal_bridge.py import sys from heapq import heappush, heappop from collections import deque input = sys.stdin.readline move = [[0, 1], [1, 0], [0, -1], [-1, 0]] def bfs(i, j): visited[i][j] = 1 points = [(i, j)] Q = deque([(i, j)]) while Q: x, y = Q.popleft() for nx, ny in move: nx += x ny += y if 0 <= nx < n and 0 <= ny < m and arr[nx][ ny] and not visited[nx][ny]: points.append((nx, ny)) visited[nx][ny] = 1 Q.append((nx, ny)) return points def dist(x, y): ans = 10 for a, b in group[x]: for c, d in group[y]: if a == c: if b > d: s, e = d, b else: s, e = b, d diff = e - s - 1 if diff > 1 and diff < ans: noland = True for i in range(s + 1, e): if arr[a][i]: noland = False break if noland: ans = diff elif b == d: if a > c: s, e = c, a else: s, e = a, c diff = e - s - 1 if diff > 1 and diff < ans: noland = True for i in range(s + 1, e): if arr[i][b]: noland = False break if noland: ans = diff if ans == 10: return 0 else: return ans def kruskal(graph, n_node): def find(i): while i != idx[i]: idx[i] = idx[idx[i]] i = idx[i] return i idx = list(range(n_node)) cnt = 0 ans = 0 while graph: d, x, y = heappop(graph) xset, yset = find(x), find(y) if xset != yset: idx[xset] = yset cnt += 1 ans += d if cnt == n_node - 1: return ans else: return -1 # input n, m = map(int, input().split()) arr = [list(map(int, input().split())) for _ in range(n)] # check lands visited = [[0] * m for _ in range(n)] group = [] cnt = 0 for i in range(n): for j in range(m): if arr[i][j] and not visited[i][j]: group.append(bfs(i, j)) cnt += 1 # check distance between lands graph = [] n_group = len(group) for i in range(n_group): for j in range(i): d = dist(i, j) if d: heappush(graph, (d, i, j)) # kruskal algorithm print(kruskal(graph, n_group)) <file_sep>/boj1991_tree_v1.py def transversal(tree, mode, node=0): idx = tree[node] l_idx, r_idx = 2 * idx + 1, 2 * idx + 2 d = [node_name[node]] l = transversal(tree, mode, tree.index(l_idx)) if l_idx in tree else [] r = transversal(tree, mode, tree.index(r_idx)) if r_idx in tree else [] if mode == 0: ans = d + l + r elif mode == 1: ans = l + d + r else: ans = l + r + d return ans n_node = int(input()) node_name = list(map(chr, range(65, 65 + n_node))) tree = [0] * n_node for i in range(n_node): d, l, r = map(ord, input().split()) parent_idx = tree[d - 65] if l > 64: tree[l - 65] = 2 * parent_idx + 1 if r > 64: tree[r - 65] = 2 * parent_idx + 2 print(*transversal(tree, 0), sep='') print(*transversal(tree, 1), sep='') print(*transversal(tree, 2), sep='') <file_sep>/boj11012_fenwick_tree.py import sys from bisect import bisect_left input = sys.stdin.readline def add(t, i): while i < n_y + 1: t[i] += 1 i += i & -i def get(t, i): ans = 0 while i > 0: ans += t[i] i -= i & -i return ans for _ in range(int(input())): n, m = map(int, input().split()) xs, ys = set(), set() pts = [] for _ in range(n): x, y = map(int, input().split()) pts.append([x, y]) xs.add(x) ys.add(y) pts.sort() xs = sorted(xs) ys = sorted(ys) n_x = len(xs) n_y = len(ys) t = [0] * (n_y + 1) ts = [] px = pts[0][0] for x, y in pts: if px != x: ts.append(t.copy()) idx = bisect_left(ys, y) + 1 add(t, idx) px = x ts.append(t.copy()) ans = 0 for _ in range(m): l, r, b, t = map(int, input().split()) il = bisect_left(xs, l) - 1 ir = min(bisect_left(xs, r), n_x - 1) ib = bisect_left(ys, b) it = min(bisect_left(ys, t) + 1, n_y) ans += get(ts[ir], it) - get(ts[ir], ib) if il >= 0: ans -= get(ts[il], it) - get(ts[il], ib) print(ans) <file_sep>/boj1657_dp_bitmask.py import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline def solve(i, state): print(i, state) if i >= n * m: return 0 if dp[i][state] == -1: if state & 1: dp[i][state] = solve(i + 1, state >> 1) else: # pass dp[i][state] = solve(i + 1, state >> 1) # vertical if i // m < n - 1: dp[i][state] = max( dp[i][state], solve(i + 1, (state >> 1) | (1 << m - 1)) + price[grade[i] - 65][grade[i + m] - 65]) # horizontal if i % m < m - 1 and not state >> 1 & 1: dp[i][state] = max( dp[i][state], solve(i + 2, state >> 2) + price[grade[i] - 65][grade[i + 1] - 65]) return dp[i][state] price = [[10, 8, 7, 5, 0, 1], [8, 6, 4, 3, 0, 1], [7, 4, 3, 2, 0, 1], [5, 3, 2, 2, 0, 1], [0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 0, 0]] n, m = map(int, input().split()) grade = [] for _ in range(n): grade.extend(list(map(ord, input().rstrip()))) dp = [[-1] * (1 << m) for _ in range(n * m)] print(solve(0, 0)) <file_sep>/boj5419_sweeping_segment_tree.py import sys input = sys.stdin.readline def get(t, i): ans = 0 while i > 0: ans += t[i] i -= i & -i return ans def update(t, i, v): while i < n + 1: t[i] += v i += i & -i for _ in range(int(input())): n = int(input()) a = [list(map(int, input().split())) for _ in range(n)] a.sort(key=lambda i: i[1]) t = [0] * (n + 1) update(t, 1, 1) b = [[a[0][0], -1]] for i in range(1, n): if a[i][1] == a[i - 1][1]: j = b[-1][1] else: j = -(i + 1) b.append([a[i][0], j]) update(t, -j, 1) b.sort() ans = 0 for _, i in b: ans += get(t, -i) - 1 update(t, -i, -1) print(ans) <file_sep>/boj14725_trie.py import sys input = sys.stdin.readline def print_trie(trie, step=0): for i, v in sorted(trie.items()): print('--' * step, i, sep='') if v: print_trie(v, step + 1) trie = {} for _ in range(int(input())): k, *x = input().split() node = trie for i in range(int(k)): if x[i] not in node: node[x[i]] = {} node = node[x[i]] print_trie(trie) <file_sep>/boj2494_dp_rotate.py import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline max_n = 10**5 def solve(i, t): if i == n: return 0 if dp[i][t] == max_n: c = (x[i] + t) % 10 l = (y[i] - c) % 10 r = (c - y[i]) % 10 ans_l = l + solve(i + 1, (t + l) % 10) ans_r = r + solve(i + 1, t) dp[i][t] = min(ans_l, ans_r) return dp[i][t] def backtracking(): t = 0 for i in range(n): c = (x[i] + t) % 10 l = (y[i] - c) % 10 r = (c - y[i]) % 10 if i < n - 1: ans_l = l + dp[i + 1][(t + l) % 10] ans_r = r + dp[i + 1][t] else: ans_l = l ans_r = r if ans_l < ans_r: print(i + 1, l) t = (t + l) % 10 else: print(i + 1, -r) n = int(input()) x = list(map(int, input().rstrip())) y = list(map(int, input().rstrip())) dp = [[max_n] * 10 for _ in range(n)] solve(0, 0) print(dp[0][0]) backtracking() <file_sep>/boj11780_floyd_warshall_2.py import sys input = sys.stdin.readline max_dist = 10**7 def floyd_warshall(edges, track, n_node): for m in range(1, n_node + 1): for s in range(1, n_node + 1): for e in range(1, n_node + 1): if edges[s][e] > edges[s][m] + edges[m][e]: edges[s][e] = edges[s][m] + edges[m][e] track[s][e] = m def tracking(track, s, e): if s == e: return [] m = track[s][e] if m == 0: return [s, e] return tracking(track, s, m)[:-1] + tracking(track, m, e) n_node, n_edge = int(input()), int(input()) edges = [[max_dist] * (n_node + 1) for _ in range(n_node + 1)] track = [[0] * (n_node + 1) for _ in range(n_node + 1)] for i in range(1, n_node + 1): edges[i][i] = 0 for _ in range(n_edge): a, b, c = map(int, input().split()) if edges[a][b] > c: edges[a][b] = c floyd_warshall(edges, track, n_node) for s in edges[1:]: s = [i if i < max_dist else 0 for i in s[1:]] print(*s) for i in range(1, n_node + 1): for j in range(1, n_node + 1): if edges[i][j] < max_dist: ans = tracking(track, i, j) print(len(ans), *ans) else: print(0) <file_sep>/boj17386_cross_line.py import sys input = sys.stdin.readline x1, y1, x2, y2 = map(int, input().split()) x3, y3, x4, y4 = map(int, input().split()) a = x1 - x2 b = -(x3 - x4) c = y1 - y2 d = -(y3 - y4) e = x4 - x2 f = y4 - y2 det = a * d - b * c if det == 0: print(0) else: k = (d * e - b * f) / det l = (a * f - c * e) / det if 0 <= k <= 1 and 0 <= l <= 1: print(1) else: print(0) <file_sep>/boj5977_mowing_the_lawn.py import sys from collections import deque input = sys.stdin.readline n, k = map(int, input().split()) q = deque([0]) total = 0 a = [0] * (n + 1) for i in range(1, n + 1): x = int(input()) a[i] = x total += x while q and i - q[0] > k + 1: q.popleft() if q: a[i] = a[q[0]] + x while q and a[i] <= a[q[-1]]: q.pop() q.append(i) print(total - min(a[n-k:])) <file_sep>/boj12899_data_structure_v2.py import sys input = sys.stdin.readline n = 2 ** ((2000000).bit_length()) tree = [0] * (2 * n) def add(node, val=1): node += n while node > 0: tree[node] += val node >>= 1 def pop(value): node = 1 while node < n: if value > tree[node * 2]: value -= tree[node * 2] node = node * 2 + 1 else: node = node * 2 node -= n add(node, -1) return node + 1 for _ in range(int(input())): t, x = map(int, input().split()) if t == 1: add(x - 1) else: print(pop(x)) <file_sep>/boj2357_min_max_segment_tree_v2.py import sys input = sys.stdin.readline def build(): for i in reversed(range(1, n)): tm[i] = min(tm[2 * i], tm[2 * i + 1]) tM[i] = max(tM[2 * i], tM[2 * i + 1]) def get(i, j): ans = [10**9, 0] i += n j += n while i < j: if i & 1: ans[0] = min(ans[0], tm[i]) ans[1] = max(ans[1], tM[i]) i += 1 if j & 1: j -= 1 ans[0] = min(ans[0], tm[j]) ans[1] = max(ans[1], tM[j]) i >>= 1 j >>= 1 return ans n, m = map(int, input().split()) arr = [int(input()) for _ in range(n)] tm = [10**9] * n + arr tM = [0] * n + arr build() for _ in range(m): a, b = map(int, input().split()) print(*get(a - 1, b)) <file_sep>/boj17131_sweeping_segment_tree.py import sys input = sys.stdin.readline m = 10**9 + 7 def get(t, i): ans = 0 while i > 0: ans += t[i] i -= i & -i return ans def update(t, i, v): while i < m + 1: t[i] += v i += i & -i # input n = int(input()) d = [] x = [] for _ in range(n): nx, ny = map(int, input().split()) d.append([ny, nx]) x.append(nx) # build idx = {x: i + 1 for i, x in enumerate(sorted(set(x)))} ni = len(idx) t = [0] * (ni + 1) for i in x: update(t, idx[i], 1) # main d.sort() ans = 0 prev = -3 * 10**5 for i in range(n): if d[i][0] != prev: prev = d[i][0] j = i while j < n and d[j][0] == d[i][0]: update(t, idx[d[j][1]], -1) j += 1 l = get(t, idx[d[i][1]] - 1) r = get(t, ni) - get(t, idx[d[i][1]]) ans = (ans + l * r) % m print(ans) <file_sep>/boj9205_floyd_warshall.py import sys r = sys.stdin.readline isconnected = lambda i, j: abs(p[i][0] - p[j][0]) + abs(p[i][1] - p[j][1]) <= 1000 for _ in range(int(r())): n = int(r()) p = [list(map(int, r().split())) for _ in range(n + 2)] connected = [[0] * (n + 2) for _ in range(n + 2)] for i in range(n + 2): for j in range(i + 1, n + 2): if isconnected(i, j): connected[i][j] = connected[j][i] = 1 for m in range(n + 2): for s in range(n + 2): for e in range(n + 2): if connected[s][m] and connected[m][e]: connected[s][e] = 1 print('happy' if connected[0][-1] else 'sad') <file_sep>/boj2178_bfs.py import sys from collections import deque input = sys.stdin.readline dx, dy = [-1, 1, 0, 0], [0, 0, -1, 1] def bfs(arr, cnt): n, m = len(arr), len(arr[0]) arr[0][0] = 0 cnt[0][0] = 1 cue = deque([(0, 0)]) while cue: x, y = cue.popleft() for ix, iy in zip(dx, dy): nx = x + ix ny = y + iy if 0 <= nx < n and 0 <= ny < m and arr[nx][ny]: arr[nx][ny] = 0 cnt[nx][ny] = cnt[x][y] + 1 cue.append((nx, ny)) n, m = map(int, input().split()) arr = [list(map(int, list(input().rstrip()))) for _ in range(n)] cnt = [[0] * m for _ in range(n)] bfs(arr, cnt) print(cnt[-1][-1]) <file_sep>/boj10026_bfs.py import sys from collections import deque r = sys.stdin.readline direction = [[-1, 0], [1, 0], [0, -1], [0, 1]] def bfs(i, j, blind): t = d[i][j] visited[i][j] = 1 q = deque([(i, j)]) while q: i, j = q.popleft() for k, l in direction: k += i l += j if 0 <= k < n and 0 <= l < n and not visited[k][l]: if blind: if (t != 'B' and d[k][l] != 'B') or (t == 'B' and d[k][l] == 'B'): visited[k][l] = 1 q.append((k, l)) elif d[k][l] == t: visited[k][l] = 1 q.append((k, l)) n = int(r()) d = [r().rstrip() for _ in range(n)] cnt = 0 visited = [[0] * n for _ in range(n)] for i in range(n): for j in range(n): if not visited[i][j]: cnt += 1 bfs(i, j, False) cnt_blind = 0 visited = [[0] * n for _ in range(n)] for i in range(n): for j in range(n): if not visited[i][j]: cnt_blind += 1 bfs(i, j, True) print(cnt, cnt_blind)
d74ec030bf38db5fdaa594280784ad1cab999690
[ "Python", "C++" ]
126
Python
lapis42/boj
4f225f397b9ff919cfda26772036aff7d9637d07
36c4964ebbd3f2f60282fa7942cad3fa386f3823
refs/heads/master
<file_sep>[shrub and rdm 2014.csv] Col7=Canopy Double [Scat and RDM 2013-2014.csv] Col7=Canopy Double <file_sep># Shrub_Density_Carrizo A set of shrub densities for sites 3 &amp; 4 at Carrizo National Monument <file_sep>[site3_50m.csv] Format=CSVDelimited ColNameHeader=True Col1=FID Long Col2=Slope Single Col3=Elevat Long Col4=ShrubCov Single Col5=x_utm Double Col6=y_utm Double [site3_30m.csv] Format=CSVDelimited ColNameHeader=True Col1=FID Long Col2=Slope Single Col3=Elevat Long Col4=ShrubCov Single Col5=x_utm Double Col6=y_utm Double [site3_40m.csv] Format=CSVDelimited ColNameHeader=True Col1=FID Long Col2=Slope Single Col3=Elevat Long Col4=ShrubCov Single Col5=x_utm Double Col6=y_utm Double [site4_30.csv] Format=CSVDelimited ColNameHeader=True Col1=FID Long Col2=Elevat Long Col3=Slope Single Col4=ShrubCov Single Col5=x_wgs Double Col6=y_wgs Double [site4_40m.csv] Format=CSVDelimited ColNameHeader=True Col1=FID Long Col2=Elevat Long Col3=Slope Single Col4=ShrubCov Single Col5=x_wgs Double Col6=y_wgs Double [site4_50m.csv] Format=CSVDelimited ColNameHeader=True Col1=FID Long Col2=Elevat Long Col3=Slope Single Col4=ShrubCov Single Col5=x_wgs Double Col6=y_wgs Double <file_sep>library(dplyr) data <- read.csv("data/Panoche/truthing.csv") cor.test(data$Count_, data$Shrub_Cov) <file_sep>--- title: "New Shrub density" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(tidyr) library(ggplot2) library(dplyr) library(leaflet) library(markdown) library(knitr) ``` ```{r} site3_20m <- read.csv("site3_20m.csv") site3_30m <- read.csv("site3_30m.csv") site3_40m <- read.csv("site3_40m.csv") site3_50m <- read.csv("site3_50m.csv") site4_20m <- read.csv("site4_20m.csv") site4_30m <- read.csv("site4_30m.csv") site4_40m <- read.csv("site4_40m.csv") site4_50m <- read.csv("site4_50m.csv") ``` ```{r} shrub3_20m_box <- ggplot(data = site3_20m, aes(x = FID, y = shrub_cov)) + geom_boxplot() + labs(title = "site 3 20m") shrub3_30m_box <- ggplot(data = site3_30m, aes(x = FID, y = ShrubCov)) + geom_boxplot() + labs(title = "site 3 30m") shrub3_40m_box <- ggplot(data = site3_40m, aes(x = FID, y = ShrubCov)) + geom_boxplot() + labs(title = "site 3 40m") shrub3_50m_box <- ggplot(data = site3_50m, aes(x = FID, y = ShrubCov)) + geom_boxplot() + labs(title = "site 3 50m") ``` ```{r} shrub3_20m_box shrub3_30m_box shrub3_40m_box shrub3_50m_box ``` ```{r} shrub4_20m_box <- ggplot(data = site4_20m, aes(x = FID, y = shrub_cov)) + geom_boxplot() + labs(title = "site 4 20m") shrub4_30m_box <- ggplot(data = site4_30m, aes(x = FID, y = ShrubCov)) + geom_boxplot() + labs(title = "site 4 30m") shrub4_40m_box <- ggplot(data = site4_40m, aes(x = FID, y = ShrubCov)) + geom_boxplot() + labs(title = "site 4 40m") shrub4_50m_box <- ggplot(data = site4_50m, aes(x = FID, y = ShrubCov)) + geom_boxplot() + labs(title = "site 4 50m") ``` ```{r} shrub4_20m_box shrub4_30m_box shrub4_40m_box shrub4_50m_box ``` ```{r} mean(site3_20m$shrub_cov) mean(site3_30m$ShrubCov) mean(site3_40m$ShrubCov) mean(site3_50m$ShrubCov) ``` ```{r} mean(site4_20m$shrub_cov) mean(site4_30m$ShrubCov) mean(site4_40m$ShrubCov) mean(site4_50m$ShrubCov) ```
4e3ffe8914b14b5dafdbc0dfcd810840be6a920f
[ "Markdown", "R", "RMarkdown", "INI" ]
5
INI
MarioZuliani/Shrub-Density
27a6520a2b98d1b5f3744c7be07c257f9b855653
a61c360024c11f46bb830d4015a7eae0ff5bef7d
refs/heads/master
<repo_name>x-falcon/liteos_18e_1<file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/halt.c #include "halt.h" #include "boardconfig.h" /****************************************************************** *函数名称:InitEnterHaltMode * *功能描述:进入低功耗模式前的配置 * para: void *******************************************************************/ void InitEnterHaltMode(void) { /*关闭中断*/ disableInterrupts(); #if 0 /*将开关机管脚设为中断模式*/ GPIO_Init(SW_KEY_GPIO,SW_KEY_GPIO_Pin,GPIO_Mode_In_PU_IT); /*然后配置中断1为下降沿低电平触发*/ EXTI_SetPinSensitivity(EXTI_Pin_1, EXTI_Trigger_Falling); /*设置中断的优先级*/ ITC_SetSoftwarePriority(EXTI1_IRQn, ITC_PriorityLevel_1); #endif GPIO_Init(D2H_WAK_GPIO,D2H_WAK_GPIO_Pin,GPIO_Mode_In_FL_IT); /*然后配置中断1为下降沿低电平触发*/ EXTI_SetPinSensitivity(EXTI_Pin_0, EXTI_Trigger_Rising); /*设置中断的优先级*/ ITC_SetSoftwarePriority(EXTI0_IRQn, ITC_PriorityLevel_1); /*关闭定时器中断*/ TIM3_DeInit(); /*关闭串口*/ GPIO_Init(USART_RX_GPIO,USART_RX_GPIO_Pin,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(USART_TX_GPIO,USART_TX_GPIO_Pin,GPIO_Mode_Out_PP_Low_Slow); GPIO_ResetBits(USART_TX_GPIO, USART_TX_GPIO_Pin); GPIO_ResetBits(USART_RX_GPIO, USART_RX_GPIO_Pin); USART_Cmd(USART1,DISABLE); USART_DeInit(USART1); /*关闭ADC采样*/ ADC_Deinit_adc0(); /*若需开启PIR中断唤醒,则设置PIR为中断模式*/ extern u8 g_Wifi_Reg_Det_Flag; if(g_Wifi_Reg_Det_Flag==0) { GPIO_Init(PIR_GPIO, PIR_GPIO_Pin, GPIO_Mode_In_FL_IT); } else { GPIO_Init(PIR_GPIO, PIR_GPIO_Pin, GPIO_Mode_Out_OD_HiZ_Slow); } /*开启中断*/ enableInterrupts(); } /****************************************************************** *函数名称:InitExitHaltMode * *功能描述:退出低功耗模式相关配置 * para: void *******************************************************************/ void InitExitHaltMode(void) { disableInterrupts(); GPIO_Init(PIR_GPIO,PIR_GPIO_Pin,GPIO_Mode_In_FL_No_IT); TIM3_Config(); ADC_Init_adc0(); Usart_Config(); enableInterrupts(); } /****************************************************************** *函数名称:GPIO_init * *功能描述:GPIO初始化 * para: void *******************************************************************/ void GPIO_init(void) { GPIO_DeInit(GPIOA); GPIO_DeInit(GPIOB); GPIO_DeInit(GPIOC); GPIO_DeInit(GPIOD); /* Port A in output push-pull 0 */ GPIO_Init(GPIOA,GPIO_Pin_All,GPIO_Mode_Out_PP_Low_Slow); /* Port B in output push-pull 0 */ GPIO_Init(GPIOB, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port C in output push-pull 0 */ GPIO_Init(GPIOC,GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port D in output push-pull 0 */ GPIO_Init(GPIOD,GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); } /********************************************************************** * 函数名称: ALL_PWR_ON * 功能描述:给所有功能器件上电,包括主控和wifi * para: void ***********************************************************************/ void ALL_PWR_ON(void) { GPIO_SetBits(PWR_EN_GPIO, PWR_EN_GPIO_Pin); //MDelay(10); GPIO_SetBits(PWR_HOLD_GPIO, PWR_HOLD_GPIO_Pin); g_IsSystemOn = 1; } /********************************************************************** * 函数名称: ALL_PWR_OFF * 功能描述:主控和wifi切断电源,只保留MCU低功耗, 进入高节能低功耗模式 * para: void ***********************************************************************/ void ALL_PWR_OFF(void) { GPIO_ResetBits(PWR_HOLD_GPIO, PWR_HOLD_GPIO_Pin); g_IsSystemOn = 0; } /****************************************************************** *函数名称:BAR_Detect * *功能描述:待机状态下电池电量过低关闭WIFI供电进入深入待机 * para: void *******************************************************************/ void BAR_Detect(void) { u8 key_val = 0; /*WIFI待机中电池电量低 检测*/ key_val = GPIO_ReadInputDataBit(BAT_LOW_DET_GPIO, BAT_LOW_DET_GPIO_Pin); //检测到为低 if(g_Bar_Det_Flag||(!key_val)) { ALL_PWR_OFF(); g_Bar_Det_Flag=0; } } /****************************************************************** *函数名称:Change_Mode * *功能描述:正常模式和低功耗模式切换 * para: void *******************************************************************/ void Change_Mode(void) { /*当检测到电池电量< 3v进入深度待机*/ //BAR_Detect(); /* normal mode enter halt mode*/ /*延时开机用,持续按键时不使MCU进入低功耗 */ if(!g_Wifi_WakeUp) { if(g_IsSystemOn==0) { /*按键无持续按下或无按键按下*/ if(!g_WakeUp_Key_Flag) { /*配置相关IO模式*/ InitEnterHaltMode(); /*进入低功耗模式*/ Halt_Mode(); } } } // halt mode enter normal mode /*按键中断*/ if(g_WakeUp_Halt_Flag||g_Vbus_Check) { /*确保是关机状态下退出halt模式*/ if(g_IsSystemOn==0) { /*退出低功耗的相关配置*/ InitExitHaltMode(); /*按键唤醒*/ g_WakeUp_Halt_Flag=0; /*检测是否持续按下按键标识*/ g_WakeUp_Key_Flag = 10; } } } /****************************************************************** *函数名称:Halt_Mode * *功能描述:低功耗模式接口 * para: void *******************************************************************/ void Halt_Mode(void) { /*ENTER ACTIVE HALT CLOSE the main voltage regulator is powered off*/ CLK->ICKCR|=CLK_ICKCR_SAHALT; /* Set STM8 in low power */ PWR->CSR2 = 0x2; /* low power fast wake up disable*/ PWR_FastWakeUpCmd(DISABLE); CLK_RTCClockConfig(CLK_RTCCLKSource_Off, CLK_RTCCLKDiv_1); CLK_PeripheralClockConfig(CLK_Peripheral_RTC, DISABLE); CLK_LSICmd(DISABLE); while ((CLK->ICKCR & 0x04) != 0x00); CLK_PeripheralClockConfig(CLK_Peripheral_TIM1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM4, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM5, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_I2C1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_SPI1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART3, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_BEEP, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_DAC, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_LCD, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_DMA1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_BOOTROM, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_COMP, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_AES, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_SPI2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_CSSLSE, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM3, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART1, DISABLE); enableInterrupts(); halt(); //system go to halt mode; } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/halt.h #ifndef __HALT_H_ #define __HALT_H_ void InitExitHaltMode(void); void InitEnterHaltMode(void); void Change_Mode(void); void Halt_Mode(void); void GPIO_init(void); #endif<file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/HuaweiLite/app_init.c /****************************************************************************** Some simple Hisilicon Hi35xx system functions. Copyright (C), 2010-2015, Hisilicon Tech. Co., Ltd. ****************************************************************************** Modification: 2015-6 Created ******************************************************************************/ #include "sys/types.h" #include "sys/time.h" #include "unistd.h" #include "stdio.h" #include "shell.h" #include "hisoc/uart.h" #include "linux/fb.h" extern int mem_dev_register(void); extern void hisi_eth_init(void); //extern void tools_cmd_register(void); extern int spi_dev_init(void); extern int i2c_dev_init(void); extern int gpio_dev_init(void); extern int dmac_init(void); extern int ran_dev_register(void); extern UINT32 osShellInit(char *); extern void CatLogShell(); extern void proc_fs_init(void); extern int uart_dev_init(void); extern int system_console_init(const char *); extern int nand_init(void); extern int add_mtd_partition( char *, UINT32 , UINT32 , UINT32 ); extern int spinor_init(void); extern void SDK_init(void); extern int app_main(int argc, char* argv[]); #define ARGS_SIZE_T 20 #define ARG_BUF_LEN_T 256 static char *ptask_args[ARGS_SIZE_T]; static char *args_buf_t = NULL; static int taskid = -1; struct netif* pnetif; void com_app(unsigned int p0, unsigned int p1, unsigned int p2, unsigned int p3) { int i = 0; unsigned int argc = p0; char **argv = (char **)p1; dprintf("\ninput command:\n"); for(i=0; i<argc; i++) { dprintf("%s ", argv[i]); } dprintf("\n"); app_main(argc,argv); dprintf("\nmain out\n"); dprintf("[END]:app_test finish!\n"); free(args_buf_t); args_buf_t = NULL; taskid = -1; } void app_sample(int argc, char **argv ) { int i = 0, ret = 0; int len = 0; char *pch = NULL; TSK_INIT_PARAM_S stappTask; if(argc < 1) { dprintf("illegal parameter!\n"); } if (taskid != -1) { dprintf("There's a app_main task existed."); } args_buf_t = zalloc(ARG_BUF_LEN_T); memset(&stappTask, 0, sizeof(TSK_INIT_PARAM_S)); pch = args_buf_t; for(i=0; i<ARGS_SIZE_T; i++) { ptask_args[i] = NULL; } argc++; ptask_args[0] = "sample"; for(i = 1; i < argc; i++) { len = strlen(argv[i-1]); memcpy(pch , argv[i-1], len); ptask_args[i] = pch; //keep a '\0' at the end of a string. pch = pch + len + 1; if (pch >= args_buf_t +ARG_BUF_LEN_T) { dprintf("args out of range!\n"); break; } } memset(&stappTask, 0, sizeof(TSK_INIT_PARAM_S)); stappTask.pfnTaskEntry = (TSK_ENTRY_FUNC)com_app; stappTask.uwStackSize = 0x10000; stappTask.pcName = "sample"; stappTask.usTaskPrio = 10; stappTask.uwResved = LOS_TASK_STATUS_DETACHED; stappTask.auwArgs[0] = argc; stappTask.auwArgs[1] = (UINT32)ptask_args; ret = LOS_TaskCreate((UINT32 *)&taskid, &stappTask); if (LOS_OK != ret) { dprintf("LOS_TaskCreate err, ret:%d\n", ret); } else { dprintf("camera_Task %d\n", taskid); } chdir("/nfs"); } void sample_command(void) { osCmdReg(CMD_TYPE_EX, "sample", 0, (CMD_CBK_FUNC)app_sample); } void app_init(void) { extern int SD_MMC_Host_init(void); extern UINT32 usb_init(void); extern int spinor_init(void); dprintf("os vfs init ...\n"); proc_fs_init(); mem_dev_register(); dprintf("uart init ...\n"); uart_dev_init(); dprintf("shell init ...\n"); system_console_init(TTY_DEVICE); osShellInit(TTY_DEVICE); dprintf("spi nor flash init ...\n"); if(!spinor_init()){ add_mtd_partition("spinor", 0x100000, 2*0x100000, 0); add_mtd_partition("spinor", 3*0x100000, 2*0x100000, 1); mount("/dev/spinorblk0", "/jffs0", "jffs", 0, NULL); } dprintf("g_sys_mem_addr_end=0x%08x,\n",g_sys_mem_addr_end); dprintf("done init!\n"); dprintf("Date:%s.\n", __DATE__); dprintf("Time:%s.\n", __TIME__); SDK_init(); sample_command(); return; } /* EOF kthread1.c */ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/drv/sdio_hi1131sv100/Makefile include $(LITEOSTOPDIR)/config.mk ARFLAGS = cr LIBOUT = $(ROOTOUT)/obj/$(WIFI_DEVICE) RM = -rm -rf hisi_driver_subdir = data_backup_lib driver hisi_app all: $(LIBOUT) hisi_driver hisi_driver: for dir in $(hisi_driver_subdir); \ do $(MAKE) -C $$dir all || exit 1; \ done $(LIBOUT): mkdir -p $(LIBOUT) clean: for dir in $(hisi_driver_subdir); \ do $(MAKE) -C $$dir clean || exit 1;\ done @$(RM) $(LIBOUT) *.bak *~ .PHONY: all clean <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/hash/drv_hash.h /********************************************************************************* * * Copyright (C) 2014 Hisilicon Technologies Co., Ltd. All rights reserved. * * This program is confidential and proprietary to Hisilicon Technologies Co., Ltd. * (Hisilicon), and may not be copied, reproduced, modified, disclosed to * others, published or used, in whole or in part, without the express prior * written permission of Hisilicon. * ***********************************************************************************/ #ifndef __DRV_CIPHER_SHA__ #define __DRV_CIPHER_SHA__ #ifdef __cplusplus extern "C" { #endif #ifdef CIPHER_HASH_SUPPORT HI_VOID HASH_DRV_ModInit(HI_VOID); HI_VOID HASH_DRV_ModDeInit(HI_VOID); HI_S32 HAL_Cipher_CalcHashInit(CIPHER_HASH_DATA_S *pCipherHashData); HI_S32 HAL_Cipher_CalcHashUpdate(CIPHER_HASH_DATA_S *pCipherHashData); HI_S32 HAL_Cipher_CalcHashFinal(CIPHER_HASH_DATA_S *pCipherHashData); HI_S32 HAL_Cipher_HashSoftReset(HI_VOID); #endif #ifdef __cplusplus } #endif #endif /* sha2.h */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/init/HuaweiLite/cipher_init.c #include <linux/module.h> #include <linux/kernel.h> #include "hi_type.h" extern int CIPHER_DRV_ModInit(void); extern void CIPHER_DRV_ModExit(void); int cipher_mod_init(void) { return CIPHER_DRV_ModInit(); } void cipher_mod_exit(void) { CIPHER_DRV_ModExit(); } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/sample_cipher_efuse.c /****************************************************************************** Copyright (C), 2011-2021, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : sample_rng.c Version : Initial Draft Author : Hisilicon Created : 2012/07/10 Last Modified : Description : sample for cipher Function List : History : ******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <assert.h> #include "hi_type.h" #include "hi_unf_cipher.h" #include "hi_mmz_api.h" #include "config.h" #define HI_ERR_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #define HI_INFO_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #ifdef CIPHER_EFUSE_SUPPORT //#ifdef CIPHER_KLAD_SUPPORT static HI_U8 aes_128_cbc_key[16] = {<KEY>}; //static HI_U8 aes_128_enc_key[16] = {<KEY>}; //#endif static HI_U8 aes_128_cbc_IV[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}; static HI_U8 aes_128_src_buf[16] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A}; static HI_U8 aes_128_dst_buf[16] = {0xb0,0x1b,0x77,0x09,0xe8,0xdc,0xf9,0xef,0x37,0x13,0x0b,0x13,0xda,0x11,0xbf,0x24}; static HI_S32 printBuffer(HI_CHAR *string, HI_U8 *pu8Input, HI_U32 u32Length) { HI_U32 i = 0; if ( NULL != string ) { printf("%s\n", string); } for ( i = 0 ; i < u32Length; i++ ) { if( (i % 16 == 0) && (i != 0)) printf("\n"); printf("0x%02x ", pu8Input[i]); } printf("\n"); return HI_SUCCESS; } static HI_S32 Setconfiginfo(HI_HANDLE chnHandle, HI_UNF_CIPHER_KEY_SRC_E enKeySrc, HI_UNF_CIPHER_ALG_E alg, HI_UNF_CIPHER_WORK_MODE_E mode, HI_UNF_CIPHER_KEY_LENGTH_E keyLen, const HI_U8 u8KeyBuf[16], const HI_U8 u8IVBuf[16]) { HI_S32 s32Ret = HI_SUCCESS; HI_UNF_CIPHER_CTRL_S CipherCtrl; memset(&CipherCtrl, 0, sizeof(HI_UNF_CIPHER_CTRL_S)); CipherCtrl.enAlg = alg; CipherCtrl.enWorkMode = mode; CipherCtrl.enBitWidth = HI_UNF_CIPHER_BIT_WIDTH_128BIT; CipherCtrl.enKeyLen = keyLen; CipherCtrl.enKeySrc = enKeySrc; if(CipherCtrl.enWorkMode != HI_UNF_CIPHER_WORK_MODE_ECB) { CipherCtrl.stChangeFlags.bit1IV = 1; //must set for CBC , CFB mode memcpy(CipherCtrl.u32IV, u8IVBuf, 16); } memcpy(CipherCtrl.u32Key, u8KeyBuf, 32); s32Ret = HI_UNF_CIPHER_ConfigHandle(chnHandle, &CipherCtrl); if(HI_SUCCESS != s32Ret) { return HI_FAILURE; } return HI_SUCCESS; } HI_S32 sample_cipher_efuse() { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 16; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return HI_FAILURE; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return HI_FAILURE; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); /* For encrypt */ s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_EFUSE_0, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CBC, HI_UNF_CIPHER_KEY_AES_128BIT, aes_128_cbc_key, aes_128_cbc_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_128_src_buf, u32TestDataLen); printBuffer("clear text:", aes_128_src_buf, sizeof(aes_128_src_buf)); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("encrypted text:", pOutputAddrVir, sizeof(aes_128_dst_buf)); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_128_dst_buf, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ memcpy(pInputAddrVir, aes_128_dst_buf, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_EFUSE_0, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CBC, HI_UNF_CIPHER_KEY_AES_128BIT, aes_128_cbc_key, aes_128_cbc_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } printBuffer("before decrypt:", aes_128_dst_buf, sizeof(aes_128_dst_buf)); s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("decrypted text:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_128_src_buf, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } #else int sample_cipher_efuse() { printf("cipher efuse not support!!!\n"); return HI_SUCCESS; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/tools/vpss_attr.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "hi_common.h" #include "hi_comm_video.h" #include "hi_comm_sys.h" #include "hi_comm_vo.h" #include "hi_comm_vi.h" #include "hi_comm_vpss.h" #include "hi_type.h" #include "mpi_vb.h" #include "mpi_sys.h" #include "mpi_vi.h" #include "mpi_vo.h" #include "mpi_vpss.h" #define USAGE_HELP(void)\ {\ printf("\n\tusage : %s group para value \n", argv[0]); \ printf("\n\t para: \n"); \ printf("\t\tenNR [0, disable; 1,enable]\n"); \ } #define CHECK_RET(express,name)\ do{\ if (HI_SUCCESS != express)\ {\ printf("%s failed at %s: LINE: %d ! errno:%#x \n", \ name, __FUNCTION__, __LINE__, express);\ return HI_FAILURE;\ }\ }while(0) #ifdef __HuaweiLite__ HI_S32 vpss_attr(int argc, char* argv[]) #else HI_S32 main(int argc, char* argv[]) #endif { HI_S32 s32Ret; VPSS_GRP_ATTR_S stVpssGrpAttr = {0}; VPSS_NR_PARAM_U unNrParam = {{0}}; char paraTemp[16]; HI_U32 value = 0; VPSS_GRP VpssGrp = 0; const char* para = paraTemp; if (argc < 4) { USAGE_HELP(); return -1; } strcpy(paraTemp, argv[2]); value = atoi(argv[3]); VpssGrp = atoi(argv[1]); s32Ret = HI_MPI_VPSS_GetGrpAttr(VpssGrp, &stVpssGrpAttr); CHECK_RET(s32Ret, "HI_MPI_VPSS_GetGrpAttr"); #if 0 s32Ret = HI_MPI_VPSS_GetNRParam(VpssGrp, &unNrParam); CHECK_RET(s32Ret, "HI_MPI_VPSS_GetGrpParam"); #endif if (0 == strcmp(para, "enNR")) { stVpssGrpAttr.bNrEn = value; } else { printf("err para\n"); USAGE_HELP(); } s32Ret = HI_MPI_VPSS_SetGrpAttr(VpssGrp, &stVpssGrpAttr); CHECK_RET(s32Ret, "HI_MPI_VPSS_SetGrpAttr"); #if 0 s32Ret = HI_MPI_VPSS_SetNRParam(VpssGrp, &unNrParam); CHECK_RET(s32Ret, "HI_MPI_VPSS_SetNRParam"); #endif printf("\t\tenNR %d\n", stVpssGrpAttr.bNrEn); #if 0 printf("\t\typk %d\n", unNrParam.stNRParam_V1.s32YPKStr); printf("\t\tysf %d\n", unNrParam.stNRParam_V1.s32YSFStr); printf("\t\tytf %d\n", unNrParam.stNRParam_V1.s32YTFStr); printf("\t\tytfmax %d\n", unNrParam.stNRParam_V1.s32TFStrMax); printf("\t\tyss %d\n", unNrParam.stNRParam_V1.s32YSmthStr); printf("\t\tysr %d\n", unNrParam.stNRParam_V1.s32YSmthRat); printf("\t\tysfdlt %d\n", unNrParam.stNRParam_V1.s32YSFStrDlt); printf("\t\tytfdlt %d\n", unNrParam.stNRParam_V1.s32YTFStrDlt); printf("\t\tytfdl %d\n", unNrParam.stNRParam_V1.s32YTFStrDl); printf("\t\tysfbr %d\n", unNrParam.stNRParam_V1.s32YSFBriRat); printf("\t\tcsf %d\n", unNrParam.stNRParam_V1.s32CSFStr); printf("\t\tctf %d\n", unNrParam.stNRParam_V1.s32CTFstr); #endif return 0; } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/Makefile #ifeq ($(PARAM_FILE), ) PARAM_FILE:=../../../../mpp/Makefile.param include $(PARAM_FILE) #endif include $(SAMPLE_DIR)/Makefile.param export AUDIO_LIBA := CFLAGS += -DCHIP_TYPE_$(HIARCH) SRC_ROOT :=$(PWD) CFLAGS += -I$(SRC_ROOT)/../include \ -I$(SRC_ROOT)/../src \ -I$(SRC_ROOT)/../arch/$(INTERDRVVER)\ -I$(REL_DIR)/include ifeq ($(OSTYPE),HuaweiLite) CFLAGS += -I$(MPP_PATH)/code/init/HuaweiLite CFLAGS += -I$(SDK_PATH)/drv/interdrv/$(HIARCH)/init/HuaweiLite/ else SENSOR_LIBS += $(SRC_ROOT)/../src/libhi_cipher.a endif TARGET := sample_cipher SRCS := $(wildcard *.c) # compile linux or HuaweiLite #include $(SAMPLE_DIR)/Make.$(OSTYPE) include Make.$(OSTYPE) <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/cipher/hal_cipher.c /****************************************************************************** Copyright (C), 2011-2014, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : hal_cipher.c Version : Initial Draft Author : <NAME> Created : Last Modified : Description : Function List : History : ******************************************************************************/ #include "hi_osal.h" #include "hi_type.h" #include "hi_error_mpi.h" #include "drv_cipher_ioctl.h" #include "drv_cipher_reg.h" #include "hal_cipher.h" #include "hi_drv_cipher.h" #include "drv_hash.h" #include "drv_cipher_log.h" #include "drv_cipher_mmz.h" #include "hal_efuse.h" #include "config.h" /***************************** Macro Definition ******************************/ #define RSA_DATA_CLR (7<<4) #define RSA_DATA_CLR_KEY (1<<4) #define RSA_DATA_CLR_INPUT (2<<4) #define RSA_DATA_CLR_OUTPUT (4<<4) #define RSA_MOD_SEL (3 << 0) #define RSA_MOD_SEL_OPT (0 << 0) #define RSA_MOD_SEL_KEY_UPDATA (1 << 0) #define RSA_MOD_SEL_RAM_CLAER (2 << 0) #define RSA_MOD_SEL_CRC16 (3 << 0) #define RSA_BUSY (1 << 0) #define RSA_START (1 << 0) #define RSA_RTY_CNT 5000 /******************************* API declaration *****************************/ #ifdef CIPHER_MULTICIPHER_SUPPORT HI_S32 HAL_Cipher_SetInBufNum(HI_U32 chnId, HI_U32 num) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } /* register0~15 bit is valid, others bits reserved */ regAddr = CIPHER_REG_CHANn_IBUF_NUM(chnId); if (num > 0xffff) { HI_ERR_CIPHER("value err:%#x, set to 0xffff\n", num); num = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, num); HI_INFO_CIPHER(" cnt=%u\n", num); return HI_SUCCESS; } HI_S32 HAL_Cipher_GetInBufNum(HI_U32 chnId, HI_U32 *pNum) { HI_U32 regAddr = 0; HI_U32 regValue = 0; if (CIPHER_PKGx1_CHAN == chnId || HI_NULL == pNum) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_IBUF_NUM(chnId); (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); *pNum = regValue; HI_INFO_CIPHER(" cnt=%u\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetInBufCnt(HI_U32 chnId, HI_U32 num) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_IBUF_CNT(chnId); if (num > 0xffff) { HI_ERR_CIPHER("value err:%x, set to 0xffff\n", num); num = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, num); HI_INFO_CIPHER(" HAL_Cipher_SetInBufCnt=%u\n", num); return HI_SUCCESS; } HI_S32 HAL_Cipher_GetInBufCnt(HI_U32 chnId, HI_U32 *pNum) { HI_U32 regAddr = 0; HI_U32 regValue = 0; if ( (CIPHER_PKGx1_CHAN == chnId) || (HI_NULL == pNum) ) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_IBUF_CNT(chnId); (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); *pNum = regValue; HI_INFO_CIPHER(" cnt=%u\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetInBufEmpty(HI_U32 chnId, HI_U32 num) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_IEMPTY_CNT(chnId); if (num > 0xffff) { HI_ERR_CIPHER("value err:%x, set to 0xffff\n", num); num = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, num); HI_INFO_CIPHER(" cnt=%u\n", num); return HI_SUCCESS; } HI_S32 HAL_Cipher_GetInBufEmpty(HI_U32 chnId, HI_U32 *pNum) { HI_U32 regAddr = 0; HI_U32 regValue = 0; if ( (CIPHER_PKGx1_CHAN == chnId) || (HI_NULL == pNum) ) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_IEMPTY_CNT(chnId); (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); *pNum = regValue; HI_INFO_CIPHER(" cnt=%u\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetOutBufNum(HI_U32 chnId, HI_U32 num) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_OBUF_NUM(chnId); if (num > 0xffff) { HI_ERR_CIPHER("value err:%x, set to 0xffff\n", num); num = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, num); HI_INFO_CIPHER("chn=%d cnt=%u\n", chnId, num); return HI_SUCCESS; } HI_S32 HAL_Cipher_GetOutBufNum(HI_U32 chnId, HI_U32 *pNum) { HI_U32 regAddr = 0; HI_U32 regValue = 0; if ( (CIPHER_PKGx1_CHAN == chnId) || (HI_NULL == pNum) ) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_OBUF_NUM(chnId); (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); *pNum = regValue; HI_INFO_CIPHER(" cnt=%u\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetOutBufCnt(HI_U32 chnId, HI_U32 num) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_OBUF_CNT(chnId); if (num > 0xffff) { HI_ERR_CIPHER("value err:%x, set to 0xffff\n", num); num = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, num); HI_INFO_CIPHER("SetOutBufCnt=%u, chnId=%u\n", num,chnId); return HI_SUCCESS; } HI_S32 HAL_Cipher_GetOutBufCnt(HI_U32 chnId, HI_U32 *pNum) { HI_U32 regAddr = 0; HI_U32 regValue = 0; if ( (CIPHER_PKGx1_CHAN == chnId) || (HI_NULL == pNum) ) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_OBUF_CNT(chnId); (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); *pNum = regValue; HI_INFO_CIPHER(" HAL_Cipher_GetOutBufCnt=%u\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetOutBufFull(HI_U32 chnId, HI_U32 num) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_OFULL_CNT(chnId); if (num > 0xffff) { HI_ERR_CIPHER("value err:%x, set to 0xffff\n", num); num = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, num); HI_INFO_CIPHER(" cnt=%u\n", num); return HI_SUCCESS; } HI_S32 HAL_Cipher_GetOutBufFull(HI_U32 chnId, HI_U32 *pNum) { HI_U32 regAddr = 0; HI_U32 regValue = 0; if ( (CIPHER_PKGx1_CHAN == chnId) || (HI_NULL == pNum) ) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHANn_OFULL_CNT(chnId); (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); *pNum = regValue; HI_INFO_CIPHER(" cnt=%u\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_WaitIdle(HI_VOID) { HI_S32 i = 0; HI_U32 u32RegAddr = 0; HI_U32 u32RegValue = 0; /* channel 0 configuration register [31-2]:reserved, [1]:ch0_busy, [0]:ch0_start * [1]:channel 0 status signal, [0]:channel 0 encrypt/decrypt start signal */ u32RegAddr = CIPHER_REG_CHAN0_CFG; for (i = 0; i < CIPHER_WAIT_IDEL_TIMES; i++) { (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); if (0x0 == ((u32RegValue >> 1) & 0x01)) { return HI_SUCCESS; } else { //udelay(1); } } return HI_FAILURE; } /* just only check for channel 0 */ HI_BOOL HAL_Cipher_IsIdle(HI_U32 chn) { HI_U32 u32RegValue = 0; HI_ASSERT(CIPHER_PKGx1_CHAN == chn); (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_REG_CHAN0_CFG, &u32RegValue); if (0x0 == ((u32RegValue >> 1) & 0x01)) { return HI_TRUE; } return HI_FALSE; } HI_S32 HAL_Cipher_SetDataSinglePkg(HI_DRV_CIPHER_DATA_INFO_S * info) { HI_U32 regAddr = 0; HI_U32 i = 0; regAddr = CIPHER_REG_CHAN0_CIPHER_DIN(0); /***/ for (i = 0; i < (16/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_WriteReg(regAddr + (i * sizeof(HI_U32)), (*(info->u32DataPkg + i)) ); } return HI_SUCCESS; } HI_S32 HAL_Cipher_ReadDataSinglePkg(HI_U32 *pData) { HI_U32 regAddr = 0; HI_U32 i = 0; regAddr = CIPHER_REG_CHAN0_CIPHER_DOUT(0); /***/ for (i = 0; i < (16/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_ReadReg(regAddr + (i * sizeof(HI_U32)), pData+ i); } return HI_SUCCESS; } HI_S32 HAL_Cipher_StartSinglePkg(HI_U32 chnId) { HI_U32 u32RegAddr = 0; HI_U32 u32RegValue = 0; HI_ASSERT(CIPHER_PKGx1_CHAN == chnId); u32RegAddr = CIPHER_REG_CHAN0_CFG; (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); u32RegValue |= 0x1; (HI_VOID)HAL_CIPHER_WriteReg(u32RegAddr, u32RegValue); /* start work */ return HI_SUCCESS; } HI_S32 HAL_Cipher_SetBufAddr(HI_U32 chnId, CIPHER_BUF_TYPE_E bufType, HI_U32 addr) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } if (CIPHER_BUF_TYPE_IN == bufType) { regAddr = CIPHER_REG_CHANn_SRC_LST_SADDR(chnId); } else if (CIPHER_BUF_TYPE_OUT == bufType) { regAddr = CIPHER_REG_CHANn_DEST_LST_SADDR(chnId); } else { HI_ERR_CIPHER("SetBufAddr type err:%x.\n", bufType); return HI_ERR_CIPHER_INVALID_PARA; } HI_INFO_CIPHER("Set chn%d '%s' BufAddr to:%x.\n",chnId, (CIPHER_BUF_TYPE_IN == bufType)?"In":"Out", addr); (HI_VOID)HAL_CIPHER_WriteReg(regAddr, addr); return HI_SUCCESS; } HI_VOID HAL_Cipher_Reset(HI_VOID) { //(HI_VOID)HAL_CIPHER_WriteReg(CIPHER_SOFT_RESET_ADDR, 1); return; } HI_S32 HAL_Cipher_GetOutIV(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 i = 0; HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { regAddr = CIPHER_REG_CHAN0_CIPHER_IVOUT(0); } else { regAddr = CIPHER_REG_CHAN_CIPHER_IVOUT(chnId); } /***/ for (i = 0; i < (CI_IV_SIZE/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_ReadReg(regAddr + (i * sizeof(HI_U32)), &(pCtrl->u32IV[i])); } return HI_SUCCESS; } #ifdef CIPHER_CCM_GCM_SUPPORT HI_S32 HAL_Cipher_GetTag(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl, HI_U32 *pu32Tag) { HI_U32 i = 0; HI_U32 regAddr = 0; if (pCtrl->enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM) { regAddr = CIPHER_REG_CHANn_GCM_TAG(chnId); } else { return HI_FAILURE; } for (i = 0; i < (CI_IV_SIZE/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_ReadReg(regAddr + (i * sizeof(HI_U32)), &pu32Tag[i]); } return HI_SUCCESS; } HI_S32 HAL_Cipher_SetLen(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 regAddrA0, regAddrA1; HI_U32 regAddrP0, regAddrP1; HI_U32 regAddrIV, valIV; if (pCtrl->enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM) { regAddrA0 = CIPHER_REG_CHANn_GCM_A_LEN_0(chnId); regAddrP0 = CIPHER_REG_CHANn_GCM_PC_LEN_0(chnId); regAddrA1 = CIPHER_REG_CHANn_GCM_A_LEN_1(chnId); regAddrP1 = CIPHER_REG_CHANn_GCM_PC_LEN_1(chnId); regAddrIV = CIPHER_REG_CHANn_GCM_IV_LEN(chnId); } else { return HI_FAILURE; } (HI_VOID)HAL_CIPHER_ReadReg(regAddrIV, &valIV); valIV &= ~(0x1F << ((chnId & 0x03) * 8)); valIV |= pCtrl->unModeInfo.stGCM.u32IVLen << ((chnId & 0x03) * 8); (HI_VOID)HAL_CIPHER_WriteReg(regAddrIV, valIV); (HI_VOID)HAL_CIPHER_WriteReg(regAddrA0, pCtrl->unModeInfo.stGCM.u32ALen); (HI_VOID)HAL_CIPHER_WriteReg(regAddrP0, pCtrl->unModeInfo.stGCM.u32MLen); (HI_VOID)HAL_CIPHER_WriteReg(regAddrA1, 0x00); (HI_VOID)HAL_CIPHER_WriteReg(regAddrP1, 0x00); return HI_SUCCESS; } HI_S32 HAL_Cipher_CleanAadEnd(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 regAddr, val; if (pCtrl->enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM) { regAddr = CIPHER_REG_CHANn_GCM_GHASH_A_END; } else { return HI_SUCCESS; } val = 0x01 << chnId; (HI_VOID)HAL_CIPHER_WriteReg(regAddr, val); HAL_CIPHER_ReadReg (regAddr, &val); // printk("regAddr: 0x%x, val 0x%x\n", regAddr, val); return HI_SUCCESS; } HI_S32 HAL_Cipher_WaitAadEnd(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 regAddr; HI_U32 u32Value; HI_U32 u32TryCount = 0; if (pCtrl->enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM) { regAddr = CIPHER_REG_CHANn_GCM_GHASH_A_END; } else { return HI_SUCCESS; } do { HAL_CIPHER_ReadReg(regAddr, &u32Value); // printk("regAddr: 0x%x, val 0x%x\n", regAddr, u32Value); if ((u32Value >> chnId) & 0x01) { return HI_SUCCESS; } u32TryCount++; osal_msleep(1); } while (u32TryCount < RSA_RTY_CNT); HI_ERR_CIPHER("Wait Aad ghash End timeout, chnid = %d\n", chnId); return HI_FAILURE; } HI_S32 HAL_Cipher_CleanTagVld(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 regAddr, val; if (pCtrl->enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM) { regAddr = CIPHER_REG_CHANn_GCM_TAG_VLD; } else { return HI_SUCCESS; } val = 0x01 << chnId; (HI_VOID)HAL_CIPHER_WriteReg(regAddr, val); return HI_SUCCESS; } HI_S32 HAL_RSA_WaitTagVld(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 regAddr; HI_U32 u32Value; HI_U32 u32TryCount = 0; if (pCtrl->enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM) { regAddr = CIPHER_REG_CHANn_GCM_TAG_VLD; } else { return HI_SUCCESS; } do { HAL_CIPHER_ReadReg(regAddr, &u32Value); if ((u32Value >> chnId) & 0x01) { return HI_SUCCESS; } u32TryCount++; osal_udelay(500); } while (u32TryCount < RSA_RTY_CNT); HI_ERR_CIPHER("Wait TAG VLD timeout, chnid = %d\n", chnId); return HI_FAILURE; } #endif HI_S32 HAL_Cipher_SetInIV(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 i = 0; HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN != chnId) { return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CHAN0_CIPHER_IVIN(0); /***/ for (i = 0; i < (CI_IV_SIZE/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_WriteReg(regAddr + (i * sizeof(HI_U32)), pCtrl->u32IV[i]); } return HI_SUCCESS; } #ifdef CIPHER_KLAD_SUPPORT HI_S32 HAL_Cipher_KladConfig(HI_U32 chnId, HI_U32 u32OptId, HI_UNF_CIPHER_KLAD_TARGET_E enTarget, HI_BOOL bIsDecrypt) { HI_S32 ret = HI_SUCCESS; HI_U32 u32Ctrl; ret = HAL_Efuse_LoadCipherKey(chnId, u32OptId); if(ret != HI_SUCCESS) { return ret; } u32Ctrl = chnId << 16; u32Ctrl |= enTarget << 2;// Cipher klad u32Ctrl |= bIsDecrypt << 1;// decrypt u32Ctrl |= 0x00;// start (HI_VOID)HAL_CIPHER_WriteReg(KLAD_REG_KLAD_CTRL, u32Ctrl); return HI_SUCCESS; } HI_VOID HAL_Cipher_StartKlad(HI_VOID) { HI_U32 u32Ctrl; (HI_VOID)HAL_CIPHER_ReadReg(KLAD_REG_KLAD_CTRL, &u32Ctrl); u32Ctrl |= 0x01;// start (HI_VOID)HAL_CIPHER_WriteReg(KLAD_REG_KLAD_CTRL, u32Ctrl); } HI_VOID HAL_Cipher_SetKladData(HI_U32 *pu32DataIn) { HI_U32 i = 0; for(i=0; i<4; i++) { (HI_VOID)HAL_CIPHER_WriteReg(KLAD_REG_DAT_IN + i * 4, pu32DataIn[i]); } } HI_VOID HAL_Cipher_GetKladData(HI_U32 *pu32DataOut) { HI_U32 i = 0; for(i=0; i<4; i++) { (HI_VOID)HAL_CIPHER_ReadReg(KLAD_REG_ENC_OUT+ i * 4, &pu32DataOut[i]); } } HI_S32 HAL_Cipher_WaitKladDone(HI_VOID) { HI_U32 u32TryCount = 0; HI_U32 u32Ctrl; do { HAL_CIPHER_ReadReg(KLAD_REG_KLAD_CTRL, &u32Ctrl); if ((u32Ctrl & 0x01) == 0x00) { return HI_SUCCESS; } u32TryCount++; } while (u32TryCount < CIPHER_WAIT_IDEL_TIMES); HI_ERR_CIPHER("Klad time out!\n"); return HI_FAILURE; } #endif HI_S32 HAL_Cipher_SetKey(HI_U32 chnId, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 i = 0; HI_S32 ret = HI_SUCCESS; HI_U32 regAddr = 0; if(NULL == pCtrl) { HI_ERR_CIPHER("Error, null pointer!\n"); return HI_ERR_CIPHER_INVALID_PARA; } regAddr = CIPHER_REG_CIPHER_KEY(chnId); #ifdef CIPHER_EFUSE_SUPPORT if (HI_UNF_CIPHER_KEY_SRC_USER == pCtrl->enKeySrc) { for (i = 0; i < (CI_KEY_SIZE/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_WriteReg(regAddr + (i * sizeof(HI_U32)), pCtrl->u32Key[i]); } } else if ((pCtrl->enKeySrc >= HI_UNF_CIPHER_KEY_SRC_EFUSE_0) && (pCtrl->enKeySrc <= HI_UNF_CIPHER_KEY_SRC_EFUSE_3)) { ret = HAL_Efuse_LoadCipherKey(chnId, pCtrl->enKeySrc - HI_UNF_CIPHER_KEY_SRC_EFUSE_0); } #else for (i = 0; i < (CI_KEY_SIZE/sizeof(HI_U32)); i++) { (HI_VOID)HAL_CIPHER_WriteReg(regAddr + (i * sizeof(HI_U32)), pCtrl->u32Key[i]); } #endif HI_INFO_CIPHER("SetKey: chn%u,Key:%#x, %#x, %#x, %#x.\n", chnId, pCtrl->u32Key[0], pCtrl->u32Key[1], pCtrl->u32Key[2], pCtrl->u32Key[3]); return ret; } /* =========channel n control register========== [31:22] weight [in 64bytes, just only for multi-packet channel encrypt or decrypt, otherwise reserved.] [21:17] reserved [16:14] RW key_adder [current key sequence number] [13] RW key_sel [key select control, 0-CPU keys, 1-keys from key Ladder] [12:11] reserved [10:9] RW key_length[key length control (1).AES, 00-128 bits key, 01-192bits 10-256bits, 11-128bits (2).DES, 00-3 keys, 01-3keys, 10-3keys, 11-2keys] [8] reserved [7:6] RW width[bits width control (1).for DES/3DES, 00-64bits, 01-8bits, 10-1bit, 11-64bits (2).for AES, 00-128bits, 01-8bits, 10-1bit, 11-128bits] [5:4] RW alg_sel[algorithm type, 00-DES, 01-3DES, 10-AES, 11-DES] [3:1] RW mode[mode control, (1).for AES, 000-ECB, 001-CBC, 010-CFB, 011-OFB, 100-CTR, others-ECB (2).for DES, 000-ECB, 001-CBC, 010-CFB, 011-OFB, others-ECB] [0] RW decrypt[encrypt or decrypt control, 0 stands for encrypt, 1 stands for decrypt] */ HI_S32 HAL_Cipher_Config(HI_U32 chnId, HI_BOOL bDecrypt, HI_BOOL bIVChange, HI_UNF_CIPHER_CTRL_S* pCtrl) { HI_U32 keyId = 0; HI_U32 regAddr = 0; HI_U32 regValue = 0; HI_BOOL bKeyByCA = 0; #ifdef CIPHER_EFUSE_SUPPORT if (pCtrl->enKeySrc == HI_UNF_CIPHER_KEY_SRC_USER) { bKeyByCA = 0; } else { bKeyByCA = 1; } #endif if (CIPHER_PKGx1_CHAN == chnId) { /* channel 0, single packet encrypt or decrypt channel */ regAddr = CIPHER_REG_CHAN0_CIPHER_CTRL; } else { regAddr = CIPHER_REG_CHANn_CIPHER_CTRL(chnId); } (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); if (HI_FALSE == bDecrypt)/* encrypt */ { regValue &= ~(1 << 0); } else /* decrypt */ { regValue |= 1; } /* set mode */ regValue &= ~(0x07 << 1);/* clear bit1~bit3 */ regValue |= ((pCtrl->enWorkMode & 0x7) << 1); /* set algorithm bits */ regValue &= ~(0x03 << 4); /* clear algorithm bits*/ regValue |= ((pCtrl->enAlg & 0x3) << 4); /* set bits width */ regValue &= ~(0x03 << 6); regValue |= ((pCtrl->enBitWidth & 0x3) << 6); regValue &= ~(0x01 << 8); regValue |= ((bIVChange & 0x1) << 8); if (bIVChange) ///? { HAL_Cipher_SetInIV(chnId, pCtrl); } regValue &= ~(0x03 << 9); regValue |= ((pCtrl->enKeyLen & 0x3) << 9); regValue &= ~(0x01 << 13); regValue |= ((bKeyByCA & 0x1) << 13); // if (HI_FALSE == bKeyByCA) /* By User */ // { keyId = chnId;/**/ //HAL_Cipher_SetKey(chnId, pCtrl->u32Key); regValue &= ~(0x07 << 14); regValue |= ((keyId & 0x7) << 14); // } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetAGEThreshold(HI_U32 chnId, CIPHER_INT_TYPE_E intType, HI_U32 value) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } if (CIPHER_INT_TYPE_IN_BUF == intType) { regAddr = CIPHER_REG_CHANn_IAGE_CNT(chnId); } else if (CIPHER_INT_TYPE_OUT_BUF == intType) { regAddr = CIPHER_REG_CHANn_OAGE_CNT(chnId); } else { HI_ERR_CIPHER("SetAGEThreshold type err:%x.\n", intType); return HI_ERR_CIPHER_INVALID_PARA; } if (value > 0xffff) { HI_ERR_CIPHER("SetAGEThreshold value err:%x, set to 0xffff\n", value); value = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, value); return HI_SUCCESS; } HI_S32 HAL_Cipher_SetIntThreshold(HI_U32 chnId, CIPHER_INT_TYPE_E intType, HI_U32 value) { HI_U32 regAddr = 0; if (CIPHER_PKGx1_CHAN == chnId) { return HI_ERR_CIPHER_INVALID_PARA; } if (CIPHER_INT_TYPE_IN_BUF == intType) { regAddr = CIPHER_REG_CHANn_INT_ICNTCFG(chnId); } else if (CIPHER_INT_TYPE_OUT_BUF == intType) { regAddr = CIPHER_REG_CHANn_INT_OCNTCFG(chnId); } else { HI_ERR_CIPHER("SetIntThreshold type err:%x.\n", intType); return HI_ERR_CIPHER_INVALID_PARA; } if (value > 0xffff) { HI_ERR_CIPHER("SetIntThreshold value err:%x, set to 0xffff\n", value); value = 0xffff; } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, value); return HI_SUCCESS; } /* interrupt enable [31]-----cipher module unitary interrupt enable [30:16]--reserved [15] channel 7 output queue data interrupt enable [14] channel 6 output queue data interrupt enable [... ] channel ... output queue data interrupt enable [9] channel 1 output queue data interrupt enable [8] channel 0 data dispose finished interrupt enble [7] channel 7 input queue data interrupt enable [6] channel 6 input queue data interrupt enable ... [1] channel 1 input queue data interrupt enable [0] reserved */ HI_S32 HAL_Cipher_EnableInt(HI_U32 chnId, int intType) { HI_U32 regAddr = 0; HI_U32 regValue = 0; regAddr = CIPHER_REG_INT_EN; (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); regValue |= (1 << 31); /* sum switch int_en */ #if defined(CHIP_TYPE_hi3719mv100) || defined(CHIP_TYPE_hi3718mv100) || defined(CHIP_TYPE_hi3798mv100_a) || defined(CHIP_TYPE_hi3798mv100) regValue |= (1 << 30); /* sec_int_en */ #endif if (CIPHER_PKGx1_CHAN == chnId) { regValue |= (1 << 8); } else { if (CIPHER_INT_TYPE_OUT_BUF == (CIPHER_INT_TYPE_OUT_BUF & intType)) { regValue |= (1 << (8 + chnId)); } /* NOT else if */ if (CIPHER_INT_TYPE_IN_BUF == (CIPHER_INT_TYPE_IN_BUF & intType)) { regValue |= (1 << (0 + chnId)); } } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, regValue); HI_INFO_CIPHER("HAL_Cipher_EnableInt: Set INT_EN:%#x\n", regValue); return HI_SUCCESS; } HI_S32 HAL_Cipher_DisableInt(HI_U32 chnId, int intType) { HI_U32 regAddr = 0; HI_U32 regValue = 0; regAddr = CIPHER_REG_INT_EN; (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); if (CIPHER_PKGx1_CHAN == chnId) { regValue &= ~(1 << 8); } else { if (CIPHER_INT_TYPE_OUT_BUF == (CIPHER_INT_TYPE_OUT_BUF & intType)) { regValue &= ~(1 << (8 + chnId)); } /* NOT else if */ if (CIPHER_INT_TYPE_IN_BUF == (CIPHER_INT_TYPE_IN_BUF & intType)) { regValue &= ~(1 << (0 + chnId)); } } if (0 == (regValue & 0x7fffffff)) { regValue &= ~(1 << 31); /* regValue = 0; sum switch int_en */ } (HI_VOID)HAL_CIPHER_WriteReg(regAddr, regValue); HI_INFO_CIPHER("HAL_Cipher_DisableInt: Set INT_EN:%#x\n", regValue); return HI_SUCCESS; } HI_VOID HAL_Cipher_DisableAllInt(HI_VOID) { HI_U32 regAddr = 0; HI_U32 regValue = 0; regAddr = CIPHER_REG_INT_EN; regValue = 0; (HI_VOID)HAL_CIPHER_WriteReg(regAddr, regValue); } /* interrupt status register [31:16]--reserved [15] channel 7 output queue data interrupt enable [14] channel 6 output queue data interrupt enable [... ] channel ... output queue data interrupt enable [9] channel 1 output queue data interrupt enable [8] channel 0 data dispose finished interrupt enble [7] channel 7 input queue data interrupt enable [6] channel 6 input queue data interrupt enable ... [1] channel 1 input queue data interrupt enable [0] reserved */ HI_VOID HAL_Cipher_GetIntState(HI_U32 *pState) { HI_U32 regAddr = 0; HI_U32 regValue = 0; regAddr = CIPHER_REG_INT_STATUS; (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); if (pState) { *pState = regValue; } HI_INFO_CIPHER("HAL_Cipher_GetIntState=%#x\n", regValue); } HI_VOID HAL_Cipher_GetIntEnState(HI_U32 *pState) { HI_U32 regAddr = 0; HI_U32 regValue = 0; regAddr = CIPHER_REG_INT_EN; (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); if (pState) { *pState = regValue; } HI_INFO_CIPHER("HAL_Cipher_GetIntEnState=%#x\n", regValue); } HI_VOID HAL_Cipher_GetRawIntState(HI_U32 *pState) { HI_U32 regAddr = 0; HI_U32 regValue = 0; regAddr = CIPHER_REG_INT_RAW; (HI_VOID)HAL_CIPHER_ReadReg(regAddr, &regValue); if (pState) { *pState = regValue; } HI_INFO_CIPHER("HAL_Cipher_GetRawIntState=%#x\n", regValue); } HI_VOID HAL_Cipher_ClrIntState(HI_U32 intStatus) { HI_U32 regAddr; HI_U32 regValue; regAddr = CIPHER_REG_INT_RAW; regValue = intStatus; (HI_VOID)HAL_CIPHER_WriteReg(regAddr, regValue); } HI_VOID HAL_Cipher_EnableAllSecChn(HI_VOID) { HI_U32 regAddr = CIPHER_REG_SEC_CHN_CFG; HI_U32 regValue = 0; regValue = 0xffffffff; (HI_VOID)HAL_CIPHER_WriteReg(regAddr, regValue); return; } HI_VOID HAL_Cipher_Init(void) { HI_U32 CipherCrgValue; HI_U32 pvirt; pvirt = (HI_U32)osal_ioremap_nocache(REG_CRG_CLK_PHY_ADDR_CIPHER, 0x100); if (pvirt == 0) { HI_ERR_CIPHER("osal_ioremap_nocache phy addr err:%x.\n", REG_CRG_CLK_PHY_ADDR_CIPHER); return ; } HAL_CIPHER_ReadReg(pvirt, &CipherCrgValue); HAL_SET_BIT(CipherCrgValue, CRG_RST_BIT_CIPHER); /* reset */ HAL_SET_BIT(CipherCrgValue, CRG_CLK_BIT_CIPHER); /* set the bit 0, clock opened */ HAL_CIPHER_WriteReg(pvirt,CipherCrgValue); /* clock select and cancel reset 0x30100*/ HAL_CLEAR_BIT(CipherCrgValue, CRG_RST_BIT_CIPHER); /* cancel reset */ HAL_SET_BIT(CipherCrgValue, CRG_CLK_BIT_CIPHER); /* set the bit 0, clock opened */ HAL_CIPHER_WriteReg(pvirt,CipherCrgValue); osal_iounmap((void *)pvirt); /* hash sw reset */ #ifdef CFG_HI_CIPHER_HASH_SUPPORT (HI_VOID)HAL_Cipher_HashSoftReset(); #endif #ifdef CIPHER_RSA_SUPPORT HAL_RSA_Reset(); #endif #ifdef CIPHER_RNG_SUPPORT HAL_RNG_Reset(); #endif return; } HI_VOID HAL_Cipher_DeInit(void) { HI_U32 u32RngCtrl = 0; HI_U32 CipherCrgValue; HI_U32 pvirt; #ifdef CIPHER_RNG_SUPPORT #ifdef CIPHER_RNG_VERSION_1 (HI_VOID)HAL_CIPHER_ReadReg(REG_RNG_CTRL_ADDR, &u32RngCtrl); u32RngCtrl &= 0xfffffffc; (HI_VOID)HAL_CIPHER_WriteReg(REG_RNG_CTRL_ADDR, u32RngCtrl); #elif defined(CIPHER_RNG_VERSION_2) (HI_VOID)HAL_CIPHER_ReadReg(HISEC_COM_TRNG_CTRL, &u32RngCtrl); u32RngCtrl &= 0xfffffffc; (HI_VOID)HAL_CIPHER_WriteReg(HISEC_COM_TRNG_CTRL, u32RngCtrl); #endif #endif pvirt = (HI_U32)osal_ioremap_nocache(REG_CRG_CLK_PHY_ADDR_CIPHER, 0x100); if (pvirt == 0) { HI_ERR_CIPHER("osal_ioremap_nocache phy addr err:%x.\n", REG_CRG_CLK_PHY_ADDR_CIPHER); return ; } HAL_CIPHER_ReadReg(pvirt, &CipherCrgValue); HAL_SET_BIT(CipherCrgValue, 0); /* reset */ HAL_SET_BIT(CipherCrgValue, 1); /* set the bit 0, clock opened */ HAL_CIPHER_WriteReg(pvirt,CipherCrgValue); osal_iounmap((void *)pvirt); return; } HI_S32 HAL_CIPHER_ProcGetStatus(CIPHER_CHN_STATUS_S *pstCipherStatus) { HI_U32 u32RegAddr = 0; HI_U32 u32RegValue = 0; HI_UNF_CIPHER_ALG_E enAlg; HI_UNF_CIPHER_WORK_MODE_E enMode; HI_UNF_CIPHER_KEY_LENGTH_E enKeyLen; HI_BOOL bKeyFrom; HI_U32 i = 0; if(NULL == pstCipherStatus) { HI_ERR_CIPHER("HAL_CIPHER_ProcGetStatus failed!\n"); return HI_FAILURE; } for(i = 0; i < 8; i++) { /* get cipher ctrl */ if(0 != i) { u32RegAddr = CIPHER_REG_CHANn_CIPHER_CTRL(i); } else { u32RegAddr = CIPHER_REG_CHAN0_CIPHER_CTRL; } (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); pstCipherStatus[i].bIsDecrypt = u32RegValue & 1; enAlg = (u32RegValue >> 4) & 0x3; switch(enAlg) { case HI_UNF_CIPHER_ALG_DES: { pstCipherStatus[i].ps8Alg = "DES "; break; } case HI_UNF_CIPHER_ALG_3DES: { pstCipherStatus[i].ps8Alg = "3DES"; break; } case HI_UNF_CIPHER_ALG_AES: { pstCipherStatus[i].ps8Alg = "AES "; break; } default: { pstCipherStatus[i].ps8Alg = "BUTT"; break; } } enMode = (u32RegValue >> 1) & 0x7; switch(enMode) { case HI_UNF_CIPHER_WORK_MODE_ECB: { pstCipherStatus[i].ps8Mode= "ECB "; break; } case HI_UNF_CIPHER_WORK_MODE_CBC: { pstCipherStatus[i].ps8Mode = "CBC "; break; } case HI_UNF_CIPHER_WORK_MODE_CFB: { pstCipherStatus[i].ps8Mode = "CFB "; break; } case HI_UNF_CIPHER_WORK_MODE_OFB: { pstCipherStatus[i].ps8Mode = "OFB "; break; } case HI_UNF_CIPHER_WORK_MODE_CTR: { pstCipherStatus[i].ps8Mode = "CTR "; break; } case HI_UNF_CIPHER_WORK_MODE_CCM: { pstCipherStatus[i].ps8Mode = "CCM "; break; } case HI_UNF_CIPHER_WORK_MODE_GCM: { pstCipherStatus[i].ps8Mode = "GCM "; break; } default: { pstCipherStatus[i].ps8Mode = "BUTT"; break; } } enKeyLen = (u32RegValue >> 9) & 0x3; if(enAlg == HI_UNF_CIPHER_ALG_AES) { switch(enKeyLen) { case HI_UNF_CIPHER_KEY_AES_128BIT: { pstCipherStatus[i].u32KeyLen = 128; break; } case HI_UNF_CIPHER_KEY_AES_192BIT: { pstCipherStatus[i].u32KeyLen = 192; break; } case HI_UNF_CIPHER_KEY_AES_256BIT: { pstCipherStatus[i].u32KeyLen = 256; break; } default: { pstCipherStatus[i].u32KeyLen = 0; break; } } } else { switch(enKeyLen) { case HI_UNF_CIPHER_KEY_DES_3KEY: { pstCipherStatus[i].u32KeyLen = 3; break; } case HI_UNF_CIPHER_KEY_DES_2KEY: { pstCipherStatus[i].u32KeyLen = 2; break; } default: { pstCipherStatus[i].u32KeyLen = 0; break; } } } bKeyFrom = (u32RegValue >> 13) & 1; if(0 == bKeyFrom) { pstCipherStatus[i].ps8KeyFrom = "SW"; } else { pstCipherStatus[i].ps8KeyFrom = "HW"; } /* get data in */ if(0 != i) { u32RegAddr = CIPHER_REG_CHANn_SRC_LST_SADDR(i); (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); pstCipherStatus[i].u32DataInAddr = u32RegValue; } else { u32RegAddr = CIPHER_REG_CHAN0_CIPHER_DIN(0); pstCipherStatus[0].u32DataInAddr = u32RegAddr; } /* get data out */ if(0 != i) { u32RegAddr = CIPHER_REG_CHANn_DEST_LST_SADDR(i); (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); pstCipherStatus[i].u32DataOutAddr = u32RegValue; } else { u32RegAddr = CIPHER_REG_CHAN0_CIPHER_DOUT(0); pstCipherStatus[0].u32DataOutAddr = u32RegAddr; } /* get INT RAW status */ u32RegAddr = CIPHER_REG_INT_RAW; (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); pstCipherStatus[i].bInINTRaw = ( u32RegValue >> i ) & 0x1; pstCipherStatus[i].bOutINTRaw = ( u32RegValue >> (i + 8) ) & 0x1; /* get INT EN status */ u32RegAddr = CIPHER_REG_INT_EN; (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); pstCipherStatus[i].bInINTEn= ( u32RegValue >> i ) & 0x1; pstCipherStatus[i].bOutINTEn= ( u32RegValue >> (i + 8) ) & 0x1; pstCipherStatus[i].bInINTAllEn= ( u32RegValue >> (i + 31) ) & 0x1; /* get INT_OINTCFG */ u32RegAddr = CIPHER_REG_CHANn_INT_OCNTCFG(i); (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr, &u32RegValue); pstCipherStatus[i].u32OutINTCount = u32RegValue; } return HI_SUCCESS; } #endif //CIPHER_MULTICIPHER_SUPPORT #ifdef CIPHER_RNG_SUPPORT #ifdef CIPHER_RNG_VERSION_1 HI_S32 HAL_Cipher_GetRandomNumber(CIPHER_RNG_S *pstRNG) { HI_U32 u32RngStat = 0; if(NULL == pstRNG) { HI_ERR_CIPHER("Invalid params!\n"); return HI_FAILURE; } if(0 == pstRNG->u32TimeOutUs) { /* low 3bit(RNG_data_count[2:0]), indicate how many RNGs in the fifo is available now */ (HI_VOID)HAL_CIPHER_ReadReg(REG_RNG_STAT_ADDR, &u32RngStat); if((u32RngStat & 0x7) <= 0) { return HI_ERR_CIPHER_NO_AVAILABLE_RNG; } } else { while(1) { /* low 3bit(RNG_data_count[2:0]), indicate how many RNGs in the fifo is available now */ (HI_VOID)HAL_CIPHER_ReadReg(REG_RNG_STAT_ADDR, &u32RngStat); if((u32RngStat & 0x7) > 0) { break; } osal_msleep(1); } } (HI_VOID)HAL_CIPHER_ReadReg(REG_RNG_NUMBER_ADDR, &pstRNG->u32RNG); return HI_SUCCESS; } #elif defined(CIPHER_RNG_VERSION_2) HI_S32 HAL_Cipher_GetRandomNumber(CIPHER_RNG_S *pstRNG) { HI_U32 u32RngStat = 0; HI_U32 u32TimeOut = 0; if(NULL == pstRNG) { HI_ERR_CIPHER("Invalid params!\n"); return HI_FAILURE; } if(0 == pstRNG->u32TimeOutUs) { /* low 3bit(RNG_data_count[2:0]), indicate how many RNGs in the fifo is available now */ (HI_VOID)HAL_CIPHER_ReadReg(HISEC_COM_TRNG_DATA_ST, &u32RngStat); if(((u32RngStat >> 8) & 0x3F) <= 0) { return HI_ERR_CIPHER_NO_AVAILABLE_RNG; } } else { while(u32TimeOut ++ < pstRNG->u32TimeOutUs) { /* low 3bit(RNG_data_count[2:0]), indicate how many RNGs in the fifo is available now */ (HI_VOID)HAL_CIPHER_ReadReg(HISEC_COM_TRNG_DATA_ST, &u32RngStat); if(((u32RngStat >> 8) & 0x3F) > 0) { break; } } if (u32TimeOut >= pstRNG->u32TimeOutUs) { return HI_ERR_CIPHER_NO_AVAILABLE_RNG; } } (HI_VOID)HAL_CIPHER_ReadReg(HISEC_COM_TRNG_FIFO_DATA, &pstRNG->u32RNG); return HI_SUCCESS; } #endif HI_VOID HAL_RNG_Reset(HI_VOID) { HI_U32 u32Value; HI_U32 u32Virt; HI_U32 u32RngCtrl = 0; if (REG_CRG_CLK_PHY_ADDR_RNG != 0x00) { u32Virt = (HI_U32)osal_ioremap_nocache(REG_CRG_CLK_PHY_ADDR_RNG, 0x100); HAL_CIPHER_ReadReg(u32Virt, &u32Value); HAL_SET_BIT(u32Value, CRG_RST_BIT_RNG); /* reset */ HAL_SET_BIT(u32Value, CRG_CLK_BIT_RNG); /* clock opened */ HAL_CIPHER_WriteReg(u32Virt, u32Value); /* clock select and cancel reset */ HAL_CLEAR_BIT(u32Value, CRG_RST_BIT_RNG); /* cancel reset */ HAL_SET_BIT(u32Value, CRG_CLK_BIT_RNG); /* clock opened */ HAL_CIPHER_WriteReg(u32Virt, u32Value); osal_iounmap((void *)u32Virt); } #ifdef CIPHER_RNG_VERSION_1 /* RNG init*/ (HI_VOID)HAL_CIPHER_ReadReg(REG_RNG_CTRL_ADDR, &u32RngCtrl); u32RngCtrl &= 0xfffffffc; u32RngCtrl |= 0x2; /* select rng source 0x2, but 0x03 is ok too */ /* config post_process_depth */ u32RngCtrl |= 0x00009000; /* config post_process_enable andd drop_enable */ u32RngCtrl |= 0x000000a0; (HI_VOID)HAL_CIPHER_WriteReg(REG_RNG_CTRL_ADDR, u32RngCtrl); #elif defined(CIPHER_RNG_VERSION_2) (HI_VOID)HAL_CIPHER_ReadReg(HISEC_COM_TRNG_CTRL, &u32RngCtrl); u32RngCtrl = 0x0a; (HI_VOID)HAL_CIPHER_WriteReg(HISEC_COM_TRNG_CTRL, u32RngCtrl); #endif } #endif #ifdef CIPHER_RSA_SUPPORT HI_VOID HAL_RSA_Reset(HI_VOID) { HI_U32 u32Value; HI_U32 u32Virt; if (REG_CRG_CLK_PHY_ADDR_RSA == 0x00) { return; } u32Virt = (HI_U32)osal_ioremap_nocache(REG_CRG_CLK_PHY_ADDR_RSA, 0x100); HAL_CIPHER_ReadReg(u32Virt, &u32Value); HAL_SET_BIT(u32Value, CRG_RST_BIT_RSA); /* reset */ HAL_SET_BIT(u32Value, CRG_CLK_BIT_RSA); /* clock opened */ HAL_CIPHER_WriteReg(u32Virt, u32Value); /* clock select and cancel reset */ HAL_CLEAR_BIT(u32Value, CRG_RST_BIT_RSA); /* cancel reset */ HAL_SET_BIT(u32Value, CRG_CLK_BIT_RSA); /* clock opened */ HAL_CIPHER_WriteReg(u32Virt, u32Value); osal_iounmap((void *)u32Virt); } HI_VOID HAL_RSA_Start(HI_VOID) { HAL_CIPHER_WriteReg(SEC_RSA_START_REG, 0x01); } HI_S32 HAL_RSA_WaitFree(HI_VOID) { HI_U32 u32Value; HI_U32 u32TryCount = 0; do { HAL_CIPHER_ReadReg(SEC_RSA_BUSY_REG, &u32Value); if ((u32Value & RSA_BUSY) == 0) { return HI_SUCCESS; } u32TryCount++; osal_msleep(1); } while (u32TryCount < RSA_RTY_CNT); return HI_FAILURE; } HI_VOID HAL_RSA_ClearRam(HI_VOID) { HI_U32 u32Value; u32Value = RSA_DATA_CLR_INPUT | RSA_DATA_CLR_OUTPUT | RSA_DATA_CLR_KEY | RSA_MOD_SEL_RAM_CLAER; HAL_CIPHER_WriteReg(SEC_RSA_MOD_REG, u32Value); } HI_VOID HAL_RSA_ConfigMode(CIPHER_RSA_KEY_WIDTH_E enKenWidth) { HI_U32 u32Value; u32Value = (enKenWidth << 2) | RSA_MOD_SEL_OPT; HAL_CIPHER_WriteReg(SEC_RSA_MOD_REG, u32Value); } HI_VOID HAL_RSA_WriteData(CIPHER_RSA_DATA_TYPE_E enDataType, HI_U8 *pu8Data, HI_U32 u32DataLen, HI_U32 u32Len) { HI_U32 u32Value; HI_U32 u32Reg; HI_U8 *pPos; HI_U32 i= 0; if (enDataType == CIPHER_RSA_DATA_TYPE_CONTEXT) { u32Reg = SEC_RSA_WDAT_REG; } else { u32Reg = SEC_RSA_WSEC_REG; } pPos = pu8Data; #if 0 /*if length of data is less then Klen, fill 0*/ for(i=0; i<(u32Len - ((u32DataLen + 3)&(~0x03))); i+=4) { HAL_CIPHER_WriteReg(u32Reg, 0x00); } if (u32DataLen&0x03) { u32Value = 0; for(i=0; i<(u32DataLen&0x03); i++) { u32Value |= (*pPos) << (i*8); pPos++; } HAL_CIPHER_WriteReg(u32Reg, u32Value); } #endif for(i=0; i<u32Len; i+=4) { u32Value = (HI_U32)pPos[0]; u32Value |= ((HI_U32)pPos[1]) << 8; u32Value |= ((HI_U32)pPos[2]) << 16; u32Value |= ((HI_U32)pPos[3]) << 24; HAL_CIPHER_WriteReg(u32Reg, u32Value); pPos+=4; } } HI_VOID HAL_RSA_ReadData(HI_U8 *pu8Data, HI_U32 u32DataLen, HI_U32 u32Klen) { HI_U32 u32Value; HI_U8 *pPos; HI_U32 i = 0; pPos = pu8Data; /* for(i=0; i<(u32Klen - u32DataLen); i+=4) { HAL_CIPHER_ReadReg(SEC_RSA_RRSLT_REG, &u32Value); }*/ for(i=0; i<u32Klen; i+=4) { HAL_CIPHER_ReadReg(SEC_RSA_RRSLT_REG, &u32Value); pPos[0] = (HI_U8)(u32Value & 0xFF); pPos[1] = (HI_U8)((u32Value >> 8) & 0xFF); pPos[2] = (HI_U8)((u32Value >> 16) & 0xFF); pPos[3] = (HI_U8)((u32Value >> 24) & 0xFF); pPos+=4; } } HI_U32 HAL_RSA_GetErrorCode(HI_VOID) { HI_U32 u32Value; HAL_CIPHER_ReadReg(SEC_RSA_ERROR_REG, &u32Value); return u32Value; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/sample_rsa_enc.c /****************************************************************************** Copyright (C), 2011-2021, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : sample_rng.c Version : Initial Draft Author : Hisilicon Created : 2012/07/10 Last Modified : Description : sample for hash Function List : History : ******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <assert.h> #include "hi_type.h" #include "hi_unf_cipher.h" #include "hi_mmz_api.h" #include "config.h" #define HI_ERR_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #define HI_INFO_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #ifdef CIPHER_RSA_SUPPORT static HI_S32 printBuffer(const HI_CHAR *string, const HI_U8 *pu8Input, HI_U32 u32Length) { HI_U32 i = 0; if ( NULL != string ) { printf("%s\n", string); } for ( i = 0 ; i < u32Length; i++ ) { if( (i % 16 == 0) && (i != 0)) printf("\n"); printf("0x%02x ", pu8Input[i]); } printf("\n"); return HI_SUCCESS; } static unsigned char test_data[] = {"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"}; unsigned char sha256_sum[32] = { 0x24, 0x8D, 0x6A, 0x61, 0xD2, 0x06, 0x38, 0xB8, 0xE5, 0xC0, 0x26, 0x93, 0x0C, 0x3E, 0x60, 0x39, 0xA3, 0x3C, 0xE4, 0x59, 0x64, 0xFF, 0x21, 0x67, 0xF6, 0xEC, 0xED, 0xD4, 0x19, 0xDB, 0x06, 0xC1, }; static HI_U8 N[] = { 0x82, 0x78, 0xA0, 0xC5, 0x39, 0xE6, 0xF6, 0xA1, 0x5E, 0xD1, 0xC6, 0x8B, 0x9C, 0xF9, 0xC4, 0x3F, 0xEA, 0x19, 0x16, 0xB0, 0x96, 0x3A, 0xB0, 0x5A, 0x94, 0xED, 0x6A, 0xD3, 0x83, 0xE8, 0xA0, 0xFD, 0x01, 0x5E, 0x92, 0x2A, 0x7D, 0x0D, 0xF9, 0x72, 0x1E, 0x03, 0x8A, 0x68, 0x8B, 0x4D, 0x57, 0x55, 0xF5, 0x2F, 0x9A, 0xC9, 0x45, 0xCF, 0x9B, 0xB7, 0xF5, 0x11, 0x94, 0x7A, 0x16, 0x0B, 0xED, 0xD9, 0xA3, 0xF0, 0x63, 0x8A, 0xEC, 0xD3, 0x21, 0xAB, 0xCF, 0x74, 0xFC, 0x6B, 0xCE, 0x06, 0x4A, 0x51, 0xC9, 0x7C, 0x7C, 0xA3, 0xC4, 0x10, 0x63, 0x7B, 0x00, 0xEC, 0x2D, 0x02, 0x18, 0xD5, 0xF1, 0x8E, 0x19, 0x7F, 0xBE, 0xE2, 0x45, 0x5E, 0xD7, 0xA8, 0x95, 0x90, 0x88, 0xB0, 0x73, 0x35, 0x89, 0x66, 0x1C, 0x23, 0xB9, 0x6E, 0x88, 0xE0, 0x7A, 0x57, 0xB0, 0x55, 0x8B, 0x81, 0x9B, 0x9C, 0x34, 0x9F, 0x86, 0x0E, 0x15, 0x94, 0x2C, 0x6B, 0x12, 0xC3, 0xB9, 0x56, 0x60, 0x25, 0x59, 0x3E, 0x50, 0x7B, 0x62, 0x4A, 0xD0, 0xF0, 0xB6, 0xB1, 0x94, 0x83, 0x51, 0x66, 0x6F, 0x60, 0x4D, 0xEF, 0x8F, 0x94, 0xA6, 0xD1, 0xA2, 0x80, 0x06, 0x24, 0xF2, 0x6E, 0xD2, 0xC7, 0x01, 0x34, 0x8D, 0x2B, 0x6B, 0x03, 0xF7, 0x05, 0xA3, 0x99, 0xCC, 0xC5, 0x16, 0x75, 0x1A, 0x81, 0xC1, 0x67, 0xA0, 0x88, 0xE6, 0xE9, 0x00, 0xFA, 0x62, 0xAF, 0x2D, 0xA9, 0xFA, 0xC3, 0x30, 0x34, 0x98, 0x05, 0x4C, 0x1A, 0x81, 0x0C, 0x52, 0xCE, 0xBA, 0xD6, 0xEB, 0x9C, 0x1E, 0x76, 0x01, 0x41, 0x6C, 0x34, 0xFB, 0xC0, 0x83, 0xC5, 0x4E, 0xB3, 0xF2, 0x5B, 0x4F, 0x94, 0x08, 0x33, 0x87, 0x5E, 0xF8, 0x39, 0xEF, 0x7F, 0x72, 0x94, 0xFF, 0xD7, 0x51, 0xE8, 0xA2, 0x5E, 0x26, 0x25, 0x5F, 0xE9, 0xCC, 0x2A, 0x7D, 0xAC, 0x5B, 0x35 }; static HI_U8 E[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01 }; static HI_U8 D[] = { 0x49, 0x7E, 0x93, 0xE9, 0xA5, 0x7D, 0x42, 0x0E, 0x92, 0xB0, 0x0E, 0x6C, 0x94, 0xC7, 0x69, 0x52, 0x2B, 0x97, 0x68, 0x5D, 0x9E, 0xB2, 0x7E, 0xA6, 0xF7, 0xDF, 0x69, 0x5E, 0xAE, 0x9E, 0x7B, 0x19, 0x2A, 0x0D, 0x50, 0xBE, 0xD8, 0x64, 0xE7, 0xCF, 0xED, 0xB2, 0x46, 0xE4, 0x2F, 0x1C, 0x29, 0x07, 0x45, 0xAF, 0x44, 0x3C, 0xFE, 0xB3, 0x3C, 0xDF, 0x7A, 0x10, 0x26, 0x18, 0x43, 0x95, 0x02, 0xAD, 0xA7, 0x98, 0x81, 0x2A, 0x3F, 0xCF, 0x8A, 0xD7, 0x12, 0x6C, 0xAE, 0xC8, 0x37, 0x6C, 0xF9, 0xAE, 0x6A, 0x96, 0x52, 0x4B, 0x99, 0xE5, 0x35, 0x74, 0x93, 0x87, 0x76, 0xAF, 0x08, 0xB8, 0x73, 0x72, 0x7D, 0x50, 0xA5, 0x81, 0x26, 0x5C, 0x8F, 0x94, 0xEA, 0x73, 0x59, 0x5C, 0x33, 0xF9, 0xC3, 0x65, 0x1E, 0x92, 0xCD, 0x20, 0xC3, 0xBF, 0xD7, 0x8A, 0xCF, 0xCC, 0xD0, 0x61, 0xF8, 0xFB, 0x1B, 0xF4, 0xB6, 0x0F, 0xD4, 0xCF, 0x3E, 0x55, 0x48, 0x4C, 0x99, 0x2D, 0x40, 0x44, 0x7C, 0xBA, 0x7B, 0x6F, 0xDB, 0x5D, 0x71, 0x91, 0x2D, 0x93, 0x80, 0x19, 0xE3, 0x26, 0x5D, 0x59, 0xBE, 0x46, 0x6D, 0x90, 0x4B, 0xDF, 0x72, 0xCE, 0x6C, 0x69, 0x72, 0x8F, 0x5B, 0xA4, 0x74, 0x50, 0x2A, 0x42, 0x95, 0xB2, 0x19, 0x04, 0x88, 0xD7, 0xDA, 0xBB, 0x17, 0x23, 0x69, 0xF4, 0x52, 0xEB, 0xC8, 0x55, 0xBE, 0xBC, 0x2E, 0xA9, 0xD0, 0x57, 0x7D, 0xC6, 0xC8, 0x8B, 0x86, 0x7B, 0x73, 0xCD, 0xE4, 0x32, 0x79, 0xC0, 0x75, 0x53, 0x53, 0xE7, 0x59, 0x38, 0x0A, 0x8C, 0xEC, 0x06, 0xA9, 0xFC, 0xA5, 0x15, 0x81, 0x61, 0x3E, 0x44, 0xCD, 0x05, 0xF8, 0x54, 0x04, 0x00, 0x79, 0xB2, 0x0D, 0x69, 0x2A, 0x47, 0x60, 0x1A, 0x2B, 0x79, 0x3D, 0x4B, 0x50, 0x8A, 0x31, 0x72, 0x48, 0xBB, 0x75, 0x78, 0xD6, 0x35, 0x90, 0xE1, }; static HI_U8 NO_PADDING[] = { 0x31, 0x5d, 0xfa, 0x52, 0xa4, 0x93, 0x52, 0xf8, 0xf5, 0xed, 0x39, 0xf4, 0xf8, 0x23, 0x4b, 0x30, 0x11, 0xa2, 0x2c, 0x5b, 0xa9, 0x8c, 0xcf, 0xdf, 0x19, 0x66, 0xf5, 0xf5, 0x1a, 0x6d, 0xf6, 0x25, 0x89, 0xaf, 0x06, 0x13, 0xdc, 0xa4, 0xd4, 0x0b, 0x3c, 0x1c, 0x4f, 0xb9, 0xd3, 0xd0, 0x63, 0x29, 0x2a, 0x5d, 0xfe, 0xb6, 0x99, 0x20, 0x58, 0x36, 0x2b, 0x1d, 0x57, 0xf4, 0x71, 0x38, 0xa7, 0x8b, 0xad, 0x8c, 0xef, 0x1f, 0x2f, 0xea, 0x4c, 0x87, 0x2b, 0xd7, 0xb8, 0xc8, 0xb8, 0x09, 0xcb, 0xb9, 0x05, 0xab, 0x43, 0x41, 0xd9, 0x75, 0x36, 0x4d, 0xb6, 0x8a, 0xd3, 0x45, 0x96, 0xfd, 0x9c, 0xe8, 0x6e, 0xc8, 0x37, 0x5e, 0x4f, 0x63, 0xf4, 0x1c, 0x18, 0x2c, 0x38, 0x79, 0xe2, 0x5a, 0xe5, 0x1d, 0x48, 0xf6, 0xb2, 0x79, 0x57, 0x12, 0xab, 0xae, 0xc1, 0xb1, 0x9d, 0x11, 0x4f, 0xa1, 0x4d, 0x1b, 0x4c, 0x8c, 0x3a, 0x2d, 0x7b, 0x98, 0xb9, 0x89, 0x7b, 0x38, 0x84, 0x13, 0x8e, 0x3f, 0x3c, 0xe8, 0x59, 0x26, 0x90, 0x77, 0xe7, 0xca, 0x52, 0xbf, 0x3a, 0x5e, 0xe2, 0x58, 0x54, 0xd5, 0x9b, 0x2a, 0x0d, 0x33, 0x31, 0xf4, 0x4d, 0x68, 0x68, 0xf3, 0xe9, 0xb2, 0xbe, 0x28, 0xeb, 0xce, 0xdb, 0x36, 0x1e, 0xae, 0xb7, 0x37, 0xca, 0xaa, 0xf0, 0x9c, 0x6e, 0x27, 0x93, 0xc9, 0x61, 0x76, 0x99, 0x1a, 0x0a, 0x99, 0x57, 0xa8, 0xea, 0x71, 0x96, 0x63, 0xbc, 0x76, 0x11, 0x5c, 0x0c, 0xd4, 0x70, 0x0b, 0xd8, 0x1c, 0x4e, 0x95, 0x89, 0x5b, 0x09, 0x17, 0x08, 0x44, 0x70, 0xec, 0x60, 0x7c, 0xc9, 0x8a, 0xa0, 0xe8, 0x98, 0x64, 0xfa, 0xe7, 0x52, 0x73, 0xb0, 0x04, 0x9d, 0x78, 0xee, 0x09, 0xa1, 0xb9, 0x79, 0xd5, 0x52, 0x4f, 0xf2, 0x39, 0x1c, 0xf7, 0xb9, 0x73, 0xe0, 0x3d, 0x6b, 0x54, 0x64, 0x86 }; HI_S32 PKCS_PUB_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_E enScheme, HI_U8 *pu8Expect) { HI_S32 ret = HI_SUCCESS; HI_U8 u8Enc[256]; HI_U8 u8Dec[256]; HI_U32 u32OutLen; HI_UNF_CIPHER_RSA_PUB_ENC_S stRsaEnc; HI_UNF_CIPHER_RSA_PRI_ENC_S stRsaDec; ret = HI_UNF_CIPHER_Init(); if ( HI_SUCCESS != ret ) { return HI_FAILURE; } memset(&stRsaEnc, 0, sizeof(HI_UNF_CIPHER_RSA_PUB_ENC_S)); memset(&stRsaDec, 0, sizeof(HI_UNF_CIPHER_RSA_PRI_ENC_S)); stRsaEnc.enScheme = enScheme; stRsaEnc.stPubKey.pu8N = N; stRsaEnc.stPubKey.pu8E = E; stRsaEnc.stPubKey.u16NLen = sizeof(N); stRsaEnc.stPubKey.u16ELen = sizeof(E); if(enScheme == HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING) { ret = HI_UNF_CIPHER_RsaPublicEnc(&stRsaEnc, NO_PADDING, 256, u8Enc, &u32OutLen); } else { ret = HI_UNF_CIPHER_RsaPublicEnc(&stRsaEnc, test_data, sizeof(test_data) - 1, u8Enc, &u32OutLen); } if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaPublicEnc failed\n"); return HI_FAILURE; } if(pu8Expect != HI_NULL) { if(memcmp(u8Enc, pu8Expect, u32OutLen) != 0) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaPublicEnc failed\n"); printBuffer("enc", u8Enc, u32OutLen); printBuffer("expect", pu8Expect, 256); return HI_FAILURE; } } stRsaDec.enScheme = enScheme; stRsaDec.stPriKey.pu8N = N; stRsaDec.stPriKey.pu8D = D; stRsaDec.stPriKey.u16NLen = sizeof(N); stRsaDec.stPriKey.u16DLen = sizeof(D); ret = HI_UNF_CIPHER_RsaPrivateDec(&stRsaDec, u8Enc, u32OutLen, u8Dec, &u32OutLen); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaVerify failed\n"); return HI_FAILURE; } if(enScheme == HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING) { if(memcmp(u8Dec, NO_PADDING, 256) != 0) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaPrivateDec failed\n"); printBuffer("dec", u8Dec, u32OutLen); printBuffer("expect", NO_PADDING, 256); return HI_FAILURE; } } else { if((sizeof(test_data) - 1) != u32OutLen) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaPrivateDec len error\n"); printf("dec: 0x%x, expect: 0x%x\n", u32OutLen, sizeof(test_data) - 1); return HI_FAILURE; } if(memcmp(u8Dec, test_data, sizeof(test_data) - 1) != 0) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaPrivateDec failed\n"); printBuffer("enc", u8Enc, u32OutLen); printBuffer("expect", test_data, sizeof(test_data) - 1); return HI_FAILURE; } } printf("sample %s run successfully!\n", __FUNCTION__); HI_UNF_CIPHER_DeInit(); return HI_SUCCESS; } HI_S32 PKCS_PRI_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_E enScheme) { HI_S32 ret = HI_SUCCESS; HI_U8 u8Sign[256]; HI_U32 u32SignLen; HI_U8 u8Hash[32]; HI_U32 u32HLen; HI_UNF_CIPHER_RSA_PRI_ENC_S stRsaEnc; HI_UNF_CIPHER_RSA_PUB_ENC_S stRsaDec; ret = HI_UNF_CIPHER_Init(); if ( HI_SUCCESS != ret ) { return HI_FAILURE; } memset(&stRsaEnc, 0, sizeof(HI_UNF_CIPHER_RSA_PRI_ENC_S)); memset(&stRsaDec, 0, sizeof(HI_UNF_CIPHER_RSA_PUB_ENC_S)); stRsaEnc.enScheme = enScheme; stRsaDec.enScheme = enScheme; if (enScheme == HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1) { printf("Generate a RSA KEY...\n"); stRsaEnc.stPriKey.pu8N = (HI_U8*)malloc(256); stRsaEnc.stPriKey.pu8E = (HI_U8*)malloc(256); stRsaEnc.stPriKey.pu8D = (HI_U8*)malloc(256); ret = HI_UNF_CIPHER_RsaGenKey(2048, 0x10001, &stRsaEnc.stPriKey); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaGenKey failed\n"); return HI_FAILURE; } stRsaDec.stPubKey.pu8N = stRsaEnc.stPriKey.pu8N; stRsaDec.stPubKey.pu8E = stRsaEnc.stPriKey.pu8E; stRsaDec.stPubKey.u16NLen = stRsaEnc.stPriKey.u16NLen; stRsaDec.stPubKey.u16ELen = stRsaEnc.stPriKey.u16ELen; printBuffer ("N", stRsaEnc.stPriKey.pu8N, stRsaEnc.stPriKey.u16NLen); printBuffer ("E", stRsaEnc.stPriKey.pu8E, stRsaEnc.stPriKey.u16ELen); printBuffer ("D", stRsaEnc.stPriKey.pu8D, stRsaEnc.stPriKey.u16DLen); #ifdef CIPHER_KLAD_SUPPORT ret = HI_UNF_CIPHER_KladEncryptKey(HI_UNF_CIPHER_KEY_SRC_EFUSE_1, HI_UNF_CIPHER_KLAD_TARGET_RSA, stRsaEnc.stPriKey.pu8D, stRsaEnc.stPriKey.pu8D, stRsaEnc.stPriKey.u16DLen); if(HI_SUCCESS != ret) { HI_ERR_CIPHER("Error: Klad Encrypt Key failed!\n"); return HI_FAILURE; } printBuffer("ENC_D", stRsaEnc.stPriKey.pu8D, stRsaEnc.stPriKey.u16DLen); stRsaEnc.enKeySrc = HI_UNF_CIPHER_KEY_SRC_KLAD_1; #endif } else { stRsaEnc.stPriKey.pu8N = N; stRsaEnc.stPriKey.pu8D = D; stRsaEnc.stPriKey.u16NLen = sizeof(N); stRsaEnc.stPriKey.u16DLen = sizeof(D); stRsaDec.stPubKey.pu8N = N; stRsaDec.stPubKey.pu8E = E; stRsaDec.stPubKey.u16NLen = sizeof(N); stRsaDec.stPubKey.u16ELen = sizeof(E); stRsaEnc.enKeySrc = HI_UNF_CIPHER_KEY_SRC_USER; } ret = HI_UNF_CIPHER_RsaPrivateEnc(&stRsaEnc, sha256_sum, 32, u8Sign, &u32SignLen); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaSign failed\n"); return HI_FAILURE; } switch(enScheme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: break; default: break; } // printBuffer("sign", u8Sign, u32SignLen); ret = HI_UNF_CIPHER_RsaPublicDec(&stRsaDec, u8Sign, u32SignLen, u8Hash, &u32HLen); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaVerify failed\n"); return HI_FAILURE; } switch(enScheme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: if(memcmp(u8Hash, sha256_sum, u32HLen) != 0) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaPublicDec failed\n"); printBuffer("sign", u8Sign, u32SignLen); printBuffer("sha256_sum", sha256_sum, sizeof(sha256_sum)); return HI_FAILURE; } break; default: break; } if (enScheme == HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1) { free(stRsaEnc.stPriKey.pu8N); free(stRsaEnc.stPriKey.pu8E); free(stRsaEnc.stPriKey.pu8D); } printf("\033[0;1;32m""sample PKCS_PRI_ENC run successfully!\n""\033[0m"); HI_UNF_CIPHER_DeInit(); return HI_SUCCESS; } int sample_rsa_enc() { HI_S32 s32Ret = HI_SUCCESS; s32Ret = PKCS_PUB_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING, HI_NULL); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = PKCS_PUB_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2, HI_NULL); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = PKCS_PUB_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA1, HI_NULL); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = PKCS_PUB_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA256, HI_NULL); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = PKCS_PUB_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_PKCS1_V1_5, HI_NULL); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = PKCS_PRI_ENC(HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1); if (s32Ret != HI_SUCCESS) { return s32Ret; } return HI_SUCCESS; } #else int sample_rsa_enc() { printf("RSA not support!!!\n"); return HI_SUCCESS; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/Makefile ################################################################################ # Select Wi-Fi device # # Supported device: # 1) usb_rtl8188eus # 3) sdio_ap6212 # 4) sdio_ap6212a # 5) sdio_ap6214a # 6) sdio_ap6474 # 8) sdio_8801 # 9) sdio_hi1131sv100 ################################################################################ #WIFI_DEVICE ?= usb_mt7601u WIFI_DEVICE ?= sdio_hi1131sv100 ################################################################################ # 编译 wifi 驱动时,需要自行指定 liteos 系统的路径 ################################################################################ #LITEOSTOPDIR ?= /home/os/liushanping/bvt/liteos/liteos #LITEOSTOPDIR ?= $(CURDIR)/../liteos CURDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) #LITEOSTOPDIR ?= $(CURDIR)/../liteos LITEOSTOPDIR ?= $(CURDIR)/../../osdrv/opensource/liteos/liteos include ${LITEOSTOPDIR}/config.mk ROOTOUT := $(CURDIR)/out/${LITEOS_PLATFORM} COMPLIE_ROOT := $(CURDIR) WIFI_DRIVER := $(WIFI_DEVICE) ifeq ($(WIFI_DEVICE), sdio_ap6212) WIFI_DRIVER = sdio_bcm endif ifeq ($(WIFI_DEVICE), sdio_ap6212a) WIFI_DRIVER = sdio_bcm endif ifeq ($(WIFI_DEVICE), sdio_ap6214a) WIFI_DRIVER = sdio_bcm endif ifeq ($(WIFI_DEVICE), sdio_ap6474) WIFI_DRIVER = sdio_bcm endif export LITEOSTOPDIR export ROOTOUT export COMPLIE_ROOT # 每次要发布时,即执行 make release 之前,需要人工配置下要支持的芯片 RELEASE_WIFI_DEVICE = usb_rtl8188eus usb_mt7601u sdio_ap6212 sdio_ap6212a \ sdio_ap6214a sdio_ap6474 sdio_rtl8189ftv sdio_8801 sdio_hi1131sv100 all: driver tools $(ROOTOUT): mkdir -p $(ROOTOUT) mkdir -p $(ROOTOUT)/lib driver: $(ROOTOUT) $(MAKE) -C drv/$(WIFI_DRIVER) DEVICE_TYPE=$(WIFI_DEVICE) tools: $(ROOTOUT) $(MAKE) -C tools/wpa_supplicant-2.2 DEVICE_TYPE=$(WIFI_DEVICE) $(MAKE) -C tools/iperf-2.0.5 DEVICE_TYPE=$(WIFI_DEVICE) sample: $(MAKE) -C sample/$(WIFI_DRIVER) DEVICE_TYPE=$(WIFI_DEVICE) clean: $(RM) -rf $(CURDIR)/out driver_clean: $(RM) -rf $(ROOTOUT)/obj/$(WIFI_DRIVER) DEVICE_TYPE=$(WIFI_DEVICE) tools_clean: $(RM) -rf $(ROOTOUT)/obj/wpa_supplicant-2.2 DEVICE_TYPE=$(WIFI_DEVICE) sample_clean: $(MAKE) -C sample/$(WIFI_DRIVER) DEVICE_TYPE=$(WIFI_DEVICE) clean release: $(ROOTOUT) for dir in $(RELEASE_WIFI_DEVICE);\ do \ WIFI_DRIVER=$$dir;\ if [ $$dir == sdio_ap6212 ];then \ WIFI_DRIVER=sdio_bcm;\ elif [ $$dir == sdio_ap6212a ];then \ WIFI_DRIVER=sdio_bcm;\ elif [ $$dir == sdio_ap6214a ];then \ WIFI_DRIVER=sdio_bcm;\ elif [ $$dir == sdio_ap6474 ];then \ WIFI_DRIVER=sdio_bcm;\ fi; \ $(MAKE) -C drv/$$WIFI_DRIVER DEVICE_TYPE=$$dir release;\ if [ $$dir == usb_rtl8188eus ] || [ $$dir == sdio_rtl8189ftv ] || [ $$dir == usb_mt7601u ];then \ $(MAKE) -C tools/wpa_supplicant-2.2 DEVICE_TYPE=$$dir release;\ fi; \ $(RM) -rf $(ROOTOUT)/lib/*;\ $(RM) -rf $(ROOTOUT)/obj;\ done $(RM) -rf $(CURDIR)/out @echo "=============== make release lib done ===============" release_clean: $(RM) -rf $(CURDIR)/out $(RM) -rf $(CURDIR)/release @echo "=============== make release clean done ===============" hi1131s_release: @echo "===start to make release===" rm -rf sdk_lib_release/new mkdir -p $(CURDIR)/sdk_lib_release/new cp -rf drv sample tools $(CURDIR)/sdk_lib_release/new cp Makefile $(CURDIR)/sdk_lib_release/new #python delete name cp sdk_lib_release/hi1131s_tools/cp_wanted_ftree.py sdk_lib_release/hi1131s_tools/dst_src_dirs.conf $(CURDIR) python cp_wanted_ftree.py dst_src_dirs.conf rm -rf cp_wanted_ftree.py dst_src_dirs.conf cp drv/sdio_hi1131sv100/driver/hi3518ev200/libhi1131wifi.a sdk_lib_release/new_no_name/drv/sdio_hi1131sv100/driver/hi3518ev200/libhi1131wifi.a #rename new_no_name rm -rf sdk_lib_release/new mv sdk_lib_release/new_no_name sdk_lib_release/new hi1131s_release_clean: rm -rf sdk_lib_release/new_no_name sdk_lib_release/new .PHONY: all driver tools clean driver_clean tools_clean sample sample_clean release release_clean <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/boardconfig.h #ifndef __BOARDCONFIG_H #define __BOARDCONFIG_H #include "stm8l15x.h" #include "rtc.h" #include "adc.h" #include "halt.h" //SWIM 烧入IO PA0 #define SWIM_GPIO GPIOA #define SWIM_GPIO_Pin GPIO_Pin_0 //串口接收IO PC6 #define USART_RX_GPIO GPIOC #define USART_RX_GPIO_Pin GPIO_Pin_6 //串口发送IO PC5 #define USART_TX_GPIO GPIOC #define USART_TX_GPIO_Pin GPIO_Pin_5 //开机键PC1 #define SW_KEY_GPIO GPIOC #define SW_KEY_GPIO_Pin GPIO_Pin_1 //主控设置wifi寄存器标志IO PA2 #define REG_ON_DET_GPIO GPIOA #define REG_ON_DET_GPIO_Pin GPIO_Pin_2 //wifi唤醒标志位IO PA3 #define MCU_GPIO2_GPIO GPIOA #define MCU_GPIO2_GPIO_Pin GPIO_Pin_3 //未发现使用 PC4 #define MCU_GPIO3_GPIO GPIOC #define MCU_GPIO3_GPIO_Pin GPIO_Pin_4 #define PWR_EN_GPIO GPIOB #define PWR_EN_GPIO_Pin GPIO_Pin_0 #define PWR_HOLD_GPIO GPIOD #define PWR_HOLD_GPIO_Pin GPIO_Pin_0 #define BAT_LOW_DET_GPIO GPIOB #define BAT_LOW_DET_GPIO_Pin GPIO_Pin_2 #define BT_HOST_WAKE_GPIO GPIOB #define BT_HOST_WAKE_GPIO_Pin GPIO_Pin_3 #define BT_REG_ON_GPIO GPIOB #define BT_REG_ON_GPIO_Pin GPIO_Pin_4 #define WIFI_REG_ON_GPIO GPIOB #define WIFI_REG_ON_GPIO_Pin GPIO_Pin_5 #define WIFI_GPIO2_GPIO GPIOB #define WIFI_GPIO2_GPIO_Pin GPIO_Pin_6 //#define WIFI_GPIO1_GPIO GPIOB //#define WIFI_GPIO1_GPIO_Pin GPIO_Pin_7 #define WIFI_GPIO1_GPIO GPIOC #define WIFI_GPIO1_GPIO_Pin GPIO_Pin_0 #define VBUS_DETECT GPIOB #define VBUS_DETECT_GPIO_Pin GPIO_Pin_1 #define ADCIN_GPIO GPIOB #define ADCIN_GPIO_Pin GPIO_Pin_0 //#define PIR_GPIO GPIOC //#define PIR_GPIO_Pin GPIO_Pin_0 #define PIR_GPIO GPIOB #define PIR_GPIO_Pin GPIO_Pin_0 #define KEY_OUT_GPIO GPIOB #define KEY_OUT_GPIO_Pin GPIO_Pin_7 //PB6 #define WL_EN_GPIO GPIOB #define WL_EN_GPIO_Pin GPIO_Pin_6 //PB5 #define DEV_PWR_GPIO GPIOB #define DEV_PWR_GPIO_Pin GPIO_Pin_5 //PC0 #define D2H_WAK_GPIO GPIOC #define D2H_WAK_GPIO_Pin GPIO_Pin_0 #define MCU_GPIO1_GPIO GPIOA #define MCU_GPIO1_GPIO_Pin GPIO_Pin_2 //此前预留于电池电量 #define VBAT_DETECT GPIOD #define VBAT_DETECT_GPIO_Pin GPIO_Pin_3 /* KEY */ #define KEY_VALID_LEVEL 0 #define KEY_CHECK_CYCLE 5 #define KEY_JITTER_CHECK_CYCLE 5 #define PWR_ON_KEY_KEEP_COUNT 500 //unit is 4ms #define PWR_OFF_KEY_KEEP_COUNT 300 /* VBUS and VBAT */ #define VBUS_VALID_LEVEL 1 #define VBAT_VALID_LEVEL 1 #define UF_START 0 #define UF_LEN 1 #define UF_CMD 2 #define UF_DATA 3 #define UF_MAX_LEN 64 //此数需2的n次方,以便后续与操作等效取余操作,以优化指令,提高性能 #define GPIO_DEBOUNCE 2 #define MIN_CMD_LEN 4 #define CMD_LEN 8 #define CMDFLAG_START 0x7B #define ENABLE_RTC 0 //是否编译RTC定时器 extern u8 g_IsSystemOn; extern u8 g_Key_Handle_Flag; extern u8 g_WakeUp_Halt_Flag ; //唤醒标志 extern u8 g_Wifi_WakeUp ; //WIFI唤醒标志 extern u8 g_Bar_Det_Flag; extern u8 g_Vbus_Check; extern u8 USART_Send_Buf[UF_MAX_LEN]; extern u8 USART_Receive_Buf[UF_MAX_LEN]; extern u32 USART_Receive_Flag; extern u16 USART_Receive_Timeout; extern u16 g_WakeUp_Key_Flag; //halt模式延时开机计数 extern void InitExitHaltMode(void); void Board_Init(void); void CLK_Config(void); void TIM3_Config(void); void Usart_Config(void); void PWR_ON(void); void PWR_OFF(void); void USART_Send_Data(unsigned char *Dbuf,unsigned int len); u8 XOR_Inverted_Check(unsigned char *inBuf,unsigned char inLen); void Response_CMD_Handle(); void Request_CMD_Handle(u8* cmdstr, u8 len); void Uart_Handle(void); void Key_Handle(void); #endif /* __BOARDCONFIG_H */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/sample_cipher.c /****************************************************************************** Copyright (C), 2011-2021, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : sample_rng.c Version : Initial Draft Author : Hisilicon Created : 2012/07/10 Last Modified : Description : sample for cipher Function List : History : ******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <assert.h> #include "hi_type.h" #include "hi_unf_cipher.h" #include "hi_mmz_api.h" #include "config.h" #define HI_ERR_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #define HI_INFO_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #ifdef CIPHER_MULTICIPHER_SUPPORT static HI_S32 printBuffer(HI_CHAR *string, HI_U8 *pu8Input, HI_U32 u32Length) { HI_U32 i = 0; if ( NULL != string ) { printf("%s\n", string); } for ( i = 0 ; i < u32Length; i++ ) { if( (i % 16 == 0) && (i != 0)) printf("\n"); printf("0x%02x ", pu8Input[i]); } printf("\n"); return HI_SUCCESS; } static HI_S32 Setconfiginfo(HI_HANDLE chnHandle, HI_UNF_CIPHER_KEY_SRC_E enKeySrc, HI_UNF_CIPHER_ALG_E alg, HI_UNF_CIPHER_WORK_MODE_E mode, HI_UNF_CIPHER_KEY_LENGTH_E keyLen, const HI_U8 u8KeyBuf[32], const HI_U8 u8IVBuf[16]) { HI_S32 s32Ret = HI_SUCCESS; HI_UNF_CIPHER_CTRL_S CipherCtrl; memset(&CipherCtrl, 0, sizeof(HI_UNF_CIPHER_CTRL_S)); CipherCtrl.enAlg = alg; CipherCtrl.enWorkMode = mode; CipherCtrl.enBitWidth = HI_UNF_CIPHER_BIT_WIDTH_128BIT; CipherCtrl.enKeyLen = keyLen; CipherCtrl.enKeySrc = enKeySrc; if((mode == HI_UNF_CIPHER_WORK_MODE_CBC) ||(mode == HI_UNF_CIPHER_WORK_MODE_CFB) ||(mode == HI_UNF_CIPHER_WORK_MODE_OFB) ||(mode == HI_UNF_CIPHER_WORK_MODE_CTR)) { CipherCtrl.stChangeFlags.bit1IV = 1; //must set for CBC , CFB mode memcpy(CipherCtrl.u32IV, u8IVBuf, 16); } if ( HI_UNF_CIPHER_KEY_SRC_USER == enKeySrc ) { memcpy(CipherCtrl.u32Key, u8KeyBuf, 32); } s32Ret = HI_UNF_CIPHER_ConfigHandle(chnHandle, &CipherCtrl); if(HI_SUCCESS != s32Ret) { return HI_FAILURE; } return HI_SUCCESS; } /* encrypt data using special chn*/ static HI_S32 CBC_AES128(HI_VOID) { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 16; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; HI_U8 aes_key[16] = {<KEY>}; HI_U8 aes_IV[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}; HI_U8 aes_src[16] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A}; HI_U8 aes_dst[16] = {0x76,0x49,0xAB,0xAC,0x81,0x19,0xB2,0x46,0xCE,0xE9,0x8E,0x9B,0x12,0xE9,0x19,0x7D}; printf("\n--------------------------%s-----------------------\n", __FUNCTION__); s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return s32Ret; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return s32Ret; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); /* For encrypt */ s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CBC, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_src, u32TestDataLen); printBuffer("CBC-AES-128-ORI:", aes_src, sizeof(aes_src)); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CBC-AES-128-ENC:", pOutputAddrVir, sizeof(aes_dst)); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_dst, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ memcpy(pInputAddrVir, aes_dst, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CBC, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CBC-AES-128-DEC:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_src, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printf("\033[0;1;32m""\%s test pass !!!\n""\033[0m", __FUNCTION__); __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } static HI_S32 CFB_AES128(HI_VOID) { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 32; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; HI_U8 aes_key[16] = {"\<KEY>"}; HI_U8 aes_IV[16] = {"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"}; HI_U8 aes_src[32] = {"\x6B\xC1\xBE\xE2\x2E\x40\x9F\x96\xE9\x3D\x7E\x11\x73\x93\x17\x2A\xAE\x2D\x8A\x57\x1E\x03\xAC\x9C\x9E\xB7\x6F\xAC\x45\xAF\x8E\x51"}; HI_U8 aes_dst[32] = {"\x3B\x3F\xD9\x2E\xB7\x2D\xAD\x20\x33\x34\x49\xF8\xE8\x3C\xFB\x4A\xC8\xA6\x45\x37\xA0\xB3\xA9\x3F\xCD\xE3\xCD\xAD\x9F\x1C\xE5\x8B"}; printf("\n--------------------------%s-----------------------\n", __FUNCTION__); s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return s32Ret; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return s32Ret; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); /* For encrypt */ s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CFB, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_src, u32TestDataLen); printBuffer("CFB-AES-128-ORI:", aes_src, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CFB-AES-128-ENC:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_dst, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ memcpy(pInputAddrVir, aes_dst, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CFB, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CFB-AES-128-DEC", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_src, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printf("\033[0;1;32m""\%s test pass !!!\n""\033[0m", __FUNCTION__); __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } static HI_S32 CTR_AES128(HI_VOID) { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 30; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; HI_U8 aes_key[16] = {"\<KEY>"}; HI_U8 aes_IV[16] = {"\<KEY>"}; HI_U8 aes_src[32] = {"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"}; HI_U8 aes_dst[32] = {"\x51\x04\xA1\x06\x16\x8A\x72\xD9\x79\x0D\x41\xEE\x8E\xDA\xD3\x8<KEY>0\xDF\x91\x41\xBE\x28"}; printf("\n--------------------------%s-----------------------\n", __FUNCTION__); s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return s32Ret; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return s32Ret; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); /* For encrypt */ s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CTR, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_src, u32TestDataLen); printBuffer("CTR-AES-128-ORI:", aes_src, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CTR-AES-128-ENC:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_dst, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ memcpy(pInputAddrVir, aes_dst, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = Setconfiginfo(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CTR, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_IV); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CTR-AES-128-DEC", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_src, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printf("\033[0;1;32m""\%s test pass !!!\n""\033[0m", __FUNCTION__); __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } #ifdef CIPHER_CCM_GCM_SUPPORT static HI_S32 SetconfiginfoEx(HI_HANDLE chnHandle, HI_UNF_CIPHER_KEY_SRC_E enKeySrc, HI_UNF_CIPHER_ALG_E alg, HI_UNF_CIPHER_WORK_MODE_E mode, HI_UNF_CIPHER_KEY_LENGTH_E keyLen, const HI_U8 u8KeyBuf[32], const HI_U8 u8IVBuf[16], HI_UNF_CIPHER_CCM_INFO_S *pstCCM, HI_UNF_CIPHER_GCM_INFO_S *pstGCM) { HI_S32 s32Ret = HI_SUCCESS; HI_UNF_CIPHER_CTRL_S CipherCtrl; memset(&CipherCtrl, 0, sizeof(HI_UNF_CIPHER_CTRL_S)); CipherCtrl.enAlg = alg; CipherCtrl.enWorkMode = mode; CipherCtrl.enBitWidth = HI_UNF_CIPHER_BIT_WIDTH_128BIT; CipherCtrl.enKeyLen = keyLen; CipherCtrl.enKeySrc = enKeySrc; if((mode == HI_UNF_CIPHER_WORK_MODE_CBC) ||(mode == HI_UNF_CIPHER_WORK_MODE_CFB) ||(mode == HI_UNF_CIPHER_WORK_MODE_OFB) ||(mode == HI_UNF_CIPHER_WORK_MODE_CTR) ||(mode == HI_UNF_CIPHER_WORK_MODE_GCM)) { CipherCtrl.stChangeFlags.bit1IV = 1; //must set for CBC , CFB mode memcpy(CipherCtrl.u32IV, u8IVBuf, 16); } if ((mode == HI_UNF_CIPHER_WORK_MODE_CCM) && (pstCCM != HI_NULL)) { memcpy(&CipherCtrl.unModeInfo.stCCM, pstCCM, sizeof(HI_UNF_CIPHER_CCM_INFO_S)); CipherCtrl.stChangeFlags.bit1IV = 1; } if ((mode == HI_UNF_CIPHER_WORK_MODE_GCM) && (pstGCM != HI_NULL)) { memcpy(&CipherCtrl.unModeInfo.stGCM, pstGCM, sizeof(HI_UNF_CIPHER_GCM_INFO_S)); } if ( HI_UNF_CIPHER_KEY_SRC_USER == enKeySrc ) { memcpy(CipherCtrl.u32Key, u8KeyBuf, 32); } s32Ret = HI_UNF_CIPHER_ConfigHandle(chnHandle, &CipherCtrl); if(HI_SUCCESS != s32Ret) { return HI_FAILURE; } return HI_SUCCESS; } // Klen = 128, Tlen =32, Nlen = 56, Alen = 64, and Plen = 32 // t = 4, q=8, p=4 HI_S32 CCM_AES128(HI_VOID) { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 4; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; HI_UNF_CIPHER_CCM_INFO_S stCCM; HI_U8 aes_key[16] = {"\<KEY>"}; HI_U8 aes_n[7] = {"\x10\x11\x12\x13\x14\x15\x16"}; HI_U8 aes_a[8] = {"\x00\x01\x02\x03\x04\x05\x06\x07"}; HI_U8 aes_src[4] = {"\x20\x21\x22\x23"}; HI_U8 aes_dst[4] = {"\x71\x62\x01\x5b"}; HI_U8 aes_tag[4] = {"\x4d\xac\x25\x5d"}; HI_U8 out_tag[4]; printf("\n--------------------------%s-----------------------\n", __FUNCTION__); s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return s32Ret; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return s32Ret; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(32, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(32, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); memset(&stCCM, 0, sizeof(HI_UNF_CIPHER_CCM_INFO_S)); memcpy(&stCCM.u8Nonce, aes_n, sizeof(aes_n)); stCCM.pu8Aad = aes_a; stCCM.u32ALen = 8; stCCM.u8NLen = 7; stCCM.u32MLen = 4; stCCM.u8TLen = 4; /* For encrypt */ s32Ret = SetconfiginfoEx(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CCM, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, HI_NULL, &stCCM, HI_NULL); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_src, u32TestDataLen); printBuffer("CCM-AES-128-ORI:", aes_src, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-ENC:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_dst, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_GetTag(hTestchnid, out_tag); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Get tag failed.\n"); goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-TAG", out_tag, stCCM.u8TLen); if ( 0 != memcmp(out_tag, aes_tag, stCCM.u8TLen) ) { HI_ERR_CIPHER("Tag compare failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ memcpy(pInputAddrVir, aes_a, sizeof(aes_a)); s32Ret = SetconfiginfoEx(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CCM, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, HI_NULL, &stCCM, HI_NULL); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memcpy(pInputAddrVir, aes_dst, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-DEC", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_src, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_GetTag(hTestchnid, out_tag); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Get tag failed.\n"); goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-TAG", out_tag, stCCM.u8TLen); if ( 0 != memcmp(out_tag, aes_tag, stCCM.u8TLen) ) { HI_ERR_CIPHER("Tag compare failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printf("\033[0;1;32m""\%s test pass !!!\n""\033[0m", __FUNCTION__); __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } /* ***************************************************************************** * In the following example, Klen = 128, Tlen =112, Nlen = 104, * Alen = 524288, and Plen = 256. ******************************************************************************/ static HI_S32 CCM_AES128_2(HI_VOID) { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 32; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; HI_U32 i; HI_UNF_CIPHER_CCM_INFO_S stCCM; HI_U8 aes_key[16] = {"\<KEY>"}; HI_U8 aes_n[13] = {"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c"}; static HI_U8 aes_a[65536]; HI_U8 aes_src[32] = {"\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f" "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"}; HI_U8 aes_dst[32] = {"\x69\x91\x5d\xad\x1e\x84\xc6\x37\x6a\x68\xc2\x96\x7e\x4d\xab\x61" "\x5a\xe0\xfd\x1f\xae\xc4\x4c\xc4\x84\x82\x85\x29\x46\x3c\xcf\x72"}; HI_U8 aes_tag[14] = {"\xb4\xac\x6b\xec\x93\xe8\x59\x8e\x7f\x0d\xad\xbc\xea\x5b"}; HI_U8 out_tag[14]; printf("\n--------------------------%s-----------------------\n", __FUNCTION__); for(i=0; i<65536; i++) { aes_a[i] = i; } s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return s32Ret; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return s32Ret; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(u32TestDataLen, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); memset(&stCCM, 0, sizeof(HI_UNF_CIPHER_CCM_INFO_S)); memcpy(&stCCM.u8Nonce, aes_n, sizeof(aes_n)); stCCM.pu8Aad = aes_a; stCCM.u32ALen = 65536; stCCM.u8NLen = 13; stCCM.u32MLen = u32TestDataLen; stCCM.u8TLen = 14; /* For encrypt */ s32Ret = SetconfiginfoEx(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CCM, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, HI_NULL, &stCCM, HI_NULL); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_src, u32TestDataLen); printBuffer("CCM-AES-128-ORI:", aes_src, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-ENC:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_dst, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_GetTag(hTestchnid, out_tag); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Get tag failed.\n"); goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-TAG", out_tag, stCCM.u8TLen); if ( 0 != memcmp(out_tag, aes_tag, stCCM.u8TLen) ) { HI_ERR_CIPHER("Tag compare failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ s32Ret = SetconfiginfoEx(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_CCM, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, HI_NULL, &stCCM, HI_NULL); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memcpy(pInputAddrVir, aes_dst, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-DEC", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_src, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_GetTag(hTestchnid, out_tag); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Get tag failed.\n"); goto __CIPHER_EXIT__; } printBuffer("CCM-AES-128-TAG", out_tag, stCCM.u8TLen); if ( 0 != memcmp(out_tag, aes_tag, stCCM.u8TLen) ) { HI_ERR_CIPHER("Tag compare failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printf("\033[0;1;32m""\%s test pass !!!\n""\033[0m", __FUNCTION__); __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } static HI_S32 GCM_AES128(HI_VOID) { HI_S32 s32Ret = HI_SUCCESS; HI_U32 u32TestDataLen = 60; HI_U32 u32InputAddrPhy = 0; HI_U32 u32OutPutAddrPhy = 0; HI_U32 u32Testcached = 0; HI_U8 *pInputAddrVir = HI_NULL; HI_U8 *pOutputAddrVir = HI_NULL; HI_HANDLE hTestchnid = 0; HI_UNF_CIPHER_GCM_INFO_S stGCM; HI_U8 aes_key[32] = {"\<KEY>"}; HI_U8 aes_iv[12] = {"\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88"}; HI_U8 aes_a[20] = {"\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad\xda\xd2"}; HI_U8 aes_src[60] = {"\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a" "\x86\xa7\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72" "\x1c\x3c\x0c\x95\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25" "\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57\xba\x63\x7b\x39"}; HI_U8 aes_dst[60] = {"\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c" "\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e" "\x21\xd5\x14\xb2\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05" "\x1b\xa3\x0b\x39\x6a\x0a\xac\x97\x3d\x58\xe0\x91"}; HI_U8 aes_tag[16] = {"\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb\x94\xfa\xe9\x5a\xe7\x12\x1a\x47"}; HI_U8 out_tag[16]; printf("\n--------------------------%s-----------------------\n", __FUNCTION__); s32Ret = HI_UNF_CIPHER_Init(); if(HI_SUCCESS != s32Ret) { return s32Ret; } s32Ret = HI_UNF_CIPHER_CreateHandle(&hTestchnid); if(HI_SUCCESS != s32Ret) { HI_UNF_CIPHER_DeInit(); return s32Ret; } u32InputAddrPhy = (HI_U32)HI_MMZ_New(64, 0, NULL, "CIPHER_BufIn"); if (0 == u32InputAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for input failed!\n"); goto __CIPHER_EXIT__; } pInputAddrVir = HI_MMZ_Map(u32InputAddrPhy, u32Testcached); u32OutPutAddrPhy = (HI_U32)HI_MMZ_New(64, 0, NULL, "CIPHER_BufOut"); if (0 == u32OutPutAddrPhy) { HI_ERR_CIPHER("Error: Get phyaddr for outPut failed!\n"); goto __CIPHER_EXIT__; } pOutputAddrVir = HI_MMZ_Map(u32OutPutAddrPhy, u32Testcached); memset(&stGCM, 0, sizeof(HI_UNF_CIPHER_GCM_INFO_S)); stGCM.pu8Aad = aes_a; stGCM.u32ALen = 20; stGCM.u32MLen = 60; stGCM.u32IVLen = 12; u32TestDataLen = stGCM.u32MLen; /* For encrypt */ s32Ret = SetconfiginfoEx(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_GCM, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_iv, HI_NULL, &stGCM); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memset(pInputAddrVir, 0x0, u32TestDataLen); memcpy(pInputAddrVir, aes_src, u32TestDataLen); printBuffer("GCM-AES-128-ORI:", aes_src, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Encrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher encrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("GCM-AES-128-ENC:", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_dst, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_GetTag(hTestchnid, out_tag); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Get tag failed.\n"); goto __CIPHER_EXIT__; } printBuffer("GCM-AES-128-TAG", out_tag, 16); if ( 0 != memcmp(out_tag, aes_tag, 16) ) { HI_ERR_CIPHER("Tag compare failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } /* For decrypt */ memcpy(pInputAddrVir, aes_a, sizeof(aes_a)); s32Ret = SetconfiginfoEx(hTestchnid, HI_UNF_CIPHER_KEY_SRC_USER, HI_UNF_CIPHER_ALG_AES, HI_UNF_CIPHER_WORK_MODE_GCM, HI_UNF_CIPHER_KEY_AES_128BIT, aes_key, aes_iv, HI_NULL, &stGCM); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Set config info failed.\n"); goto __CIPHER_EXIT__; } memcpy(pInputAddrVir, aes_dst, u32TestDataLen); memset(pOutputAddrVir, 0x0, u32TestDataLen); s32Ret = HI_UNF_CIPHER_Decrypt(hTestchnid, u32InputAddrPhy, u32OutPutAddrPhy, u32TestDataLen); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Cipher decrypt failed.\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printBuffer("GCM-AES-128-DEC", pOutputAddrVir, u32TestDataLen); /* compare */ if ( 0 != memcmp(pOutputAddrVir, aes_src, u32TestDataLen) ) { HI_ERR_CIPHER("Memcmp failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } s32Ret = HI_UNF_CIPHER_GetTag(hTestchnid, out_tag); if(HI_SUCCESS != s32Ret) { HI_ERR_CIPHER("Get tag failed.\n"); goto __CIPHER_EXIT__; } printBuffer("GCM-AES-128-TAG", out_tag, 16); if ( 0 != memcmp(out_tag, aes_tag, 16) ) { HI_ERR_CIPHER("Tag compare failed!\n"); s32Ret = HI_FAILURE; goto __CIPHER_EXIT__; } printf("\033[0;1;32m""\%s test pass !!!\n""\033[0m", __FUNCTION__); __CIPHER_EXIT__: if (u32InputAddrPhy> 0) { HI_MMZ_Unmap(u32InputAddrPhy); HI_MMZ_Delete(u32InputAddrPhy); } if (u32OutPutAddrPhy > 0) { HI_MMZ_Unmap(u32OutPutAddrPhy); HI_MMZ_Delete(u32OutPutAddrPhy); } HI_UNF_CIPHER_DestroyHandle(hTestchnid); HI_UNF_CIPHER_DeInit(); return s32Ret; } #endif //CIPHER_CCM_GCM_SUPPORT int sample_cipher() { HI_S32 s32Ret = HI_SUCCESS; s32Ret = CBC_AES128(); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = CFB_AES128(); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = CTR_AES128(); if (s32Ret != HI_SUCCESS) { return s32Ret; } #ifdef CIPHER_CCM_GCM_SUPPORT s32Ret = CCM_AES128(); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = CCM_AES128_2(); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = GCM_AES128(); if (s32Ret != HI_SUCCESS) { return s32Ret; } #endif return HI_SUCCESS; } #else int sample_cipher() { printf("cipher not support!!!\n"); return HI_SUCCESS; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/sensor_spi/sensor_spi.c /* * Simple synchronous userspace interface to SPI devices * * Copyright (C) 2006 SWAPP * <NAME> <<EMAIL>> * Copyright (C) 2007 <NAME> (simplification, cleanup) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/init.h> #include <linux/module.h> #include <linux/ioctl.h> #include <linux/fs.h> #include <linux/device.h> #include <linux/err.h> #include <linux/list.h> #include <linux/errno.h> #include <linux/mutex.h> #include <linux/slab.h> #include <linux/compat.h> #include <linux/delay.h> #ifdef __HuaweiLite__ #include <spi.h> #include "fcntl.h" #else #include <linux/spi/spi.h> #endif #include <asm/uaccess.h> #include "isp_ext.h" #include "sensor_spi.h" static unsigned bus_num = 0; static unsigned csn = 0; #ifdef __HuaweiLite__ static char sensor[64]; #else static char* sensor = ""; #endif module_param(bus_num, uint, S_IRUGO); MODULE_PARM_DESC(bus_num, "spi bus number"); module_param(csn, uint, S_IRUGO); MODULE_PARM_DESC(csn, "chip select number"); /* some sensor has special dev addr */ module_param(sensor, charp, S_IRUGO); MODULE_PARM_DESC(sensor, "sensor name"); #ifndef __HuaweiLite__ struct spi_master *hi_master; struct spi_device *hi_spi; extern struct bus_type spi_bus_type; #define SPI_MSG_NUM 20 typedef struct hi_spi_message_s { struct spi_transfer t; struct spi_message m; unsigned char buf[8]; }spi_message_s; typedef struct hi_spi_message_info_s { int msg_idx; spi_message_s spi_msg_array[SPI_MSG_NUM]; }spi_message_info_s; static spi_message_info_s g_spi_msg = {0}; #endif #ifdef __HuaweiLite__ static void reverse8(unsigned char *buf, unsigned int len) { unsigned int i; for (i = 0; i < len; i++) { buf[i] = (buf[i] & 0x55) << 1 | (buf[i] & 0xAA) >> 1; buf[i] = (buf[i] & 0x33) << 2 | (buf[i] & 0xCC) >> 2; buf[i] = (buf[i] & 0x0F) << 4 | (buf[i] & 0xF0) >> 4; } } extern int spi_dev_set(int host_no, int cs_no, struct spi_ioc_transfer * transfer); int ssp_write_alt(unsigned int u32DevAddr, unsigned int u32DevAddrByteNum, unsigned int u32RegAddr, unsigned int u32RegAddrByteNum, unsigned int u32Data , unsigned int u32DataByteNum) { char file_name[0x20]; unsigned char buf[0x10]; struct spi_ioc_transfer transfer[1]; int fd = -1; int retval = 0; int index = 0; unsigned int dev_addr, reg_addr, data; unsigned int dev_width = 1, reg_width = 1, data_width = 1; dev_addr = u32DevAddr; reg_addr = u32RegAddr; data = u32Data; dev_width = u32DevAddrByteNum; reg_width = u32RegAddrByteNum; data_width = u32DataByteNum; memset(transfer, 0, sizeof(transfer)); transfer[0].tx_buf = (char *)buf; transfer[0].rx_buf = (char *)buf; transfer[0].len = dev_width + reg_width + data_width; memset(buf, 0, sizeof(buf)); if (strcmp(sensor, "imx117")) { buf[index++] = dev_addr & (~0x80); } else { if(dev_width == 2) { buf[index++] = dev_addr >> 8; } buf[index++] = dev_addr & 0xFF; } if(reg_width == 2) { buf[index++] = reg_addr >> 8; } buf[index++] = reg_addr & 0xFF; if(data_width == 2) { buf[index++] = data >>8; } buf[index++] = data & 0xFF; retval = spi_dev_set(bus_num, csn, &transfer[0]); if (retval != transfer[0].len) { printf("SPI_IOC_MESSAGE error \n"); retval = -1; } return retval; } #else /***************************************************************** This function will be called in interrupt route. So use spi_async, can't call spi_sync here. *****************************************************************/ int ssp_write_alt(unsigned int addr1, unsigned int addr1bytenum, unsigned int addr2, unsigned int addr2bytenum, unsigned int data , unsigned int databytenum) { struct spi_master *master = hi_master; struct spi_device *spi = hi_spi; struct spi_transfer *t; struct spi_message *m; unsigned char *buf; int status = 0; unsigned long flags; int buf_idx = 0; int idx = g_spi_msg.msg_idx; g_spi_msg.msg_idx++; if (g_spi_msg.msg_idx > SPI_MSG_NUM - 1) { g_spi_msg.msg_idx = 0; } buf = g_spi_msg.spi_msg_array[idx].buf; t = &g_spi_msg.spi_msg_array[idx].t; m = &g_spi_msg.spi_msg_array[idx].m; /* check spi_message is or no finish */ spin_lock_irqsave(&master->queue_lock, flags); if (m->state != NULL) { spin_unlock_irqrestore(&master->queue_lock, flags); dev_err(&spi->dev, "%s, %s, %d line: spi_message no finish!\n", __FILE__, __func__, __LINE__); return -EFAULT; } spin_unlock_irqrestore(&master->queue_lock, flags); spi->mode = SPI_MODE_3 | SPI_LSB_FIRST; memset(buf, 0, sizeof(g_spi_msg.spi_msg_array[idx].buf)); if (strcmp(sensor, "imx117")) { buf[buf_idx++] = addr1 & (~0x80); } else { /* imx117 has different dev addr format */ buf[buf_idx++] = addr1; } if (2 == addr2bytenum) { buf[buf_idx++] = addr2 >> 8; } buf[buf_idx++] = addr2; if (2 == databytenum) { buf[buf_idx++] = data >> 8; } buf[buf_idx++] = data; t->tx_buf = buf; t->rx_buf = buf; t->len = buf_idx; t->cs_change = 1; t->speed_hz = 2000000; t->bits_per_word = 8; spi_message_init(m); spi_message_add_tail(t, m); m->state = m; status = spi_async(spi, m); if (status) { dev_err(&spi->dev, "%s: spi_async() error!\n", __func__); status = -EFAULT; } return status; } #endif int hi_ssp_write(unsigned int addr1, unsigned int addr1bytenum, unsigned int addr2, unsigned int addr2bytenum, unsigned int data ,unsigned int databytenum) { if ((addr1bytenum > 1) || (addr2bytenum > 2) || (databytenum > 2)) { printk("addr1_num: %d, addr2_num: %d, data_num: %d, bit_width not support now.\n", addr1bytenum, addr2bytenum, databytenum); return -1; } #if 0 printk("addr1: 0x%x, addr1_num: %d, addr2: 0x%x, addr2_num: %d, data: 0x%x, data_num: %d.\n", addr1, addr1bytenum, addr2, addr2bytenum, data, databytenum); #endif return ssp_write_alt(addr1, addr1bytenum, addr2, addr2bytenum, data, databytenum); } #ifndef __HuaweiLite__ /***************************************************************** This function can't be called in interrupt route because spi_sync will schedule out. *****************************************************************/ int ssp_read_alt(unsigned char devaddr, unsigned char addr, unsigned char *data) { struct spi_master *master = hi_master; struct spi_device *spi = hi_spi; int status = 0; unsigned long flags; static struct spi_transfer t; static struct spi_message m; static unsigned char buf[8]; int buf_idx = 0; /* check spi_message is or no finish */ spin_lock_irqsave(&master->queue_lock, flags); if (m.state != NULL) { spin_unlock_irqrestore(&master->queue_lock, flags); dev_err(&spi->dev, "\n**********%s, %s, %d line: spi_message no finish!*********\n", __FILE__, __func__, __LINE__); return -EFAULT; } spin_unlock_irqrestore(&master->queue_lock, flags); spi->mode = SPI_MODE_3 | SPI_LSB_FIRST; memset(buf, 0, sizeof(buf)); buf[buf_idx++] = devaddr | 0x80; buf[buf_idx++] = addr; buf[buf_idx++] = 0; t.tx_buf = buf; t.rx_buf = buf; t.len = buf_idx; t.cs_change = 1; t.speed_hz = 2000000; t.bits_per_word = 8; spi_message_init(&m); spi_message_add_tail(&t, &m); m.state = &m; status = spi_sync(spi, &m); if (status) { dev_err(&spi->dev, "%s: spi_async() error!\n", __func__); status = -EFAULT; } *data = buf[2]; printk("func:%s rx_buf = %#x, %#x, %#x\n", __func__, buf[0], buf[1], buf[2]); return status; } #if 0 static void ssp_test(void) { unsigned char data; ssp_write_alt(0x2, 1, 0x14, 1, 0x34, 1); // wait spi write finish msleep(1); ssp_read_alt(0x2, 0x14, &data); } #endif #endif #ifdef __HuaweiLite__ int sensor_spi_dev_init(void *pArgs) { ISP_BUS_CALLBACK_S stBusCb = {0}; SPI_MODULE_PARAMS_S* pstSpiModuleParam = (SPI_MODULE_PARAMS_S*)pArgs; if (pstSpiModuleParam != NULL) { bus_num = pstSpiModuleParam->u32BusNum; csn = pstSpiModuleParam->u32csn; memcpy(sensor,pstSpiModuleParam->cSensor, sizeof(pstSpiModuleParam->cSensor)); } stBusCb.pfnISPWriteSSPData = hi_ssp_write; if (CKFN_ISP_RegisterBusCallBack()) { CALL_ISP_RegisterBusCallBack(0, ISP_BUS_TYPE_SSP, &stBusCb); } else { printk("register ssp_write_callback to isp failed, ssp init is failed!\n"); return -1; } return 0; } #else static int __init sensor_spi_dev_init(void) { int status = 0; struct spi_master *master; struct device *dev; char spi_name[128] = {0}; ISP_BUS_CALLBACK_S stBusCb = {0}; stBusCb.pfnISPWriteSSPData = hi_ssp_write; if ((NULL != FUNC_ENTRY(ISP_EXPORT_FUNC_S, HI_ID_ISP)) && (CKFN_ISP_RegisterBusCallBack())) { CALL_ISP_RegisterBusCallBack(0, ISP_BUS_TYPE_SSP, &stBusCb); } else { printk("register ssp_write_callback to isp failed, ssp init is failed!\n"); return -1; } master = spi_busnum_to_master(bus_num); if(master) { hi_master = master; snprintf(spi_name, sizeof(spi_name), "%s.%u", dev_name(&master->dev), csn); dev = bus_find_device_by_name(&spi_bus_type, NULL, spi_name); if (dev == NULL) { dev_err(NULL, "chipselect %d has not been used\n", csn); status = -ENXIO; goto end1; } hi_spi = to_spi_device(dev); if(hi_spi == NULL) { dev_err(dev, "to_spi_device() error!\n"); status = -ENXIO; goto end1; } } else { dev_err(NULL, "spi_busnum_to_master() error!\n"); status = -ENXIO; goto end0; } //ssp_test(); end1: put_device(dev); end0: return status; } #endif #ifndef __HuaweiLite__ static void __exit sensor_spi_dev_exit(void) { printk("%s, %s, %d line\n", __FILE__, __func__, __LINE__); } #endif module_init(sensor_spi_dev_init); module_exit(sensor_spi_dev_exit); MODULE_AUTHOR("BVT OSDRV"); MODULE_LICENSE("GPL"); #ifndef __HuaweiLite__ MODULE_ALIAS("sensor spidev"); #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/tools/iperf-2.0.5/Makefile include $(LITEOSTOPDIR)/config.mk ARFLAGS = cr all: mkdir -p $(ROOTOUT)/lib/ cp -rf $(LITEOS_PLATFORM)/*.a $(ROOTOUT)/lib clean: rm -rf $(OUT)/lib/*.a .PHONY: all clean <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/drv_cipher_mmz.h /****************************************************************************** Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : cipher_mmz.h Version : Initial Draft Author : Hisilicon multimedia software group Created : 2011/05/28 Description : cipher_mmz.c header file History : 1.Date : 2011/05/28 Author : j00169368 Modification: Created file ******************************************************************************/ #ifndef __CIPHER_MMZ_H__ #define __CIPHER_MMZ_H__ #include "hi_osal.h" #include "osal_mmz.h" #include "hi_type.h" #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ #ifndef HI_REG_READ8 #define HI_REG_READ8(addr,result) ((result) = *(volatile unsigned char *)(addr)) #endif #ifndef HI_REG_READ16 #define HI_REG_READ16(addr,result) ((result) = *(volatile unsigned short *)(addr)) #endif #ifndef HI_REG_READ32 #define HI_REG_READ32(addr,result) ((result) = *(volatile unsigned int *)(addr)) #endif #ifndef HI_REG_WRITE8 #define HI_REG_WRITE8(addr,result) (*(volatile unsigned char *)(addr) = (result)) #endif #ifndef HI_REG_WRITE16 #define HI_REG_WRITE16(addr,result) (*(volatile unsigned short *)(addr) = (result)) #endif #ifndef HI_REG_WRITE32 #define HI_REG_WRITE32(addr,result) (*(volatile unsigned int *)(addr) = (result)) #endif #ifndef HI_REG_READ #define HI_REG_READ HI_REG_READ32 #endif #ifndef HI_REG_WRITE #define HI_REG_WRITE HI_REG_WRITE32 #endif /*process of bit*/ #define HAL_SET_BIT(src, bit) ((src) |= (1<<bit)) #define HAL_CLEAR_BIT(src,bit) ((src) &= ~(1<<bit)) #define HI_KMALLOC(module_id, size, flags) osal_kmalloc(size, flags) #define HI_KFREE(module_id, addr) osal_kfree(addr) #define HI_VMALLOC(module_id, size) osal_vmalloc(size) #define HI_VFREE(module_id, addr) osal_vfree(addr) typedef struct hiCI_MMZ_BUF_S { HI_U32 u32StartPhyAddr; HI_U8* pu8StartVirAddr; HI_U32 u32Size; }MMZ_BUFFER_S; static inline HI_S32 HI_DRV_MMZ_AllocAndMap(const char *name, char *mmzzonename, HI_U32 size, int align, MMZ_BUFFER_S *psMBuf) { hil_mmb_t *pmmb = NULL; pmmb = hil_mmb_alloc(name, size, 0, 0, mmzzonename); if(NULL == pmmb) { return HI_FAILURE; } psMBuf->u32StartPhyAddr = hil_mmb_phys(pmmb); psMBuf->u32Size = hil_mmb_length(pmmb); //printk("pMmzBuf->u32Size:%d\n",pMmzBuf->u32Size); psMBuf->pu8StartVirAddr = (HI_U8*)osal_ioremap_nocache(psMBuf->u32StartPhyAddr, psMBuf->u32Size); return HI_SUCCESS; } static inline HI_VOID HI_DRV_MMZ_UnmapAndRelease(MMZ_BUFFER_S *psMBuf) { if(psMBuf->u32StartPhyAddr != 0) { hil_mmb_freeby_phys(psMBuf->u32StartPhyAddr); psMBuf->u32StartPhyAddr = 0; } if(psMBuf->pu8StartVirAddr != 0) { osal_iounmap((void*)psMBuf->pu8StartVirAddr); psMBuf->pu8StartVirAddr = 0; } } static inline HI_VOID HI_DRV_MMZ_Map(MMZ_BUFFER_S *psMBuf) { psMBuf->pu8StartVirAddr = (HI_U8*)osal_ioremap_nocache(psMBuf->u32StartPhyAddr, psMBuf->u32Size); } static inline HI_VOID HI_DRV_MMZ_Unmap(MMZ_BUFFER_S *psMBuf) { osal_iounmap((void*)psMBuf->pu8StartVirAddr); } #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ #endif /* End of #ifndef __CIPHER_MMZ_H__ */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/HuaweiLite/sdk_init.c /****************************************************************************** Some simple Hisilicon Hi35xx system functions. Copyright (C), 2010-2015, Hisilicon Tech. Co., Ltd. ****************************************************************************** Modification: 2015-6 Created ******************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* End of #ifdef __cplusplus */ #include <stdio.h> #include <asm/io.h> #include <string.h> #include "hi_type.h" #include "hi_comm_sys.h" #include "hi_module_param.h" #include "osal_mmz.h" #define himm(address, value) writel(value, address) #define M_SIZE (1024*1024) #define MEM_ALIGN(x) (((x)+ M_SIZE - 1)&(~(M_SIZE - 1))) #define MEM_TOTAL_SIZE 64U /* MB, total mem */ /* calculate the MMZ info */ extern unsigned long g_usb_mem_size; extern unsigned int g_sys_mem_addr_end; static HI_S32 MMZ_init(void) { extern int media_mem_init(void *); MMZ_MODULE_PARAMS_S stMMZ_Param; HI_U32 u32MmzStart, u32MmzSize; u32MmzStart = g_sys_mem_addr_end + g_usb_mem_size; u32MmzSize = (SYS_MEM_BASE + MEM_TOTAL_SIZE*M_SIZE - u32MmzStart)/M_SIZE; snprintf(stMMZ_Param.mmz, MMZ_SETUP_CMDLINE_LEN, "anonymous,0,0x%x,%dM", u32MmzStart, u32MmzSize); stMMZ_Param.anony = 1; dprintf("mem_start=0x%x, MEM_OS_SIZE=%dM, MEM_USB_SIZE=%dM, mmz_start=0x%x, mmz_size=%dM\n", SYS_MEM_BASE, (g_sys_mem_addr_end-SYS_MEM_BASE)/M_SIZE, MEM_ALIGN(g_usb_mem_size)/M_SIZE, u32MmzStart, u32MmzSize); dprintf("mmz param= %s\n", stMMZ_Param.mmz); return media_mem_init(&stMMZ_Param); } static HI_S32 CIPHER_init(void) { extern int CIPHER_DRV_ModInit(void); return CIPHER_DRV_ModInit(); } extern void osal_proc_init(void); HI_VOID SDK_init(void) { HI_S32 ret = 0; ret = MMZ_init(); if (ret != 0) { printf("mmz init error.\n"); } osal_proc_init(); ret = CIPHER_init(); if (ret != 0) { printf("cipher init error.\n"); } printf("SDK init ok...\n"); } #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/main.c #include "boardconfig.h" #include "kfifo.h" u8 g_WakeUp_Halt_Flag = 0; //按键唤醒标志 u8 g_Wifi_WakeUp = 0; //WIFI唤醒标志 u8 g_KeyPoweroff_Flag = 0; //按键关机标志 u8 g_Vbus_Check = 0; //VBUS检测 u8 g_PIR_Check = 0; //PIR检测 u8 g_IsSystemOn = 0; //dv主控芯片的状态,0关机, 1开机 u8 g_Key_Handle_Flag = 0; u8 g_Wifi_Reg_Det_Flag = 1; u8 g_Bar_Det_Flag = 0; //wifi待机时的电池检测 u8 g_poweroff_check_flg = 0;//检测是否满足断电条件无按键、无pir触发 u8 g_pir_ok_poweroff = 0; // PIR满足关机条件 u8 g_key_ok_poweroff = 0; // 按键满足关机条件 u8 g_host_readly_uart = 0;//标志主控芯片uart准备OK u16 g_WakeUp_Key_Flag = 0; u16 USART_Receive_Timeout = 0; u8 USART_Send_Buf[UF_MAX_LEN]; u8 USART_Receive_Buf[UF_MAX_LEN]; u32 USART_Receive_Flag = 0; u32 g_time_count = 0; u8 g_IsDevPwrOn = 0; //device power 的状态,0 关机 ,1 开机 u8 g_IsDevWlanEn = 0; //device wlan 的状态,0 disable ,1 enable u8 g_Iswkupmsgsend = 0; u8 g_wkup_reason = 0; u8 g_debounce_cnt = 0; #define GPIO_DEBOUNCE 2 struct kfifo recvfifo; /*设置波特率,默认为9600*/ #define BAUD_RATE 9600 #if (BAUD_RATE == 115200) #define BAUD_CLK CLK_SYSCLKDiv_1 #elif (BAUD_RATE == 9600) #define BAUD_CLK CLK_SYSCLKDiv_32 #endif /********************************************************************** * 函数名称: MDelay * 功能描述:延时函数,单位为ms * para: delay_count: 延时时长 ***********************************************************************/ static void MDelay(u32 delay_count) { u32 i, j; for (i = 0; i < delay_count; i++) { for (j = 0; j < 50; j++); } } /********************************************************************** * 函数名称: PWR_ON * 功能描述:给主控上电 * para: void ***********************************************************************/ void PWR_ON(void) { GPIO_SetBits(PWR_HOLD_GPIO, PWR_HOLD_GPIO_Pin); g_IsSystemOn = 1; } /********************************************************************** * 函数名称: PWR_OFF * 功能描述:切断主控电源 * para: void ***********************************************************************/ void PWR_OFF(void) { GPIO_ResetBits(PWR_HOLD_GPIO, PWR_HOLD_GPIO_Pin); GPIO_ResetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); g_IsSystemOn = 0; g_key_ok_poweroff = 0; g_pir_ok_poweroff = 0; g_host_readly_uart = 0; } /********************************************************************** * 函数名称: XOR_Inverted_Check * 功能描述:数据的异或取反校验 * para: inBuf: 需检测的字符串 inLen: 所需检测的字符串长度 ***********************************************************************/ u8 XOR_Inverted_Check(unsigned char* inBuf, unsigned char inLen) { u8 check = 0, i; for (i = 0; i < inLen; i++) { check ^= inBuf[i]; } return ~check; } /********************************************************************** * 函数名称: USART_Send_Data * 功能描述:发送串口数据接口 * para: Dbuf: 发送的数据 len: 所发送的数据长度 ***********************************************************************/ void USART_Send_Data(unsigned char* Dbuf, unsigned int len) { int i; for (i = 0; i < len; i++) { while (USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET); USART_SendData8(USART1, Dbuf[i]); while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET); } } /********************************************************************** * 函数名称:UartHandle * 功能描述:串口通信数据处理 * para: void ***********************************************************************/ void Uart_Handle(void) { unsigned char check = 0; u8 cmdstr[CMD_LEN]; u8 len = 0; u8 rec_len = __kfifo_len(&recvfifo); if(rec_len >= MIN_CMD_LEN) { if(CMDFLAG_START == recvfifo.buffer[(recvfifo.out + UF_START) & (recvfifo.size - 1)]) { len = recvfifo.buffer[(recvfifo.out + UF_LEN) & (recvfifo.size - 1)]; if(rec_len >= len) { __kfifo_get(&recvfifo, cmdstr, len); check = XOR_Inverted_Check(cmdstr, len - 1); if(check == cmdstr[len - 1]) { if (cmdstr[UF_CMD] < 0x80) Response_CMD_Handle(); else Request_CMD_Handle(cmdstr, len); } } } else { __kfifo_get(&recvfifo, cmdstr, 1);//如果当前位置不是命令起始标志,则丢弃 } } } void dev_pwr_on(void) { g_IsDevPwrOn = 1; GPIO_SetBits(DEV_PWR_GPIO,DEV_PWR_GPIO_Pin); } void dev_pwr_off(void) { g_IsDevPwrOn = 0; GPIO_ResetBits(DEV_PWR_GPIO, DEV_PWR_GPIO_Pin); } void dev_wlan_enable(void) { g_IsDevWlanEn = 1; GPIO_SetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); } void dev_wlan_disable(void) { g_IsDevWlanEn = 0; GPIO_ResetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); } void dev_wlan_reset_handle(u8 val) { if (val && (!g_IsDevWlanEn)) { dev_wlan_enable(); } else if ((!val) && g_IsDevWlanEn) { dev_wlan_disable(); } } void dev_wlan_power_handle(u8 val) { if (val && (!g_IsDevPwrOn)) { dev_pwr_on(); } else if ((!val) && g_IsDevPwrOn) { dev_pwr_off(); } } void host_clr_wkup_reason(void) { GPIO_ResetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); g_wkup_reason = 0; } void dev_wkup_host(void) { #if 1 GPIO_SetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); MDelay(1); GPIO_ResetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); #else USART_Send_Buf[UF_START] = 0x7B; USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = 0xbb; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); #endif } void host_set_wkup_reason(u8 val) { if(1 & val) { GPIO_SetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); } else { GPIO_ResetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); } } /****************************************************************** * 函数名称: Request_CMD_Handle * * 功能描述:接收串口指令处理 * para: void *******************************************************************/ void Request_CMD_Handle(u8* cmdstr, u8 len) { u16 adcvalue = 0; int ret; USART_Send_Buf[UF_START] = 0x7B; switch (cmdstr[UF_CMD]) { /*主控通知MCU可进行关机操作*/ case 0x80: GPIO_ResetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); PWR_OFF(); MDelay(100); g_wkup_reason = 1; g_WakeUp_Key_Flag = 0; break; /*主控控制wifi使能工作IO*/ case 0x8a: dev_wlan_power_handle(cmdstr[UF_DATA]); break; case 0x8c: host_clr_wkup_reason(); break; case 0x84: if(cmdstr[UF_DATA] == 0) { g_Wifi_Reg_Det_Flag = 0; } else { g_Wifi_Reg_Det_Flag = 1; GPIO_ResetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); } USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = 0x85; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); break; /*未知*/ case 0x86: ret = RTC_Alarm_Duration_Check(cmdstr[UF_DATA + 1], cmdstr[UF_DATA + 2]); if (!ret) { RTC_AlarmCmd(DISABLE); RTC_ITConfig(RTC_IT_ALRA, DISABLE); RTC_ClearITPendingBit(RTC_IT_ALRA); g_Alarm_Event.flag = cmdstr[UF_DATA]; g_Alarm_Event.hours = cmdstr[UF_DATA + 1]; g_Alarm_Event.minutes = cmdstr[UF_DATA + 2]; USART_Send_Buf[UF_DATA] = 0; } else { USART_Send_Buf[UF_DATA] = 1; } USART_Send_Buf[UF_LEN] = 0x5; USART_Send_Buf[UF_CMD] = 0x87; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); break; /*主控请求进行关机检测*/ case 0x88: dev_wlan_reset_handle(cmdstr[UF_DATA]); break; /*主控请求ADC采样值*/ case 0x90: adcvalue = ADC_GetBatVal(); USART_Send_Buf[UF_LEN] = 0x6; USART_Send_Buf[UF_LEN] = 0x6; USART_Send_Buf[UF_CMD] = 0x91; USART_Send_Buf[UF_DATA] = adcvalue>>8; USART_Send_Buf[UF_DATA+1] = adcvalue&0xff; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); break; case 0xee: g_host_readly_uart = 1; break; default: break; } } /****************************************************************** *函数名称:Response_CMD_Handle * *功能描述:串口指令请求处理 * para: void *******************************************************************/ void Response_CMD_Handle(void) {} /****************************************************************** *函数名称:uart_send_sure_power * *功能描述:发送确认关机串口指令 * para: void *******************************************************************/ void uart_send_cmd(u8 cmd) { USART_Send_Buf[UF_START] = 0x7B; USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = cmd; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); } /****************************************************************** *函数名称:CLK_Config * *功能描述:串口收发时钟管理初始化 * para: void *******************************************************************/ void CLK_Config(void) { CLK_DeInit(); CLK_HSICmd(ENABLE); CLK_SYSCLKDivConfig(BAUD_CLK);//CLK_SYSCLKDiv_32 while (((CLK->ICKCR) & 0x02) != 0x02); //HSI准备就绪 CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_HSI); CLK_SYSCLKSourceSwitchCmd(ENABLE); while (((CLK->SWCR) & 0x01) == 0x01); //切换完成 } /****************************************************************** *函数名称:TIM3_Config * *功能描述:定时器配置,晶振采用是16Khz * para: void *******************************************************************/ void TIM3_Config(void) { CLK_PeripheralClockConfig(CLK_Peripheral_TIM3, ENABLE);/* Enable TIM3 CLK */ /* Time base configuration */ TIM3_TimeBaseInit(TIM3_Prescaler_16, TIM3_CounterMode_Up, 125); //20MS 2480------------4ms 499 // 0.5M 4ms 625 1ms - 125 /* Clear TIM4 update flag */ TIM3_ClearFlag(TIM3_FLAG_Update); /* Enable update interrupt */ TIM3_ITConfig(TIM3_IT_Update, ENABLE); /* Enable TIM4 */ TIM3_Cmd(ENABLE); } /****************************************************************** *函数名称:Usart_Config * *功能描述:uart初始化配置,波特率默认为9600 * para: void *******************************************************************/ void Usart_Config(void) { GPIO_Init(USART_RX_GPIO, USART_RX_GPIO_Pin, GPIO_Mode_In_PU_No_IT); GPIO_Init(USART_TX_GPIO, USART_TX_GPIO_Pin, GPIO_Mode_Out_PP_Low_Fast); CLK_PeripheralClockConfig(CLK_Peripheral_USART1, ENABLE); USART_Init(USART1, BAUD_RATE, USART_WordLength_8b, USART_StopBits_1, USART_Parity_No, (USART_Mode_TypeDef)(USART_Mode_Tx | USART_Mode_Rx)); USART_ClearITPendingBit(USART1, USART_IT_RXNE); //配置USART1->SR USART_ITConfig(USART1, USART_IT_RXNE, ENABLE); //配置USART1->CR2的RIEN位 USART_Cmd(USART1, ENABLE); } /****************************************************************** *函数名称:Pin_Det_Handle * *功能描述:wifi中断唤醒处理以及wifi工作使能IO配置 * para: void *******************************************************************/ void Pin_Det_Handle(void) { u8 val; #if 0 /* wlan wake detect handle */ if (!g_IsSystemOn) { /* wifi 中断唤醒标志 */ if (g_Wifi_WakeUp == 1) { /* 配置相关IO设置,退出低功耗模式 */ InitExitHaltMode(); PWR_ON(); /* 控制wifi镜像启动IO脚,拉高 */ GPIO_SetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); g_Wifi_WakeUp = 0; } } else { g_Wifi_WakeUp = 0; } /* 若已开机,且wifi寄存器标志已置1 */ if (g_IsSystemOn && g_Wifi_Reg_Det_Flag) { /* 主控控制wifi寄存器是否已配置,高电平代表已设置*/ val = !!GPIO_ReadInputDataBit(REG_ON_DET_GPIO, REG_ON_DET_GPIO_Pin); /*控制wifi使能工作IO*/ if (val) { GPIO_SetBits(WIFI_REG_ON_GPIO, WIFI_REG_ON_GPIO_Pin); } else { GPIO_ResetBits(WIFI_REG_ON_GPIO, WIFI_REG_ON_GPIO_Pin); } } #endif // DEV WAK HOST DETECT if(!g_IsSystemOn) { val = !!GPIO_ReadInputDataBit(D2H_WAK_GPIO, D2H_WAK_GPIO_Pin); if(val) { g_debounce_cnt++; if(GPIO_DEBOUNCE < g_debounce_cnt) { PWR_ON(); MDelay(2); host_set_wkup_reason(g_wkup_reason); InitExitHaltMode(); } } else { g_Wifi_WakeUp = 0; g_debounce_cnt = 0; } } else { val = !!GPIO_ReadInputDataBit(D2H_WAK_GPIO, D2H_WAK_GPIO_Pin); if(val) { if(!g_Iswkupmsgsend) { dev_wkup_host(); g_Iswkupmsgsend = 1; } } else { g_Wifi_WakeUp = 0; g_Iswkupmsgsend = 0; } } } /****************************************************************** *函数名称:Key_Handle * *功能描述:按键处理: 断电状态按下: 开机 开机状态: 通知主控发送主播报文 * para: void *******************************************************************/ void Key_Handle(void) { /*按键检测处理*/ if (1 == g_Key_Handle_Flag) { if (g_IsSystemOn == 0) { InitExitHaltMode(); PWR_ON(); if(0 == g_Wifi_Reg_Det_Flag) { GPIO_SetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); } g_KeyPoweroff_Flag = 0; g_Key_Handle_Flag = 0; } else { /*若已开机,则通知主控再次发生主播包*/ if(g_host_readly_uart && (g_time_count % 30 == 0)) { uart_send_cmd(0x93); g_Key_Handle_Flag = 0; } } } else if(2 == g_Key_Handle_Flag) { if(g_host_readly_uart) uart_send_cmd(0x95);//reset wifi info g_Key_Handle_Flag = 0; } } /****************************************************************** *函数名称:PWR_Detect_Handle * *功能描述:检测设备是否是USB供电开机,若是直接开机 * para: void *******************************************************************/ void PWR_Detect_Handle() { /*是否检测到是USB供电*/ if (g_IsSystemOn == 0) { if (g_Vbus_Check == 1){ PWR_ON(); g_Vbus_Check = 0; } } } /****************************************************************** *函数名称:PIR_Detect_Handle * *功能描述:PIR检测处理 * para: void *******************************************************************/ void PIR_Detect_Handle() { /*红外检测处理*/ if (g_PIR_Check == 1) { /*如果通过长按键关机则无法通过PIR上电*/ if (g_IsSystemOn == 0&&g_KeyPoweroff_Flag!=1) { InitExitHaltMode(); PWR_ON(); GPIO_SetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); } g_PIR_Check = 0; } } /****************************************************************** *函数名称:Fun_Init * *功能描述:功能模块初始化 * para: void *******************************************************************/ void Fun_Init(void) { /*定时器初始化*/ TIM3_Config(); /*串口初始化*/ Usart_Config(); /*ADC采样初始化*/ ADC_Init_adc0(); } /****************************************************************** *函数名称:Board_Init * *功能描述: 首次上电,变量、GPIO初始化 * para: void *******************************************************************/ void Board_Init(void) { /*主控上电标志位*/ g_IsSystemOn = 0; /*按键按下标志位*/ g_Key_Handle_Flag = 0; /*vbus*/ g_Vbus_Check = 0; /*串口接收时间*/ USART_Receive_Timeout = 0; /*串口接收标志*/ USART_Receive_Flag = 0; /*开机键初始化*/ GPIO_Init(SW_KEY_GPIO, SW_KEY_GPIO_Pin, GPIO_Mode_In_PU_No_IT); //按键检测 /*控制主控上电IO口*/ GPIO_Init(PWR_EN_GPIO, PWR_EN_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); //默认3路电源为关 /*控制所有电源IO口*/ GPIO_Init(PWR_HOLD_GPIO, PWR_HOLD_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); //默认all电源为关 /*主控设置wifi寄存器标志IO口初始化*/ GPIO_Init(REG_ON_DET_GPIO, REG_ON_DET_GPIO_Pin, GPIO_Mode_In_FL_No_IT); #if 0 /*MCU控制wifi使能工作IO初始化*/ GPIO_Init(WIFI_REG_ON_GPIO, WIFI_REG_ON_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*MCU控制是否镜像启动IO初始化*/ GPIO_Init(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); #endif /*预留IO,连接于主控*/ GPIO_Init(MCU_GPIO3_GPIO, MCU_GPIO3_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*蓝牙唤醒GPIO初始化*/ GPIO_Init(BT_HOST_WAKE_GPIO, BT_HOST_WAKE_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*蓝牙使能工作IO初始化*/ GPIO_Init(BT_REG_ON_GPIO, BT_REG_ON_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*wifi唤醒MCU IO初始化*/ GPIO_Init(WIFI_GPIO2_GPIO, WIFI_GPIO2_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*VBUS IO初始化*/ //VBAUS关机状态下唤醒MCU GPIO_Init(VBUS_DETECT, VBUS_DETECT_GPIO_Pin, GPIO_Mode_In_FL_No_IT); /*设置WIFI唤醒检测脚为中断模式*/ GPIO_Init(WIFI_GPIO1_GPIO, WIFI_GPIO1_GPIO_Pin, GPIO_Mode_In_FL_IT); /*wifi上电IO初始化*/ GPIO_Init(DEV_PWR_GPIO, DEV_PWR_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*wifi reset IO初始化*/ GPIO_Init(WL_EN_GPIO, WL_EN_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); /*wifi唤醒主平台IO初始化*/ GPIO_Init(D2H_WAK_GPIO, D2H_WAK_GPIO_Pin, GPIO_Mode_In_FL_No_IT); EXTI_SetPinSensitivity(EXTI_Pin_0, EXTI_Trigger_Rising); ITC_SetSoftwarePriority(EXTI0_IRQn, ITC_PriorityLevel_1); /*设置电池电量检测脚为中断模式*/ GPIO_Init(BAT_LOW_DET_GPIO, BAT_LOW_DET_GPIO_Pin, GPIO_Mode_In_FL_IT); /*然后配置中断1为下降沿低电平触发*/ EXTI_SetPinSensitivity(EXTI_Pin_2, EXTI_Trigger_Falling); /*设置中断的优先级*/ ITC_SetSoftwarePriority(EXTI2_IRQn, ITC_PriorityLevel_1); #if 0 /*PIR*/ GPIO_Init(PIR_GPIO, PIR_GPIO_Pin, GPIO_Mode_In_FL_No_IT); //GPIO_Init(PIR_GPIO, PIR_GPIO_Pin, GPIO_Mode_In_PU_IT); /*然后配置中断1为上升触发*/ EXTI_SetPinSensitivity(EXTI_Pin_0, EXTI_Trigger_Rising); /*设置中断的优先级*/ ITC_SetSoftwarePriority(EXTI0_IRQn, ITC_PriorityLevel_2); #endif CLK_Config(); } /****************************************************************** *函数名称:check_power_action * *功能描述:检测设备是否满足断电要求 无按键操作,无pir触发 * para: void *******************************************************************/ void check_power_action(void) { if(g_poweroff_check_flg) { if(g_key_ok_poweroff || g_pir_ok_poweroff){ uart_send_cmd(0x00); g_poweroff_check_flg = 0; } } } /****************************************************************** *函数名称:main * *功能描述:主控程序 * para: void *******************************************************************/ void main(void) { GPIO_init(); Board_Init(); PWR_ON(); Fun_Init(); enableInterrupts(); kfifo_init(&recvfifo); while (1) { // Key_Handle(); Uart_Handle(); Pin_Det_Handle(); //PIR_Detect_Handle();//PIR检测 Change_Mode(); // check_power_action(); MDelay(1); g_time_count++; //GPIO_SetBits(WIFI_REG_ON_GPIO, WIFI_REG_ON_GPIO_Pin); } } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/kfifo.c #include "kfifo.h" void *memcpy(void *__dest, void *__src, int __n) { int i = 0; unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src; for (i = __n >> 3; i > 0; i--) { *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++; } if (__n & 1 << 2) { *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++; } if (__n & 1 << 1) { *d++ = *s++; *d++ = *s++; } if (__n & 1) *d++ = *s++; return __dest; } void kfifo_init(struct kfifo *fifo) { fifo->buffer = USART_Receive_Buf; fifo->size = sizeof(USART_Receive_Buf)/sizeof(u8); fifo->in = fifo->out = 0; } unsigned int __kfifo_put(struct kfifo *fifo, unsigned char *buffer, unsigned int len) { unsigned int l; len = min(len, fifo->size - fifo->in + fifo->out); /* first put the data starting from fifo->in to buffer end */ l = min(len, fifo->size - (fifo->in & (fifo->size - 1))); memcpy(fifo->buffer + (fifo->in & (fifo->size - 1)), buffer, l); /* then put the rest (if any) at the beginning of the buffer */ memcpy(fifo->buffer, buffer + l, len - l); fifo->in += len; return len; } void __kfifo_put_singlebyte(struct kfifo *fifo, unsigned char data) { fifo->buffer[(fifo->in++) & (fifo->size - 1)] = data; } unsigned int __kfifo_get(struct kfifo *fifo, unsigned char *buffer, unsigned int len) { unsigned int l; len = min(len, fifo->in - fifo->out); /* first get the data from fifo->out until the end of the buffer */ l = min(len, fifo->size - (fifo->out & (fifo->size - 1))); memcpy(buffer, fifo->buffer + (fifo->out & (fifo->size - 1)), l); /* then get the rest (if any) from the beginning of the buffer */ memcpy(buffer + l, fifo->buffer, len - l); fifo->out += len; return len; } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/pwm/arch/hi3518e/pwm_arch.h /* here is pwm arch . * * * This file defines pwm micro-definitions for user. * * History: * 03-Mar-2016 Start of Hi351xx Digital Camera,H6 * */ #ifndef _PWM_ARCH_H #define _PWM_ARCH_H #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ #define PWMI_ADRESS_BASE 0x20130000 #define HI_IO_PWMI_ADDRESS(base_va, x) (base_va + ((x)-(PWMI_ADRESS_BASE))) //PWMI #define PWM0_CFG_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0000) #define PWM0_CFG_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0004) #define PWM0_CFG_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0008) #define PWM0_CTRL_REG(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x000C) #define PWM0_STATE_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0010) #define PWM0_STATE_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0014) #define PWM0_STATE_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0018) #define PWM1_CFG_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0020) #define PWM1_CFG_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0024) #define PWM1_CFG_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0028) #define PWM1_CTRL_REG(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x002C) #define PWM1_STATE_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0030) #define PWM1_STATE_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0034) #define PWM1_STATE_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0038) #define PWM2_CFG_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0040) #define PWM2_CFG_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0044) #define PWM2_CFG_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0048) #define PWM2_CTRL_REG(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x004C) #define PWM2_STATE_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0050) #define PWM2_STATE_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0054) #define PWM2_STATE_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0058) #define PWM3_CFG_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0060) #define PWM3_CFG_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0064) #define PWM3_CFG_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0068) #define PWM3_CTRL_REG(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x006C) #define PWM3_STATE_REG0(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0070) #define PWM3_STATE_REG1(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0074) #define PWM3_STATE_REG2(base_va) HI_IO_PWMI_ADDRESS(base_va, PWMI_ADRESS_BASE + 0x0078) #define PWM4_CFG_REG0(base_va) 0x0 #define PWM4_CFG_REG1(base_va) 0x0 #define PWM4_CFG_REG2(base_va) 0x0 #define PWM4_CTRL_REG(base_va) 0x0 #define PWM4_STATE_REG0(base_va) 0x0 #define PWM4_STATE_REG1(base_va) 0x0 #define PWM4_STATE_REG2(base_va) 0x0 #define PWM5_CFG_REG0(base_va) 0x0 #define PWM5_CFG_REG1(base_va) 0x0 #define PWM5_CFG_REG2(base_va) 0x0 #define PWM5_CTRL_REG(base_va) 0x0 #define PWM5_STATE_REG0(base_va) 0x0 #define PWM5_STATE_REG1(base_va) 0x0 #define PWM5_STATE_REG2(base_va) 0x0 #define PWM6_CFG_REG0(base_va) 0x0 #define PWM6_CFG_REG1(base_va) 0x0 #define PWM6_CFG_REG2(base_va) 0x0 #define PWM6_CTRL_REG(base_va) 0x0 #define PWM6_STATE_REG0(base_va) 0x0 #define PWM6_STATE_REG1(base_va) 0x0 #define PWM6_STATE_REG2(base_va) 0x0 #define PWM7_CFG_REG0(base_va) 0x0 #define PWM7_CFG_REG1(base_va) 0x0 #define PWM7_CFG_REG2(base_va) 0x0 #define PWM7_CTRL_REG(base_va) 0x0 #define PWM7_STATE_REG0(base_va) 0x0 #define PWM7_STATE_REG1(base_va) 0x0 #define PWM7_STATE_REG2(base_va) 0x0 //PWM #define PWM_NUM_MAX 0x04 #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ #endif /*_PWM_ARCH_H*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/sample_rsa_sign.c /****************************************************************************** Copyright (C), 2011-2021, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : sample_rng.c Version : Initial Draft Author : Hisilicon Created : 2012/07/10 Last Modified : Description : sample for hash Function List : History : ******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <assert.h> #include "hi_type.h" #include "hi_unf_cipher.h" #include "hi_mmz_api.h" #include "config.h" #define HI_ERR_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #define HI_INFO_CIPHER(format, arg...) printf( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #ifdef CIPHER_RSA_SUPPORT static HI_S32 printBuffer(const HI_CHAR *string, const HI_U8 *pu8Input, HI_U32 u32Length) { HI_U32 i = 0; if ( NULL != string ) { printf("%s\n", string); } for ( i = 0 ; i < u32Length; i++ ) { if( (i % 16 == 0) && (i != 0)) printf("\n"); printf("0x%02x ", pu8Input[i]); } printf("\n"); return HI_SUCCESS; } static unsigned char test_data[] = {"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"}; static unsigned char sha256_sum[32] = { 0x24, 0x8D, 0x6A, 0x61, 0xD2, 0x06, 0x38, 0xB8, 0xE5, 0xC0, 0x26, 0x93, 0x0C, 0x3E, 0x60, 0x39, 0xA3, 0x3C, 0xE4, 0x59, 0x64, 0xFF, 0x21, 0x67, 0xF6, 0xEC, 0xED, 0xD4, 0x19, 0xDB, 0x06, 0xC1, }; static HI_U8 N[] = { 0x82, 0x78, 0xA0, 0xC5, 0x39, 0xE6, 0xF6, 0xA1, 0x5E, 0xD1, 0xC6, 0x8B, 0x9C, 0xF9, 0xC4, 0x3F, 0xEA, 0x19, 0x16, 0xB0, 0x96, 0x3A, 0xB0, 0x5A, 0x94, 0xED, 0x6A, 0xD3, 0x83, 0xE8, 0xA0, 0xFD, 0x01, 0x5E, 0x92, 0x2A, 0x7D, 0x0D, 0xF9, 0x72, 0x1E, 0x03, 0x8A, 0x68, 0x8B, 0x4D, 0x57, 0x55, 0xF5, 0x2F, 0x9A, 0xC9, 0x45, 0xCF, 0x9B, 0xB7, 0xF5, 0x11, 0x94, 0x7A, 0x16, 0x0B, 0xED, 0xD9, 0xA3, 0xF0, 0x63, 0x8A, 0xEC, 0xD3, 0x21, 0xAB, 0xCF, 0x74, 0xFC, 0x6B, 0xCE, 0x06, 0x4A, 0x51, 0xC9, 0x7C, 0x7C, 0xA3, 0xC4, 0x10, 0x63, 0x7B, 0x00, 0xEC, 0x2D, 0x02, 0x18, 0xD5, 0xF1, 0x8E, 0x19, 0x7F, 0xBE, 0xE2, 0x45, 0x5E, 0xD7, 0xA8, 0x95, 0x90, 0x88, 0xB0, 0x73, 0x35, 0x89, 0x66, 0x1C, 0x23, 0xB9, 0x6E, 0x88, 0xE0, 0x7A, 0x57, 0xB0, 0x55, 0x8B, 0x81, 0x9B, 0x9C, 0x34, 0x9F, 0x86, 0x0E, 0x15, 0x94, 0x2C, 0x6B, 0x12, 0xC3, 0xB9, 0x56, 0x60, 0x25, 0x59, 0x3E, 0x50, 0x7B, 0x62, 0x4A, 0xD0, 0xF0, 0xB6, 0xB1, 0x94, 0x83, 0x51, 0x66, 0x6F, 0x60, 0x4D, 0xEF, 0x8F, 0x94, 0xA6, 0xD1, 0xA2, 0x80, 0x06, 0x24, 0xF2, 0x6E, 0xD2, 0xC7, 0x01, 0x34, 0x8D, 0x2B, 0x6B, 0x03, 0xF7, 0x05, 0xA3, 0x99, 0xCC, 0xC5, 0x16, 0x75, 0x1A, 0x81, 0xC1, 0x67, 0xA0, 0x88, 0xE6, 0xE9, 0x00, 0xFA, 0x62, 0xAF, 0x2D, 0xA9, 0xFA, 0xC3, 0x30, 0x34, 0x98, 0x05, 0x4C, 0x1A, 0x81, 0x0C, 0x52, 0xCE, 0xBA, 0xD6, 0xEB, 0x9C, 0x1E, 0x76, 0x01, 0x41, 0x6C, 0x34, 0xFB, 0xC0, 0x83, 0xC5, 0x4E, 0xB3, 0xF2, 0x5B, 0x4F, 0x94, 0x08, 0x33, 0x87, 0x5E, 0xF8, 0x39, 0xEF, 0x7F, 0x72, 0x94, 0xFF, 0xD7, 0x51, 0xE8, 0xA2, 0x5E, 0x26, 0x25, 0x5F, 0xE9, 0xCC, 0x2A, 0x7D, 0xAC, 0x5B, 0x35 }; static HI_U8 E[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01 }; static HI_U8 D[] = { 0x49, 0x7E, 0x93, 0xE9, 0xA5, 0x7D, 0x42, 0x0E, 0x92, 0xB0, 0x0E, 0x6C, 0x94, 0xC7, 0x69, 0x52, 0x2B, 0x97, 0x68, 0x5D, 0x9E, 0xB2, 0x7E, 0xA6, 0xF7, 0xDF, 0x69, 0x5E, 0xAE, 0x9E, 0x7B, 0x19, 0x2A, 0x0D, 0x50, 0xBE, 0xD8, 0x64, 0xE7, 0xCF, 0xED, 0xB2, 0x46, 0xE4, 0x2F, 0x1C, 0x29, 0x07, 0x45, 0xAF, 0x44, 0x3C, 0xFE, 0xB3, 0x3C, 0xDF, 0x7A, 0x10, 0x26, 0x18, 0x43, 0x95, 0x02, 0xAD, 0xA7, 0x98, 0x81, 0x2A, 0x3F, 0xCF, 0x8A, 0xD7, 0x12, 0x6C, 0xAE, 0xC8, 0x37, 0x6C, 0xF9, 0xAE, 0x6A, 0x96, 0x52, 0x4B, 0x99, 0xE5, 0x35, 0x74, 0x93, 0x87, 0x76, 0xAF, 0x08, 0xB8, 0x73, 0x72, 0x7D, 0x50, 0xA5, 0x81, 0x26, 0x5C, 0x8F, 0x94, 0xEA, 0x73, 0x59, 0x5C, 0x33, 0xF9, 0xC3, 0x65, 0x1E, 0x92, 0xCD, 0x20, 0xC3, 0xBF, 0xD7, 0x8A, 0xCF, 0xCC, 0xD0, 0x61, 0xF8, 0xFB, 0x1B, 0xF4, 0xB6, 0x0F, 0xD4, 0xCF, 0x3E, 0x55, 0x48, 0x4C, 0x99, 0x2D, 0x40, 0x44, 0x7C, 0xBA, 0x7B, 0x6F, 0xDB, 0x5D, 0x71, 0x91, 0x2D, 0x93, 0x80, 0x19, 0xE3, 0x26, 0x5D, 0x59, 0xBE, 0x46, 0x6D, 0x90, 0x4B, 0xDF, 0x72, 0xCE, 0x6C, 0x69, 0x72, 0x8F, 0x5B, 0xA4, 0x74, 0x50, 0x2A, 0x42, 0x95, 0xB2, 0x19, 0x04, 0x88, 0xD7, 0xDA, 0xBB, 0x17, 0x23, 0x69, 0xF4, 0x52, 0xEB, 0xC8, 0x55, 0xBE, 0xBC, 0x2E, 0xA9, 0xD0, 0x57, 0x7D, 0xC6, 0xC8, 0x8B, 0x86, 0x7B, 0x73, 0xCD, 0xE4, 0x32, 0x79, 0xC0, 0x75, 0x53, 0x53, 0xE7, 0x59, 0x38, 0x0A, 0x8C, 0xEC, 0x06, 0xA9, 0xFC, 0xA5, 0x15, 0x81, 0x61, 0x3E, 0x44, 0xCD, 0x05, 0xF8, 0x54, 0x04, 0x00, 0x79, 0xB2, 0x0D, 0x69, 0x2A, 0x47, 0x60, 0x1A, 0x2B, 0x79, 0x3D, 0x4B, 0x50, 0x8A, 0x31, 0x72, 0x48, 0xBB, 0x75, 0x78, 0xD6, 0x35, 0x90, 0xE1, }; static HI_U8 RES[] = { 0x5c, 0xfd, 0x7c, 0xb3, 0x9f, 0xf1, 0x2b, 0xd0, 0x73, 0x23, 0x21, 0x4e, 0x25, 0x3d, 0x68, 0x5c, 0x6c, 0x4b, 0x12, 0x77, 0x6b, 0x0e, 0x26, 0x80, 0x2a, 0xf4, 0xd2, 0x92, 0x66, 0x40, 0xe0, 0xb2, 0x5f, 0xbe, 0x81, 0xa1, 0xda, 0xa4, 0xc5, 0x07, 0x96, 0x17, 0x4a, 0x12, 0x5f, 0xa4, 0x33, 0x43, 0x3f, 0x94, 0x7e, 0xe7, 0xbb, 0xd1, 0x7b, 0xde, 0x03, 0xb8, 0xcc, 0xe5, 0x79, 0x5c, 0x3e, 0x5c, 0x3c, 0xa1, 0x49, 0xbf, 0xda, 0xc4, 0xb4, 0x73, 0x2d, 0x49, 0x9f, 0x7a, 0xf9, 0x1d, 0x8a, 0xbc, 0x39, 0x17, 0xbc, 0xd7, 0x45, 0xaf, 0xad, 0x38, 0x99, 0xc1, 0x1c, 0xf7, 0xe6, 0xf2, 0x7b, 0x16, 0x26, 0xaa, 0xa9, 0x16, 0x96, 0xff, 0x02, 0x41, 0x97, 0x1e, 0x81, 0x43, 0xab, 0xff, 0xa8, 0xb7, 0x19, 0xdf, 0x19, 0xac, 0x19, 0xdb, 0xbf, 0x15, 0x00, 0x12, 0xbe, 0x64, 0x2b, 0xd4, 0x50, 0x32, 0x87, 0xdf, 0x52, 0xb1, 0x78, 0x65, 0x53, 0x7d, 0x10, 0x2d, 0xc1, 0x39, 0xfc, 0x9d, 0x05, 0x15, 0x07, 0x84, 0xb2, 0xa1, 0x5b, 0x72, 0x82, 0x22, 0x73, 0x1f, 0x00, 0xbf, 0xf8, 0x71, 0x3a, 0xf3, 0x5a, 0x02, 0x60, 0x53, 0x40, 0x44, 0x65, 0x0e, 0xb1, 0x3b, 0xe4, 0x9a, 0xe9, 0x8d, 0x10, 0x81, 0xa4, 0x0b, 0xed, 0x02, 0xb7, 0x7f, 0x4a, 0x32, 0x90, 0xbb, 0xe7, 0xe6, 0xb8, 0x69, 0x0f, 0x95, 0xea, 0x93, 0x45, 0x2c, 0x5f, 0x76, 0xfd, 0xb6, 0xcb, 0x1a, 0x7b, 0xe9, 0xc1, 0x37, 0xf7, 0x77, 0xba, 0xb4, 0x1a, 0x26, 0xea, 0x68, 0x18, 0x35, 0x5d, 0x71, 0xe8, 0x3f, 0xdd, 0x97, 0x7d, 0x57, 0xa6, 0x40, 0x45, 0xd8, 0x0d, 0xe4, 0xc7, 0xc0, 0x04, 0xdf, 0x20, 0x9e, 0x3a, 0x85, 0x85, 0x44, 0x37, 0x45, 0x31, 0x96, 0x3b, 0xa8, 0xa7, 0xf6, 0xec, 0xff, 0xf1, 0xd1, 0xa4, 0x23, 0x7e, 0x8c, }; HI_S32 RSA_SIGN_VERIFY(HI_UNF_CIPHER_RSA_SIGN_SCHEME_E enScheme) { HI_S32 ret = HI_SUCCESS; HI_U8 u8Sign[256]; HI_U32 u32SignLen; HI_UNF_CIPHER_RSA_SIGN_S stRsaSign; HI_UNF_CIPHER_RSA_VERIFY_S stRsaVerify; ret = HI_UNF_CIPHER_Init(); if ( HI_SUCCESS != ret ) { return HI_FAILURE; } memset(&stRsaSign, 0, sizeof(HI_UNF_CIPHER_RSA_SIGN_S)); stRsaSign.enScheme = enScheme; stRsaSign.stPriKey.pu8N = N; stRsaSign.stPriKey.pu8D = D; stRsaSign.stPriKey.u16NLen = sizeof(N); stRsaSign.stPriKey.u16DLen = sizeof(D); stRsaSign.enKeySrc = HI_UNF_CIPHER_KEY_SRC_USER; ret = HI_UNF_CIPHER_RsaSign(&stRsaSign, test_data, sizeof(test_data) - 1, sha256_sum, u8Sign, &u32SignLen); // ret = HI_UNF_CIPHER_RsaSign(&stRsaSign, test_data, sizeof(test_data) - 1, HI_NULL, u8Sign, &u32SignLen); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaSign failed\n"); return HI_FAILURE; } switch(enScheme) { case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA256: if(memcmp(u8Sign, RES, sizeof(RES)) != 0) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaSign failed\n"); printBuffer("sign", u8Sign, u32SignLen); printBuffer("golden", RES, sizeof(RES)); return HI_FAILURE; } break; default: break; } // printBuffer("sign", u8Sign, u32SignLen); memset(&stRsaVerify, 0, sizeof(HI_UNF_CIPHER_RSA_VERIFY_S)); stRsaVerify.enScheme = enScheme; stRsaVerify.stPubKey.pu8N = N; stRsaVerify.stPubKey.pu8E = E; stRsaVerify.stPubKey.u16NLen = sizeof(N); stRsaVerify.stPubKey.u16ELen = sizeof(E); // ret = HI_UNF_CIPHER_RsaVerify(&stRsaVerify, test_data, sizeof(test_data) - 1, HI_NULL, u8Sign, u32SignLen); ret = HI_UNF_CIPHER_RsaVerify(&stRsaVerify, test_data, sizeof(test_data) - 1, sha256_sum, u8Sign, u32SignLen); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("HI_UNF_CIPHER_RsaVerify failed\n"); return HI_FAILURE; } printf("\033[0;1;32m""sample RSA_SIGN_VERIFY run successfully!\n""\033[0m"); HI_UNF_CIPHER_DeInit(); return HI_SUCCESS; } int sample_rsa_sign() { HI_S32 s32Ret = HI_SUCCESS; s32Ret = RSA_SIGN_VERIFY(HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA256); if (s32Ret != HI_SUCCESS) { return s32Ret; } s32Ret = RSA_SIGN_VERIFY(HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA256); if (s32Ret != HI_SUCCESS) { return s32Ret; } return HI_SUCCESS; } #else int sample_rsa_sign() { printf("RSA not support!!!\n"); return HI_SUCCESS; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/halt.c #include "halt.h" #include "boardconfig.h" void InitEnterHaltMode(void) { disableInterrupts(); //将开关机管脚设为中断模式 //GPIO_Init(KEY1_GPIO,KEY1_GPIO_Pin,GPIO_Mode_In_PU_IT); #ifdef PIR_SUPPORT //将PIR管脚设为中断模式 GPIO_Init(PIR_GPIO,PIR_GPIO_Pin,GPIO_Mode_In_PU_IT); #endif //然后配置中断1为下降沿低电平触发 //EXTI_SetPinSensitivity(EXTI_Pin_4, EXTI_Trigger_Rising_Falling); //设置中断的优先级 GPIO_Init(D2H_WAK_GPIO,D2H_WAK_GPIO_Pin,GPIO_Mode_In_FL_IT); /*然后配置中断1为下降沿低电平触发*/ EXTI_SetPinSensitivity(EXTI_Pin_3, EXTI_Trigger_Rising); /*设置中断的优先级*/ ITC_SetSoftwarePriority(EXTI3_IRQn, ITC_PriorityLevel_1); /*关闭串口*/ GPIO_Init(USART1_RX_GPIO,USART1_RX_GPIO_Pin,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(USART1_TX_GPIO,USART1_TX_GPIO_Pin,GPIO_Mode_Out_PP_Low_Slow); GPIO_ResetBits(GPIOC, GPIO_Pin_5); GPIO_ResetBits(GPIOC, GPIO_Pin_6); USART_Cmd(USART1,DISABLE); USART_DeInit(USART1); TIM3_DeInit(); USART_DeInit(USART1); enableInterrupts(); } void InitExitHaltMode(void) { disableInterrupts(); //将开关机管脚设为普通IO口模式 GPIO_Init(KEY1_GPIO, KEY1_GPIO_Pin, GPIO_Mode_In_PU_No_IT); #ifdef PIR_SUPPORT GPIO_Init(PIR_GPIO,PIR_GPIO_Pin,GPIO_Mode_In_FL_No_IT); #endif TIM3_Config(); Usart_Config(); enableInterrupts(); } void GPIO_init(void) { GPIO_DeInit(GPIOA); GPIO_DeInit(GPIOB); GPIO_DeInit(GPIOC); GPIO_DeInit(GPIOD); /* Port A in output push-pull 0 */ GPIO_Init(GPIOA,GPIO_Pin_All,GPIO_Mode_Out_PP_Low_Slow); /* Port B in output push-pull 0 */ GPIO_Init(GPIOB, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port C in output push-pull 0 */ GPIO_Init(GPIOC, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port D in output push-pull 0 */ GPIO_Init(GPIOD,GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); } extern u8 g_forceslp_halt; void Change_Mode(void) { // key halt mode enter normal mode if(g_Key_WakeUp_It) { InitExitHaltMode(); g_Key_WakeUp_It = 0; PWR_ON(); } //Pir halt mode enter normal mode #ifdef PIR_SUPPORT if(g_Pir_WakeUp_it) { InitExitHaltMode(); g_Pir_WakeUp_it = 0; PWR_ON(); } #endif //normal mode enter halt mode if (!g_Wifi_WakeUp) { if(g_IsSystemOn == 0) { InitEnterHaltMode(); Halt_Mode(); } } } void Halt_Mode(void) { //ENTER ACTIVE HALT CLOSE the main voltage regulator is powered off CLK->ICKCR|=CLK_ICKCR_SAHALT; // Set STM8 in low power PWR->CSR2 = 0x2; // low power fast wake up disable PWR_FastWakeUpCmd(DISABLE); // Stop RTC Source clock #if (!ENABLE_RTC) CLK_RTCClockConfig(CLK_RTCCLKSource_Off, CLK_RTCCLKDiv_1); CLK_PeripheralClockConfig(CLK_Peripheral_RTC, DISABLE); #endif CLK_LSICmd(DISABLE); while ((CLK->ICKCR & 0x04) != 0x00); CLK_PeripheralClockConfig(CLK_Peripheral_TIM1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM4, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM5, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_I2C1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_SPI1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART3, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_BEEP, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_DAC, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_LCD, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_DMA1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_BOOTROM, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_COMP, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_AES, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_SPI2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_CSSLSE, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM3, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART1, DISABLE); enableInterrupts(); halt(); //system go to halt mode; } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/Makefile #Created by liucan, 2012/12/26 ifeq ($(PARAM_FILE), ) PARAM_FILE:=../../mpp/Makefile.param include $(PARAM_FILE) endif sub_dir:= mipi hisi-irda rtc wtdg clean_dir:= mipi hisi-irda rtc wtdg .PHONY: all clean $(sub_dir) $(clean_dir) all: mipi @for dir in $(sub_dir); do \ pushd $$dir; make || exit 1; popd; \ done @cp mipi/hi_mipi.h $(REL_INC) $(sub_dir): @cd $@; make || exit1; clean: $(clean_dir) $(clean_dir): @cd $(patsubst %_clean, %, $@) ; make clean; <file_sep>/Hi3518E_SDK_V5.0.5.1/sdk.unpack #!/bin/sh source scripts/common.sh ECHO "Unpacking SDK" COLOR_YELLOW WARN "Be sure you have installed the cross-compiler. if not, install it first!" WARN "ALL THE SOUCE FILES WILL BE OVERWRITED, FILES YOU MOTIFIED WILL BE LOST !!!" ECHO "" #ECHO "To continue, type 'Yes' and then press ENTER ..." #read choice #[ x$choice != xYes ] && exit 1 SDK_CHIP=hi3518e OS_TYPE=HuaweiLite ECHO "OS_TYPE =$OS_TYPE" ECHO "SDK_CHIP =$SDK_CHIP" set +e #ECHO "install cross toolchain" #./tools/toolchains/cross.install ECHO "unpacking osal" mkdir -p osal/ run_command_progress_float "tar -xvzf package/osal.tgz" 0 "tar -tzf package/osal.tgz | wc -l" ECHO "unpacking osdrv" mkdir -p osdrv/ run_command_progress_float "tar -xvzf package/osdrv.tgz" 0 "tar -tzf package/osdrv.tgz | wc -l" mkdir -p osdrv/ if [ "$OS_TYPE" = "linux" ]; then ECHO "unpacking linux kernel" run_command_progress_float "tar -xvzf osdrv/opensource/kernel/linux-4.5.y.tgz -C osdrv/opensource/kernel/" 0 "tar -tzf osdrv/opensource/kernel/linux-4.5.y.tgz | wc -l" else ECHO "unpacking liteos kernel" run_command_progress_float "tar -xvzf osdrv/opensource/liteos/liteos.tgz -C osdrv/opensource/liteos/" 0 "tar -tzf osdrv/opensource/liteos/liteos.tgz | wc -l" fi if [ "$SDK_CHIP" = "hi3519" ]; then ECHO "unpacking mpp_single" mkdir -pv mpp_single run_command_progress_float "tar -xvzf package/mpp_single.tgz" 0 "tar -tzf package/mpp_single.tgz | wc -l" if [ "$OS_TYPE" = "linux" ]; then ECHO "unpacking mpp_big-little" mkdir -pv mpp_big-little run_command_progress_float "tar -xvzf package/mpp_big-little.tgz" 0 "tar -tzf package/mpp_big-little.tgz | wc -l" fi elif [ "$SDK_CHIP" = "hi3519v101" ];then ECHO "unpacking mpp_big-little" mkdir -pv mpp_big-little run_command_progress_float "tar -xvzf package/mpp_big-little.tgz" 0 "tar -tzf package/mpp_big-little.tgz | wc -l" else ECHO "unpacking mpp" mkdir -pv mpp run_command_progress_float "tar -xvzf package/mpp.tgz" 0 "tar -tzf package/mpp.tgz | wc -l" fi ECHO "unpacking drv" mkdir -pv drv run_command_progress_float "tar -xvzf package/drv.tgz" 0 "tar -tzf package/drv.tgz | wc -l" <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/sample_hi3518ev200.c /* * osdrv sample */ #include "sys/types.h" #include "sys/time.h" #include "unistd.h" #include "fcntl.h" #include "sys/statfs.h" #include "limits.h" #include "los_event.h" #include "los_printf.h" #include "lwip/tcpip.h" #include "lwip/netif.h" #include "eth_drv.h" #include "arch/perf.h" #include "fcntl.h" #include "fs/fs.h" #include "stdio.h" #include "shell.h" #include "hisoc/uart.h" #include "vfs_config.h" #include "disk.h" #include "los_cppsupport.h" #include "linux/fb.h" #include "adaptsecure.h" /*Hi1131 modify add */ #include "los_event.h" #include "wpa_supplicant/wpa_supplicant.h" #include "hostapd/hostapd_if.h" #include "hisi_wifi.h" #include <mmc/host.h> #include "hisilink_lib.h" #include "hilink_link.h" #include "driver_hisi_lib_api.h" #include <linux/completion.h> #define WPA_SUPPLICANT_CONFIG_PATH "/jffs0/etc/hisi_wifi/wifi/wpa_supplicant.conf" typedef enum { HSL_STATUS_UNCREATE, HSL_STATUS_CREATE, HSL_STATUS_RECEIVE, HSL_STATUS_CONNECT, HSL_STATUS_BUTT }hsl_status_enum; typedef enum { HILINK_STATUS_UNCREATE, HILINK_STATUS_RECEIVE, //hilink处于接收组播阶段 HILINK_STATUS_CONNECT, //hilink处于关联阶段 HILINK_STATUS_BUTT }hilink_status_enum; extern void mcu_uart_proc(); extern void hisi_wifi_shell_cmd_register(void); /* 从启动dhcp,间隔1秒查询IP是否获取,30秒未获取IP执行去关联动作 */ #define DHCP_CHECK_CNT 30 #define DHCP_CHECK_TIME 1000 #define DHCP_IP_SET 0 #define DHCP_IP_DEL 1 #define WLAN_FILE_STORE_MIN_SIZE (0) #define WLAN_FILE_STORE_MID_SIZE (0x30000) #define WLAN_FILE_STORE_MAX_SIZE (0x70000) #define WLAN_FILE_STORE_BASEADDR (0x750000) struct timer_list hisi_dhcp_timer; unsigned int check_ip_loop = 0; struct netif *pwifi = NULL; extern unsigned char hsl_demo_get_status(void); extern hsl_result_stru* hsl_demo_get_result(void); extern unsigned char hilink_demo_get_status(void); extern hsl_result_stru* hilink_demo_get_result(void); extern void hisi_reset_addr(void); extern int hilink_demo_online(hilink_s_result* pst_result); extern int hsl_demo_online(hsl_result_stru* pst_params); extern void start_dhcps(void); extern hisi_rf_customize_stru g_st_rf_customize; /*Hi1131 modify end */ int secure_func_register(void) { int ret; STlwIPSecFuncSsp stlwIPSspCbk= {0}; stlwIPSspCbk.pfMemset_s = Stub_MemSet; stlwIPSspCbk.pfMemcpy_s = Stub_MemCpy; stlwIPSspCbk.pfStrNCpy_s = Stub_StrnCpy; stlwIPSspCbk.pfStrNCat_s = Stub_StrnCat; stlwIPSspCbk.pfStrCat_s = Stub_StrCat; stlwIPSspCbk.pfMemMove_s = Stub_MemMove; stlwIPSspCbk.pfSnprintf_s = Stub_Snprintf; stlwIPSspCbk.pfRand = rand; ret = lwIPRegSecSspCbk(&stlwIPSspCbk); if (ret != 0) { PRINT_ERR("\n***lwIPRegSecSspCbk Failed***\n"); return -1; } PRINTK("\nCalling lwIPRegSecSspCbk\n"); return ret; } extern UINT32 osShellInit(char *); struct netif *pnetif; void net_init() { (void)secure_func_register(); tcpip_init(NULL, NULL); #ifdef LOSCFG_DRIVERS_HIGMAC extern struct los_eth_driver higmac_drv_sc; pnetif = &(higmac_drv_sc.ac_if); higmac_init(); #endif #ifdef LOSCFG_DRIVERS_HIETH_SF extern struct los_eth_driver hisi_eth_drv_sc; pnetif = &(hisi_eth_drv_sc.ac_if); hisi_eth_init(); #endif dprintf("cmd_startnetwork : DHCP_BOUND finished\n"); netif_set_up(pnetif); } extern unsigned int g_uwFatSectorsPerBlock; extern unsigned int g_uwFatBlockNums; #define SUPPORT_FMASS_PARITION #ifdef SUPPORT_FMASS_PARITION extern int fmass_register_notify(void(*notify)(void* context, int status), void* context); extern int fmass_partition_startup(char* path); void fmass_app_notify(void* conext, int status) { if(status == 1)/*usb device connect*/ { char *path = "/dev/mmcblk0p0"; //startup fmass access patition fmass_partition_startup(path); } } #endif #include "board.h" extern UINT32 g_sys_mem_addr_end; extern unsigned int g_uart_fputc_en; void board_config(void) { g_sys_mem_addr_end = SYS_MEM_BASE + SYS_MEM_SIZE_DEFAULT; g_uwSysClock = OS_SYS_CLOCK; g_uart_fputc_en = 1; #ifndef TWO_OS extern unsigned long g_usb_mem_addr_start; extern unsigned long g_usb_mem_size; g_usb_mem_addr_start = g_sys_mem_addr_end; g_usb_mem_size = 0x20000; //recommend 128K nonCache for usb g_uwFatSectorsPerBlock = CONFIG_FS_FAT_SECTOR_PER_BLOCK; g_uwFatBlockNums = CONFIG_FS_FAT_BLOCK_NUMS; //different board should set right mode:"rgmii" "rmii" "mii" //if you don't set : //hi3516a board's default mode is "rgmii" //hi3518ev200 board's default mode is "rmii" //hi3519 board's default mode is "rgmii" #if defined(HI3516A) || defined(HI3519) || defined(HI3519V101) || defined(HI3559) hisi_eth_set_phy_mode("rgmii"); #endif #if defined(HI35168EV200) hisi_eth_set_phy_mode("rmii"); #endif //different board should set right addr:0~31 //if you don't set ,driver will detect it automatically //hisi_eth_set_phy_addr(0);//0~31 #if (defined(HI3518EV200) &&defined(LOSCFG_DRIVERS_EMMC)) || defined(HI3519) || defined(HI3519V101) || defined(HI3559) size_t part0_start_sector = 16 * (0x100000/512); size_t part0_count_sector = 1024 * (0x100000/512); size_t part1_start_sector = 16 * (0x100000/512) + part0_count_sector; size_t part1_count_sector = 1024 * (0x100000/512); extern struct disk_divide_info emmc; add_mmc_partition(&emmc, part0_start_sector, part0_count_sector); add_mmc_partition(&emmc, part1_start_sector, part1_count_sector); #endif #endif } #if 0 void app_init(void) { UINT32 uwRet; dprintf("uart init ...\n"); hi_uartdev_init(); dprintf("shell init ...\n"); system_console_init(TTY_DEVICE); osShellInit(TTY_DEVICE); dprintf("spi bus init ...\n"); hi_spi_init(); dprintf("dmac init\n"); hi_dmac_init(); dprintf("i2c bus init ...\n"); i2c_dev_init(); dprintf("random dev init ...\n"); ran_dev_register(); dprintf("mem dev init ...\n"); mem_dev_register(); dprintf("fb dev init ...\n"); struct fb_info *info = malloc(sizeof(struct fb_info)); register_framebuffer(info); dprintf("porc fs init ...\n"); proc_fs_init(); dprintf("cxx init ...\n"); extern char __init_array_start__, __init_array_end__; LOS_CppSystemInit((unsigned long)&__init_array_start__, (unsigned long)&__init_array_end__, NO_SCATTER); #ifndef TWO_OS dprintf("nand init ...\n"); if(!nand_init()) { add_mtd_partition("nand", 0x200000, 32*0x100000, 0); add_mtd_partition("nand", 0x200000 + 32*0x100000, 32*0x100000, 1); mount("/dev/nandblk0", "/yaffs0", "yaffs", 0, NULL); //mount("/dev/nandblk1", "/yaffs1", "yaffs", 0, NULL); } dprintf("spi nor flash init ...\n"); if(!spinor_init()){ add_mtd_partition("spinor", 0x100000, 2*0x100000, 0); add_mtd_partition("spinor", 3*0x100000, 2*0x100000, 1); #ifndef HI3559 mount("/dev/spinorblk0", "/jffs0", "jffs", 0, NULL); #endif //mount("/dev/spinorblk1", "/jffs1", "jffs", 0, NULL); } dprintf("gpio init ...\n"); hi_gpio_init(); dprintf("net init ...\n"); net_init(); dprintf("sd/mmc host init ...\n"); SD_MMC_Host_init(); msleep(2000); #ifndef SUPPORT_FMASS_PARITION uwRet = mount("/dev/mmcblk0p0", "/sd0p0", "vfat", 0, 0); if (uwRet) dprintf("mount mmcblk0p0 to sd0p0 err %d\n", uwRet); uwRet = mount("/dev/mmcblk0p1", "/sd0p1", "vfat", 0, 0); if (uwRet) dprintf("mount mmcblk0p1 to sd0p1 err %d\n", uwRet); uwRet = mount("/dev/mmcblk1p0", "/sd1p0", "vfat", 0, 0); if (uwRet) dprintf("mount mmcblk1p0 to sd1p0 err %d\n", uwRet); uwRet = mount("/dev/mmcblk2p0", "/sd2p0", "vfat", 0, 0); if (uwRet) dprintf("mount mmcblk2p0 to sd2p0 err %d\n", uwRet); #endif dprintf("usb init ...\n"); //g_usb_mem_addr_start and g_usb_mem_size must be set in board_config //usb_init must behind SD_MMC_Host_init uwRet = usb_init(); #ifdef SUPPORT_FMASS_PARITION if(!uwRet) fmass_register_notify(fmass_app_notify,NULL); #endif msleep(2000); uwRet = mount("/dev/sdap0", "/usbp0", "vfat", 0, 0); if (uwRet) dprintf("mount sdap0 to usbp0 err %d\n", uwRet); uwRet = mount("/dev/sdap1", "/usbp1", "vfat", 0, 0); if (uwRet) dprintf("mount sdap1 to usbp1 err %d\n", uwRet); #ifdef HI3516A dprintf("dvfs init ...\n"); dvfs_init(); #endif #endif dprintf("g_sys_mem_addr_end=0x%08x,\n",g_sys_mem_addr_end); dprintf("done init!\n"); dprintf("Date:%s.\n", __DATE__); dprintf("Time:%s.\n", __TIME__); #ifdef TWO_OS extern int _ipcm_vdd_init(void); extern int ipcm_net_init(void); dprintf("tcpip init ...\n"); (void)secure_func_register(); tcpip_init(NULL, NULL); dprintf("_ipcm vdd init ...\n"); _ipcm_vdd_init(); dprintf("ipcm net init ...\n"); ipcm_net_init(); extern int HI_ShareFs_Client_Init(char *); dprintf("share fs init ... \n"); HI_ShareFs_Client_Init("/liteos"); dprintf("share fs init done.\n"); #endif #ifdef __OSDRV_TEST__ #ifndef TWO_OS msleep(5000); #endif test_app_init(); #endif return; } #else void hi_rf_customize_init(void) { /*11b scaling 功率,共4字节,低字节到高字节对应1m、2m、5.5m、11m,值越大,11b模式发射功率越高*/ g_st_rf_customize.l_11b_scaling_value = 0x9c9c9c9c; /*11g scaling 功率,共4字节,低字节到高字节对应6m、9m、12m、18m,值越大,11g模式发射功率越高*/ g_st_rf_customize.l_11g_u1_scaling_value = 0x6c6c6c6c; /*11g scaling 功率,共4字节,低字节到高字节对应24m、36m、48m、54m,值越大,11g模式发射功率越高*/ g_st_rf_customize.l_11g_u2_scaling_value = 0x666c6c6c; /*11n 20m scaling 功率,共4字节,低字节到高字节对应mcs4、mcs5、mcs6、mcs7,值越大,11n模式发射功率越高*/ g_st_rf_customize.l_11n_20_u1_scaling_value = 0x57575757; /*11n 20m scaling 功率,共4字节,低字节到高字节对应mcs0、mcs1、mcs2、mcs3,值越大,11n模式发射功率越高*/ g_st_rf_customize.l_11n_20_u2_scaling_value = 0x5c5c5757; /*11n 40m scaling 功率,共4字节,低字节到高字节对应mcs4、mcs5、mcs6、mcs7,值越大,11n模式发射功率越高*/ g_st_rf_customize.l_11n_40_u1_scaling_value = 0x5a5a5a5a; /*11n 40m scaling 功率,共4字节,低字节到高字节对应mcs0、mcs1、mcs2、mcs3,值越大,11n模式发射功率越高*/ g_st_rf_customize.l_11n_40_u2_scaling_value = 0x5d5d5a5a; /*1-4信道upc功率调整,值越大,该信道功率越高*/ g_st_rf_customize.l_ban1_ref_value = 55; /*5-9信道upc功率调整,值越大,该信道功率越高*/ g_st_rf_customize.l_ban2_ref_value = 55; /*10-13信道upc功率调整,值越大,该信道功率越高*/ g_st_rf_customize.l_ban3_ref_value = 56; /*40M带宽bypass,置1禁用40M带宽,写0使用40M带宽*/ g_st_rf_customize.l_disable_bw_40 = 1; /*低功耗开关,写1打开低功耗,写0关闭低功耗*/ g_st_rf_customize.l_pm_switch = 1; /*dtim设置, 范围1-10*/ g_st_rf_customize.l_dtim_setting = 1; /*如需定制化,请置1,否则请置0*/ g_st_rf_customize.l_customize_enable = 1; } void hi_wifi_register_init(void) { unsigned int value = 0; /*配置管脚复用*/ if (0 == WIFI_SDIO_INDEX) { value = 0x0001; writel(value, REG_MUXCTRL_SDIO0_CLK_MAP); //writel(value, REG_MUXCTRL_SDIO0_DETECT_MAP); writel(value, REG_MUXCTRL_SDIO0_CWPR_MAP); writel(value, REG_MUXCTRL_SDIO0_CDATA1_MAP); writel(value, REG_MUXCTRL_SDIO0_CDATA0_MAP); writel(value, REG_MUXCTRL_SDIO0_CDATA3_MAP); writel(value, REG_MUXCTRL_SDIO0_CCMD_MAP); writel(value, REG_MUXCTRL_SDIO0_POWER_EN_MAP); writel(value, REG_MUXCTRL_SDIO0_CDATA2_MAP); } else if (1 == WIFI_SDIO_INDEX) { value = 0X0004; writel(value, REG_MUXCTRL_SDIO1_CLK_MAP); //writel(value, REG_MUXCTRL_SDIO1_DETECT_MAP); writel(value, REG_MUXCTRL_SDIO1_CWPR_MAP); writel(value, REG_MUXCTRL_SDIO1_CDATA1_MAP); writel(value, REG_MUXCTRL_SDIO1_CDATA0_MAP); writel(value, REG_MUXCTRL_SDIO1_CDATA3_MAP); writel(value, REG_MUXCTRL_SDIO1_CCMD_MAP); writel(value, REG_MUXCTRL_SDIO1_POWER_EN_MAP); writel(value, REG_MUXCTRL_SDIO1_CDATA2_MAP); } value = 0x0; writel(value, REG_MUXCTRL_WIFI_DATA_INTR_GPIO_MAP); writel(value, REG_MUXCTRL_HOST_WAK_DEV_GPIO_MAP); writel(value, REG_MUXCTRL_WIFI_WAK_FLAG_GPIO_MAP); writel(value, REG_MUXCTRL_DEV_WAK_HOST_GPIO_MAP); } void hi_wifi_power_set(unsigned char val) { HI_HAL_MCUHOST_WiFi_Power_Set(val); } void hi_wifi_rst_set(unsigned char val) { HI_HAL_MCUHOST_WiFi_Rst_Set(val); } void himci_wifi_sdio_detect_trigger(void) { unsigned int reg_value = 0; struct mmc_host *mmc = NULL; mmc = get_mmc_host(WIFI_SDIO_INDEX); struct himci_host *host = (struct himci_host *)mmc->priv; if (0 == WIFI_SDIO_INDEX) { writel(0x0001, REG_MUXCTRL_SDIO0_DETECT_MAP); } else if (1 == WIFI_SDIO_INDEX) { reg_value = readl(REG_MUXCTRL_SDIO1_DETECT_MAP); if (0X0004 == reg_value) { writel(0x0, REG_MUXCTRL_SDIO1_DETECT_MAP); msleep(500);//wait sdio card remove } writel(0X0004, REG_MUXCTRL_SDIO1_DETECT_MAP); } hi_mci_pre_detect_card(host); hi_mci_pad_ctrl_cfg(host, SIGNAL_VOLT_1V8); } void hi_wifi_board_info_register(void) { BOARD_INFO *wlan_board_info = get_board_info(); if (NULL == wlan_board_info) { dprintf("wifi_board_info is NULL!\n"); return; } wlan_board_info->wlan_irq = WIFI_IRQ; wlan_board_info->wifi_data_intr_gpio_group = WIFI_DATA_INTR_GPIO_GROUP; wlan_board_info->wifi_data_intr_gpio_offset = WIFI_DATA_INTR_GPIO_OFFSET; wlan_board_info->dev_wak_host_gpio_group = DEV_WAK_HOST_GPIO_GROUP; wlan_board_info->dev_wak_host_gpio_offset = DEV_WAK_HOST_GPIO_OFFSET; wlan_board_info->host_wak_dev_gpio_group = HOST_WAK_DEV_GPIO_GROUP; wlan_board_info->host_wak_dev_gpio_offset = HOST_WAK_DEV_GPIO_OFFSET; wlan_board_info->wifi_power_set = hi_wifi_power_set; wlan_board_info->wifi_rst_set = hi_wifi_rst_set; wlan_board_info->wifi_sdio_detect = himci_wifi_sdio_detect_trigger; } void hi_wifi_check_wakeup_flag(void) { int wak_flag = 0; gpio_dir_config(WIFI_WAK_FLAG_GPIO_GROUP, WIFI_WAK_FLAG_GPIO_OFFSET, 0); wak_flag = gpio_read(WIFI_WAK_FLAG_GPIO_GROUP, WIFI_WAK_FLAG_GPIO_OFFSET); HI_HAL_MCUHOST_WiFi_Clr_Flag(); wlan_resume_state_set(wak_flag); } struct databk_addr_info *hi_wifi_databk_info_cb(void) { /* 暂时写死,由应用侧补齐 */ struct databk_addr_info *wlan_databk_addr_info = NULL; wlan_databk_addr_info = malloc(sizeof(struct databk_addr_info)); if (NULL == wlan_databk_addr_info) { dprintf("hi_wifi_databk_info_cb:wlan_databk_addr_info is NULL!\n"); return NULL; } memset(wlan_databk_addr_info, 0, sizeof(struct databk_addr_info)); wlan_databk_addr_info->databk_addr = 0x7d0000; wlan_databk_addr_info->databk_length = 0x20000; wlan_databk_addr_info->get_databk_info = NULL; return wlan_databk_addr_info; } void hi_wifi_register_backup_addr(void) { struct databk_addr_info *wlan_databk_addr_info = hisi_wlan_get_databk_addr_info(); if (NULL == wlan_databk_addr_info) { dprintf("hi_wifi_register_backup_addr:wlan_databk_addr_info is NULL!\n"); return NULL; } /* 暂时写死,由应用侧补齐 */ wlan_databk_addr_info->databk_addr = 0x7d0000; wlan_databk_addr_info->databk_length = 0x10000; wlan_databk_addr_info->get_databk_info = hi_wifi_databk_info_cb; } void hi_wifi_no_fs_init(void) { hisi_wlan_no_fs_config(WLAN_FILE_STORE_BASEADDR, WLAN_FILE_STORE_MIN_SIZE); } void hi_wifi_pre_proc() { hi_wifi_register_init(); hi_wifi_board_info_register(); hi_wifi_check_wakeup_flag(); hi_wifi_register_backup_addr(); hi_wifi_no_fs_init(); hi_rf_customize_init(); } struct completion dhcp_complet; int hi_check_dhcp_success(void) { int ret = 0; unsigned int ipaddr = 0; ret = dhcp_is_bound(pwifi); if (0 == ret) { /* IP获取成功后通知wifi驱动 */ printf("\n\n DHCP SUCC\n\n"); hisi_wlan_ip_notify(ipaddr, DHCP_IP_SET); if ((HSL_STATUS_UNCREATE != hsl_demo_get_status()) || (HILINK_STATUS_UNCREATE != hilink_demo_get_status())) { complete(&dhcp_complet); } del_timer(&hisi_dhcp_timer); return 0; } if (check_ip_loop++ > DHCP_CHECK_CNT) { /* IP获取失败执行去关联 */ printf("\n\n DHCP FAILED\n\n"); wpa_cli_disconnect(); del_timer(&hisi_dhcp_timer); return 0; } /* 重启查询定时器 */ add_timer(&hisi_dhcp_timer); return 0; } extern int hsl_demo_connect(hsl_result_stru* pst_params); extern int hilink_demo_connect(hilink_s_result* pst_result); void hisi_wifi_event_cb(enum wpa_event event) { unsigned char uc_status; unsigned int ipaddr = 0; hsl_result_stru *pst_hsl_result; hilink_s_result *pst_hilink_result; printf("wifi_event_cb,event:%d\n",event); if(pwifi == 0) return ; switch(event) { case WPA_EVT_SCAN_RESULTS: printf("Scan results available\n"); break; case WPA_EVT_CONNECTED: printf("WiFi: Connected\n"); /* 启动dhcp获取IP */ netifapi_dhcp_stop(pwifi); netifapi_dhcp_start(pwifi); /* 查询IP是否获取 */ check_ip_loop = 0; init_timer(&hisi_dhcp_timer); hisi_dhcp_timer.expires = LOS_MS2Tick(DHCP_CHECK_TIME); hisi_dhcp_timer.function = hi_check_dhcp_success; add_timer(&hisi_dhcp_timer); msleep(500); break; case WPA_EVT_DISCONNECTED: printf("WiFi: disconnect\n"); netifapi_dhcp_stop(pwifi); hisi_reset_addr(); hisi_wlan_ip_notify(ipaddr, DHCP_IP_DEL); break; case WPA_EVT_ADDIFACE: //wpa_supplicant创建成功 /* 判断是否为hisi_link创建的WPA成功 */ uc_status = hsl_demo_get_status(); printf("hsl_status=%d\n",uc_status); if (HSL_STATUS_CONNECT == uc_status) { pst_hsl_result = hsl_demo_get_result(); if (NULL != pst_hsl_result) { hsl_demo_connect(pst_hsl_result); break; } } /* 判断是否为hilink创建的WPA成功 */ uc_status = hilink_demo_get_status(); printf("hilink_status=%d\n",uc_status); if (HILINK_STATUS_CONNECT == uc_status) { pst_hilink_result = hilink_demo_get_result(); if (NULL != pst_hilink_result) { hilink_demo_connect(pst_hilink_result); } } break; default: break; } } void hisi_reset_addr(void) { ip_addr_t st_gw; ip_addr_t st_ipaddr; ip_addr_t st_netmask; struct netif *pst_lwip_netif; IP4_ADDR(&st_gw, 0, 0, 0, 0); IP4_ADDR(&st_ipaddr, 0, 0, 0, 0); IP4_ADDR(&st_netmask, 0, 0, 0, 0); pst_lwip_netif = netif_find("wlan0"); if (HISI_NULL == pst_lwip_netif) { HISI_PRINT_ERROR("cmd_start_hapd::Null param of netdev"); return; } /* wpa_stop后,重新设置netif的网关和mac地址 */ netif_set_addr(pst_lwip_netif, &st_ipaddr, &st_netmask, &st_gw); } extern int hsl_demo_init(void); extern int hilink_demo_init(void); void hisi_wifi_hostapd_event_cb(enum hostapd_event event) { unsigned char uc_status; printf("hostapd_event=%d\n",event); switch(event) { case HOSTAPD_EVT_ENABLED: //hostapd创建成功 start_dhcps(); /* 判断是否起hisilink */ uc_status = hsl_demo_get_status(); printf("hsl_status=%d\n",uc_status); if (HSL_STATUS_RECEIVE == uc_status) { hsl_demo_init(); } /* 判断是否起hilink */ uc_status = hilink_demo_get_status(); printf("hilink_status=%d\n",uc_status); if (HILINK_STATUS_RECEIVE == uc_status) { hilink_demo_init(); } break; case HOSTAPD_EVT_DISABLED: //hostapd删除成功 hisi_reset_addr(); break; case HOSTAPD_EVT_CONNECTED: //用户关联成功 break; case HOSTAPD_EVT_DISCONNECTED: //用户去关联 break; default: break; } } void app_init(void){ UINT32 uwRet; dprintf("random init ...\n"); ran_dev_register(); dprintf("uart init ...\n"); uart_dev_init(); dprintf("shell init ...\n"); system_console_init(TTY_DEVICE); osShellInit(TTY_DEVICE); dprintf("hisi_wifi_shell_cmd_register init ...\n"); hisi_wifi_shell_cmd_register(); dprintf("spi nor falsh init ...\n"); if (!spinor_init()) { #if 0 add_mtd_partition("spinor", 0x100000, 1*0x100000, 0); mount("/dev/spinorblk0", "/jffs0", "jffs", 0, NULL); #endif } dprintf("gpio init ...\n"); gpio_dev_init(); dprintf("net init ...\n"); net_init(); #ifdef _PRE_FEATURE_USB dprintf("usb init ...\n"); usb_init(); #endif dprintf("sd/mmc host init ...\n"); SD_MMC_Host_init(); mcu_uart_proc(); msleep(500); /*check system bootup or wakeup*/ hi_wifi_pre_proc(); dprintf("porc fs init ...\n"); proc_fs_init(); dprintf("hi1131 wifi start \n"); #ifdef Hi1131_SDK char *mac_addr[] = {"3E","22","15","05","31","35"}; cmd_set_macaddr(6,mac_addr); #endif wpa_register_event_cb(hisi_wifi_event_cb); hostapd_register_event_cb(hisi_wifi_hostapd_event_cb); uwRet = hisi_wlan_wifi_init(&pwifi); if(0 != uwRet) { dprintf("fail to start hi1131 wifi\n"); if(pwifi != NULL) hisi_wlan_wifi_deinit(); } #ifdef Hi1131_SDK if(0 == hisi_get_resume_wifi_mode()) { uwRet = wpa_supplicant_start("wlan0", "hisi", WPA_SUPPLICANT_CONFIG_PATH); if(0 != uwRet) { dprintf("fail to start wpa_supplicant\n"); } wpa_register_event_cb(wifi_event_cb); int argc = 4; char *argv[] = {"0","sdk_test","wpa","12345678"}; uwRet = cmd_wpa_connect(argc, argv); if(0 != uwRet) { dprintf("fail to send wpa connect command"); } } #endif return; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/kfifo.h #ifndef KFIFO_H #define KFIFO_H /* Includes ------------------------------------------------------------------*/ #include "stm8l15x.h" #include "boardconfig.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #ifndef min #define min(x,y) ((x) < (y) ? x : y) #endif struct kfifo { unsigned char *buffer; /* the buffer holding the data */ unsigned int size; /* the size of the allocated buffer */ unsigned int in; /* data is added at offset (in % size) */ unsigned int out; /* data is extracted from off. (out % size) */ }; static inline unsigned int __kfifo_len(struct kfifo *fifo) { return fifo->in - fifo->out; } extern struct kfifo recvfifo; extern u8 USART_Receive_Buf[UF_MAX_LEN]; extern void kfifo_init(struct kfifo *fifo); extern unsigned int __kfifo_put(struct kfifo *fifo, unsigned char *buffer, unsigned int len); extern void __kfifo_put_singlebyte(struct kfifo *fifo, unsigned char data); extern unsigned int __kfifo_get(struct kfifo *fifo, unsigned char *buffer, unsigned int len); #endif /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/hi1131_wifi/hisi_app_demo/aplink_demo.c /****************************************************************************** 版权所有 (C), 2001-2011, 华为技术有限公司 ****************************************************************************** 文 件 名 : hisilink_demo.c 版 本 号 : 初稿 作 者 : 生成日期 : 2016年11月29日 最近修改 : 功能描述 : HSL_config核心代码 函数列表 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 创建文件 ******************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif #include "hisilink_adapt.h" #include "hostapd/hostapd_if.h" #include "wpa_supplicant/wpa_supplicant.h" #include "src/common/defs.h" #include "los_task.h" #include "driver_hisi_lib_api.h" #include "hisilink_lib.h" #include "lwip/sockets.h" #include "hisilink_ext.h" #define APLINK_PERIOD_TIMEOUT 70000 //aplink超时时间 typedef enum { HSL_STATUS_UNCREATE, HSL_STATUS_CREATE, HSL_STATUS_RECEIVE, HSL_STATUS_CONNECT, HSL_STATUS_BUTT }hsl_status_enum; typedef unsigned char hsl_status_enum_type ; hsl_result_stru* g_pst_aplink_result; unsigned int gul_aplink_taskid = 0; unsigned int gul_aplink_timeout_taskid = 0; unsigned int gul_aplink_task_flag = 0; int gl_aplink_socketfd; extern hsl_result_stru gst_hsl_params; /***************************************************************************** 函数声明 *****************************************************************************/ extern unsigned char hsl_demo_get_status(void); extern int hsl_demo_set_status(hsl_status_enum_type uc_type); extern int hsl_demo_connect_prepare(void); extern int hsl_demo_prepare(void); /*************************************************************************** 函 数 名 : aplink_demo_get_result 功能描述 : 获取AP信息结果 输入参数 : 无 输出参数 : pst_result解码得出的结果 返 回 值 : 成功返回0、异常返回-1 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月12日 作 者 : 修改内容 : 新生成函数 ***************************************************************************/ int aplink_demo_get_result(unsigned char* puc_data, hsl_result_stru* pst_result) { unsigned char uc_ssid_len; unsigned char uc_pwd_len; unsigned int ul_index = 0; if ((NULL == puc_data) || (NULL == pst_result)) { HISI_PRINT_ERROR("aplink_get_result:puc_data=%x,pst_result=%x",puc_data,pst_result); return -1; } /* 初始化 */ memset(pst_result, 0, sizeof(hsl_result_stru)); /**************************************************************************************/ /*SSID的长度|PWD的长度|SSID的内容|PWD的内容|加密方式|发送方式|手机端IP|手机端端口号|设备连接标识|*/ /* 1字节 | 1字节 | 可变长度 | 可变长度| 4bits | 4bits | 4字节 | 2字节 | 2字节 |*/ /**************************************************************************************/ /* 前两个字节的数据分别表示ssid和pwd的长度 */ uc_ssid_len = puc_data[0]; uc_pwd_len = puc_data[1]; if ((32 < uc_ssid_len) || (128 < uc_pwd_len)) { HISI_PRINT_ERROR("aplink_get_result:ssid_len[%d],pwd_len[%d]",uc_ssid_len, uc_pwd_len); return -1; } ul_index += 2; pst_result->uc_ssid_len = uc_ssid_len; pst_result->uc_pwd_len = uc_pwd_len; /* 获取SSID */ memcpy(pst_result->auc_ssid, &puc_data[ul_index],uc_ssid_len); ul_index += uc_ssid_len; /* 获取PWD */ memcpy(pst_result->auc_pwd, &puc_data[ ul_index], uc_pwd_len); ul_index += uc_pwd_len; /* 获取加密方式 */ pst_result->en_auth_mode = (puc_data[ul_index] & 0xf0) >> 4; /*获取上线通知包的发送方式*/ pst_result->en_online_type = puc_data[ul_index++] & 0x0f; /* 获取手机端IP地址 */ memcpy(pst_result->auc_ip, &puc_data[ul_index], IP_ADDR_LEN); ul_index += IP_ADDR_LEN; /* 获取端口号 */ pst_result->us_port = (puc_data[ul_index] << 8) + puc_data[ul_index + 1]; ul_index += 2; /* 获取连接标识 */ pst_result->auc_flag[0] = puc_data[ul_index++]; pst_result->auc_flag[1] = puc_data[ul_index++]; HISI_PRINT_INFO("ssid:%s\n",pst_result->auc_ssid); HISI_PRINT_INFO("auth_mode:%d\n",pst_result->en_auth_mode); HISI_PRINT_INFO("phone ip:%d.%d.%d.%d\n",pst_result->auc_ip[0], pst_result->auc_ip[1], \ pst_result->auc_ip[2], pst_result->auc_ip[3]); HISI_PRINT_INFO("port:%d\n",pst_result->us_port); HISI_PRINT_INFO("flag:%02x %02x\n",pst_result->auc_flag[0], pst_result->auc_flag[1]); memcpy(g_pst_aplink_result, pst_result, sizeof(hsl_result_stru)); return 0; } /*************************************************************************** 函 数 名 : aplink_demo_tcpserver 功能描述 : 传统AP模式下的TCP服务器用于接收手机传送的AP信息 输入参数 : 输出参数 : 无 返 回 值 : 异常返回-1,正常返回0 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月12日 作 者 : 修改内容 : 新生成函数 ***************************************************************************/ int aplink_demo_tcpserver(void) { int sockfd; struct sockaddr_in serveraddr; struct sockaddr_in clientaddr; unsigned int ul_len; unsigned char auc_buf[256]; hsl_result_stru st_result; unsigned int ul_ret; int l_ret; unsigned char *puc_macaddr; gl_aplink_socketfd = socket(AF_INET, SOCK_STREAM, 0); if (0 > gl_aplink_socketfd) { HISI_PRINT_ERROR("%s[%d]:tcp create socket fail",__func__,__LINE__); return -1; } memset(&serveraddr, 0, sizeof(serveraddr)); memset(&clientaddr, 0, sizeof(clientaddr)); serveraddr.sin_family = AF_INET; serveraddr.sin_port = htons(5000);//服务器端的端口号 serveraddr.sin_addr.s_addr = htonl(INADDR_ANY); if (0 != bind(gl_aplink_socketfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr))) { HISI_PRINT_ERROR("%s[%d]:tcp bind fail",__func__,__LINE__); return -1; } if (0 != listen(gl_aplink_socketfd, 10))//10代表TCP服务器最大能够监听10条TCP连接即最大允许10个客户端的连接 { HISI_PRINT_ERROR("%s[%d]:tcp listen fail",__func__,__LINE__); return -1; } ul_len = sizeof(struct sockaddr_in); sockfd = accept(gl_aplink_socketfd, (struct sockaddr *)&clientaddr, &ul_len); if (0 > sockfd) { HISI_PRINT_ERROR("%s[%d]:tcp connect fail",__func__,__LINE__); return -1; } memset(auc_buf, 0, sizeof(auc_buf)); recv(sockfd, auc_buf, sizeof(auc_buf), 0); /* 获取结果 */ if(0 == aplink_demo_get_result(auc_buf, &st_result)) { LOS_TaskLock(); memcpy(g_pst_aplink_result, &st_result, sizeof(hsl_result_stru)); LOS_TaskUnlock(); /* 将hsl的状态设置为CONNECT保证后续流程顺利 */ hsl_demo_set_status(HSL_STATUS_CONNECT); puc_macaddr = hisi_wlan_get_macaddr(); if (HSL_NULL != puc_macaddr) { if ((puc_macaddr[4] == g_pst_aplink_result->auc_flag[0]) && (puc_macaddr[5] == g_pst_aplink_result->auc_flag[1])) { l_ret = hsl_demo_connect_prepare(); if (0 != l_ret) { HISI_PRINT_ERROR("aplink_demo_tcpserver:connect prepare fail[%d]\n",l_ret); } } else { HISI_PRINT_ERROR("This device is not intended to be associated:%02x %02x\n",g_pst_aplink_result->auc_flag[0],g_pst_aplink_result->auc_flag[1]); } } } close(gl_aplink_socketfd); close(sockfd); gul_aplink_task_flag = 0; hsl_demo_set_status(HSL_STATUS_UNCREATE); /* 删除aplink TCP服务器线程 */ ul_ret = LOS_TaskDelete(gul_aplink_taskid); if (0 != ul_ret) { HISI_PRINT_WARNING("%s[%d]:delete task fail[%d]",__func__,__LINE__,ul_ret); } return 0; } /*************************************************************************** 函 数 名 : aplink_demo_timeout_task 功能描述 : 传统AP模式下的超时定时器线程 输入参数 : 输出参数 : 无 返 回 值 : 异常返回-1,正常返回0 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2017年3月29日 作 者 : 修改内容 : 新生成函数 ***************************************************************************/ int aplink_demo_timeout_task(void) { unsigned int ul_wait_time = 0; unsigned int ul_start_time; unsigned int ul_current_time; unsigned int ul_ret; ul_start_time = hsl_get_time(); ul_current_time = hsl_get_time(); while ((0 != gul_aplink_task_flag) && (APLINK_PERIOD_TIMEOUT > ul_wait_time)) { msleep(50); ul_current_time = hsl_get_time(); ul_wait_time = ul_current_time - ul_start_time; } if (0 != gul_aplink_task_flag) { printf("timeout,delete aplink task!\n"); /* 超时删除线程 */ hsl_demo_set_status(HSL_STATUS_UNCREATE); close(gl_aplink_socketfd); /* 删除aplink TCP服务器线程 */ ul_ret = LOS_TaskDelete(gul_aplink_taskid); if (0 != ul_ret) { HISI_PRINT_WARNING("%s[%d]:delete task fail[%d]",__func__,__LINE__,ul_ret); } } /* 删除自身线程 */ ul_ret = LOS_TaskDelete(gul_aplink_timeout_taskid); if (0 != ul_ret) { HISI_PRINT_WARNING("%s[%d]:delete task fail[%d]",__func__,__LINE__,ul_ret); } return 0; } extern int hilink_demo_get_status(void); /***************************************************************************** 函 数 名 : hsl_demo_main 功能描述 : hsl demo程序总入口 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int aplink_demo_main(void) { unsigned int ul_ret; int l_ret; unsigned char uc_status; TSK_INIT_PARAM_S st_aplink_task; TSK_INIT_PARAM_S st_aplink_timeout_task; uc_status = hilink_demo_get_status(); if (0 != uc_status) { HISI_PRINT_ERROR("aplink already start,cannot start hilink"); return -HSL_FAIL; } uc_status = hsl_demo_get_status(); if (HSL_STATUS_UNCREATE != uc_status) { HISI_PRINT_ERROR("aplink already start,cannot start again"); return -HSL_FAIL; } /* 传统AP模式获取的结果和hsl获取的结果存储在同一位置 */ g_pst_aplink_result = &gst_hsl_params; hsl_demo_set_status(HSL_STATUS_CREATE); l_ret = hsl_demo_prepare(); if (0 != l_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); HISI_PRINT_ERROR("%s[%d]:demo init fail",__func__,__LINE__); return -HSL_FAIL; } /* 创建aplink的TCP服务器线程 */ memset(&st_aplink_task, 0, sizeof(TSK_INIT_PARAM_S)); st_aplink_task.pfnTaskEntry = (TSK_ENTRY_FUNC)aplink_demo_tcpserver; st_aplink_task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; st_aplink_task.pcName = "aplink_thread"; st_aplink_task.usTaskPrio = 8; st_aplink_task.uwResved = LOS_TASK_STATUS_DETACHED; ul_ret = LOS_TaskCreate(&gul_aplink_taskid, &st_aplink_task); if(0 != ul_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); HISI_PRINT_ERROR("%s[%d]:create task fail[%d]",__func__,__LINE__,ul_ret); return -HSL_FAIL; } gul_aplink_task_flag = 1; /* 创建aplink的超时线程 */ memset(&st_aplink_timeout_task, 0, sizeof(TSK_INIT_PARAM_S)); st_aplink_timeout_task.pfnTaskEntry = (TSK_ENTRY_FUNC)aplink_demo_timeout_task; st_aplink_timeout_task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; st_aplink_timeout_task.pcName = "aplink_timeout_task"; st_aplink_timeout_task.usTaskPrio = 8; st_aplink_timeout_task.uwResved = LOS_TASK_STATUS_DETACHED; ul_ret = LOS_TaskCreate(&gul_aplink_timeout_taskid, &st_aplink_timeout_task); if(0 != ul_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); close(gl_aplink_socketfd); /* 删除aplink TCP服务器线程 */ ul_ret = LOS_TaskDelete(gul_aplink_taskid); if (0 != ul_ret) { HISI_PRINT_WARNING("%s[%d]:delete task fail[%d]",__func__,__LINE__,ul_ret); } HISI_PRINT_ERROR("%s[%d]:create task fail[%d]",__func__,__LINE__,ul_ret); return -HSL_FAIL; } return HSL_SUCC; } #ifdef __cplusplus #if __cplusplus } #endif #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/adv7179/README.txt 1.Module parameter description BT656 PAL:stAdv7179Param.Norm_mode=0 BT656 NTSC:stAdv7179Param.Norm_mode=1 BT656 PAL is defualt <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/drv_cipher_intf.c /****************************************************************************** Copyright (C), 2011-2014, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : drv_cipher_intf.c Version : Initial Draft Author : Hisilicon hisecurity team Created : Last Modified : Description : Function List : History : ******************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ #include "hi_osal.h" #include "hi_type.h" #include "hal_cipher.h" #include "drv_cipher.h" #include "drv_cipher_ioctl.h" #include "drv_hash.h" #include "drv_cipher_log.h" #include "hi_drv_cipher.h" #include "config.h" #include <asm/io.h> extern HI_VOID DRV_CIPHER_UserCommCallBack(HI_U32 arg); HI_U32 g_u32CipherBase = 0; HI_U32 g_u32HashBase = 0; HI_U32 g_u32RsaBase = 0; HI_U32 g_u32RngBase = 0; HI_U32 g_u32KladBase = 0; HI_U32 g_u32EfuseBase = 0; HI_VOID HAL_CIPHER_ReadReg(HI_U32 addr, HI_U32 *pu32Val) { *pu32Val = readl((void*)addr); return; } HI_VOID HAL_CIPHER_WriteReg(HI_U32 addr, HI_U32 u32Val) { writel(u32Val, (void*)addr); return; } static HI_S32 CIPHER_ProcGetStatus(CIPHER_CHN_STATUS_S *pstCipherStatus) { #ifdef CIPHER_MULTICIPHER_SUPPORT return DRV_CIPHER_ProcGetStatus(pstCipherStatus); #else memset(pstCipherStatus, 0, sizeof(CIPHER_CHN_STATUS_S)); return HI_SUCCESS; #endif } static int CIPHER_ProcRead(struct osal_proc_dir_entry *p) { CIPHER_CHN_STATUS_S stCipherStatus[8]; int i = 0; HI_S32 ret = HI_SUCCESS; osal_seq_printf(p, "\n------------------------------------------CIPHER STATUS-----------------------------------------------------------------------------------------------\n"); osal_seq_printf(p, "Chnid Status Decrypt Alg Mode KeyLen Phy-Addr in/out KeyFrom INT-RAW in/out INT-EN in/out INT_OCNTCFG\n"); osal_memset(&stCipherStatus, 0, sizeof(stCipherStatus)); for(i = 0; i < 8; i++) { stCipherStatus[i].u32ChnId = i; } ret = CIPHER_ProcGetStatus((CIPHER_CHN_STATUS_S *)&stCipherStatus); if(HI_FAILURE == ret) { osal_seq_printf(p, "CIPHER_ProcGetStatus failed!\n"); return HI_FAILURE; } for(i = 0; i < 8; i++) { osal_seq_printf(p, " %d %s %d %s %s %03d %08x/%08x %s %d/%d %d/%d %08x\n", i, stCipherStatus[i].ps8Openstatus, stCipherStatus[i].bIsDecrypt, stCipherStatus[i].ps8Alg, stCipherStatus[i].ps8Mode, stCipherStatus[i].u32KeyLen, stCipherStatus[i].u32DataInAddr, stCipherStatus[i].u32DataOutAddr, stCipherStatus[i].ps8KeyFrom, stCipherStatus[i].bInINTRaw, stCipherStatus[i].bOutINTRaw, stCipherStatus[i].bInINTEn, stCipherStatus[i].bOutINTEn, stCipherStatus[i].u32OutINTCount); } return HI_SUCCESS; } static int CIPHER_ProcWrite(struct osal_proc_dir_entry *p, const char *buf, int count, long long * param) { return HI_SUCCESS; } HI_S32 CIPHER_Ioctl(HI_U32 cmd, HI_U32 argp, HI_VOID *private_data) { HI_S32 ret = HI_SUCCESS; HI_INFO_CIPHER("start cmd, MOD_ID=0x%02X, NR=0x%02x, SIZE=0x%02x!\n", _IOC_TYPE (cmd), _IOC_NR (cmd), _IOC_SIZE(cmd)); switch(cmd) { #ifdef CIPHER_MULTICIPHER_SUPPORT case CMD_CIPHER_CREATEHANDLE: { CIPHER_HANDLE_S *pstCIHandle = (CIPHER_HANDLE_S *)argp; ret = HI_DRV_CIPHER_CreateHandle(pstCIHandle, (HI_U32)private_data); break; } case CMD_CIPHER_DESTROYHANDLE: { HI_HANDLE hCipherChn = *(HI_HANDLE *)argp; ret = HI_DRV_CIPHER_DestroyHandle(hCipherChn); break; } case CMD_CIPHER_CONFIGHANDLE: { CIPHER_Config_CTRL stCIConfig = *(CIPHER_Config_CTRL *)argp; HI_U32 softChnId = HI_HANDLE_GET_CHNID(stCIConfig.CIHandle); ret = HI_DRV_CIPHER_ConfigChn(softChnId, &stCIConfig.CIpstCtrl); break; } case CMD_CIPHER_ENCRYPT: { CIPHER_DATA_S *pstCIData = (CIPHER_DATA_S *)argp; ret = HI_DRV_CIPHER_Encrypt(pstCIData); break; } case CMD_CIPHER_DECRYPT: { CIPHER_DATA_S *pstCIData = (CIPHER_DATA_S *)argp; ret = HI_DRV_CIPHER_Decrypt(pstCIData); break; } case CMD_CIPHER_ENCRYPTMULTI: { CIPHER_DATA_S *pstCIData = (CIPHER_DATA_S *)argp; ret = HI_DRV_CIPHER_EncryptMulti(pstCIData); break; } case CMD_CIPHER_DECRYPTMULTI: { CIPHER_DATA_S *pstCIData = (CIPHER_DATA_S *)argp; ret = HI_DRV_CIPHER_DecryptMulti(pstCIData); break; } case HI_CIPHER_ENCRYPTMULTI_EX: { CIPHER_MUTIL_EX_DATA_S *pstCIDataEx = (CIPHER_MUTIL_EX_DATA_S *)argp; ret = HI_DRV_CIPHER_EncryptMultiEx(pstCIDataEx); break; } case HI_CIPHER_DECRYPTMULTI_EX: { CIPHER_MUTIL_EX_DATA_S *pstCIDataEx = (CIPHER_MUTIL_EX_DATA_S *)argp; ret = HI_DRV_CIPHER_DecryptMultiEx(pstCIDataEx); break; } #ifdef CIPHER_CCM_GCM_SUPPORT case CMD_CIPHER_GETTAG: { CIPHER_TAG *pstCITag = (CIPHER_TAG *)argp; ret = HI_DRV_CIPHER_GetTag(pstCITag); break; } #endif case CMD_CIPHER_GETHANDLECONFIG: { CIPHER_Config_CTRL *pstCIData = (CIPHER_Config_CTRL *)argp; ret = HI_DRV_CIPHER_GetHandleConfig(pstCIData); break; } #ifdef CIPHER_KLAD_SUPPORT case CMD_CIPHER_KLAD_KEY: { CIPHER_KLAD_KEY_S *pstKladData = (CIPHER_KLAD_KEY_S *)argp; ret = HI_DRV_CIPHER_KladEncryptKey(pstKladData); break; } #endif #endif #ifdef CIPHER_RNG_SUPPORT case CMD_CIPHER_GETRANDOMNUMBER: { CIPHER_RNG_S *pstRNG = (CIPHER_RNG_S *)argp; ret = HI_DRV_CIPHER_GetRandomNumber(pstRNG); break; } #endif #ifdef CIPHER_HASH_SUPPORT case CMD_CIPHER_CALCHASHINIT: { CIPHER_HASH_DATA_S *pstCipherHashData = (CIPHER_HASH_DATA_S*)argp; pstCipherHashData->enHMACKeyFrom = HI_CIPHER_HMAC_KEY_FROM_CPU; ret = HI_DRV_CIPHER_CalcHashInit(pstCipherHashData); break; } case CMD_CIPHER_CALCHASHUPDATE: { CIPHER_HASH_DATA_S *pstCipherHashData = (CIPHER_HASH_DATA_S*)argp; ret = HI_DRV_CIPHER_CalcHashUpdate(pstCipherHashData); break; } case CMD_CIPHER_CALCHASHFINAL: { CIPHER_HASH_DATA_S *pstCipherHashData = (CIPHER_HASH_DATA_S*)argp; ret = HI_DRV_CIPHER_CalcHashFinal(pstCipherHashData); break; } case CMD_CIPHER_CALCHASH: { CIPHER_HASH_DATA_S *pstCipherHashData = (CIPHER_HASH_DATA_S*)argp; ret = HI_DRV_CIPHER_CalcHash(pstCipherHashData); break; } #endif #ifdef CIPHER_RSA_SUPPORT case CMD_CIPHER_CALCRSA: { CIPHER_RSA_DATA_S *pCipherRsaData = (CIPHER_RSA_DATA_S*)argp; ret = HI_DRV_CIPHER_CalcRsa(pCipherRsaData); break; } #endif default: { HI_ERR_CIPHER("Unknow cmd, MOD_ID=0x%02X, NR=0x%02x, SIZE=0x%02x!\n", _IOC_TYPE (cmd), _IOC_NR (cmd), _IOC_SIZE(cmd)); ret = HI_FAILURE; break; } } HI_INFO_CIPHER("end cmd, MOD_ID=0x%02X, NR=0x%02x, SIZE=0x%02x!\n", _IOC_TYPE (cmd), _IOC_NR (cmd), _IOC_SIZE(cmd)); return ret; } static long DRV_CIPHER_Ioctl(HI_U32 cmd, unsigned long arg, HI_VOID *private_data) { return CIPHER_Ioctl(cmd, arg, private_data); } static osal_fileops_t DRV_CIPHER_Fops; static osal_dev_t *s_pstCipherDev; HI_S32 CIPHER_DRV_ModInit(HI_VOID) { HI_S32 ret = HI_SUCCESS; osal_proc_entry_t *pstProcEntry = HI_NULL; DRV_CIPHER_Fops.open = DRV_CIPHER_Open; DRV_CIPHER_Fops.unlocked_ioctl = DRV_CIPHER_Ioctl; DRV_CIPHER_Fops.release = DRV_CIPHER_Release; s_pstCipherDev = osal_createdev(UMAP_DEVNAME_CIPHER); s_pstCipherDev->fops = &DRV_CIPHER_Fops; s_pstCipherDev->minor = UMAP_CIPHER_MINOR_BASE; ret = osal_registerdevice(s_pstCipherDev); if (HI_SUCCESS != ret ) { HI_ERR_CIPHER("ERROR: could not register cipher devices\n"); return -1; } #ifdef CIPHER_MULTICIPHER_SUPPORT g_u32CipherBase = (HI_U32)osal_ioremap_nocache(REG_BASE_PHY_ADDR_CIPHER, REG_CI_BASE_SIZE); if (g_u32CipherBase == 0) { HI_ERR_CIPHER("ERROR: osal_ioremap_nocache for cipher failed!!\n"); return -1; } #endif #ifdef CIPHER_HASH_SUPPORT g_u32HashBase = (HI_U32)osal_ioremap_nocache(REG_BASE_PHY_ADDR_SHA, 0x1000); if (g_u32HashBase == 0) { HI_ERR_CIPHER("ERROR: osal_ioremap_nocache for Hash failed!!\n"); return -1; } #endif #ifdef CIPHER_RSA_SUPPORT g_u32RsaBase = (HI_U32)osal_ioremap_nocache(REG_BASE_PHY_ADDR_RSA, 0x1000); if (g_u32RsaBase == 0) { HI_ERR_CIPHER("ERROR: osal_ioremap_nocache for RSA failed!!\n"); return -1; } #endif #ifdef CIPHER_RNG_SUPPORT g_u32RngBase = (HI_U32)osal_ioremap_nocache(REG_BASE_PHY_ADDR_RNG, 0x1000); if (g_u32RngBase == 0) { HI_ERR_CIPHER("ERROR: osal_ioremap_nocache for RNG failed!!\n"); return -1; } #endif #ifdef CIPHER_KLAD_SUPPORT g_u32KladBase = (HI_U32)osal_ioremap_nocache(REG_BASE_PHY_ADDR_KLAD, 0x100); if (g_u32KladBase == 0) { HI_ERR_CIPHER("ERROR: osal_ioremap_nocache for KLAD failed!!\n"); return -1; } #endif #ifdef CIPHER_EFUSE_SUPPORT g_u32EfuseBase = (HI_U32)osal_ioremap_nocache(REG_BASE_PHY_ADDR_EFUSE, 0x100); if (g_u32EfuseBase == 0) { HI_ERR_CIPHER("ERROR: osal_ioremap_nocache for EFUSE failed!!\n"); return -1; } #endif #ifdef CIPHER_MULTICIPHER_SUPPORT ret = DRV_CIPHER_Init(); if (HI_SUCCESS != ret) { return ret; } #endif #ifdef CIPHER_HASH_SUPPORT (HI_VOID)HASH_DRV_ModInit(); (HI_VOID)HAL_Cipher_HashSoftReset(); #endif pstProcEntry = osal_create_proc_entry(UMAP_DEVNAME_CIPHER, HI_NULL); if (NULL == pstProcEntry) { HI_ERR_CIPHER("cipher: can't create %s.\n", CIPHER_PROC_NAME); return HI_FAILURE; } pstProcEntry->read = CIPHER_ProcRead; pstProcEntry->write = CIPHER_ProcWrite; HI_PRINT("Load hi_cipher.ko success. "); return HI_SUCCESS; } HI_VOID CIPHER_DRV_ModExit(HI_VOID) { osal_remove_proc_entry(UMAP_DEVNAME_CIPHER, NULL); #ifdef CIPHER_MULTICIPHER_SUPPORT (HI_VOID)DRV_CIPHER_DeInit(); #endif #ifdef CIPHER_HASH_SUPPORT (HI_VOID)HASH_DRV_ModDeInit(); #endif osal_deregisterdevice(s_pstCipherDev); osal_destroydev(s_pstCipherDev); if (g_u32CipherBase != 0) { osal_iounmap((void*)g_u32CipherBase); g_u32CipherBase = 0; } if (g_u32HashBase != 0) { osal_iounmap((void*)g_u32HashBase); g_u32HashBase = 0; } if (g_u32RsaBase != 0) { osal_iounmap((void*)g_u32RsaBase); g_u32RsaBase = 0; } if (g_u32RngBase != 0) { osal_iounmap((void*)g_u32RngBase); g_u32RngBase = 0; } if (g_u32KladBase != 0) { osal_iounmap((void*)g_u32KladBase); g_u32KladBase = 0; } if (g_u32EfuseBase != 0) { osal_iounmap((void*)g_u32EfuseBase); g_u32EfuseBase = 0; } HI_PRINT("Unload hi_cipher.ko success.\n"); } /* #ifdef MODULE module_init(CIPHER_DRV_ModInit); module_exit(CIPHER_DRV_ModExit); #endif MODULE_AUTHOR("Hi3720 MPP GRP"); MODULE_LICENSE("GPL"); */ #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/adc.c #include "boardconfig.h" void ADC_Init_adc0() { GPIO_Init(ADCIN_GPIO, ADCIN_GPIO_Pin, GPIO_Mode_In_FL_No_IT); //ADC_ConversionMode_TypeDef adc_conversionmode = ADC_ConversionMode_Single; ADC_ConversionMode_TypeDef adc_conversionmode = ADC_ConversionMode_Continuous; ADC_Resolution_TypeDef adc_resolution = ADC_Resolution_12Bit; ADC_Prescaler_TypeDef adc_prescaler = ADC_Prescaler_2; CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE); ADC_Cmd(ADC1, DISABLE); ADC_DMACmd(ADC1, DISABLE); ADC_Init(ADC1, adc_conversionmode, adc_resolution, adc_prescaler); ADC_ChannelCmd(ADC1, ADC_Channel_18, ENABLE); ADC_SamplingTimeConfig(ADC1, ADC_Group_FastChannels, ADC_SamplingTime_4Cycles); ADC_Cmd(ADC1, ENABLE); } void ADC_Deinit_adc0() { ADC_DMACmd(ADC1, DISABLE); ADC_Cmd(ADC1, DISABLE); GPIO_Init(ADCIN_GPIO, ADCIN_GPIO_Pin, GPIO_Mode_Out_PP_Low_Slow); CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, DISABLE); } uint16_t ADC_GetBatVal() { uint16_t val = 0; ADC_SoftwareStartConv(ADC1); while(ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET); val = ADC_GetConversionValue(ADC1); return val; } uint16_t ADC_GetBatVal_ori() { uint16_t val = 0; ADC_ConversionMode_TypeDef adc_conversionmode = ADC_ConversionMode_Single; ADC_Resolution_TypeDef adc_resolution = ADC_Resolution_12Bit; ADC_Prescaler_TypeDef adc_prescaler = ADC_Prescaler_2; CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE); ADC_Cmd(ADC1, DISABLE); ADC_DMACmd(ADC1, DISABLE); //ADC_Cmd(ADC1, ENABLE); ADC_Init(ADC1, adc_conversionmode, adc_resolution, adc_prescaler); ADC_ChannelCmd(ADC1, ADC_Channel_18, ENABLE); ADC_SamplingTimeConfig(ADC1, ADC_Group_FastChannels, ADC_SamplingTime_4Cycles); ADC_Cmd(ADC1, ENABLE); ADC_SoftwareStartConv(ADC1); while (ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET); val = ADC_GetConversionValue(ADC1); ADC_Cmd(ADC1, DISABLE); return val; }<file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/rtc/hi_rtc.c /* hi_rtc.c * * Copyright (c) 2012 Hisilicon Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; * * History: * 2012.05.15 create this file <<EMAIL>> * 2012.11.20 add temp select method <<EMAIL>> */ #include "hi_osal.h" #include "hi_rtc.h" #include "rtc_temp_lut_tbl.h" #define RTC_NAME "hi_rtc" //#define HIDEBUG #ifdef HIDEBUG #define HI_MSG(x...) \ do { \ osal_printk("%s->%d: ", __FUNCTION__, __LINE__); \ osal_printk(x); \ osal_printk("\n"); \ } while (0) #else #define HI_MSG(args...) do { } while (0) #endif #define HI_ERR(x...) \ do { \ osal_printk("%s->%d: ", __FUNCTION__, __LINE__); \ osal_printk(x); \ osal_printk("\n"); \ } while (0) #ifndef NULL #define NULL ((void *)0) #endif #define OSDRV_MODULE_VERSION_STRING "HISI_RTC @Hi3518EV200" void* crg_base_addr = NULL; //#define CRG_BASE_ADDR OSAL_IO_ADDRESS(0x20030000) #define CRG_BASE_ADDR crg_base_addr #define PERI_CRG57 (CRG_BASE_ADDR + 0xE4) #define BIT_TEMP_SRST_REQ 2 /* RTC Control over SPI */ void* rtc_base_addr = NULL; //#define RTC_SPI_BASE_ADDR OSAL_IO_ADDRESS(0x20060000) #define RTC_SPI_BASE_ADDR rtc_base_addr #define SPI_CLK_DIV (RTC_SPI_BASE_ADDR + 0x000) #define SPI_RW (RTC_SPI_BASE_ADDR + 0x004) /* RTC temperature reg */ #define RTC_TEMP_START (RTC_SPI_BASE_ADDR + 0x80) #define RTC_TEMP_CRC (RTC_SPI_BASE_ADDR + 0x84) #define RTC_TEMP_INT_MASK (RTC_SPI_BASE_ADDR + 0x88) #define RTC_TEMP_INT_CLEAR (RTC_SPI_BASE_ADDR + 0x8c) #define RTC_TEMP_STAT (RTC_SPI_BASE_ADDR + 0x90) #define RTC_TEMP_INT_RAW (RTC_SPI_BASE_ADDR + 0x94) #define RTC_TEMP_INT_STAT (RTC_SPI_BASE_ADDR + 0x98) #define RTC_TEMP_VAL (RTC_SPI_BASE_ADDR + 0x9c) #define RTC_TEMP_IRQ_NUM (2) /* Define the union SPI_RW */ typedef union { struct { unsigned int spi_wdata : 8; /* [7:0] */ unsigned int spi_rdata : 8; /* [15:8] */ unsigned int spi_addr : 7; /* [22:16] */ unsigned int spi_rw : 1; /* [23] */ unsigned int spi_start : 1; /* [24] */ unsigned int reserved : 6; /* [30:25] */ unsigned int spi_busy : 1; /* [31] */ } bits; /* Define an unsigned member */ unsigned int u32; } U_SPI_RW; #define SPI_WRITE (0) #define SPI_READ (1) #define RTC_IRQ (2) unsigned int rtc_irq = RTC_IRQ; /* RTC REG */ #define RTC_10MS_COUN 0x00 #define RTC_S_COUNT 0x01 #define RTC_M_COUNT 0x02 #define RTC_H_COUNT 0x03 #define RTC_D_COUNT_L 0x04 #define RTC_D_COUNT_H 0x05 #define RTC_MR_10MS 0x06 #define RTC_MR_S 0x07 #define RTC_MR_M 0x08 #define RTC_MR_H 0x09 #define RTC_MR_D_L 0x0A #define RTC_MR_D_H 0x0B #define RTC_LR_10MS 0x0C #define RTC_LR_S 0x0D #define RTC_LR_M 0x0E #define RTC_LR_H 0x0F #define RTC_LR_D_L 0x10 #define RTC_LR_D_H 0x11 #define RTC_LORD 0x12 #define RTC_IMSC 0x13 #define RTC_INT_CLR 0x14 #define RTC_INT_MASK 0x15 #define RTC_INT_RAW 0x16 #define RTC_CLK 0x17 #define RTC_POR_N 0x18 #define RTC_SAR_CTRL 0x1A #define RTC_ANA_CTRL 0x1B #define TOT_OFFSET_L 0x1C #define TOT_OFFSET_H 0x1D #define TEMP_OFFSET 0x1E #define OUTSIDE_TEMP 0x1F #define INTERNAL_TEMP 0x20 #define TEMP_SEL 0x21 #define LUT1 0x22 #define RTC_FREQ_H 0x51 #define RTC_FREQ_L 0x52 #define NORMAL_TEMP_VALUE 25 #define TEMP_TO_RTC(value) (((value) + 40)*255/180) #define TEMP_ENV_OFFSET 27 #define TEMP_OFFSET_TO_RTC(value) ((value)*255/180) #define RETRY_CNT 100 #define FREQ_MAX_VAL 3277000 #define FREQ_MIN_VAL 3276000 static osal_spinlock_t rtc_spin_lock; static osal_mutex_t hirtc_lock; static int is_comp_off = 0; static struct osal_timer temperature_timer; static enum temp_sel_mode mode = TEMP_SEL_FIXMODE; int t_second = 5; static int alm_itrp; static int temperature_itrp; static int spi_write(char reg, char val) { U_SPI_RW w_data, r_data; HI_MSG("WRITE, reg 0x%02x, val 0x%02x", reg, val); r_data.u32 = 0; w_data.u32 = 0; w_data.bits.spi_wdata = val; w_data.bits.spi_addr = reg; w_data.bits.spi_rw = SPI_WRITE; w_data.bits.spi_start = 0x1; HI_MSG("val 0x%x\n", w_data.u32); osal_writel(w_data.u32, SPI_RW); do { r_data.u32 = osal_readl(SPI_RW); HI_MSG("read 0x%x", r_data.u32); HI_MSG("test busy %d", r_data.bits.spi_busy); } while (r_data.bits.spi_busy); return 0; } static int spi_rtc_write(char reg, char val) { osal_mutex_lock(&hirtc_lock); spi_write(reg, val); osal_mutex_unlock(&hirtc_lock); return 0; } static int spi_read(char reg, char* val) { U_SPI_RW w_data, r_data; HI_MSG("READ, reg 0x%02x", reg); r_data.u32 = 0; w_data.u32 = 0; w_data.bits.spi_addr = reg; w_data.bits.spi_rw = SPI_READ; w_data.bits.spi_start = 0x1; HI_MSG("val 0x%x\n", w_data.u32); osal_writel(w_data.u32, SPI_RW); do { r_data.u32 = osal_readl(SPI_RW); HI_MSG("read 0x%x\n", r_data.u32); HI_MSG("test busy %d\n", r_data.bits.spi_busy); } while (r_data.bits.spi_busy); *val = r_data.bits.spi_rdata; return 0; } static int spi_rtc_read(char reg, char* val) { osal_mutex_lock(&hirtc_lock); spi_read(reg, val); osal_mutex_unlock(&hirtc_lock); return 0; } static int temp_crg_reset(void) { int value = osal_readl(PERI_CRG57); osal_mb(); osal_writel(value | (1<<BIT_TEMP_SRST_REQ), PERI_CRG57); osal_mb(); osal_writel(value & ~(1<<BIT_TEMP_SRST_REQ), PERI_CRG57); return 0; } static int rtc_reset_first(void) { spi_rtc_write(RTC_POR_N, 0); spi_rtc_write(RTC_CLK, 0x01); return 0; } /* * converse the data type from year.mouth.data.hour.minite.second to second * define 2000.1.1.0.0.0 as jumping-off point */ static int rtcdate2second(rtc_time_t compositetime, unsigned long *ptimeOfsecond) { struct osal_rtc_time tmp; if (compositetime.weekday > 6) { return -1; } tmp.tm_year = compositetime.year - 1900; tmp.tm_mon = compositetime.month - 1; tmp.tm_mday = compositetime.date; tmp.tm_wday = compositetime.weekday; tmp.tm_hour = compositetime.hour; tmp.tm_min = compositetime.minute; tmp.tm_sec = compositetime.second; tmp.tm_isdst = 0; tmp.tm_yday = 0; if (osal_rtc_valid_tm(&tmp)) { return -1; } osal_rtc_tm_to_time(&tmp, ptimeOfsecond); return 0; } /* * converse the data type from second to year.mouth.data.hour.minite.second * define 2000.1.1.0.0.0 as jumping-off point */ static int rtcSecond2Date(rtc_time_t *compositetime, unsigned long timeOfsecond) { struct osal_rtc_time tmp ; osal_rtc_time_to_tm(timeOfsecond, &tmp); compositetime->year = (unsigned int)tmp.tm_year + 1900; compositetime->month = (unsigned int)tmp.tm_mon + 1; compositetime->date = (unsigned int)tmp.tm_mday; compositetime->hour = (unsigned int)tmp.tm_hour; compositetime->minute = (unsigned int)tmp.tm_min; compositetime->second = (unsigned int)tmp.tm_sec; compositetime->weekday = (unsigned int)tmp.tm_wday; HI_MSG("=================RTC read time\n"); HI_MSG("\tyear %d", compositetime->year); HI_MSG("\tmonth %d", compositetime->month); HI_MSG("\tdate %d", compositetime->date); HI_MSG("\thour %d", compositetime->hour); HI_MSG("\tminute %d", compositetime->minute); HI_MSG("\tsecond %d", compositetime->second); HI_MSG("\tweekday %d", compositetime->weekday); HI_MSG("===============================\n"); return 0; } static int hirtc_get_alarm(rtc_time_t *compositetime) { unsigned char dayl, dayh; unsigned char second, minute, hour; unsigned long seconds = 0; unsigned int day; spi_rtc_read(RTC_MR_S, &second); spi_rtc_read(RTC_MR_M, &minute); spi_rtc_read(RTC_MR_H, &hour); spi_rtc_read(RTC_MR_D_L, &dayl); spi_rtc_read(RTC_MR_D_H, &dayh); day = (unsigned int)(dayl | (dayh << 8)); HI_MSG("day %d\n", day); seconds = second + minute*60 + hour*60*60 + day*24*60*60; rtcSecond2Date(compositetime, seconds); return 0; } static int hirtc_set_alarm(rtc_time_t compositetime) { unsigned int days; unsigned long seconds = 0; HI_MSG("RTC read time"); HI_MSG("\tyear %d", compositetime.year); HI_MSG("\tmonth %d", compositetime.month); HI_MSG("\tdate %d", compositetime.date); HI_MSG("\thour %d", compositetime.hour); HI_MSG("\tminute %d", compositetime.minute); HI_MSG("\tsecond %d", compositetime.second); HI_MSG("\tweekday %d", compositetime.weekday); rtcdate2second(compositetime, &seconds); days = seconds/(60*60*24); spi_rtc_write(RTC_MR_10MS, 0); spi_rtc_write(RTC_MR_S, compositetime.second); spi_rtc_write(RTC_MR_M, compositetime.minute); spi_rtc_write(RTC_MR_H, compositetime.hour); spi_rtc_write(RTC_MR_D_L, (days & 0xFF)); spi_rtc_write(RTC_MR_D_H, (days >> 8)); return 0; } static int hirtc_get_time(rtc_time_t *compositetime) { unsigned char dayl, dayh; unsigned char second, minute, hour; unsigned long seconds = 0; unsigned int day; unsigned char raw_value; spi_rtc_read(RTC_LORD, &raw_value); if (raw_value & 0x4) { spi_rtc_write(RTC_LORD, (~(1 << 2)) & raw_value); } spi_rtc_read(RTC_LORD, &raw_value); spi_rtc_write(RTC_LORD, (1 << 1) | raw_value); //lock the time do { spi_rtc_read(RTC_LORD, &raw_value); } while (raw_value & 0x2); osal_msleep(1); // must delay 1 ms spi_rtc_read(RTC_S_COUNT, &second); spi_rtc_read(RTC_M_COUNT, &minute); spi_rtc_read(RTC_H_COUNT, &hour); spi_rtc_read(RTC_D_COUNT_L, &dayl); spi_rtc_read(RTC_D_COUNT_H, &dayh); day = (dayl | (dayh << 8)); HI_MSG("day %d\n", day); seconds = second + minute*60 + hour*60*60 + day*24*60*60; rtcSecond2Date(compositetime, seconds); return 0; } static int hirtc_set_time(rtc_time_t compositetime) { unsigned char ret = 0; unsigned int days; unsigned long seconds = 0; unsigned int cnt = 0; HI_MSG("RTC read time"); HI_MSG("\tyear %d", compositetime.year); HI_MSG("\tmonth %d", compositetime.month); HI_MSG("\tdate %d", compositetime.date); HI_MSG("\thour %d", compositetime.hour); HI_MSG("\tminute %d", compositetime.minute); HI_MSG("\tsecond %d", compositetime.second); HI_MSG("\tweekday %d", compositetime.weekday); ret = rtcdate2second(compositetime, &seconds); if (ret) { return -1; } days = seconds/(60*60*24); HI_MSG("day %d\n", days); spi_rtc_write(RTC_LR_10MS, 0); spi_rtc_write(RTC_LR_S, compositetime.second); spi_rtc_write(RTC_LR_M, compositetime.minute); spi_rtc_write(RTC_LR_H, compositetime.hour); spi_rtc_write(RTC_LR_D_L, (days & 0xFF)); spi_rtc_write(RTC_LR_D_H, (days >> 8)); spi_rtc_write(RTC_LORD, (ret | 0x1)); /* wait rtc load flag */ do { spi_rtc_read(RTC_LORD, &ret); osal_msleep(1); cnt++; } while ((ret & 0x1) && (cnt < RETRY_CNT)); if (cnt >= RETRY_CNT) { HI_ERR("check state error!\n"); return -1; } /* must sleep 10ms, internal clock is 100Hz */ osal_msleep(10); HI_MSG("set time ok!\n"); return 0; } static long hi_rtc_ioctl (unsigned int cmd, unsigned long arg, void *private_data) { unsigned long flags; int ret; rtc_time_t time; reg_data_t reg_info; reg_temp_mode_t temp_mode; char temp_reg; switch (cmd) { /* Alarm interrupt on/off */ case HI_RTC_AIE_ON: HI_MSG("HI_RTC_AIE_ON"); spi_rtc_write(RTC_IMSC, 0x1); break; case HI_RTC_AIE_OFF: HI_MSG("HI_RTC_AIE_OFF"); spi_rtc_write(RTC_IMSC, 0x0); break; case HI_RTC_COMP_OFF: if (is_comp_off) { break; } /*The timer may still in use , turn off it!*/ osal_del_timer(&temperature_timer); spi_rtc_write(TEMP_SEL, 0x6); break; case HI_RTC_COMP_ON: spi_rtc_write(TEMP_SEL, 0x1); is_comp_off = 0; break; case HI_RTC_SET_FREQ: { char freq_l, freq_h; unsigned int freq; rtc_freq_t value; osal_memcpy(&value, (struct rtc_freq_t*) arg, sizeof(value)); freq = value.freq_l; /* freq = 32700 + (freq /3052)*100 */ if (freq > FREQ_MAX_VAL || freq < FREQ_MIN_VAL) { HI_MSG("[error]Invalid argument\n"); return -1; } freq = (freq - 3270000) * 3052 / 10000; freq_l = (char)(freq & 0xff); freq_h = (char)((freq >> 8) & 0xf); spi_rtc_write(RTC_FREQ_H, freq_h); spi_rtc_write(RTC_FREQ_L, freq_l); break; } case HI_RTC_GET_FREQ: { char freq_l, freq_h; unsigned int freq; rtc_freq_t value; spi_rtc_read(RTC_FREQ_H, &freq_h); spi_rtc_read(RTC_FREQ_L, &freq_l); HI_MSG("freq_h=%x\n", freq_h); HI_MSG("freq_l=%x\n", freq_l); freq = ((freq_h & 0xf) << 8) + freq_l; value.freq_l = 3270000 + (freq * 10000) / 3052; HI_MSG("freq=%d\n", value.freq_l); osal_memcpy((void*)arg, &value, sizeof(rtc_freq_t)); break; } case HI_RTC_ALM_READ: hirtc_get_alarm(&time); osal_memcpy((void*)arg, &time, sizeof(time)); break; case HI_RTC_ALM_SET: osal_memcpy(&time, (struct rtc_time_t*) arg,sizeof(time)); ret = hirtc_set_alarm(time); if (ret) { HI_MSG("[error]Bad addres\n"); return -1; } break; case HI_RTC_RD_TIME: HI_MSG("HI_RTC_RD_TIME"); hirtc_get_time(&time); osal_memcpy((void*)arg, &time, sizeof(time)); break; case HI_RTC_SET_TIME: HI_MSG("HI_RTC_SET_TIME"); osal_memcpy(&time,(struct rtc_time_t*) arg,sizeof(time)); hirtc_set_time(time); break; case HI_RTC_RESET: rtc_reset_first(); break; case HI_RTC_REG_SET: osal_memcpy(&reg_info, (struct reg_data_t*) arg,sizeof(reg_info)); spi_rtc_write(reg_info.reg, reg_info.val); break; case HI_RTC_REG_READ: osal_memcpy(&reg_info, (struct reg_data_t*) arg,sizeof(reg_info)); spi_rtc_read(reg_info.reg, &reg_info.val); osal_memcpy((void*)arg, &reg_info, sizeof(reg_info)); break; case HI_RTC_SET_TEMP_MODE: if (is_comp_off) { HI_ERR("compensation off, please SET_COMP_ON first!\n"); return -1; } osal_memcpy(&temp_mode, (struct reg_temp_mode_t*) arg,sizeof(temp_mode)); osal_spin_lock_irqsave(&rtc_spin_lock, &flags); mode = temp_mode.mode; osal_spin_unlock_irqrestore(&rtc_spin_lock, &flags); switch (mode) { case TEMP_SEL_FIXMODE: if (temp_mode.value > 140 || temp_mode.value < -40) { HI_MSG("invalid value %d", temp_mode.value); return -1; } osal_del_timer(&temperature_timer); spi_rtc_write(OUTSIDE_TEMP, TEMP_TO_RTC(temp_mode.value)); break; case TEMP_SEL_INTERNAL: case TEMP_SEL_OUTSIDE: osal_set_timer(&temperature_timer, 1000); break; default: return -1; } break; case HI_RTC_GET_TEMP: HI_MSG("HI_RTC_GET_TEMP"); spi_rtc_read(INTERNAL_TEMP, &temp_reg); osal_memcpy((int*)arg, &temp_reg, sizeof(temp_reg)); break; default: return -1; } return 0; } static void temperature_detection(unsigned long arg) { int ret; int cnt = 0; HI_MSG("START temperature adjust"); if (mode == TEMP_SEL_OUTSIDE) { do { ret = osal_readl(RTC_TEMP_STAT); osal_udelay(10); cnt++; } while (ret && (cnt < RETRY_CNT)); if (cnt >= RETRY_CNT) { /*maybe temperature capture module is error, need reset */ HI_ERR("RTC_TEMP_STAT not ready,please check pin configuration\n"); temp_crg_reset(); goto timer_again; } HI_MSG("WRITE RTC_TEMP_START"); osal_writel(0x1, RTC_TEMP_START); } else if (mode == TEMP_SEL_INTERNAL) { char temp = TEMP_TO_RTC(25); spi_read(INTERNAL_TEMP, &temp); HI_MSG("internal temp is %d\n", temp); /*FIXME: sub offset to get enviroment temperature*/ //temp -= 38; /*38=27c*255/180*/ temp -= TEMP_OFFSET_TO_RTC(TEMP_ENV_OFFSET); spi_write(OUTSIDE_TEMP, temp); } else { HI_ERR("invalid temperature mode"); } timer_again: osal_set_timer(&temperature_timer, 1000*t_second); } /** * this function change DS1820 temperature format to native RTC format * OUTSIDE_TEMP value size (-40<oC>, +140<oC>), use 8bit to spec * DS1820 value size (-55<oC>, +120<oC>), use 9bit to spec */ static void set_temperature(void) { unsigned short ret; unsigned char temp; ret = (unsigned short)osal_readl(RTC_TEMP_VAL); HI_MSG("READ DS1820 temperature value 0x%x", ret); /* mode 1 sample, ret > 0x800 means negative number */ if (ret > 0x800) { /* change to positive number */ ret = 4096 - ret; ret = ret / 2; /* rtc temperature lower limit -40<oC> */ if (ret > 40) { ret = 40; } temp = (40 - ret) * 255 / 180; } else { /* rtc temperature upper limit 140<oC> */ ret = ret / 2; if (ret > 140) { ret = 140; } temp = TEMP_TO_RTC(ret); } HI_MSG("WRITE RTC temperature value 0x%02x", temp); spi_write(OUTSIDE_TEMP, temp); } static int rtc_temperature_interrupt(int irq, void *dev_id) { int ret = OSAL_IRQ_NONE; int irq_stat; irq_stat = osal_readl(RTC_TEMP_INT_STAT); if (!irq_stat) { return ret; } HI_MSG("irq mask"); osal_writel(0x01, RTC_TEMP_INT_MASK); irq_stat = osal_readl(RTC_TEMP_INT_RAW); HI_MSG("irq clear"); osal_writel(0x1, RTC_TEMP_INT_CLEAR); if (mode != TEMP_SEL_OUTSIDE) { goto endl; } if (irq_stat & 0x2) { /* err start again */ osal_set_timer(&temperature_timer, 1000*t_second); } else { /* set temperature data */ set_temperature(); } endl: HI_MSG("irq unmask"); osal_writel(0x0, RTC_TEMP_INT_MASK); ret = OSAL_IRQ_HANDLED; return ret; } /* * interrupt function * do nothing. left for future */ static int rtc_alm_interrupt(int irq, void *dev_id) { int ret = OSAL_IRQ_NONE; osal_printk("RTC alarm interrupt!!!\n"); //spi_rtc_write(RTC_IMSC, 0x0); spi_write(RTC_INT_CLR, 0x1); //spi_rtc_write(RTC_IMSC, 0x1); /*FIXME: do what you want here. such as wake up a pending thread.*/ ret = OSAL_IRQ_HANDLED; return ret; } static int hi_rtc_open(void *private_data) { return 0; } static int hi_rtc_release(void *private_data) { return 0; } static struct osal_fileops hi_rtc_fops = { .unlocked_ioctl = hi_rtc_ioctl, .open = hi_rtc_open, .release = hi_rtc_release, }; static osal_dev_t *rtc_dev = 0; int rtc_init(void) { int i,ret = 0; char base; if ((NULL==rtc_base_addr)||(NULL==crg_base_addr)) { rtc_base_addr = OSAL_IO_ADDRESS(0x20060000); crg_base_addr = OSAL_IO_ADDRESS(0x20030000); } ret = osal_spin_lock_init(&rtc_spin_lock); if (0 != ret) { HI_ERR("failed to init spin lock!\n"); return -1; } ret = osal_mutex_init(&hirtc_lock); if (0 != ret) { HI_ERR("failed to init mutex!\n"); goto RTC_INIT_FAIL0; } rtc_dev = osal_createdev(RTC_NAME); if (NULL == rtc_dev) { HI_ERR("cretate rtc device failed!\n"); goto RTC_INIT_FAIL1; } rtc_dev->fops = &hi_rtc_fops; rtc_dev->minor = 255; ret = osal_registerdevice(rtc_dev); if (0 != ret) { HI_ERR("rtc device register failed!\n"); goto RTC_INIT_FAIL2; } ret = osal_request_irq(rtc_irq, &rtc_alm_interrupt, NULL, "RTC Alarm", (void*)&alm_itrp); if(0 != ret) { HI_ERR("hi3518ev200 rtc: failed to register IRQ(%d)\n", rtc_irq); goto RTC_INIT_FAIL3; } ret = osal_request_irq(rtc_irq, &rtc_temperature_interrupt, NULL, "RTC Temperature", (void*)&temperature_itrp); if(0 != ret) { HI_ERR("hi3518ev200 rtc: failed to register IRQ(%d)\n", rtc_irq); goto RTC_INIT_FAIL4; } ret = osal_timer_init(&temperature_timer); if(0 != ret) { HI_ERR("failed to init timer\n"); goto RTC_INIT_FAIL5; } temperature_timer.function = temperature_detection; /* clk div value = (apb_clk/spi_clk)/2-1, for asic , apb clk = 100MHz, spi_clk = 10MHz,so value= 0x4 */ osal_writel(0x4, SPI_CLK_DIV); /* always fixed frequency division mode */ spi_rtc_write(TEMP_SEL, 0x06); spi_rtc_write(RTC_SAR_CTRL, 0x08); spi_rtc_write(OUTSIDE_TEMP, TEMP_TO_RTC(25)); /* rtc analog voltage config */ spi_rtc_write(RTC_ANA_CTRL, 0x01); /*init rtc temperature lut table value*/ for (i = 0; i < sizeof(temp_lut_table) / sizeof(temp_lut_table[0]); i++) { if (i < 3) { base = TOT_OFFSET_L; spi_rtc_write(base + i, temp_lut_table[i]); } else { base = LUT1; spi_rtc_write(base + i - 3, temp_lut_table[i]); } } /* enable temperature IRQ */ osal_writel(0x0, RTC_TEMP_INT_MASK); osal_printk("hirtc init ok. ver=%s, %s.\n", __DATE__, __TIME__); return 0; RTC_INIT_FAIL5: osal_free_irq(rtc_irq, (void*)&temperature_itrp); RTC_INIT_FAIL4: osal_free_irq(rtc_irq, (void*)&alm_itrp); RTC_INIT_FAIL3: osal_deregisterdevice(rtc_dev); RTC_INIT_FAIL2: osal_destroydev(rtc_dev); RTC_INIT_FAIL1: osal_mutex_destory(&hirtc_lock); RTC_INIT_FAIL0: osal_spin_lock_destory(&rtc_spin_lock); return -1; } void rtc_exit(void) { osal_del_timer(&temperature_timer); osal_timer_destory(&temperature_timer); osal_free_irq(rtc_irq, (void*)&alm_itrp); osal_free_irq(rtc_irq, (void*)&temperature_itrp); osal_deregisterdevice(rtc_dev); osal_destroydev(rtc_dev); osal_mutex_destory(&hirtc_lock); osal_spin_lock_destory(&rtc_spin_lock); } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/cipher/drv_cipher.h /********************************************************************************* * * Copyright (C) 2014 Hisilicon Technologies Co., Ltd. All rights reserved. * * This program is confidential and proprietary to Hisilicon Technologies Co., Ltd. * (Hisilicon), and may not be copied, reproduced, modified, disclosed to * others, published or used, in whole or in part, without the express prior * written permission of Hisilicon. * ***********************************************************************************/ #ifndef __DRV_CIPHER_H__ #define __DRV_CIPHER_H__ /* add include here */ #include "hal_cipher.h" #include "drv_cipher_ioctl.h" #include "drv_cipher_mmz.h" #include "drv_cipher_log.h" #include "hi_error_mpi.h" #ifdef __cplusplus extern "C" { #endif typedef struct hiCIPHER_COMM_S { MMZ_BUFFER_S stChainedListPhyBuf; MMZ_BUFFER_S stTempPhyBuf; } CIPHER_COMM_S; typedef struct hiCIPHER_OSR_CHN_S { HI_BOOL g_bSoftChnOpen; /* mark soft channel open or not*/ HI_BOOL g_bDataDone; /* mark the data done or not */ osal_wait_t cipher_wait_queue; /* mutex method */ HI_VOID *pWichFile; /* which file need to operate */ HI_UNF_CIPHER_DATA_S *pstDataPkg; HI_U32 u32DataPkgNum; }CIPHER_OSR_CHN_S; typedef HI_VOID (*funcCipherCallback)(HI_U32); /***************************** Macro Definition ******************************/ #define CIPHER_DEFAULT_INT_NUM 1 #define CIPHER_SOFT_CHAN_NUM CIPHER_CHAN_NUM #define CIPHER_INVALID_CHN (0xffffffff) HI_S32 DRV_CIPHER_ReadReg(HI_U32 addr, HI_U32 *pVal); HI_S32 DRV_CIPHER_WriteReg(HI_U32 addr, HI_U32 Val); HI_S32 DRV_CIPHER_Init(HI_VOID); HI_VOID DRV_CIPHER_DeInit(HI_VOID); HI_S32 DRV_CIPHER_Open(HI_VOID *private_data); HI_S32 DRV_CIPHER_Release(HI_VOID *private_data); HI_S32 DRV_CIPHER_OpenChn(HI_U32 softChnId); HI_S32 DRV_CIPHER_CloseChn(HI_U32 softChnId); HI_S32 DRV_CIPHER_CreatTask(HI_U32 softChnId, HI_DRV_CIPHER_TASK_S *pTask, HI_U32 *pKey, HI_U32 *pIV); HI_S32 DRV_CIPHER_CreatMultiPkgTask(HI_U32 softChnId, HI_DRV_CIPHER_DATA_INFO_S *pBuf2Process, HI_U32 pkgNum, HI_BOOL isMultiIV, HI_U32 callBackArg); HI_S32 DRV_CIPHER_ProcGetStatus(CIPHER_CHN_STATUS_S *pstCipherStatus); HI_S32 DRV_CIPHER_CreateHandle(CIPHER_HANDLE_S * pstCIHandle, HI_VOID *file); HI_S32 DRV_CIPHER_ConfigChn(HI_U32 softChnId,HI_UNF_CIPHER_CTRL_S * pConfig); HI_S32 DRV_CIPHER_GetHandleConfig(CIPHER_Config_CTRL *pstCipherConfig); HI_S32 DRV_CIPHER_Encrypt(HI_U32 softChnId, HI_U32 ScrPhyAddr,HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt); HI_S32 DRV_CIPHER_EncryptEx(HI_U32 u32SoftChanId, HI_U32 ScrPhyAddr,HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt, HI_U8 *pLastBlock); #ifdef CIPHER_CCM_GCM_SUPPORT HI_S32 DRV_CIPHER_CCM_Aad(HI_U32 u32SoftChanId); HI_S32 DRV_CIPHER_GCM_Aad(HI_U32 u32SoftChanId); HI_S32 DRV_CIPHER_CCM(HI_U32 u32SoftChanId, HI_U32 ScrPhyAddr, HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt); HI_S32 DRV_CIPHER_GCM(HI_U32 u32SoftChanId, HI_U32 ScrPhyAddr, HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt); HI_S32 DRV_CIPHER_GetTag(HI_U32 u32SoftChanId, HI_U32 *pu32Tag, HI_U32 *pu32Len); #endif HI_S32 DRV_CIPHER_DestroyHandle(HI_HANDLE hCipherchn); #ifdef CIPHER_KLAD_SUPPORT HI_S32 DRV_Cipher_KladLoadKey(HI_U32 chnId, HI_UNF_CIPHER_KEY_SRC_E enRootKey, HI_UNF_CIPHER_KLAD_TARGET_E enTarget, HI_U8 *pu8DataIn, HI_U32 u32KeyLen); HI_S32 DRV_Cipher_KladEncryptKey(CIPHER_KLAD_KEY_S *pstKladKey); #endif #ifdef __cplusplus } #endif #endif /* __DRV_CIPHER_H__ */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/api/hi_mpi_cipher.h /********************************************************************************* * * Copyright (C) 2014 Hisilicon Technologies Co., Ltd. All rights reserved. * * This program is confidential and proprietary to Hisilicon Technologies Co., Ltd. * (Hisilicon), and may not be copied, reproduced, modified, disclosed to * others, published or used, in whole or in part, without the express prior * written permission of Hisilicon. * ***********************************************************************************/ #ifndef __HI_MPI_CIPHER_H__ #define __HI_MPI_CIPHER_H__ #include "drv_cipher_ioctl.h" #include "hi_error_mpi.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* __cplusplus */ HI_S32 HI_MPI_CIPHER_Init(HI_VOID); HI_S32 HI_MPI_CIPHER_DeInit(HI_VOID); #ifdef CIPHER_MULTICIPHER_SUPPORT HI_S32 HI_MPI_CIPHER_CreateHandle(HI_HANDLE* phCipher); HI_S32 HI_MPI_CIPHER_DestroyHandle(HI_HANDLE hCipher); HI_S32 HI_MPI_CIPHER_ConfigHandle(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl); HI_S32 HI_MPI_CIPHER_Encrypt(HI_HANDLE hCipher, HI_U32 u32SrcPhyAddr, HI_U32 u32DestPhyAddr, HI_U32 u32ByteLength); HI_S32 HI_MPI_CIPHER_Decrypt(HI_HANDLE hCipher, HI_U32 u32SrcPhyAddr, HI_U32 u32DestPhyAddr, HI_U32 u32ByteLength); HI_S32 HI_MPI_CIPHER_EncryptMulti(HI_HANDLE hCipher, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum); HI_S32 HI_MPI_CIPHER_DecryptMulti(HI_HANDLE hCipher, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum); HI_S32 HI_MPI_CIPHER_GetTag(HI_HANDLE hCipherHandle, HI_U8 *pstTag); HI_S32 HI_MPI_CIPHER_EncryptMultiEx(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum); HI_S32 HI_MPI_CIPHER_DecryptMultiEx(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum); HI_S32 HI_MPI_CIPHER_GetHandleConfig(HI_HANDLE hCipherHandle, HI_UNF_CIPHER_CTRL_S* pstCtrl); #endif #ifdef CIPHER_KLAD_SUPPORT HI_S32 HI_MPI_CIPHER_KladEncryptKey(HI_UNF_CIPHER_KEY_SRC_E enRootKey, HI_UNF_CIPHER_KLAD_TARGET_E enTarget, HI_U8 *pu8CleanKey, HI_U8* pu8EcnryptKey, HI_U32 u32KeyLen); #endif #ifdef CIPHER_RNG_SUPPORT HI_S32 HI_MPI_CIPHER_GetRandomNumber(HI_U32 *pu32RandomNumber, HI_U32 u32TimeOutUs); #endif #ifdef CIPHER_HASH_SUPPORT HI_S32 HI_MPI_CIPHER_HashInit(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_HANDLE *pHashHandle); HI_S32 HI_MPI_CIPHER_HashUpdate(HI_HANDLE hHashHandle, HI_U8 *pu8InputData, HI_U32 u32InputDataLen); HI_S32 HI_MPI_CIPHER_HashFinal(HI_HANDLE hHashHandle, HI_U8 *pu8OutputHash); HI_S32 HI_MPI_CIPHER_Hash(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_U32 u32DataPhyAddr, HI_U32 u32ByteLength, HI_U8 *pu8OutputHash); #endif #ifdef CIPHER_RSA_SUPPORT HI_S32 HI_MPI_CIPHER_RsaPublicEnc(HI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaEnc, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen); HI_S32 HI_MPI_CIPHER_RsaPrivateDec(HI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaDec, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen); HI_S32 HI_MPI_CIPHER_RsaSign(HI_UNF_CIPHER_RSA_SIGN_S *pstRsaSign, HI_U8 *pu8InData, HI_U32 u32InDataLen, HI_U8 *pu8HashData, HI_U8 *pu8OutSign, HI_U32 *pu32OutSignLen); HI_S32 HI_MPI_CIPHER_RsaVerify(HI_UNF_CIPHER_RSA_VERIFY_S *pstRsaVerify, HI_U8 *pu8InData, HI_U32 u32InDataLen, HI_U8 *pu8HashData, HI_U8 *pu8InSign, HI_U32 u32InSignLen); HI_S32 HI_MPI_CIPHER_RsaPrivateEnc(HI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsEnc, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen); HI_S32 HI_MPI_CIPHER_RsaPublicDec(HI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaDec, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen); HI_S32 HI_MPI_CIPHER_RsaGenKey(HI_U32 u32NumBits, HI_U32 u32Exponent, HI_UNF_CIPHER_RSA_PRI_KEY_S *pstRsaPriKey); #endif #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ #endif /* __HI_MPI_CIPHER_H__ */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/init/HuaweiLite/wtdg_init.c #include "hi_interdrv_param.h" #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* __cplusplus */ extern int watchdog_init(void); extern void watchdog_exit(void); extern int default_margin; //extern int nowayout; extern int nodeamon; int wtdg_mod_init(void *pArgs) { WTDG_MODULE_PARAMS_S *pstWtdgModParam = (WTDG_MODULE_PARAMS_S*)pArgs; default_margin = pstWtdgModParam->default_margin; // nowayout = pstWtdgModParam->nowayout; nodeamon = pstWtdgModParam->nodeamon; return watchdog_init(); } void wtdg_mod_exit() { watchdog_exit(); } #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/include/hi_module_param.h #ifndef __HI_MOD_PARAM__ #define __HI_MOD_PARAM__ #include "hi_type.h" #include "hi_defines.h" typedef struct hiSYS_MODULE_PARAMS_S { HI_U32 u32VI_VPSS_online; HI_U32 u32SensorNum; HI_CHAR cSensor[HISI_MAX_SENSOR_NUM][32]; }SYS_MODULE_PARAMS_S; typedef struct hiVI_MODULE_PARAMS_S { HI_U32 u32DetectErrFrame; HI_U32 u32DropErrFrame; HI_U32 u32StopIntLevel; HI_U32 u32DiscardInt; HI_U32 u32IntdetInterval; HI_BOOL bCscTvEnable; HI_BOOL bCscCtMode; HI_BOOL bYuvSkip; }VI_MODULE_PARAMS_S; typedef struct hiVO_MODULE_PARAMS_S { HI_U32 u32DetectCycle; HI_BOOL bTransparentTransmit; HI_BOOL bLowPowerMode; }VO_MODULE_PARAMS_S; typedef struct hiVPSS_MODULE_PARAMS_S { HI_U32 u32RfrFrameCmp; HI_BOOL bOneBufferforLowDelay; }VPSS_MODULE_PARAMS_S; typedef struct hiVGS_MODULE_PARAMS_S { HI_U32 u32MaxVgsJob; HI_U32 u32MaxVgsTask; HI_U32 u32MaxVgsNode; HI_U32 u32WeightThreshold; }VGS_MODULE_PARAMS_S; typedef struct hiFISHEYE_MODULE_PARAMS_S { HI_U32 u32MaxFisheyeJob; HI_U32 u32MaxFisheyeTask; HI_U32 u32MaxFisheyeNode; HI_U32 u32WeightThreshold; }FISHEYE_MODULE_PARAMS_S; typedef struct hiIVE_MODULE_PARAMS_S { HI_BOOL bSavePowerEn; }IVE_MODULE_PARAMS_S; typedef struct hiACODEC_MODULE_PARAMS_S { HI_U32 u32InitDelayTimeMs; }ACODEC_MODULE_PARAMS_S; #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/hi_drv_cipher.h /****************************************************************************** Copyright (C), 2011-2014, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name :hi_drv_cipher.h Version : Initial Draft Author : <NAME>isecurity team Created : Last Modified : Description : Function List : History : ******************************************************************************/ #ifndef __HI_DRV_CIPHER_H__ #define __HI_DRV_CIPHER_H__ #include "hi_type.h" #include "hi_unf_cipher.h" #include "config.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define CIPHER_SOFT_CHAN_NUM CIPHER_CHAN_NUM #define CIPHER_INVALID_CHN (0xffffffff) #define HASH_BLOCK_SIZE (64) #ifdef CIPHER_MULTICIPHER_SUPPORT typedef struct hiCIPHER_DATA_INFO_S { HI_U32 u32src; HI_U32 u32dest; HI_U32 u32length; HI_BOOL bDecrypt; HI_U32 u32DataPkg[4]; }HI_DRV_CIPHER_DATA_INFO_S; typedef struct hiCIPHER_TASK_S { HI_DRV_CIPHER_DATA_INFO_S stData2Process; HI_U32 u32CallBackArg; }HI_DRV_CIPHER_TASK_S; typedef struct hiCIPHER_HANDLE_S { HI_HANDLE hCIHandle; }CIPHER_HANDLE_S; typedef struct hiCIPHER_DATA_S { HI_HANDLE CIHandle; HI_U32 ScrPhyAddr; HI_U32 DestPhyAddr; HI_U32 u32DataLength; }CIPHER_DATA_S; typedef struct hiCIPHER_MUTIL_EX_DATA_S { HI_HANDLE hCipher; HI_UNF_CIPHER_DATA_S *pstPkg; HI_U32 u32PkgNum; HI_UNF_CIPHER_CTRL_S CIpstCtrl; }CIPHER_MUTIL_EX_DATA_S; typedef struct hiCIPHER_Config_CTRL { HI_HANDLE CIHandle; HI_UNF_CIPHER_CTRL_S CIpstCtrl; }CIPHER_Config_CTRL; typedef struct hiCIPHER_TAG { HI_HANDLE CIHandle; HI_U32 u32Tag[4]; HI_U32 u32Len; }CIPHER_TAG; typedef struct hiCIPHER_CBCMAC_DATA_S { HI_U8 *pu8RefCbcMac; HI_U32 u32AppLen; }CIPHER_CBCMAC_DATA_S; #endif #ifdef CIPHER_HASH_SUPPORT typedef enum { HI_CIPHER_HMAC_KEY_FROM_CA = 0, HI_CIPHER_HMAC_KEY_FROM_CPU = 1, }CIPHER_HMAC_KEY_FROM_E; typedef struct hiCipher_HASH_MMZ_BUFFER_S { HI_U32 u32StartVirAddr; HI_U32 u32StartPhyAddr; HI_U32 u32Size; }HASH_MMZ_BUFFER_S; typedef struct hiCIPHER_HASH_DATA_S { HI_UNF_CIPHER_HASH_TYPE_E enShaType; CIPHER_HMAC_KEY_FROM_E enHMACKeyFrom; HI_U32 u32ShaVal[8]; HI_U32 u32DataPhy; HI_U32 u32DataLen; }CIPHER_HASH_DATA_S; #endif #ifdef CIPHER_RNG_SUPPORT typedef struct { HI_U32 u32TimeOutUs; HI_U32 u32RNG; }CIPHER_RNG_S; #endif #ifdef CIPHER_RSA_SUPPORT typedef struct { HI_U8 *pu8Input; HI_U8 *pu8Output; HI_U32 u32DataLen; HI_U8 *pu8N; HI_U8 *pu8K; HI_U16 u16NLen; HI_U16 u16KLen; HI_UNF_CIPHER_KEY_SRC_E enKeySrc; }CIPHER_RSA_DATA_S; typedef struct { HI_UNF_CIPHER_RSA_PRI_KEY_S stPriKey; HI_U32 u32NumBits; HI_U32 u32Exponent; }CIPHER_RSA_KEY_S; #endif #ifdef CIPHER_KLAD_SUPPORT typedef struct { HI_UNF_CIPHER_KEY_SRC_E enRootKey; HI_UNF_CIPHER_KLAD_TARGET_E enTarget; HI_U32 u32CleanKey[4]; HI_U32 u32EncryptKey[4]; }CIPHER_KLAD_KEY_S; #endif #ifdef CIPHER_MULTICIPHER_SUPPORT HI_S32 HI_DRV_CIPHER_CreateHandle(CIPHER_HANDLE_S *pstCIHandle, HI_U32 file); HI_S32 HI_DRV_CIPHER_ConfigChn(HI_U32 softChnId, HI_UNF_CIPHER_CTRL_S *pConfig); HI_S32 HI_DRV_CIPHER_GetHandleConfig(CIPHER_Config_CTRL *pstCipherConfig); HI_S32 HI_DRV_CIPHER_DestroyHandle(HI_HANDLE hCipherchn); HI_S32 HI_DRV_CIPHER_Encrypt(CIPHER_DATA_S *pstCIData); HI_S32 HI_DRV_CIPHER_Decrypt(CIPHER_DATA_S *pstCIData); HI_S32 HI_DRV_CIPHER_EncryptMulti(CIPHER_DATA_S *pstCIData); HI_S32 HI_DRV_CIPHER_DecryptMulti(CIPHER_DATA_S *pstCIData); HI_S32 HI_DRV_CIPHER_EncryptMultiEx(CIPHER_MUTIL_EX_DATA_S *pstCIDataEx); HI_S32 HI_DRV_CIPHER_DecryptMultiEx(CIPHER_MUTIL_EX_DATA_S *pstCIDataEx); HI_S32 HI_DRV_CIPHER_GetTag(CIPHER_TAG *pstTag); #endif #ifdef CIPHER_RNG_SUPPORT HI_S32 HI_DRV_CIPHER_GetRandomNumber(CIPHER_RNG_S *pstRNG); #endif #ifdef CIPHER_HASH_SUPPORT HI_S32 HI_DRV_CIPHER_CalcHashInit(CIPHER_HASH_DATA_S *pCipherHashData); HI_S32 HI_DRV_CIPHER_CalcHashUpdate(CIPHER_HASH_DATA_S *pCipherHashData); HI_S32 HI_DRV_CIPHER_CalcHashFinal(CIPHER_HASH_DATA_S *pCipherHashData); HI_S32 HI_DRV_CIPHER_CalcHash(CIPHER_HASH_DATA_S *pCipherHashData); #endif #ifdef CIPHER_RSA_SUPPORT HI_S32 HI_DRV_CIPHER_CalcRsa(CIPHER_RSA_DATA_S *pCipherRsaData); #endif #ifdef CIPHER_KLAD_SUPPORT HI_S32 HI_DRV_CIPHER_KladEncryptKey(CIPHER_KLAD_KEY_S *pstKladKey); #endif HI_VOID HI_DRV_CIPHER_Suspend(HI_VOID); HI_S32 HI_DRV_CIPHER_Resume(HI_VOID); HI_S32 HI_DRV_CIPHER_SoftReset(HI_VOID); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* End of #ifndef __HI_DRV_CIPHER_H__*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/tlv320aic31/arch/hi3518e/tlv320aic31_hal.h #ifndef __TLV320AIC31_HAL_H__ #define __TLV320AIC31_HAL_H__ #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ /***************I2C device num***********************/ #define TLV320AIC31_I2C_ADAPTER_ID 2 #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ #endif /*__TLV320AIC31_HAL_H__*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/main.c #include "boardconfig.h" #include "kfifo.h" u8 g_Key_WakeUp_It = 0; //按键唤醒标志 u8 g_Pir_WakeUp_it = 0;//PIR中断唤醒标志 u8 g_Wifi_WakeUp = 0; //WIFI唤醒标志 u8 g_Pir_Wakeup = 0; u8 g_IsSystemOn = 0; //dv主控芯片的状态,0关机, 1开机 u8 g_Key_Handle_Flag = 0; u8 g_Power_Key_Pressed = 0; u8 g_Wifi_Reg_Det_Flag = 1; u16 USART_Receive_Timeout = 0; u8 USART_Send_Buf[UF_MAX_LEN]; u8 USART_Receive_Buf[UF_MAX_LEN]; u32 USART_Receive_Flag = 0; u8 g_IsDevPwrOn = 0; //device power 的状态,0 关机 ,1 开机 u8 g_IsDevWlanEn = 0; //device wlan 的状态,0 disable ,1 enable u8 g_Iswkupmsgsend = 0; u8 g_wkup_reason = 0; u8 g_forceslp_halt = 0; u8 g_debounce_cnt = 0; struct kfifo recvfifo; static void MDelay(u32 delay_count) { u32 i, j; for (i = 0; i < delay_count; i++) { for(j = 0; j < 15; j++); } } /********************************************************************** * 函数名称: XOR_Inverted_Check * 功能描述:数据的异或取反校验 ***********************************************************************/ u8 XOR_Inverted_Check(unsigned char *inBuf,unsigned char inLen) { u8 check = 0,i; for(i = 0;i < inLen;i++) check ^= inBuf[i]; return ~check; } void USART_Send_Data(unsigned char *Dbuf,unsigned int len) { int i; //USART1->CR2 |= (uint8_t)USART_CR2_TEN; for(i = 0;i < len;i++) { while (USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET); USART_SendData8(USART1,Dbuf[i]); while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET); } //USART1->CR2 &= (uint8_t)~USART_CR2_TEN; } /********************************************************************** * 函数名称:UartHandle * 功能描述:串口通信数据处理 ***********************************************************************/ void Uart_Handle(void) { unsigned char check = 0; u8 cmdstr[CMD_LEN]; u8 len = 0; u8 rec_len = __kfifo_len(&recvfifo); if(rec_len >= MIN_CMD_LEN) { if(CMDFLAG_START == recvfifo.buffer[(recvfifo.out + UF_START) & (recvfifo.size - 1)]) { len = recvfifo.buffer[(recvfifo.out + UF_LEN) & (recvfifo.size - 1)]; if(rec_len >= len) { __kfifo_get(&recvfifo, cmdstr, len); check = XOR_Inverted_Check(cmdstr, len - 1); if(check == cmdstr[len - 1]) { if (cmdstr[UF_CMD] < 0x80) Response_CMD_Handle(); else Request_CMD_Handle(cmdstr, len); } } } else { __kfifo_get(&recvfifo, cmdstr, 1);//如果当前位置不是命令起始标志,则丢弃 } } } void dev_pwr_on(void) { g_IsDevPwrOn = 1; GPIO_SetBits(DEV_PWR_GPIO,DEV_PWR_GPIO_Pin); } void dev_pwr_off(void) { g_IsDevPwrOn = 0; GPIO_ResetBits(DEV_PWR_GPIO, DEV_PWR_GPIO_Pin); } void dev_wlan_enable(void) { g_IsDevWlanEn = 1; GPIO_SetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); } void dev_wlan_disable(void) { g_IsDevWlanEn = 0; GPIO_ResetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); } void dev_wlan_reset_handle(u8 val) { if (val && (!g_IsDevWlanEn)) { dev_wlan_enable(); } else if ((!val) && g_IsDevWlanEn) { dev_wlan_disable(); } } void dev_wlan_power_handle(u8 val) { if (val && (!g_IsDevPwrOn)) { dev_pwr_on(); } else if ((!val) && g_IsDevPwrOn) { dev_pwr_off(); } } void host_clr_wkup_reason(void) { GPIO_ResetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); g_wkup_reason = 0; } void dev_wkup_host(void) { #if 1 GPIO_SetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); MDelay(1); GPIO_ResetBits(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); #else USART_Send_Buf[UF_START] = 0x7B; USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = 0xbb; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); #endif } void host_set_wkup_reason(u8 val) { if(1 & val) { GPIO_SetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); } else { GPIO_ResetBits(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); } } void Request_CMD_Handle(u8* cmdstr, u8 len) { int ret; USART_Send_Buf[UF_START] = 0x7B; switch (cmdstr[UF_CMD]) { case 0x80: PWR_OFF(); MDelay(5); g_wkup_reason = 1; #if 0 USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = 0x81; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); timeout = 0; while (timeout++ < 3000) { if (GPIO_ReadInputDataBit(PWROFF_Req_GPIO, PWROFF_Req_GPIO_Pin)) { break; } MDelay(1); } #endif break; case 0x8a: dev_wlan_power_handle(cmdstr[UF_DATA]); break; case 0x88: dev_wlan_reset_handle(cmdstr[UF_DATA]); break; case 0x8c: host_clr_wkup_reason(); break; case 0x84: if(cmdstr[UF_DATA] == 0) g_Wifi_Reg_Det_Flag = 0; else g_Wifi_Reg_Det_Flag = 1; #if 0 USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = 0x85; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); #endif break; case 0x86: ret = RTC_Alarm_Duration_Check(cmdstr[UF_DATA + 1], cmdstr[UF_DATA + 2]); if (!ret) { RTC_AlarmCmd(DISABLE); RTC_ITConfig(RTC_IT_ALRA, DISABLE); RTC_ClearITPendingBit(RTC_IT_ALRA); g_Alarm_Event.flag = cmdstr[UF_DATA]; g_Alarm_Event.hours = cmdstr[UF_DATA + 1]; g_Alarm_Event.minutes = cmdstr[UF_DATA + 2]; USART_Send_Buf[UF_DATA] = 0; } else { USART_Send_Buf[UF_DATA] = 1; } USART_Send_Buf[UF_LEN] = 0x5; USART_Send_Buf[UF_CMD] = 0x87; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); break; default: break; } } void Response_CMD_Handle() { ; } void CLK_Config(void) { CLK_DeInit(); CLK_HSICmd(ENABLE); CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_32);//CLK_SYSCLKDiv_32 while (((CLK->ICKCR)& 0x02)!=0x02); //HSI准备就绪 CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_HSI); CLK_SYSCLKSourceSwitchCmd(ENABLE); while (((CLK->SWCR)& 0x01)==0x01); //切换完成 } void TIM3_Config(void) { CLK_PeripheralClockConfig(CLK_Peripheral_TIM3, ENABLE);/* Enable TIM3 CLK */ /* Time base configuration */ TIM3_TimeBaseInit(TIM3_Prescaler_16,TIM3_CounterMode_Up,125);//20MS 2480------------4ms 499 // 0.5M 4ms 625 1ms - 125 /* Clear TIM4 update flag */ TIM3_ClearFlag(TIM3_FLAG_Update); /* Enable update interrupt */ TIM3_ITConfig(TIM3_IT_Update, ENABLE); /* Enable TIM4 */ TIM3_Cmd(ENABLE); } void Usart_Config(void) { GPIO_Init(USART1_RX_GPIO,USART1_RX_GPIO_Pin,GPIO_Mode_In_PU_No_IT); GPIO_Init(USART1_TX_GPIO,USART1_TX_GPIO_Pin,GPIO_Mode_Out_PP_Low_Fast); CLK_PeripheralClockConfig(CLK_Peripheral_USART1, ENABLE); USART_Init(USART1,9600,USART_WordLength_8b,USART_StopBits_1,USART_Parity_No,(USART_Mode_TypeDef)(USART_Mode_Tx | USART_Mode_Rx)); USART_ClearITPendingBit(USART1,USART_IT_RXNE); //配置USART1->SR USART_ITConfig(USART1,USART_IT_RXNE,ENABLE); //配置USART1->CR2的RIEN位 USART_Cmd(USART1,ENABLE); } void PWR_ON(void) { g_IsSystemOn = 1; GPIO_SetBits(PWR_GPIO,PWR_GPIO_Pin); GPIO_ResetBits(WIFI_LED_GPIO,WIFI_LED_GPIO_Pin); } void PWR_OFF(void) { g_IsSystemOn = 0; GPIO_ResetBits(PWR_GPIO,PWR_GPIO_Pin); GPIO_SetBits(WIFI_LED_GPIO,WIFI_LED_GPIO_Pin); } void PWR_Detect_Handle(u8 delay_val) { u8 val; static u8 vbus_detect_last = !VBUS_VALID_LEVEL; if (g_IsSystemOn == 0) { val = !!GPIO_ReadInputDataBit(VBUS_DETECT, VBUS_DETECT_GPIO_Pin); if (val == VBUS_VALID_LEVEL) { if (vbus_detect_last != VBUS_VALID_LEVEL) { MDelay(delay_val); PWR_ON(); } } vbus_detect_last = val; } return; } void Pin_Det_Handle(void) { u8 val; #if 0 /* wlan wake detect handle */ if(!g_IsSystemOn) { if(g_Wifi_WakeUp == 1) { InitExitHaltMode(); PWR_ON(); g_Wifi_WakeUp = 0; } } if (g_IsSystemOn && g_Wifi_Reg_Det_Flag) { val = !!GPIO_ReadInputDataBit(REG_ON_DET_GPIO, REG_ON_DET_GPIO_Pin); if (val) { GPIO_SetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); //GPIO_SetBits(REG_ON_GPIO, REG_ON_GPIO_Pin); } else { // GPIO_ResetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); //GPIO_ResetBits(REG_ON_GPIO, REG_ON_GPIO_Pin); } } #endif #if 0 //WLEN DETECT val = !!GPIO_ReadInputDataBit(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin); if (val && (!g_IsDevWlanEn)) dev_wlan_enable(); else if ((!val) && g_IsDevWlanEn) dev_wlan_disable(); //PWR DETECT val = !!GPIO_ReadInputDataBit(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); if (val && (!g_IsDevPwrOn)) dev_pwr_on(); else if ((!val) && g_IsDevPwrOn) dev_pwr_off(); #endif // DEV WAK HOST DETECT if(!g_IsSystemOn) { val = !!GPIO_ReadInputDataBit(D2H_WAK_GPIO, D2H_WAK_GPIO_Pin); if(val) { kfifo_init(&recvfifo); g_debounce_cnt++; if(GPIO_DEBOUNCE < g_debounce_cnt) { PWR_ON(); MDelay(2); host_set_wkup_reason(g_wkup_reason); InitExitHaltMode(); GPIO_SetBits(VBAT_DETECT, VBAT_DETECT_GPIO_Pin); } } else { g_Wifi_WakeUp = 0; g_debounce_cnt = 0; } } else { val = !!GPIO_ReadInputDataBit(D2H_WAK_GPIO, D2H_WAK_GPIO_Pin); if(val) { if(!g_Iswkupmsgsend) { dev_wkup_host(); g_Iswkupmsgsend = 1; } } else { g_Wifi_WakeUp = 0; g_Iswkupmsgsend = 0; } } } void Board_Init(void) { g_IsSystemOn = 0; g_Key_Handle_Flag = 0; USART_Receive_Timeout = 0; USART_Receive_Flag = 0; GPIO_Init(KEY1_GPIO, KEY1_GPIO_Pin, GPIO_Mode_In_FL_IT); GPIO_Init(ADC1_GPIO, ADC1_GPIO_Pin, GPIO_Mode_Out_OD_HiZ_Slow); GPIO_Init(LOW_VOL_CHECK_GPIO, LOW_VOL_CHECK_GPIO_Pin, GPIO_Mode_In_FL_IT); GPIO_Init(WIFI_LED_GPIO, WIFI_LED_GPIO_Pin, GPIO_Mode_Out_PP_High_Fast); GPIO_Init(PWR_GPIO, PWR_GPIO_Pin, GPIO_Mode_Out_PP_Low_Fast); GPIO_Init(WL_EN_GPIO, WL_EN_GPIO_Pin, GPIO_Mode_Out_PP_Low_Fast); GPIO_Init(DEV_PWR_GPIO, DEV_PWR_GPIO_Pin, GPIO_Mode_Out_PP_Low_Fast); GPIO_Init(REG_ON_DET_GPIO, REG_ON_DET_GPIO_Pin, GPIO_Mode_In_PU_No_IT); #ifdef PIR_SUPPORT GPIO_Init(PIR_GPIO, PIR_GPIO_Pin, GPIO_Mode_In_FL_No_IT); #endif GPIO_Init(MCU_GPIO1_GPIO, MCU_GPIO1_GPIO_Pin, GPIO_Mode_Out_PP_Low_Fast); GPIO_Init(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin, GPIO_Mode_Out_PP_Low_Fast); //将WIFI开机管脚设为中断模式 GPIO_Init(WL_WAK_GPIO,WL_WAK_GPIO_Pin,GPIO_Mode_In_FL_IT); //然后配置中断1为上升沿低电平触发 EXTI_SetPinSensitivity(EXTI_Pin_1, EXTI_Trigger_Rising); //设置中断的优先级 ITC_SetSoftwarePriority(EXTI1_IRQn, ITC_PriorityLevel_1); CLK_Config(); } //test RTC void Param_test_Init(void) { g_Wifi_WakeUp = 0; // test enter halt mode after 1min use rtc wake up STM8 #if ENABLE_RTC g_Alarm_Event.flag = 0x03; g_Alarm_Event.hours = 0; g_Alarm_Event.minutes = 1; #endif } void PullWifiRegon(void) { GPIO_ResetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); MDelay(10); GPIO_SetBits(WL_EN_GPIO, WL_EN_GPIO_Pin); } void init_func(void) { TIM3_Config(); Usart_Config(); } /*************************************************************** LED_Delay 控制LED灯 闪烁间隔,850 -------- 1S ****************************************************************/ void LED_Delay(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, uint32_t time) { if(time <= 0) time = 425; GPIO_SetBits(GPIOx,GPIO_Pin); MDelay(time); GPIO_ResetBits(GPIOx,GPIO_Pin); MDelay(time); } /*************************************************************** Pir_Check 热感红外检测。检测PC4口是否为高电平 ****************************************************************/ void Pir_Check(void) { static u8 g_pir_state = 0; if(g_pir_state != g_Pir_Wakeup){ g_pir_state = g_Pir_Wakeup; if(g_pir_state){ if(g_IsSystemOn == 0) PWR_ON(); }else { if(g_IsSystemOn == 1) PWR_OFF(); } } } /*************************************************************** Key_Handle 按键处理 ****************************************************************/ void Key_Handle(void) { static u8 power_on_off = 0; if (g_Key_Handle_Flag) { if (power_on_off == 0) { PWR_ON(); power_on_off = 1; } else { #if 1 u32 val = 0; u32 timeout = 0; USART_Send_Buf[UF_START] = 0x7B; USART_Send_Buf[UF_LEN] = 0x4; USART_Send_Buf[UF_CMD] = 0x0; USART_Send_Buf[USART_Send_Buf[UF_LEN] - 1] = XOR_Inverted_Check(USART_Send_Buf, USART_Send_Buf[UF_LEN] - 1); USART_Send_Data(USART_Send_Buf, USART_Send_Buf[UF_LEN]); MDelay(300); while(timeout++ < 2400) { //Uart_Handle(); //MDelay(1); //if(g_IsSystemOn == 0) { // power_on_off = 0; // break; //} // val = GPIO_ReadInputDataBit(MCU_GPIO2_GPIO, MCU_GPIO2_GPIO_Pin); //if(val != 0x0) { // break; //} val = GPIO_ReadInputDataBit(REG_ON_DET_GPIO, REG_ON_DET_GPIO_Pin); if(val != 0x0) { break; } } #endif PWR_OFF(); power_on_off = 0; } g_Key_Handle_Flag = 0; } } void main(void) { GPIO_init(); Board_Init(); PWR_ON(); init_func(); PullWifiRegon(); enableInterrupts(); kfifo_init(&recvfifo); while(1) { //LED_Delay(WIFI_LED_GPIO,WIFI_LED_GPIO_Pin,0); //Key_Handle(); Pin_Det_Handle(); #ifdef PIR_SUPPORT Pir_Check(); #endif Uart_Handle(); Change_Mode(); MDelay(1); } } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/api/hi_mmz_api.h #ifndef __HI_MMZ_API_H #define __HI_MMZ_API_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> #include <linux/kernel.h> #include "hi_type.h" #include "osal_mmz.h" #include "hi_osal_user.h" #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* __cplusplus */ #define HI_MMZ_New HI_MMB_New #define HI_MMZ_Map HI_MMB_Map #define HI_MMZ_Unmap HI_MMB_Unmap #define HI_MMZ_Delete HI_MMB_Delete #define HI_MMZ_Flush HI_MMB_Flush static HI_S32 g_s32fd = 0; #define CHECK_INIT() do{ if( g_s32fd <=0) g_s32fd =open("/dev/mmz_userdev", O_RDWR); \ if( g_s32fd <=0) return HI_FAILURE; \ }while(0); #define CHECK_INIT2() do{ if( g_s32fd <=0) g_s32fd =open("/dev/mmz_userdev", O_RDWR); \ if( g_s32fd <=0) return NULL; \ }while(0); static HI_S32 s_s32MemDev = -1; #define MEM_DEV_OPEN \ do \ {\ if (s_s32MemDev <= 0)\ {\ s_s32MemDev = open("/dev/mem", O_RDWR|O_SYNC);\ if (s_s32MemDev < 0)\ {\ perror("Open dev/mem error");\ return NULL;\ }\ }\ }while(0)\ static inline HI_VOID *HI_MMB_New(HI_U32 size , HI_U32 align, HI_CHAR *mmz_name, HI_CHAR *mmb_name ) { struct mmb_info mmi = {0}; CHECK_INIT2(); if( (size ==0) || (size > 0x40000000)) { return NULL; } mmi.size = size; mmi.align = align; if( (mmb_name!= NULL) && (strlen(mmb_name) < (HIL_MMB_NAME_LEN-1))) { strncpy(mmi.mmb_name, mmb_name, HIL_MMB_NAME_LEN - 1); } if( (mmz_name != NULL) && (strlen(mmz_name) < (HIL_MMB_NAME_LEN-1))) { strncpy(mmi.mmz_name, mmz_name, HIL_MMB_NAME_LEN - 1); } if(ioctl(g_s32fd, IOC_MMB_ALLOC, &mmi) !=0) { return NULL; } else { return (HI_VOID *)mmi.phys_addr; } } static inline HI_VOID *HI_MMB_Map(HI_U32 phys_addr, HI_U32 cached) { struct mmb_info mmi = {0}; HI_S32 ret; CHECK_INIT2(); if(cached != 0 && cached != 1) return NULL; mmi.prot = PROT_READ | PROT_WRITE; mmi.flags = MAP_SHARED; mmi.phys_addr = phys_addr; if (cached) ret = ioctl(g_s32fd, IOC_MMB_USER_REMAP_CACHED, &mmi); else ret = ioctl(g_s32fd, IOC_MMB_USER_REMAP, &mmi); if( ret !=0 ) return NULL; return (HI_VOID *)mmi.mapped; } static inline HI_S32 HI_MMB_Unmap(HI_U32 phys_addr) { struct mmb_info mmi = {0}; CHECK_INIT(); mmi.phys_addr = phys_addr; return ioctl(g_s32fd, IOC_MMB_USER_UNMAP, &mmi); } static inline HI_S32 HI_MMB_Delete(HI_U32 phys_addr) { struct mmb_info mmi = {0}; CHECK_INIT(); mmi.phys_addr = phys_addr; return ioctl(g_s32fd, IOC_MMB_FREE, &mmi); } static inline HI_S32 HI_MMB_Flush() { return ioctl(g_s32fd, IOC_MMB_FLUSH_DCACHE, NULL); } static inline HI_VOID * HI_SYS_Mmap(HI_U32 u32PhyAddr, HI_U32 u32Size) { HI_U32 u32Diff; HI_U32 u32PagePhy; HI_U32 u32PageSize; HI_U8 * pPageAddr; MEM_DEV_OPEN; /********************************************************** u32PageSize will be 0 when u32size is 0 and u32Diff is 0, and then mmap will be error (error: Invalid argument) ***********************************************************/ if (!u32Size) { printf("Func: %s u32Size can't be 0.\n", __FUNCTION__); return NULL; } /* The mmap address should align with page */ u32PagePhy = u32PhyAddr & 0xfffff000; u32Diff = u32PhyAddr - u32PagePhy; /* The mmap size shuld be mutliples of 1024 */ u32PageSize = ((u32Size + u32Diff - 1) & 0xfffff000) + 0x1000; pPageAddr = mmap ((void *)0, u32PageSize, PROT_READ|PROT_WRITE, MAP_SHARED, s_s32MemDev, u32PagePhy); if (MAP_FAILED == pPageAddr ) { perror("mmap error"); return NULL; } return (HI_VOID *) (pPageAddr + u32Diff); } static inline HI_S32 HI_SYS_Munmap(HI_VOID* pVirAddr, HI_U32 u32Size) { HI_U32 u32PageAddr; HI_U32 u32PageSize; HI_U32 u32Diff; u32PageAddr = (((HI_U32)pVirAddr) & 0xfffff000); u32Diff = (HI_U32)pVirAddr - u32PageAddr; u32PageSize = ((u32Size + u32Diff - 1) & 0xfffff000) + 0x1000; return munmap((HI_VOID*)u32PageAddr, u32PageSize); } #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ #endif /*__HI_MMZ_API_H*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/drv_cipher_log.h /****************************************************************************** Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : cipher_log.h Version : Initial Draft Author : Hisilicon multimedia software group Created : 2011/05/28 Description : History : 1.Date : 2011/05/28 Author : j00169368 Modification: Created file ******************************************************************************/ #ifndef __CIPHER_LOG_H__ #define __CIPHER_LOG_H__ #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ #define HI_PRINT osal_printk #define HI_LOG_LEVEL 3 #define HI_FATAL_CIPHER(fmt...) \ do{\ if (HI_LOG_LEVEL <= 4)\ {\ HI_PRINT("CIPHER FATAL:");\ HI_PRINT(fmt);\ }\ }while(0) #define HI_ERR_CIPHER(fmt...) \ do{\ if (HI_LOG_LEVEL <= 3)\ {\ HI_PRINT("%s() ERROR:", __FUNCTION__);\ HI_PRINT(fmt);\ }\ }while(0) #define HI_WARN_CIPHER(fmt...) \ do{\ if (HI_LOG_LEVEL <= 2)\ {\ HI_PRINT("CIPHER WARNING:");\ HI_PRINT(fmt);\ }\ }while(0) #define HI_INFO_CIPHER(fmt...) \ do{\ if (HI_LOG_LEVEL <= 1)\ {\ HI_PRINT("CIPHER INFO:");\ HI_PRINT(fmt);\ }\ }while(0) #define HI_DEBUG_CIPHER(fmt...) \ do{\ if (HI_LOG_LEVEL <= 0)\ {\ HI_PRINT("CIPHER DEBUG:");\ HI_PRINT(fmt);\ }\ }while(0) /* Using samples: HI_ASSERT(x>y); */ #define HI_ASSERT(expr) \ do{ \ if (HI_LOG_LEVEL <= 0)\ {\ if (!(expr)) { \ HI_PRINT("\nASSERT failed at:\n"\ " >File name: %s\n" \ " >Function : %s\n" \ " >Line No. : %d\n" \ " >Condition: %s\n", \ __FILE__,__FUNCTION__, __LINE__, #expr);\ /*_exit(-1);*/\ } \ }\ else\ {\ /* do nothing*/\ }\ }while(0) #define HI_PRINT_HEX(name, str, len) \ {\ HI_U32 _i = 0;\ HI_PRINT("[%s]:\n", name);\ for ( _i = 0 ; _i < (len); _i++ )\ {\ if( (_i % 16 == 0) && (_i != 0)) HI_PRINT("\n");\ HI_PRINT("0x%02x ", *((str)+_i));\ }\ HI_PRINT("\n");\ } #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/rtc.c #include "boardconfig.h" u8 g_RTC_Alarm_Flag = 0; RTC_Alarm_Event_T g_Alarm_Event = {0}; void RTC_Init_Handle(void) { RTC_InitTypeDef RTC_InitStruct; RTC_TimeTypeDef RTC_TimeStruct; RTC_DateTypeDef RTC_DateStruct; g_RTC_Alarm_Flag = 0; CLK_RTCClockConfig(CLK_RTCCLKSource_LSI, CLK_RTCCLKDiv_1); CLK_PeripheralClockConfig(CLK_Peripheral_RTC, ENABLE); RTC_DeInit(); RTC_StructInit(&RTC_InitStruct); RTC_InitStruct.RTC_AsynchPrediv = 124; RTC_InitStruct.RTC_SynchPrediv = 303; RTC_Init(&RTC_InitStruct); RTC_TimeStructInit(&RTC_TimeStruct); RTC_DateStructInit(&RTC_DateStruct); RTC_SetTime(RTC_Format_BIN, &RTC_TimeStruct); RTC_SetDate(RTC_Format_BIN, &RTC_DateStruct); RTC_WaitForSynchro(); RTC_GetTime(RTC_Format_BIN, &RTC_TimeStruct); RTC_GetDate(RTC_Format_BIN, &RTC_DateStruct); RTC_AlarmCmd(DISABLE); } int RTC_Alarm_Duration_Check(u8 hours, u8 minutes) { int ret; if ((minutes >= 60) || (hours >= 24)) { ret = -1; goto end; } end: return ret; } int RTC_Alarm_Evetn_Set(RTC_Alarm_Event_T *alarm_event) { int ret; RTC_TimeTypeDef rtc_time; if ((alarm_event->minutes >= 60) || (alarm_event->hours >= 24)) { ret = -1; goto end; } if (alarm_event->flag & 0x1) { if (!(alarm_event->flag & 0x2)) { alarm_event->flag = 0; } RTC_WaitForSynchro(); RTC_GetTime(RTC_Format_BIN, &rtc_time); alarm_event->rtc_alarm.RTC_AlarmMask = RTC_AlarmMask_DateWeekDay; alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Seconds = rtc_time.RTC_Seconds; alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Minutes = rtc_time.RTC_Minutes + alarm_event->minutes; alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Hours = rtc_time.RTC_Hours + alarm_event->hours; if (alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Minutes >= 60) { alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Minutes -= 60; alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Hours++; } if (alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Hours >= 24) { alarm_event->rtc_alarm.RTC_AlarmTime.RTC_Hours -= 24; } RTC_AlarmCmd(DISABLE); RTC_SetAlarm(RTC_Format_BIN, &alarm_event->rtc_alarm); g_RTC_Alarm_Flag = 0; RTC_ClearITPendingBit(RTC_IT_ALRA); RTC_ITConfig(RTC_IT_ALRA, ENABLE); RTC_AlarmCmd(ENABLE); ret = 0; goto end; } else { RTC_AlarmCmd(DISABLE); RTC_ClearITPendingBit(RTC_IT_ALRA); RTC_ITConfig(RTC_IT_ALRA, DISABLE); ret = 0; goto end; } end: return ret; } void RTC_Handle(void) { if (g_RTC_Alarm_Flag) { if (g_IsSystemOn == 0) { InitExitHaltMode(); PWR_ON(); } g_RTC_Alarm_Flag = 0; } } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/adc.c #include "boardconfig.h" #if 0 void ADC_Init(void) { ADC_ConversionMode_TypeDef adc_conversionmode = ADC_ConversionMode_Single; ADC_Resolution_TypeDef adc_resolution = ADC_Resolution_12Bit; ADC_Prescaler_TypeDef adc_prescaler = ADC_Prescaler_2; CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE); ADC_Cmd(ADC1, DISABLE); ADC_DMACmd(ADC1, DISABLE); ADC_Init(ADC1, adc_conversionmode, adc_resolution, adc_prescaler); ADC_ChannelCmd(ADC1, ADC_Channel_14, ENABLE); //test ADC_SamplingTimeConfig(ADC1, ADC_Group_FastChannels, ADC_SamplingTime_4Cycles); ADC_Cmd(ADC1, ENABLE); ADC_SoftwareStartConv(ADC1); } uint16_t ADC_GetVal(void) { uint16_t val = 0; while (ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET); val = ADC_GetConversionValue(ADC1); return val; } #endif void ADC_Init_Handle() { uint16_t val = 0; ADC_ConversionMode_TypeDef adc_conversionmode = ADC_ConversionMode_Single; ADC_Resolution_TypeDef adc_resolution = ADC_Resolution_12Bit; ADC_Prescaler_TypeDef adc_prescaler = ADC_Prescaler_2; CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE); ADC_Cmd(ADC1, DISABLE); ADC_DMACmd(ADC1, DISABLE); ADC_Init(ADC1, adc_conversionmode, adc_resolution, adc_prescaler); ADC_ChannelCmd(ADC1, ADC_Channel_24, ENABLE); ADC_SamplingTimeConfig(ADC1, ADC_Group_FastChannels, ADC_SamplingTime_4Cycles); ADC_Cmd(ADC1, ENABLE); ADC_SoftwareStartConv(ADC1); while (ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET); USART_Send_Buf[0] = 0x7b; val = ADC_GetConversionValue(ADC1); ADC_Cmd(ADC1, DISABLE); USART_Send_Buf[0] = 0x7b; USART_Send_Buf[1] = 4; USART_Send_Buf[2] = val >> 8; USART_Send_Buf[3] = val & 0xff; USART_Send_Data(USART_Send_Buf, 4); } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/Makefile #LITEOSTOPDIR ?= .. SAMPLE_OUT = . TARGET = sample include $(LITEOSTOPDIR)/config.mk RM = -rm -rf SAMPLE_INCLUDE := -I $(COMPLIE_ROOT)/drv/$(DEVICE_TYPE)/ \ -I $(COMPLIE_ROOT)/drv/$(DEVICE_TYPE)/driver/include/common/hisi_wifi_api \ -I $(COMPLIE_ROOT)/drv/$(DEVICE_TYPE)/hisi_app/include/hilink \ -I $(COMPLIE_ROOT)/drv/$(DEVICE_TYPE)/hisi_app/include/hisilink \ -I $(COMPLIE_ROOT)/tools/wpa_supplicant-2.2/include \ -I $(COMPLIE_ROOT)/tools/wpa_supplicant-2.2/include/src LITEOS_CFLAGS += -DCONFIG_DRIVER_HI1131 LITEOS_CFLAGS += -D_PRE_WLAN_FEATURE_DATA_BACKUP LITEOS_CFLAGS += -DCONFIG_NO_CONFIG_WRITE LITEOS_CFLAGS += -D_PRE_WLAN_PM_FEATURE_MCU LITEOS_CFLAGS +=-D_HI113X_SW_DEBUG=1 LITEOS_CFLAGS +=-D_HI113X_SW_RELEASE=2 ifeq ($(V_DEBUG), y) LITEOS_CFLAGS +=-D_HI113X_SW_VERSION=_HI113X_SW_DEBUG else ifeq ($(V_RELEASE), y) LITEOS_CFLAGS +=-D_HI113X_SW_VERSION=_HI113X_SW_RELEASE else LITEOS_CFLAGS +=-D_HI113X_SW_VERSION=_HI113X_SW_RELEASE endif endif ifeq ($(HISI_WIFI_PLATFORM_HI3518EV200), y) LITEOS_CFLAGS += -DHISI_WIFI_PLATFORM_HI3518EV200 endif LITEOS_LIBS += -lwpa -lhi1131wifi -lhilink_adapt -lhilinksmartlink -lhisidata_backup -lhisilink -liperf LITEOS_LDFLAGS += -L$(ROOTOUT)/lib LITEOS_CFLAGS += $(SAMPLE_INCLUDE) LITEOS_LIBDEP := --start-group $(LITEOS_LIBS) --end-group SRCS = $(wildcard mcu_uart/*.c hi1131_wifi/hisi_app_demo/*.c) SRCS += $(wildcard *_$(LITEOS_PLATFORM).c) OBJS = $(patsubst %.c,$(SAMPLE_OUT)/%.o,$(SRCS)) all: $(TARGET) clean: @$(RM) *.o sample *.bin *.map *.asm @$(RM) $(SAMPLE_OUT)/hi1131_wifi/hisi_app_demo/*.o @$(RM) $(SAMPLE_OUT)/mcu_uart/*.o $(TARGET): $(OBJS) $(LD) $(LITEOS_LDFLAGS) --gc-sections -Map=$(SAMPLE_OUT)/sample.map -o $(SAMPLE_OUT)/sample $(OBJS) $(LITEOS_LIBDEP) $(OBJCOPY) -O binary $(SAMPLE_OUT)/sample $(SAMPLE_OUT)/sample.bin $(OBJDUMP) -d $(SAMPLE_OUT)/sample >$(SAMPLE_OUT)/sample.asm $(OBJS): $(SAMPLE_OUT)/%.o : %.c $(CC) $(LITEOS_CFLAGS) -c $< -o $@ .PHONY: all clean <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/hash/drv_hash_intf.c /********************************************************************************* * * Copyright (C) 2014 Hisilicon Technologies Co., Ltd. All rights reserved. * * This program is confidential and proprietary to Hisilicon Technologies Co., Ltd. * (Hisilicon), and may not be copied, reproduced, modified, disclosed to * others, published or used, in whole or in part, without the express prior * written permission of Hisilicon. * ***********************************************************************************/ #include "hi_osal.h" #include "hi_type.h" #include "hi_drv_cipher.h" #include "drv_hash.h" #include "hi_type.h" #include "drv_cipher_define.h" #include "drv_cipher_ioctl.h" #include "hal_cipher.h" #include "drv_cipher.h" #include "config.h" #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif #ifdef CIPHER_HASH_SUPPORT /* Set the defualt timeout value for hash calculating (5000 ms)*/ #define HASH_MAX_DURATION (5000) #define HASH_PADDING_LEGNTH 8 #define HASH_MMZ_BUF_LEN (1*1024*1024) //1M osal_mutex_t g_HashMutexKernel; typedef enum { HASH_READY, REC_READY, DMA_READY, }HASH_WAIT_TYPE; HI_S32 HAL_Cipher_HashSoftReset(HI_VOID) { HI_U32 CipherCrgValue; HI_U32 pvirt; if (REG_CRG_CLK_PHY_ADDR_SHA == 0x00) { return HI_SUCCESS; } pvirt = (HI_U32)osal_ioremap_nocache(REG_CRG_CLK_PHY_ADDR_SHA, 0x100); HAL_CIPHER_ReadReg(pvirt, &CipherCrgValue); HAL_SET_BIT(CipherCrgValue, CRG_RST_BIT_SHA); /* reset */ HAL_SET_BIT(CipherCrgValue, CRG_CLK_BIT_SHA); /* set the bit 3, clock opened */ HAL_CIPHER_WriteReg(pvirt,CipherCrgValue); /* clock select and cancel reset 0x30100*/ HAL_CLEAR_BIT(CipherCrgValue, CRG_RST_BIT_SHA); /* cancel reset */ HAL_SET_BIT(CipherCrgValue, CRG_CLK_BIT_SHA); /* set the bit 1, clock opened */ HAL_CIPHER_WriteReg(pvirt,CipherCrgValue); osal_iounmap((void*)pvirt); return HI_SUCCESS; } inline HI_S32 HASH_WaitReady(HASH_WAIT_TYPE enType, HI_BOOL bFast) { CIPHER_SHA_STATUS_U unCipherSHAstatus; HI_U32 u32TimeOut = 0; HI_SIZE_T ulStartTime = 0; HI_SIZE_T ulLastTime = 0; HI_SIZE_T ulDuraTime = 0; /* wait for hash_rdy */ while(1) { unCipherSHAstatus.u32 = 0; (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_STATUS_ADDR, &unCipherSHAstatus.u32); // HI_PRINT("unCipherSHAstatus 0x%x\n", unCipherSHAstatus.u32); if(HASH_READY == enType) { if(1 == unCipherSHAstatus.bits.hash_rdy) { break; } } else if (REC_READY == enType) { if(1 == unCipherSHAstatus.bits.rec_rdy) { break; } } else if (DMA_READY == enType) { if(1 == unCipherSHAstatus.bits.dma_rdy) { break; } } else { HI_ERR_CIPHER("Error! Invalid wait type!\n"); return HI_FAILURE; } if (bFast) { u32TimeOut++; if (u32TimeOut >= 0x100000) { HI_ERR_CIPHER("Error! Hash time out (0x%x)!\n", u32TimeOut); return HI_FAILURE; } //No OP instruction //__asm__ __volatile__("": : :"memory"); } else { if(ulStartTime == 0) { ulStartTime = osal_get_tickcount(); } ulLastTime = osal_get_tickcount(); ulDuraTime = ulLastTime - ulStartTime; osal_msleep(1); if (ulDuraTime >= HASH_MAX_DURATION ) { HI_ERR_CIPHER("Error! Hash time out!\n"); return HI_FAILURE; } } } return HI_SUCCESS; } #ifdef CIPHER_MHASH_SUPPORT static HI_U32 HAL_Hash_Small2Large(HI_U32 u32SamllVal) { HI_U32 u32LargeVal = 0; u32LargeVal = (u32SamllVal >> 24) & 0xFF; u32LargeVal |= ((u32SamllVal >> 16) & 0xFF) << 8; u32LargeVal |= ((u32SamllVal >> 8) & 0xFF) << 16; u32LargeVal |= ((u32SamllVal) & 0xFF) << 24; return u32LargeVal; } #endif HI_S32 HAL_Cipher_CalcHashInit(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; CIPHER_SHA_CTRL_U unCipherSHACtrl; CIPHER_SHA_START_U unCipherSHAStart; #ifdef CIPHER_MHASH_SUPPORT HI_U32 i; HI_U32 u32RegAddr; HI_U32 u32ShaVal; #endif if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error! Null pointer input!\n"); return HI_FAILURE; } /* wait for hash_rdy */ ret = HASH_WaitReady(HASH_READY, HI_FALSE); if(HI_SUCCESS != ret) { return HI_FAILURE; } #if 0 /* set hmac-sha key */ if( ((HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pCipherHashData->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pCipherHashData->enShaType)) && (HI_CIPHER_HMAC_KEY_FROM_CPU == pCipherHashData->enHMACKeyFrom) ) { for( i = 0; i < CIPHER_HMAC_KEY_LEN; i = i + 4) { u32WriteData = (pCipherHashData->pu8HMACKey[3+i] << 24) | (pCipherHashData->pu8HMACKey[2+i] << 16) | (pCipherHashData->pu8HMACKey[1+i] << 8) | (pCipherHashData->pu8HMACKey[0+i]); (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_MCU_KEY0 + i, u32WriteData); } } #endif /* write total len low and high */ #ifdef CIPHER_MHASH_SUPPORT (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_TOTALLEN_LOW_ADDR, pCipherHashData->u32DataLen); #else (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_TOTALLEN_LOW_ADDR, 0xFFFFFFFF); #endif (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_TOTALLEN_HIGH_ADDR, 0); /* config sha_ctrl : read by dma first, and by cpu in the hash final function */ unCipherSHACtrl.u32 = 0; (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_CTRL_ADDR, &unCipherSHACtrl.u32); unCipherSHACtrl.bits.read_ctrl = 0; if( HI_UNF_CIPHER_HASH_TYPE_SHA1 == pCipherHashData->enShaType ) { unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x0; } else if( HI_UNF_CIPHER_HASH_TYPE_SHA256 == pCipherHashData->enShaType ) { unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x1; } else if( HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pCipherHashData->enShaType ) { /* unCipherSHACtrl.bits.hardkey_hmac_flag = 1; */ unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x0; /* unCipherSHACtrl.bits.hardkey_sel = pCipherHashData->enHMACKeyFrom; */ } else if( HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pCipherHashData->enShaType ) { unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x1; /* unCipherSHACtrl.bits.hardkey_sel = pCipherHashData->enHMACKeyFrom; */ } else { HI_ERR_CIPHER("Invalid hash type input!\n"); return HI_FAILURE; } unCipherSHACtrl.bits.small_end_en = 1; #ifdef CIPHER_MHASH_SUPPORT unCipherSHACtrl.bits.sha_init_update_en = 1; u32RegAddr = CIPHER_HASH_REG_INIT1_UPDATE; for(i=0; i<8; i++) { u32ShaVal = HAL_Hash_Small2Large(pCipherHashData->u32ShaVal[i]); (HI_VOID)HAL_CIPHER_WriteReg(u32RegAddr+i*4, u32ShaVal); // HI_PRINT ("IV[%d] 0x%x\n", i, u32ShaVal); } #endif (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_CTRL_ADDR, unCipherSHACtrl.u32); /* config sha_start */ unCipherSHAStart.u32 = 0; unCipherSHAStart.bits.sha_start = 1; (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_START_ADDR, unCipherSHAStart.u32); return HI_SUCCESS; } HI_S32 HAL_Cipher_CalcHashUpdate(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } if ((pCipherHashData->u32DataLen > HASH_MMZ_BUF_LEN) || (pCipherHashData->enShaType >= HI_UNF_CIPHER_HASH_TYPE_BUTT)) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } ret= HASH_WaitReady(REC_READY, HI_FALSE); if(HI_SUCCESS != ret) { return HI_FAILURE; } (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_DMA_START_ADDR, pCipherHashData->u32DataPhy); (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_DMA_LEN, pCipherHashData->u32DataLen); ret = HASH_WaitReady(REC_READY, HI_FALSE); if(HI_SUCCESS != ret) { return HI_FAILURE; } return HI_SUCCESS; } HI_S32 HAL_Cipher_CalcHashFinal(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; CIPHER_SHA_STATUS_U unCipherSHAStatus; HI_U32 u32RegAddr; HI_U32 i = 0; if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } /* wait for rec_ready instead of hash_ready */ ret= HASH_WaitReady(REC_READY, HI_FALSE); if(HI_SUCCESS != ret) { return HI_FAILURE; } /* read digest */ unCipherSHAStatus.u32 = 0; (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_STATUS_ADDR, &unCipherSHAStatus.u32); u32RegAddr = CIPHER_HASH_REG_SHA_OUT1; if( (0x00 == unCipherSHAStatus.bits.error_state) && (0x00 == unCipherSHAStatus.bits.len_err)) { if( (HI_UNF_CIPHER_HASH_TYPE_SHA1 == pCipherHashData->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pCipherHashData->enShaType)) { for(i = 0; i < 5; i++) { (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr+i*4, &pCipherHashData->u32ShaVal[i]); } } else if( (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pCipherHashData->enShaType ) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pCipherHashData->enShaType)) { for(i = 0; i < 8; i++) { (HI_VOID)HAL_CIPHER_ReadReg(u32RegAddr+i*4, &pCipherHashData->u32ShaVal[i]); } } else { HI_ERR_CIPHER("Invalid hash type : %d!\n", pCipherHashData->enShaType); return HI_FAILURE; } } else { HI_ERR_CIPHER("Error! SHA Status Reg: error_state = %d!\n", unCipherSHAStatus.bits.error_state); HAL_Cipher_HashSoftReset(); return HI_FAILURE; } return HI_SUCCESS; } HI_S32 Cipher_CalcHashInit(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; #ifndef CIPHER_MHASH_SUPPORT ret = HAL_Cipher_CalcHashInit(pCipherHashData); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("Cipher hash init failed!\n"); return HI_FAILURE; } #endif return ret; } static HI_S32 Cipher_CalcHashUpdate(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } #ifdef CIPHER_MHASH_SUPPORT ret = HAL_Cipher_CalcHashInit(pCipherHashData); if(HI_SUCCESS != ret) { HI_ERR_CIPHER("HAL_Hash_Init failed! ret = 0x%08x\n", ret); return HI_FAILURE; } ret = HAL_Cipher_CalcHashUpdate(pCipherHashData); if(HI_SUCCESS != ret) { HI_ERR_CIPHER("HAL_Hash_Update failed! ret = 0x%08x\n", ret); return HI_FAILURE; } ret = HAL_Cipher_CalcHashFinal(pCipherHashData); if(HI_SUCCESS != ret) { HI_ERR_CIPHER("HAL_Hash_Final failed! ret = 0x%08x\n", ret); return HI_FAILURE; } #else ret = HAL_Cipher_CalcHashUpdate(pCipherHashData); if(HI_FAILURE == ret) { HI_ERR_CIPHER("Cipher hash update failed!\n"); return HI_FAILURE; } #endif return HI_SUCCESS; } HI_S32 Cipher_CalcHashFinal(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } ret = Cipher_CalcHashUpdate(pCipherHashData); if(HI_FAILURE == ret) { HI_ERR_CIPHER("Cipher hash final failed!\n"); return HI_FAILURE; } #ifndef CIPHER_MHASH_SUPPORT ret = HAL_Cipher_CalcHashFinal(pCipherHashData); if(HI_FAILURE == ret) { HI_ERR_CIPHER("Cipher hash final failed!\n"); return HI_FAILURE; } #endif return ret; } HI_S32 HI_DRV_CIPHER_CalcHashInit(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } if(osal_mutex_lock_interruptible(&g_HashMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } ret = Cipher_CalcHashInit(pCipherHashData); osal_mutex_unlock(&g_HashMutexKernel); return ret; } HI_S32 HI_DRV_CIPHER_CalcHashUpdate(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 s32Ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_HashMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } s32Ret = Cipher_CalcHashUpdate(pCipherHashData); osal_mutex_unlock(&g_HashMutexKernel); return s32Ret; } HI_S32 HI_DRV_CIPHER_CalcHashFinal(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 s32Ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_HashMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } s32Ret = Cipher_CalcHashFinal(pCipherHashData); osal_mutex_unlock(&g_HashMutexKernel); return s32Ret; } HI_S32 Cipher_CalcHash(CIPHER_HASH_DATA_S *pCipherHashData) { HI_S32 ret = HI_SUCCESS; HI_U32 i; CIPHER_SHA_CTRL_U unCipherSHACtrl; CIPHER_SHA_START_U unCipherSHAStart; CIPHER_SHA_STATUS_U unCipherSHAStatus; if( NULL == pCipherHashData ) { HI_ERR_CIPHER("Error, Null pointer input!\n"); return HI_FAILURE; } if( ((pCipherHashData->u32DataLen % 64) != 0) || (pCipherHashData->u32DataLen == 0)) { HI_ERR_CIPHER("Error, Invalid input data len 0x%x!\n", pCipherHashData->u32DataLen); return HI_FAILURE; } /* wait for hash_rdy */ ret = HASH_WaitReady(HASH_READY, HI_TRUE); if(HI_SUCCESS != ret) { HI_ERR_CIPHER("Hash wait ready failed!\n"); (HI_VOID)HAL_Cipher_HashSoftReset(); return HI_FAILURE; } /* write total len low and high */ (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_TOTALLEN_LOW_ADDR, pCipherHashData->u32DataLen); (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_TOTALLEN_HIGH_ADDR, 0); /* config sha_ctrl : read by dma first, and by cpu in the hash final function */ unCipherSHACtrl.u32 = 0; (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_CTRL_ADDR, &unCipherSHACtrl.u32); unCipherSHACtrl.bits.read_ctrl = 0; if( HI_UNF_CIPHER_HASH_TYPE_SHA1 == pCipherHashData->enShaType ) { unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x0; } else if( HI_UNF_CIPHER_HASH_TYPE_SHA256 == pCipherHashData->enShaType ) { unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x1; } else if( HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pCipherHashData->enShaType ) { /* unCipherSHACtrl.bits.hardkey_hmac_flag = 1; */ unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x0; /* unCipherSHACtrl.bits.hardkey_sel = pCipherHashData->enHMACKeyFrom; */ } else if( HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pCipherHashData->enShaType ) { unCipherSHACtrl.bits.hardkey_hmac_flag = 0; unCipherSHACtrl.bits.sha_sel= 0x1; /* unCipherSHACtrl.bits.hardkey_sel = pCipherHashData->enHMACKeyFrom; */ } else { HI_ERR_CIPHER("Invalid hash type input!\n"); (HI_VOID)HAL_Cipher_HashSoftReset(); return HI_FAILURE; } unCipherSHACtrl.bits.small_end_en = 1; unCipherSHACtrl.bits.sha_init_update_en = 0; (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_CTRL_ADDR, unCipherSHACtrl.u32); /* config sha_start */ unCipherSHAStart.u32 = 0; unCipherSHAStart.bits.sha_start = 1; (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_START_ADDR, unCipherSHAStart.u32); /*Update*/ (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_DMA_START_ADDR, pCipherHashData->u32DataPhy); (HI_VOID)HAL_CIPHER_WriteReg(CIPHER_HASH_REG_DMA_LEN, pCipherHashData->u32DataLen); /* wait for hash_rdy */ ret = HASH_WaitReady(HASH_READY, HI_TRUE); if(HI_SUCCESS != ret) { HI_ERR_CIPHER("Hash wait ready failed!\n"); (HI_VOID)HAL_Cipher_HashSoftReset(); return HI_FAILURE; } /* read digest */ unCipherSHAStatus.u32 = 0; (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_STATUS_ADDR, &unCipherSHAStatus.u32); if( (0x00 == unCipherSHAStatus.bits.error_state) && (0x00 == unCipherSHAStatus.bits.len_err)) { if( (HI_UNF_CIPHER_HASH_TYPE_SHA1 == pCipherHashData->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pCipherHashData->enShaType)) { for(i = 0; i < 5; i++) { (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_SHA_OUT1+i*4, &pCipherHashData->u32ShaVal[i]); } } else if( (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pCipherHashData->enShaType ) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pCipherHashData->enShaType)) { for(i = 0; i < 8; i++) { (HI_VOID)HAL_CIPHER_ReadReg(CIPHER_HASH_REG_SHA_OUT1+i*4, &pCipherHashData->u32ShaVal[i]); } } } else { HI_ERR_CIPHER("Error! SHA Status Reg: error_state = %d!\n", unCipherSHAStatus.bits.error_state); HI_ERR_CIPHER("Error! SHA Status Reg: len_err = %d!\n", unCipherSHAStatus.bits.len_err); (HI_VOID)HAL_Cipher_HashSoftReset(); return HI_FAILURE; } return HI_SUCCESS; } HI_S32 HI_DRV_CIPHER_CalcHash(CIPHER_HASH_DATA_S *pCipherHashData) { return Cipher_CalcHash(pCipherHashData); } HI_VOID HASH_DRV_ModInit(HI_VOID) { osal_mutex_init(&g_HashMutexKernel); } HI_VOID HASH_DRV_ModDeInit(HI_VOID) { osal_mutex_destory(&g_HashMutexKernel); } #endif #ifdef __cplusplus #if __cplusplus } #endif #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/mcu_uart/hi_ext_hal_mcu.c #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <string.h> #include <pthread.h> #include <sys/prctl.h> #include "hisoc/uart.h" #include "hi_type.h" #include "hi_ext_hal_mcu.h" #include "asm/delay.h" #define CHECK_STATE_FLAG(flag, state)\ do{\ if(flag != state)\ {\ printf("func:%s,line:%d,flag statue fail\n",__FUNCTION__,__LINE__);\ return HI_FAILURE;\ }\ }while(0) #define CHECK_NULL_PTR(ptr)\ do{\ if(NULL == ptr)\ {\ printf("func:%s,line:%d,NULL pointer\n",__FUNCTION__,__LINE__);\ return HI_FAILURE;\ }\ }while(0) HI_BOOL g_bMcuHostInit = HI_FALSE; HI_BOOL g_bMcuHostState = HI_FALSE; HI_BOOL g_bMcuHostEnableState = HI_FALSE; static HI_BOOL s_bMcuHostRegister = HI_FALSE; static PFN_MCUHOST_NotifyProc s_pfnMcuHostNotifyProc = NULL; static HI_S32 g_stResponse = 0; static HI_S32 g_s32WIFIRegDetResponse = 0; pthread_mutex_t g_ResponseLock; pthread_mutex_t g_WIFIRegDetResponseLock; pthread_t g_tMcuHostDetect; static pthread_mutex_t s_tMcuHostMutex; HI_S32 mcu_fd; extern int uart2_fd; unsigned char power_handle_flag = 0; #define UF_START 0 #define UF_LEN 1 #define UF_CMD 2 #define UF_DATA 3 #define UF_MAX_LEN 50 #define UART2_BUF_LEN 100 static char uart2_buffer[UART2_BUF_LEN]; #if 0 void debug_dump(char* buffer, HI_U16 length, char* pDescription) { char stream[60]; char byteOffsetStr[10]; HI_U32 i; HI_U16 offset, count, byteOffset; printf("<-----------Dumping %d Bytes : %s -------->\n", length, pDescription); //A_PRINTF("%s:%d = \n", pDescription, length); count = 0; offset = 0; byteOffset = 0; for (i = 0; i < length; i++) { sprintf(stream + offset, "%2.2X ", buffer[i]); count ++; offset += 3; if (count == 16) { count = 0; offset = 0; sprintf(byteOffsetStr, "%4.4X", byteOffset); printf("[%s]: %s\n", byteOffsetStr, stream); memset(stream, 0, 60); byteOffset += 16; } } if (offset != 0) { sprintf(byteOffsetStr, "%4.4X", byteOffset); printf("[%s]: %s\n", byteOffsetStr, stream); } printf("<------------------------------------------------->\n"); } #else void debug_dump(char* buffer, HI_U16 length, char* pDescription) { } #endif unsigned char XOR_Inverted_Check(unsigned char* inBuf, unsigned char inLen) { unsigned char check = 0, i; for (i = 0; i < inLen; i++) { check ^= inBuf[i]; } return ~check; } int USART_Send_Data(HI_S32 fd, HI_U8* sbuf) { int ret, i; sbuf[UF_START] = 0x7B; sbuf[sbuf[UF_LEN] - 1] = XOR_Inverted_Check(sbuf, sbuf[UF_LEN] - 1); //防止mcu丢失host发过来的消息。300us为mcu处理一次接受usart消息中断的最长时间 for (i = 0; i < sbuf[UF_LEN]; i++){ ret = write(fd, &sbuf[i], 1); udelay(300); if (ret != 1) { printf("write %d fd return %d\n", fd, ret); return -1; } } printf("uart send ok!\n"); return 0; } static HI_S32 USART_Receive_Data(HI_S32 fd, HI_U8* rbuf, HI_U8 rbuf_max_len) { HI_S32 ret; HI_U8 len, i; HI_U32 timeout_cnt; HI_U8 bcc; //fd_set fs_read; struct timeval time; HI_S32 fs_sel; len = 0; timeout_cnt = 0; while (((len < 2) || (len < rbuf[UF_LEN]))) { ret = read(fd, rbuf + len, UF_MAX_LEN); if (ret < -1) { perror("receive error!"); printf("read ret = %d\n", ret); return (HI_FAILURE); } else if (ret == 0) { usleep(50000); } else { len += ret; } timeout_cnt++; if (timeout_cnt > 500) { // printf("receive timeout!\n"); return (HI_FAILURE); } } printf("receive buf:"); for (i = 0; i < len; i++) { printf(" %02X ", rbuf[i]); } printf("\n"); bcc = XOR_Inverted_Check(rbuf, rbuf[UF_LEN] - 1); if ((rbuf[UF_START] != 0X7B) || (rbuf[rbuf[UF_LEN] - 1] != bcc)) { printf("uart bcc err\n"); return -1; } return (HI_SUCCESS); } HI_S32 HI_HAL_MCUHOST_Set_ShutDown_Interval(HI_U32 u32Interval) { HI_U32 u32hour, u32min; uart2_buffer[UF_LEN] = 0x4 + 0x3; uart2_buffer[UF_CMD] = 0x86; if (u32Interval > 0) { uart2_buffer[UF_DATA] = 0x1; } else { uart2_buffer[UF_DATA] = 0x0; } u32hour = u32Interval / 60; u32min = u32Interval % 60; uart2_buffer[UF_DATA + 1] = u32hour; uart2_buffer[UF_DATA + 2] = u32min; USART_Send_Data(mcu_fd, uart2_buffer); while (1) { pthread_mutex_lock(&g_ResponseLock); if (-1 == g_stResponse) { return HI_FAILURE; } else if (1 == g_stResponse) { return HI_SUCCESS; } pthread_mutex_unlock(&g_ResponseLock); usleep(10000); } return HI_SUCCESS; } static void Uart_CMD_Handle(int fd, unsigned char* buf, unsigned char buf_max_len) { unsigned char check = 0; int ret; ret = USART_Receive_Data(fd, buf, buf_max_len); if (ret == HI_FAILURE) { //printf("mcu host get frame fail"); return; } //printf("\nUart_CMD_Handle buf[UF_CMD]: 0x%x\n", buf[UF_CMD]); switch (buf[UF_CMD]) { case 0x00: printf("poweroff!\n"); #if 0 system("himm 0x20220400 0x40"); system("himm 0x20220100 0x40"); #else //system("poweroff"); printf("\n#LPrint file: %s func: %s line: %d ticket: %d\n", __FILE__, __FUNCTION__, __LINE__, LOS_TickCountGet()); ret = s_pfnMcuHostNotifyProc(MCUHOST_SYSTEMCLOSE); if (ret == HI_FAILURE) { return; } #endif break; case 0x81: printf("receive poweroff response cmd!\n"); #if 0 system("himm 0x20220400 0x40"); system("himm 0x20220100 0x40"); #else power_handle_flag = 0; printf("\n#LPrint file: %s func: %s line: %d ticket: %d\n", __FILE__, __FUNCTION__, __LINE__, LOS_TickCountGet()); ret = s_pfnMcuHostNotifyProc(MCUHOST_SYSTEMCLOSE); if (ret == HI_FAILURE) {return;} #endif break; case 0x87: { pthread_mutex_lock(&g_ResponseLock); if (0 == buf[UF_DATA]) { g_stResponse = 1; } else { g_stResponse = -1; } pthread_mutex_unlock(&g_ResponseLock); break; } case 0x85: { pthread_mutex_lock(&g_WIFIRegDetResponseLock); g_s32WIFIRegDetResponse = 1; printf("receive back of set reg\r\n"); pthread_mutex_unlock(&g_WIFIRegDetResponseLock); break; } default: break; } } HI_VOID* MCUHOST_Thread(HI_VOID* pPara) { HI_S32 s32Ret; prctl(PR_SET_NAME, (HI_SIZE_T)"MCUHOST_Thread", 0, 0, 0); while (g_bMcuHostState) { if (HI_TRUE != g_bMcuHostEnableState) { usleep(500 * 1000); continue; } Uart_CMD_Handle(mcu_fd, uart2_buffer, UF_MAX_LEN); } return NULL; } HI_S32 HI_HAL_MCUHOST_Init() { HI_S32 s32Ret; CHECK_STATE_FLAG(g_bMcuHostInit, HI_FALSE); mcu_fd = uart2_fd; pthread_mutex_init(&s_tMcuHostMutex, NULL); s32Ret = pthread_create(&g_tMcuHostDetect, 0, MCUHOST_Thread, NULL); if (s32Ret) { printf("mcu host create thread fail.\n"); return s32Ret; } g_bMcuHostInit = HI_TRUE; g_bMcuHostState = HI_TRUE; g_bMcuHostEnableState = HI_TRUE; pthread_mutex_init(&g_ResponseLock, NULL); pthread_mutex_init(&g_WIFIRegDetResponseLock, NULL); //s_pfnUsbNotifyProc = NULL; printf("mcu host init ok \n"); return HI_SUCCESS; } HI_S32 HI_HAL_MCUHOST_Deinit() { HI_S32 s32Ret; if (g_bMcuHostInit == HI_TRUE) { g_bMcuHostState = HI_FALSE; pthread_mutex_lock(&s_tMcuHostMutex); s32Ret = pthread_join(g_tMcuHostDetect, NULL); if (s32Ret != 0) { printf("g_tMcuHostDetect: pthread_join failed\n"); return s32Ret; } pthread_mutex_unlock(&s_tMcuHostMutex); pthread_mutex_destroy(&s_tMcuHostMutex); memset(&s_tMcuHostMutex, 0, sizeof(s_tMcuHostMutex)); g_bMcuHostEnableState = HI_FALSE; g_bMcuHostInit = HI_FALSE; } return HI_SUCCESS; } HI_S32 HI_HAL_MCUHOST_RegisterNotifyProc(PFN_MCUHOST_NotifyProc pfnNotifyProc) { CHECK_STATE_FLAG(g_bMcuHostInit, HI_TRUE); CHECK_STATE_FLAG(s_bMcuHostRegister, HI_FALSE); CHECK_NULL_PTR(pfnNotifyProc); s_pfnMcuHostNotifyProc = pfnNotifyProc; s_bMcuHostRegister = HI_TRUE; return HI_SUCCESS; } HI_S32 HI_HAL_MCUHOST_RegOn_Control(HI_CHAR u8enable) { HI_U32 u32waitcount = 20; if ((u8enable != 0) && (u8enable != 1)) { printf("intput err\r\n"); } uart2_buffer[UF_START] = 0x7b; uart2_buffer[UF_LEN] = 0x5; uart2_buffer[UF_CMD] = 0x84; uart2_buffer[UF_DATA] = u8enable; debug_dump(uart2_buffer, 4, "send Wifi_Reg_Det_Control cmd"); USART_Send_Data(uart2_fd, uart2_buffer); do { usleep(100 * 1000); } while (u32waitcount-- && (g_s32WIFIRegDetResponse == 0)); printf("\nHI_Product_Wifi_Reg_Det_Control g_s32WIFIRegDetResponse: %d u32waitcount: %d\n", g_s32WIFIRegDetResponse, u32waitcount); pthread_mutex_lock(&g_WIFIRegDetResponseLock); g_s32WIFIRegDetResponse = 0; pthread_mutex_unlock(&g_WIFIRegDetResponseLock); return HI_SUCCESS; } HI_S32 HI_HAL_MCUHOST_PowreOff_Request() { if (power_handle_flag) { printf(""); return HI_FAILURE; } printf("%s------------shutdown-----------------\n",__FUNCTION__); power_handle_flag = 1; uart2_buffer[UF_START] = 0x7b; uart2_buffer[UF_LEN] = 0x4; uart2_buffer[UF_CMD] = 0x80; debug_dump(uart2_buffer, 4, "send power off cmd"); USART_Send_Data(mcu_fd, uart2_buffer); return HI_SUCCESS; } int HI_HAL_MCUHOST_WiFi_ON_Request(int On) { char s_u8buffer[UF_MAX_LEN]; memset(s_u8buffer, 0, UF_MAX_LEN); s_u8buffer[UF_LEN] = 0x5; s_u8buffer[UF_CMD] = 0x84; s_u8buffer[UF_DATA] = On; USART_Send_Data(uart2_fd, s_u8buffer); } void HI_HAL_MCUHOST_WiFi_Clr_Flag(void) { uart2_buffer[UF_LEN] = 0x4; uart2_buffer[UF_CMD] = 0x8c; USART_Send_Data(mcu_fd,uart2_buffer); } void HI_HAL_MCUHOST_WiFi_Power_Set(unsigned char val) { uart2_buffer[UF_LEN] = 0x5; uart2_buffer[UF_CMD] = 0x8a; uart2_buffer[UF_DATA] = val; USART_Send_Data(mcu_fd,uart2_buffer); } void HI_HAL_MCUHOST_WiFi_Rst_Set(unsigned char val) { uart2_buffer[UF_LEN] = 0x5; uart2_buffer[UF_CMD] = 0x88; uart2_buffer[UF_DATA] = val; USART_Send_Data(mcu_fd,uart2_buffer); } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/boardconfig.h #ifndef __BOARDCONFIG_H #define __BOARDCONFIG_H #include "stm8l15x.h" #include "rtc.h" #include "adc.h" #include "halt.h" //#define PIR_SUPPORT 1 #define KEY1_GPIO GPIOD //Power key #define KEY1_GPIO_Pin GPIO_Pin_4 #define PWR_GPIO GPIOD //discover板的灯 是PE7 ,正式的是PB6, 2015/06/13 new board 改为PD1 #define PWR_GPIO_Pin GPIO_Pin_2 #define WIFI_LED_GPIO GPIOD //wifi led #define WIFI_LED_GPIO_Pin GPIO_Pin_0 #define PIR_GPIO GPIOC //PIR #define PIR_GPIO_Pin GPIO_Pin_4 //判断主控芯片是否已启动 #define REG_ON_DET_GPIO GPIOC #define REG_ON_DET_GPIO_Pin GPIO_Pin_5 //WIFI使能脚 #define WL_EN_GPIO GPIOB #define WL_EN_GPIO_Pin GPIO_Pin_6 //WIFI唤醒中断脚 #define WL_WAK_GPIO GPIOB #define WL_WAK_GPIO_Pin GPIO_Pin_1 //WL_EN状态脚 #define WL_EN_DET_GPIO GPIOC #define WL_EN_DET_GPIO_Pin GPIO_Pin_5 //POW_ON状态脚 #define POW_ON_DET_GPIO GPIOC #define POW_ON_DET_GPIO_Pin GPIO_Pin_6 //MCU_GPIO1 #define MCU_GPIO1_GPIO GPIOC #define MCU_GPIO1_GPIO_Pin GPIO_Pin_5 //MCU_GPIO2 #define MCU_GPIO2_GPIO GPIOC #define MCU_GPIO2_GPIO_Pin GPIO_Pin_6 //此前预留于VBUS #define VBUS_DETECT GPIOB #define VBUS_DETECT_GPIO_Pin GPIO_Pin_7 //此前预留于电池电量 #define VBAT_DETECT GPIOD #define VBAT_DETECT_GPIO_Pin GPIO_Pin_3 //PB2 #define DEV_PWR_GPIO GPIOB #define DEV_PWR_GPIO_Pin GPIO_Pin_2 //PB3 #define D2H_WAK_GPIO GPIOB #define D2H_WAK_GPIO_Pin GPIO_Pin_3 //PB4 #define WIFI_GPIO2_GPIO GPIOB #define WIFI_GPIO2_GPIO_Pin GPIO_Pin_4 //PA5 #define PWROFF_Req_GPIO GPIOA #define PWROFF_Req_GPIO_Pin GPIO_Pin_5 //PC2 #define USART1_RX_GPIO GPIOC #define USART1_RX_GPIO_Pin GPIO_Pin_2//GPIO_Pin_2 //PC3 #define USART1_TX_GPIO GPIOC #define USART1_TX_GPIO_Pin GPIO_Pin_3//GPIO_Pin_3 #define ADC1_GPIO GPIOA #define ADC1_GPIO_Pin GPIO_Pin_4 #define LOW_VOL_CHECK_GPIO GPIOD #define LOW_VOL_CHECK_GPIO_Pin GPIO_Pin_1 /* KEY */ #define KEY_VALID_LEVEL 0x00 #define KEY_CHECK_CYCLE 5 #define KEY_JITTER_CHECK_CYCLE 5 #define PWR_ON_KEY_KEEP_COUNT 100 //unit is 40ms #define PWR_OFF_KEY_KEEP_COUNT 100 /* VBUS and VBAT */ #define VBUS_VALID_LEVEL 1 #define VBAT_VALID_LEVEL 1 #define UF_START 0 #define UF_LEN 1 #define UF_CMD 2 #define UF_DATA 3 #define UF_MAX_LEN 64 //此数需2的n次方,以便后续与操作等效取余操作,以优化指令,提高性能 #define GPIO_DEBOUNCE 2 #define MIN_CMD_LEN 4 #define CMD_LEN 8 #define CMDFLAG_START 0x7B #define ENABLE_RTC 0 //是否编译RTC定时器 extern u8 g_IsSystemOn; extern u8 g_Key_Handle_Flag; extern u8 g_Pir_WakeUp_it; extern u8 g_Key_WakeUp_It; //按键中断唤醒标志 extern u8 g_Wifi_WakeUp ; //WIFI唤醒标志 extern u8 g_Pir_Wakeup;//PIR唤醒标志 extern u8 g_Power_Key_Pressed; extern u8 USART_Send_Buf[UF_MAX_LEN]; extern u8 USART_Receive_Buf[UF_MAX_LEN]; extern u32 USART_Receive_Flag; extern u16 USART_Receive_Timeout; extern void InitExitHaltMode(void); void Board_Init(void); void CLK_Config(void); void TIM3_Config(void); void Usart_Config(void); void PWR_ON(void); void PWR_OFF(void); void USART_Send_Data(unsigned char *Dbuf,unsigned int len); u8 XOR_Inverted_Check(unsigned char *inBuf,unsigned char inLen); void Response_CMD_Handle(); void Request_CMD_Handle(u8* cmdstr, u8 len); void Uart_Handle(void); void Key_Handle(void); #endif /* __BOARDCONFIG_H */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/efuse/hal_efuse.c /****************************************************************************** Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : SAR_ADC_DRIVER.c Version : Initial Draft Author : <NAME> Created : 2012/5/2 Description : History : 1.Date : 2012/5/2 Author : hkf67331 Modification: Created file ******************************************************************************/ #include "hi_osal.h" #include "hi_type.h" #include "drv_cipher_log.h" #include "drv_cipher_reg.h" #include "hal_efuse.h" #include "hal_cipher.h" #include "config.h" extern HI_U32 g_u32EfuseBase; #ifdef CIPHER_EFUSE_SUPPORT #define EFUSE_REG_BASE_ADDR g_u32EfuseBase #define CIPHER_KD_WKEY0 (EFUSE_REG_BASE_ADDR + 0x00) #define CIPHER_KD_WKEY1 (EFUSE_REG_BASE_ADDR + 0x04) #define CIPHER_KD_WKEY2 (EFUSE_REG_BASE_ADDR + 0x08) #define CIPHER_KD_WKEY3 (EFUSE_REG_BASE_ADDR + 0x0c) #define CIPHER_KD_CTRL (EFUSE_REG_BASE_ADDR + 0x10) #define CIPHER_KD_STA (EFUSE_REG_BASE_ADDR + 0x14) #define OTP_PGM_TIME (EFUSE_REG_BASE_ADDR + 0x18) #define OTP_RD_TIME (EFUSE_REG_BASE_ADDR + 0x1c) #define OTP_LOGIC_LEVEL (EFUSE_REG_BASE_ADDR + 0x20) #define KD_CTL_MODE_CIPHER_KEY_ADDR(chn_id) (chn_id<<8) #define KD_CTL_MODE_OPT_KEY_ADDR(opt_id) (opt_id<<4) #define KD_CTL_MODE_HASH_KL (0x8) #define KD_CTL_MODE_OPT_KD (0x4) #define KD_CTL_MODE_CIPHER_KL (0x2) #define KD_CTL_MODE_START (0x1) #define REG_SYS_EFUSE_CLK_ADDR_PHY 0x120100D8 /* Define the union U_CIPHER_KD_CTRL */ typedef union { /* Define the struct bits */ struct { unsigned int start : 1 ; /* [0] */ unsigned int cipher_kl_mode : 1 ; /* [1] */ unsigned int otp_kd_mode : 1 ; /* [2] */ unsigned int Reserved_2 : 1 ; /* [3] */ unsigned int otp_key_add : 2 ; /* [5..4] */ unsigned int Reserved_1 : 2 ; /* [7..6] */ unsigned int cipher_key_add : 3 ; /* [10..8] */ unsigned int Reserved_0 : 21 ; /* [31..11] */ } bits; /* Define an unsigned member */ unsigned int u32; } U_CIPHER_KD_CTRL; /* Define the union U_CIPHER_KD_STA */ typedef union { /* Define the struct bits */ struct { unsigned int cipher_kl_finish : 1 ; /* [0] */ unsigned int hash_key_read_busy : 1 ;/* [1] */ unsigned int Reserved_3 : 25 ; /* [26..2] */ unsigned int ctrl_rdy : 1 ; /* [27] */ unsigned int ctrl_busy0 : 1 ; /* [28] */ unsigned int ctrl_busy1 : 1 ; /* [29] */ unsigned int key_wt_error : 1 ; /* [30] */ unsigned int key_wt_finish : 1 ; /* [31] */ } bits; /* Define an unsigned member */ unsigned int u32; } U_CIPHER_KD_STA; static HI_U32 s_bIsEfuseBusyFlag = HI_FALSE; HI_VOID HAL_Efuse_Init(HI_VOID) { HI_U32 CrgValue; HI_U32 u32SysAddr; u32SysAddr = (HI_U32)osal_ioremap_nocache(REG_SYS_EFUSE_CLK_ADDR_PHY, 0x100); HAL_CIPHER_ReadReg(u32SysAddr, &CrgValue); CrgValue |= 0x01;/* reset */ CrgValue |= 0x02; /* set the bit 0, clock opened */ HAL_CIPHER_WriteReg(u32SysAddr, CrgValue); /* clock select and cancel reset 0x30100*/ CrgValue &= (~0x01); /* cancel reset */ CrgValue |= 0x02; /* set the bit 0, clock opened */ HAL_CIPHER_WriteReg(u32SysAddr, CrgValue); osal_iounmap((void*)u32SysAddr); } HI_S32 HAL_Efuse_WaitWriteKey(HI_VOID) { U_CIPHER_KD_STA efuse_sta; HI_U32 ulStartTime = 0; HI_U32 ulLastTime = 0; HI_U32 ulDuraTime = 0; /* wait for hash_rdy */ ulStartTime = osal_get_tickcount(); while(1) { HAL_CIPHER_ReadReg(CIPHER_KD_STA, &efuse_sta.u32); if(efuse_sta.bits.key_wt_finish == 1) { break; } ulLastTime = osal_get_tickcount(); ulDuraTime = ulLastTime - ulStartTime; if (ulDuraTime >= 50000 ) { HI_ERR_CIPHER("Error! efuse write key time out!\n"); return HI_FAILURE; } osal_msleep(1); } return HI_SUCCESS; } HI_S32 HAL_Efuse_WaitCipherLoadKey(HI_VOID) { U_CIPHER_KD_STA efuse_sta; HI_U32 ulStartTime = 0; HI_U32 ulLastTime = 0; HI_U32 ulDuraTime = 0; ulStartTime = osal_get_tickcount(); while(1) { HAL_CIPHER_ReadReg(CIPHER_KD_STA, &efuse_sta.u32); if(efuse_sta.bits.cipher_kl_finish == 1) { break; } ulLastTime = osal_get_tickcount(); ulDuraTime = (ulLastTime - ulStartTime); if (ulDuraTime >= 50000 ) { HI_ERR_CIPHER("Error! efuse load key out!\n"); return HI_FAILURE; } osal_msleep(1); } return HI_SUCCESS; } HI_S32 HAL_Efuse_WaitHashLoadKey(HI_VOID) { U_CIPHER_KD_STA efuse_sta; HI_U32 ulStartTime = 0; HI_U32 ulLastTime = 0; HI_U32 ulDuraTime = 0; ulStartTime = osal_get_tickcount(); while(1) { HAL_CIPHER_ReadReg(CIPHER_KD_STA, &efuse_sta.u32); if(efuse_sta.bits.hash_key_read_busy == 0) { break; } ulLastTime = osal_get_tickcount(); ulDuraTime = (ulLastTime - ulStartTime); if (ulDuraTime >= 50000 ) { HI_ERR_CIPHER("Error! efuse load key out!\n"); return HI_FAILURE; } osal_msleep(1); } return HI_SUCCESS; } HI_S32 HAL_Efuse_WaitReady(HI_VOID) { U_CIPHER_KD_STA efuse_sta; HI_U32 ulStartTime = 0; HI_U32 ulLastTime = 0; HI_U32 ulDuraTime = 0; ulStartTime = osal_get_tickcount(); while(1) { HAL_CIPHER_ReadReg(CIPHER_KD_STA, &efuse_sta.u32); if(efuse_sta.bits.ctrl_rdy && (!efuse_sta.bits.ctrl_busy1) && (!efuse_sta.bits.ctrl_busy0)) { break; } ulLastTime = osal_get_tickcount(); ulDuraTime = (ulLastTime - ulStartTime); if (ulDuraTime >= 50000 ) { HI_ERR_CIPHER("Error! efuse load key out!\n"); return HI_FAILURE; } osal_msleep(1); } return HI_SUCCESS; } HI_S32 HAL_Efuse_GetErrStat(HI_VOID) { U_CIPHER_KD_STA efuse_sta; HAL_CIPHER_ReadReg(CIPHER_KD_STA, &efuse_sta.u32); return efuse_sta.bits.key_wt_error; } HI_S32 HAL_Efuse_WriteKey(HI_U32 * p_key, HI_U32 opt_id) { HI_S32 ret = HI_SUCCESS; HI_U32 kd_ctl_mode = 0; if(s_bIsEfuseBusyFlag) return HI_FAILURE; s_bIsEfuseBusyFlag = HI_TRUE; kd_ctl_mode = KD_CTL_MODE_OPT_KEY_ADDR(opt_id) | KD_CTL_MODE_OPT_KD | KD_CTL_MODE_START; HAL_CIPHER_WriteReg(CIPHER_KD_WKEY0, *p_key); HAL_CIPHER_WriteReg(CIPHER_KD_WKEY1, *(p_key+1)); HAL_CIPHER_WriteReg(CIPHER_KD_WKEY2, *(p_key+2)); HAL_CIPHER_WriteReg(CIPHER_KD_WKEY3, *(p_key+3)); HAL_Efuse_WaitReady(); HAL_CIPHER_WriteReg(CIPHER_KD_CTRL, kd_ctl_mode); if(HAL_Efuse_WaitWriteKey()) { s_bIsEfuseBusyFlag = HI_FALSE; return HI_FAILURE; } if(HAL_Efuse_GetErrStat()) { HI_ERR_CIPHER("func:%s err, efuse key is already write.\n",__FUNCTION__); ret = HI_FAILURE; } s_bIsEfuseBusyFlag = HI_FALSE; return ret; } HI_S32 HAL_Efuse_LoadCipherKey(HI_U32 chn_id, HI_U32 opt_id) { HI_U32 kd_ctl_mode = 0; if(s_bIsEfuseBusyFlag) return HI_FAILURE; s_bIsEfuseBusyFlag = HI_TRUE; kd_ctl_mode = (KD_CTL_MODE_CIPHER_KEY_ADDR(chn_id) | KD_CTL_MODE_OPT_KEY_ADDR(opt_id)\ | KD_CTL_MODE_CIPHER_KL | KD_CTL_MODE_START); HAL_Efuse_WaitReady(); HAL_CIPHER_WriteReg(CIPHER_KD_CTRL, kd_ctl_mode); if(HAL_Efuse_WaitCipherLoadKey()) { s_bIsEfuseBusyFlag = HI_FALSE; return HI_FAILURE; } s_bIsEfuseBusyFlag = HI_FALSE; return HI_SUCCESS; } HI_S32 HAL_Efuse_LoadHashKey(HI_U32 opt_id) { HI_U32 kd_ctl_mode = 0; if(s_bIsEfuseBusyFlag) return HI_FAILURE; s_bIsEfuseBusyFlag = HI_TRUE; kd_ctl_mode = (KD_CTL_MODE_OPT_KEY_ADDR(opt_id)| KD_CTL_MODE_HASH_KL | KD_CTL_MODE_START); HAL_Efuse_WaitReady(); HAL_CIPHER_WriteReg(CIPHER_KD_CTRL, kd_ctl_mode); if(HAL_Efuse_WaitHashLoadKey()) { s_bIsEfuseBusyFlag = HI_FALSE; return HI_FAILURE; } s_bIsEfuseBusyFlag = HI_FALSE; return HI_SUCCESS; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/drv/sdio_hi1131sv100/hisi_app/include/hisilink/hisilink_adapt.h /****************************************************************************** 版权所有 (C), 2001-2011, 华为技术有限公司 ****************************************************************************** 文 件 名 : hisilink_adapt.h 版 本 号 : 初稿 作 者 : 生成日期 : 2016年6月27日 最近修改 : 功能描述 : hisilink_adapt.c 的头文件 函数列表 : 修改历史 : 1.日 期 : 2016年6月27日 作 者 : 修改内容 : 创建文件 ******************************************************************************/ #ifndef __HISILINK_ADAPT_H__ #define __HISILINK_ADAPT_H__ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /***************************************************************************** 1 其他头文件包含 *****************************************************************************/ #include "hisilink_lib.h" /***************************************************************************** 2 宏定义 *****************************************************************************/ #define HSL_CHANNEL_NUM 18 #define HSL_RSSI_LEVEL -100 //hsl处理组播包的RSSI下限值 typedef void (*hsl_connect_cb)(hsl_result_stru*); /***************************************************************************** 3 枚举定义 *****************************************************************************/ typedef enum { RECEIVE_FLAG_OFF, RECEIVE_FLAG_ON, RECEIVE_FLAG_BUTT }recevie_flag_enum; /***************************************************************************** 4 全局变量声明 *****************************************************************************/ /***************************************************************************** 5 消息头定义 *****************************************************************************/ /***************************************************************************** 6 消息定义 *****************************************************************************/ /***************************************************************************** 7 STRUCT定义 *****************************************************************************/ typedef struct { hsl_uint32 ul_taskid1; //HSL config非传统连接处理线程的ID hsl_uint32 ul_taskid2; //传统连接方式处理线程ID hsl_uint16 us_timerout_id; //HSL config超时定时器 hsl_uint16 us_timer_id; //周期切信道的定时器ID hsl_uint8 en_status; //HSL config当前处的状态 hsl_uint8 en_connect; //当前连接状态 hsl_uint8 auc_res[2]; hsl_uint32 ul_mux_lock; //保护锁 }hisi_hsl_status_stru; typedef struct hsl_datalist { struct hsl_datalist *next; void *data; unsigned int length; }hsl_data_list_stru; /***************************************************************************** 8 UNION定义 *****************************************************************************/ /***************************************************************************** 9 OTHERS定义 *****************************************************************************/ /***************************************************************************** 10 函数声明 *****************************************************************************/ hsl_int32 hisi_hsl_adapt_init(void); hsl_int32 hisi_hsl_adapt_deinit(void); hsl_int32 hisi_hsl_change_channel(void); hsl_int32 hisi_hsl_process_data(void); hsl_int32 hisi_hsl_online_notice(hsl_result_stru *pst_result); #ifdef __cplusplus #if __cplusplus } #endif #endif #endif //__HSLCONFIG_ADAPT_H__ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/write_efuse_key.sh #!/bin/sh #set key~key3 himm 0x20100800 0x00000001 himm 0x20100804 0x00000002 himm 0x20100808 0x00000003 himm 0x2010080c 0x00000004 sleep 1 @start write key to efuse of 0 [5:4]=otp_key_add, KEY在OTP的地址. himm 0x20100810 0x00000005 sleep 1 himd 0x20100814 #should be 0x88010000<file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/include/drv_cipher_ioctl.h /****************************************************************************** Copyright (C), 2011-2014, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : drv_cipher_ioctl.h Version : Initial Draft Author : Hisilicon hisecurity team Created : Last Modified : Description : Function List : History : ******************************************************************************/ #ifndef __DRV_CIPHER_IOCTL_H__ #define __DRV_CIPHER_IOCTL_H__ #include "hi_type.h" #include "hi_unf_cipher.h" #include "hi_drv_cipher.h" #ifdef __cplusplus extern "C"{ #endif /* __cplusplus */ typedef struct hiCIPHER_PROC_ITEM_S { HI_U32 u32Resv; }CIPHER_PROC_ITEM_S; #ifdef CIPHER_MULTICIPHER_SUPPORT typedef struct { HI_U32 u32ChnId; HI_CHAR *ps8Openstatus; HI_CHAR *ps8Alg; HI_CHAR *ps8Mode; HI_U32 u32KeyLen; HI_CHAR *ps8KeyFrom; HI_BOOL bIsDecrypt; HI_U32 u32DataInSize; HI_U32 u32DataInAddr; HI_U32 u32DataOutSize; HI_U32 u32DataOutAddr; HI_BOOL bInINTAllEn; HI_BOOL bInINTEn; HI_BOOL bInINTRaw; HI_BOOL bOutINTEn; HI_BOOL bOutINTRaw; HI_U32 u32OutINTCount; //CHANn_INT_OCNTCFG HI_U32 au32IV[4]; HI_U8 au8DataIn[16]; HI_U8 au8DataOut[16]; }CIPHER_CHN_STATUS_S; #endif #define UMAP_DEVNAME_CIPHER "cipher" #define CIPHER_PROC_NAME "driver/hi_cipher" #define UMAP_CIPHER_MINOR_BASE 100 /* Ioctl definitions */ #define HI_ID_CIPHER 100 #define HI_ID_HASH 101 #ifdef CIPHER_MULTICIPHER_SUPPORT #define CMD_CIPHER_CREATEHANDLE _IOWR(HI_ID_CIPHER, 0x1, CIPHER_HANDLE_S) #define CMD_CIPHER_DESTROYHANDLE _IOW(HI_ID_CIPHER, 0x2, HI_U32) #define CMD_CIPHER_CONFIGHANDLE _IOW(HI_ID_CIPHER, 0x3, CIPHER_Config_CTRL) #define CMD_CIPHER_ENCRYPT _IOW(HI_ID_CIPHER, 0x4, CIPHER_DATA_S) #define CMD_CIPHER_DECRYPT _IOW(HI_ID_CIPHER, 0x5, CIPHER_DATA_S) #define CMD_CIPHER_DECRYPTMULTI _IOW(HI_ID_CIPHER, 0x6, CIPHER_DATA_S) #define CMD_CIPHER_ENCRYPTMULTI _IOW(HI_ID_CIPHER, 0x7, CIPHER_DATA_S) #define CMD_CIPHER_GETHANDLECONFIG _IOWR(HI_ID_CIPHER, 0x9, CIPHER_Config_CTRL) #define HI_CIPHER_DECRYPTMULTI_EX _IOW(HI_ID_CIPHER, 0xe, CIPHER_MUTIL_EX_DATA_S) #define HI_CIPHER_ENCRYPTMULTI_EX _IOW(HI_ID_CIPHER, 0xf, CIPHER_MUTIL_EX_DATA_S) #define CMD_CIPHER_GETTAG _IOWR(HI_ID_CIPHER, 0x11, CIPHER_TAG) #endif #ifdef CIPHER_KLAD_SUPPORT #define CMD_CIPHER_KLAD_KEY _IOWR(HI_ID_CIPHER, 0x12, CIPHER_KLAD_KEY_S) #endif #ifdef CIPHER_RNG_SUPPORT #define CMD_CIPHER_GETRANDOMNUMBER _IOWR(HI_ID_CIPHER, 0x8, CIPHER_RNG_S) #endif #ifdef CIPHER_HASH_SUPPORT #define CMD_CIPHER_CALCHASHINIT _IOWR(HI_ID_CIPHER, 0xa, CIPHER_HASH_DATA_S) #define CMD_CIPHER_CALCHASHUPDATE _IOWR(HI_ID_CIPHER, 0xb, CIPHER_HASH_DATA_S) #define CMD_CIPHER_CALCHASHFINAL _IOWR(HI_ID_CIPHER, 0xc, CIPHER_HASH_DATA_S) #define CMD_CIPHER_CALCHASH _IOWR(HI_ID_CIPHER, 0x10, CIPHER_HASH_DATA_S) #endif #ifdef CIPHER_RSA_SUPPORT #define CMD_CIPHER_CALCRSA _IOWR(HI_ID_CIPHER, 0xd, CIPHER_RSA_DATA_S) #endif typedef union { #ifdef CIPHER_MULTICIPHER_SUPPORT CIPHER_HANDLE_S stCIHandle; HI_U32 HANDLE; CIPHER_DATA_S stCIData; CIPHER_Config_CTRL stCIConfig; CIPHER_CBCMAC_DATA_S stCICbcmacData; CIPHER_MUTIL_EX_DATA_S stMutliEx; CIPHER_TAG stCIPHERTag; #endif #ifdef CIPHER_HASH_SUPPORT CIPHER_HASH_DATA_S stCIHashData; #endif #ifdef CIPHER_RSA_SUPPORT CIPHER_RSA_DATA_S stCIRsaData; CIPHER_RSA_KEY_S stCIPHERRsaKey; #endif #ifdef CIPHER_KLAD_SUPPORT CIPHER_KLAD_KEY_S stKladKey; #endif }CMD_CIPHER_PARAM_U; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* End of #ifndef __DRV_CIPHER_IOCTL_H__*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/Makefile ifeq ($(PARAM_FILE), ) PARAM_FILE:=../../../../mpp/Makefile.param include $(PARAM_FILE) endif ifeq ($(KERNELRELEASE),) export CIPHER_SRC_BASE=$(PWD) endif CONFIG_CIPHER_MULTICIPHER_SUPPORT=y CONFIG_CIPHER_HASH_SUPPORT=y CONFIG_CIPHER_RSA_SUPPORT=y CFG_HI_CIPHER_RNG_SUPPORT=y KBUILD_EXTRA_SYMBOLS +="$(OSAL_ROOT)/$(OSTYPE)/kernel/Module.symvers" EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE) EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/drv EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/drv/cipher EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/drv/hash EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/drv/efuse EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/include EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/../include EXTRA_CFLAGS += -I$(CIPHER_SRC_BASE)/../arch/$(INTERDRVVER) EXTRA_CFLAGS += -I$(OSAL_ROOT)/include DRV_OBJ := drv/drv_cipher_intf.o drv/efuse/hal_efuse.o DRV_OBJ += ../../../$(INTERDRVVER)/init/$(OSTYPE)/cipher_init.o DRV_OBJ += drv/cipher/drv_cipher.o drv/cipher/hal_cipher.o DRV_OBJ += drv/hash/drv_hash_intf.o EXTRA_CFLAGS += -DCHIP_TYPE_$(INTERDRVVER) REMOVED_FILES := "*.o" "*.ko" "*.order" "*.symvers" "*.mod" "*.mod.*" "*.cmd" ".tmp_versions" "modules.builtin" ifeq ($(OSTYPE),HuaweiLite) EXTRA_CFLAGS += $(CFLAGS) endif API_OBJS := api/unf_cipher.o api/mpi_cipher.o api/hi_rsa_bignum.o api/hi_rsa.o OBJS = $(DRV_OBJ) $(API_OBJS) TARGET := hi_cipher obj-m := hi_cipher.o hi_cipher-y += $(DRV_OBJ) #************************************************************************* # all source file in this module SRCS := $(patsubst %.o,%.c,$(OBJ)) .PHONY: all clean all: $(OSTYPE)_build clean : @$(AT)find ./ -name "*.d" $(foreach file, $(REMOVED_FILES), -o -name $(file)) | xargs rm -rf @rm -f libhi_cipher.a @for x in `find ../../../$(INTERDRVVER)/init/$(OSTYPE) -name "*cipher_init.o.cmd"`;do rm -rf $$x;done @for x in `find ../../../$(INTERDRVVER)/init/$(OSTYPE) -name "*cipher_init.o*"`;do rm -rf $$x;done ################################### HuaweiLite_build: $(OBJS) @$(AR) $(ARFLAGS) lib$(TARGET).a $(OBJS) @mkdir -p $(REL_KO) && cp -rf libhi_cipher.a $(REL_KO) @cp $(CIPHER_SRC_BASE)/../arch/$(INTERDRVVER)/hi_unf_cipher.h $(REL_INC) linux_build: $(API_OBJS) @echo -e "\e[0;32;1m... Configs as follow:\e[0;36;1m" @echo ---- CROSS=$(CROSS) @echo ---- HIARCH=$(HIARCH), HICHIP=$(HICHIP), CVER=$(CVER), DBG=$(HIDBG), HI_FPGA=$(HI_FPGA) @echo ---- CPU_TYPE=$(CPU_TYPE) @echo ---- MPP_CFLAGS=$(MPP_CFLAGS) @echo ---- SDK_PATH=$(SDK_PATH) , PARAM_FILE=$(PARAM_FILE) @echo ---- KERNEL_ROOT=$(KERNEL_ROOT) @echo ---- ARCH_ROOT=$(ARCH_ROOT), ARCH_HAL=$(ARCH_HAL) @@echo -e "\e[0m" @make -C $(KERNEL_ROOT) M=$(PWD) modules @mkdir -p $(REL_KO) && cp -rf $(TARGET).ko $(REL_KO) @$(AR) -rv libhi_cipher.a $(API_OBJS) @cp $(CIPHER_SRC_BASE)/../arch/$(INTERDRVVER)/hi_unf_cipher.h $(REL_INC) $(OBJS): %.o : %.c @echo $(CC) $< ... @$(CC) $(EXTRA_CFLAGS) -c $< -o $@ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/hi1131_wifi/hisi_app_demo/hisilink_demo.c /****************************************************************************** 版权所有 (C), 2001-2011, 华为技术有限公司 ****************************************************************************** 文 件 名 : hisilink_demo.c 版 本 号 : 初稿 作 者 : 生成日期 : 2016年11月29日 最近修改 : 功能描述 : HSL_config核心代码 函数列表 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 创建文件 ******************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif #include "hisilink_adapt.h" #include "hostapd/hostapd_if.h" #include "wpa_supplicant/wpa_supplicant.h" #include "src/common/defs.h" #include "los_task.h" #include "sys/prctl.h" #include <pthread.h> #include "lwip/ip_addr.h" #include "driver_hisi_lib_api.h" #include "hisilink_lib.h" #include "hisilink_ext.h" #include <linux/completion.h> #define HSL_PERIOD_CHANNEL 50 //切信道周期 #define HSL_PERIOD_TIMEOUT 70000 //hisilink超时时间 typedef enum { HSL_STATUS_UNCREATE, HSL_STATUS_CREATE, HSL_STATUS_RECEIVE, //hisi_link处于接收组播阶段 HSL_STATUS_CONNECT, //hisi_link处于关联阶段 HSL_STATUS_BUTT }hsl_status_enum; typedef unsigned char hsl_status_enum_type ; unsigned int gul_hsl_taskid; hsl_context_stru st_context; hsl_result_stru gst_hsl_params; hsl_status_enum_type guc_hsl_status = 0; extern unsigned char hsl_receive_flag; /***************************************************************************** 函数声明 *****************************************************************************/ int hsl_demo_init(void); int hsl_demo_main(void); void hsl_demo_task_channel_change(void); int hsl_demo_connect(hsl_result_stru* pst_params); int hsl_demo_connect_prepare(void); unsigned char hsl_demo_get_status(void); int hsl_demo_set_status(hsl_status_enum_type uc_type); hsl_result_stru* hsl_demo_get_result(void); /***************************************************************************** 函 数 名 : hsl_demo_prepare 功能描述 : hsl demo启动hostapd为接收组播做准备 输入参数 : 无 输出参数 : 无 返 回 值 : 成功返回HISI_SUCC,异常返回-HISI_EFAIL 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hsl_demo_prepare(void) { int l_ret; char ac_ssid[33]; unsigned char auc_password[65]; unsigned int ul_ssid_len = 0; unsigned int ul_pass_len = 0; unsigned char auc_manufacturer_id[3] = {'0','0','3'}; unsigned char auc_device_id[3] = {'0','0','1'}; struct netif *pst_netif; ip_addr_t st_gw; ip_addr_t st_ipaddr; ip_addr_t st_netmask; struct hostapd_conf hapd_conf; /* 尝试删除wpa_supplicant和hostapd */ l_ret = wpa_supplicant_stop(); if (0 != l_ret) { HISI_PRINT_WARNING("%s[%d]:wpa_supplicant stop fail",__func__,__LINE__); } pst_netif = netif_find("wlan0"); if (NULL != pst_netif) { dhcps_stop(pst_netif); } l_ret = hostapd_stop(); if (0 != l_ret) { HISI_PRINT_WARNING("%s[%d]:hostapd stop fail",__func__,__LINE__); } memset(ac_ssid, 0, sizeof(char)*33); /* 获取启动AP需要的SSID及密码 */ l_ret = hsl_get_ap_params(auc_manufacturer_id, auc_device_id, ac_ssid, &ul_ssid_len, auc_password, &ul_pass_len); if (HSL_SUCC != l_ret) { HISI_PRINT_ERROR("%s[%d]:get ap params fail",__func__,__LINE__); return -HSL_FAIL; } /* 设置AP参数 */ hsl_memset(&hapd_conf, 0, sizeof(struct hostapd_conf)); hsl_memcpy(hapd_conf.ssid, ac_ssid, ul_ssid_len); hsl_memcpy(hapd_conf.key, auc_password, ul_pass_len); hsl_memcpy(hapd_conf.ht_capab, "[HT40+]", strlen("[HT40+]")); hapd_conf.channel_num = 6; hapd_conf.wpa_key_mgmt = WPA_KEY_MGMT_PSK; hapd_conf.wpa = 2; hapd_conf.authmode = HOSTAPD_SECURITY_WPAPSK; hapd_conf.wpa_pairwise = WPA_CIPHER_TKIP | WPA_CIPHER_CCMP; hsl_memcpy(hapd_conf.driver, "hisi", 5); #ifdef HISI_CONNETIVITY_PATCH hapd_conf.ignore_broadcast_ssid = 0; #endif l_ret = hostapd_start(NULL, &hapd_conf); if (HSL_SUCC != l_ret) { HISI_PRINT_ERROR("HSL_start_hostapd:start failed[%d]",l_ret); return -HSL_FAIL; } pst_netif = netif_find("wlan0"); if (HSL_NULL == pst_netif) { HISI_PRINT_ERROR("HSL_start_dhcps:pst_netif null"); return -HSL_ERR_NULL; } /* 设置网口信息 */ IP4_ADDR(&st_gw, 192, 168, 43, 1); IP4_ADDR(&st_ipaddr, 192, 168, 43, 1); IP4_ADDR(&st_netmask, 255, 255, 255, 0); netif_set_addr(pst_netif, &st_ipaddr, &st_netmask, &st_gw); netif_set_up(pst_netif); l_ret = dhcps_start(pst_netif); if (HSL_SUCC != l_ret) { HISI_PRINT_ERROR("HSL_start_dhcps:DHCP Server start fail"); return -HSL_FAIL; } return HSL_SUCC; } /***************************************************************************** 函 数 名 : hsl_demo_init 功能描述 : 初始化 输入参数 : 无 输出参数 : 无 返 回 值 : 成功返回HISI_SUCC,异常返回-HISI_EFAIL 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hsl_demo_init(void) { int l_ret; memset(&gst_hsl_params, 0, sizeof(hsl_result_stru)); l_ret = hsl_os_init(&st_context); if (HSL_SUCC != l_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); return -HSL_FAIL; } l_ret = hisi_hsl_adapt_init(); if (HISI_SUCC != l_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); HISI_PRINT_ERROR("%s[%d]:hisi_HSL_adapt_init fail",__func__,__LINE__); return -HSL_FAIL; } return HSL_SUCC; } /***************************************************************************** 函 数 名 : hsl_demo_task_channel_change 功能描述 : hsl demo的切信道线程处理函数 输入参数 : 无 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ void hsl_demo_task_channel_change(void) { int l_ret; unsigned int ul_ret; unsigned int ul_time = 0; unsigned int ul_time_temp = 0; unsigned int ul_wait_time = 0; unsigned char *puc_macaddr; unsigned char uc_status; struct netif *pst_netif; ul_time_temp = hsl_get_time(); ul_time = ul_time_temp; uc_status = hsl_demo_get_status(); while((HSL_STATUS_RECEIVE == uc_status) && (HSL_PERIOD_TIMEOUT >= ul_wait_time)) { if (RECEIVE_FLAG_ON == hsl_receive_flag) { ul_time_temp = hsl_get_time(); if (HSL_PERIOD_CHANNEL < (ul_time_temp - ul_time)) { ul_wait_time += (ul_time_temp - ul_time); ul_time = ul_time_temp; l_ret = hsl_get_lock_status(); if (HSL_CHANNEL_UNLOCK == l_ret) { l_ret = hisi_hsl_change_channel(); if (HISI_SUCC != l_ret) { HISI_PRINT_WARNING("%s[%d]:change channel fail",__func__,__LINE__); } hsl_os_reset(); } } } l_ret = hisi_hsl_process_data(); if (HSL_DATA_STATUS_FINISH == l_ret) { LOS_TaskLock(); hsl_receive_flag = RECEIVE_FLAG_OFF; LOS_TaskUnlock(); hsl_demo_set_status(HSL_STATUS_CONNECT); break; } msleep(1); uc_status = hsl_demo_get_status(); } hisi_hsl_adapt_deinit(); if (HSL_PERIOD_TIMEOUT >= ul_wait_time) { hsl_memset(&gst_hsl_params, 0, sizeof(hsl_result_stru)); l_ret = hsl_get_result(&gst_hsl_params); if (HSL_SUCC == l_ret) { puc_macaddr = hisi_wlan_get_macaddr(); if (HSL_NULL != puc_macaddr) { if ((puc_macaddr[4] == gst_hsl_params.auc_flag[0]) && (puc_macaddr[5] == gst_hsl_params.auc_flag[1])) { l_ret = hsl_demo_connect_prepare(); if (0 != l_ret) { HISI_PRINT_ERROR("hsl_demo_task_channel_change:connect prepare fail[%d]\n",l_ret); } } else { HISI_PRINT_ERROR("This device is not intended to be associated:%02x %02x\n",gst_hsl_params.auc_flag[0],gst_hsl_params.auc_flag[1]); } } } } else { HISI_PRINT_INFO("hsl timeout\n"); /* 删除AP模式 */ pst_netif = netif_find("wlan0"); if (HSL_NULL != pst_netif) { dhcps_stop(pst_netif); } l_ret = hostapd_stop(); if (0 != l_ret) { HISI_PRINT_ERROR("%s[%d]:stop hostapd fail",__func__,__LINE__); } } hsl_demo_set_status(HSL_STATUS_UNCREATE); ul_ret = LOS_TaskDelete(gul_hsl_taskid); if (0 != ul_ret) { HISI_PRINT_WARNING("%s[%d]:delete task fail[%d]",__func__,__LINE__,ul_ret); } } extern struct completion dhcp_complet; /***************************************************************************** 函 数 名 : hsl_demo_connect_prepare 功能描述 : 切换到wpa准备关联 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ hsl_int32 hsl_demo_connect_prepare(void) { int l_ret; unsigned int ul_ret; hsl_result_stru *pst_result; struct netif *pst_netif; /* 删除AP模式 */ pst_netif = netif_find("wlan0"); if (HSL_NULL != pst_netif) { dhcps_stop(pst_netif); } l_ret = hostapd_stop(); if (0 != l_ret) { HISI_PRINT_ERROR("%s[%d]:stop hostapd fail",__func__,__LINE__); return -HSL_FAIL; } init_completion(&dhcp_complet); #ifdef CONFIG_NO_CONFIG_WRITE l_ret = wpa_supplicant_start("wlan0", "hisi", HSL_NULL); #else l_ret = wpa_supplicant_start("wlan0", "hisi", WPA_SUPPLICANT_CONFIG_PATH); #endif if (0 != l_ret) { HISI_PRINT_ERROR("%s[%d]:start wpa_supplicant fail",__func__,__LINE__); return -HSL_FAIL; } ul_ret = wait_for_completion_timeout(&dhcp_complet, LOS_MS2Tick(40000));//40s超时 if (0 == ul_ret) { HISI_PRINT_ERROR("hsl_demo_connect_prepare:cannot get ip\n"); return -HSL_FAIL; } pst_result = hsl_demo_get_result(); if (HSL_NULL != pst_result) { hsl_demo_online(pst_result); } return HSL_SUCC; } /***************************************************************************** 函 数 名 : hsl_demo_connect 功能描述 : 利用获取到的参数启动关联 输入参数 : pst_params解码获取到的参数 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hsl_demo_connect(hsl_result_stru* pst_params) { struct wpa_assoc_request wpa_assoc_req; if (HSL_NULL == pst_params) { HISI_PRINT_ERROR("%s[%d]:pst_params is null",__func__,__LINE__); return -HSL_ERR_NULL; } hsl_memset(&wpa_assoc_req , 0 ,sizeof(struct wpa_assoc_request)); wpa_assoc_req.hidden_ssid = 1; hsl_memcpy(wpa_assoc_req.ssid, pst_params->auc_ssid, pst_params->uc_ssid_len); wpa_assoc_req.auth = pst_params->en_auth_mode; if (HSL_AUTH_TYPE_OPEN != wpa_assoc_req.auth) { hsl_memcpy(wpa_assoc_req.key, pst_params->auc_pwd, pst_params->uc_pwd_len); } /* 开始创建连接 */ wpa_connect_interface(&wpa_assoc_req); return HSL_SUCC; } /***************************************************************************** 函 数 名 : hsl_demo_get_status 功能描述 : 利用获取当前hisilink的状态 输入参数 : 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ unsigned char hsl_demo_get_status(void) { unsigned char uc_type; LOS_TaskLock(); uc_type = guc_hsl_status; LOS_TaskUnlock(); return uc_type; } /***************************************************************************** 函 数 名 : hsl_demo_set_status 功能描述 : 设置hisilink的状态 输入参数 : 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hsl_demo_set_status(hsl_status_enum_type uc_type) { LOS_TaskLock(); guc_hsl_status = uc_type; LOS_TaskUnlock(); return 0; } /***************************************************************************** 函 数 名 : hsl_demo_get_result 功能描述 : 获取解密结果指针 输入参数 : 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ hsl_result_stru* hsl_demo_get_result(void) { hsl_result_stru *pst_result; pst_result = &gst_hsl_params; return pst_result; } /***************************************************************************** 函 数 名 : hsl_demo_online 功能描述 : 成功获取IP后发送上线通知 输入参数 : 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hsl_demo_online(hsl_result_stru* pst_params) { if (HSL_NULL == pst_params) { HISI_PRINT_ERROR("%s[%d]:pst_params is null",__func__,__LINE__); return -HSL_ERR_NULL; } hisi_hsl_online_notice(pst_params); return HSL_SUCC; } extern int hilink_demo_get_status(void); /***************************************************************************** 函 数 名 : hsl_demo_main 功能描述 : hsl demo程序总入口 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年11月29日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ hsl_int32 hsl_demo_main(void) { unsigned int ul_ret; int l_ret; unsigned char uc_status; TSK_INIT_PARAM_S st_hsl_task; uc_status = hilink_demo_get_status(); if (0 != uc_status) { HISI_PRINT_ERROR("hilink already start, cannot start hisilink"); return -HSL_FAIL; } uc_status = hsl_demo_get_status(); if (HSL_STATUS_UNCREATE != uc_status) { HISI_PRINT_ERROR("hsl already start,cannot start again"); return -HSL_FAIL; } hsl_demo_set_status(HSL_STATUS_RECEIVE); l_ret = hsl_demo_prepare(); if (0 != l_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); HISI_PRINT_ERROR("%s[%d]:demo init fail",__func__,__LINE__); return -HSL_FAIL; } /* 创建切信道线程,线程结束后自动释放 */ memset(&st_hsl_task, 0, sizeof(TSK_INIT_PARAM_S)); st_hsl_task.pfnTaskEntry = (TSK_ENTRY_FUNC)hsl_demo_task_channel_change; st_hsl_task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; st_hsl_task.pcName = "hsl_thread"; st_hsl_task.usTaskPrio = 8; st_hsl_task.uwResved = LOS_TASK_STATUS_DETACHED; ul_ret = LOS_TaskCreate(&gul_hsl_taskid, &st_hsl_task); if(0 != ul_ret) { hsl_demo_set_status(HSL_STATUS_UNCREATE); HISI_PRINT_ERROR("%s[%d]:create task fail[%d]",__func__,__LINE__,ul_ret); return -HSL_FAIL; } return HSL_SUCC; } #ifdef __cplusplus #if __cplusplus } #endif #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/hisi-irda/test/Makefile # Hisilicon Hi35xx sample Makefile ifeq ($(PARAM_FILE), ) PARAM_FILE:=../../../../mpp/Makefile.param include $(PARAM_FILE) endif PWD=$(realpath ./) INC_FLAGS += -I../ INC_FLAGS += -I$(REL_INC) INC_FLAGS += -I$(SDK_PATH)/$(EXTDRV)/sensor_spi CFLAGS += -Wall -g $(INC_FLAGS) -D$(HIARCH) -DHICHIP=$(HICHIP) -D$(HIDBG) -D$(HI_FPGA) -lpthread -ldl SRCS := $(wildcard *.c) TARGET := irda_test # ********************************* # compile linux or HuaweiLite # ********************************* include $(PWD)/Make.$(OSTYPE) <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/arch/hi3518e/config.h #ifndef __CONFIG_H__ #define __CONFIG_H__ #ifdef CHIP_TYPE_hi3518e /********* Here define the function supported by chip *****************/ #define CIPHER_IRQ_NUMBER 13 #define CIPHER_HASH_SUPPORT #define CIPHER_MHASH_SUPPORT #define CIPHER_RSA_SUPPORT #define CIPHER_RNG_SUPPORT #define CIPHER_RNG_VERSION_1 //#define CIPHER_CCM_GCM_SUPPORT #define CIPHER_MULTICIPHER_SUPPORT //#define CIPHER_KLAD_SUPPORT #define CIPHER_EFUSE_SUPPORT /********* Here define the base address of chip ***********************/ #define REG_BASE_PHY_ADDR_CIPHER (0x100C0000) #define REG_BASE_PHY_ADDR_SHA (0x10070000) #define REG_BASE_PHY_ADDR_RSA (0x20260000) #define REG_BASE_PHY_ADDR_RNG (0x20280200) #define REG_BASE_PHY_ADDR_EFUSE (0x20100800) /********* Here define the clcok and reset signal in CRG ***************/ #define REG_CRG_CLK_PHY_ADDR_CIPHER (0x2003007C) #define REG_CRG_CLK_PHY_ADDR_SHA (0x2003006C) #define REG_CRG_CLK_PHY_ADDR_RSA (0x20030100) #define REG_CRG_CLK_PHY_ADDR_RNG (0x00) // Not config #define CRG_RST_BIT_CIPHER 0 #define CRG_CLK_BIT_CIPHER 1 #define CRG_RST_BIT_SHA 2 #define CRG_CLK_BIT_SHA 3 #define CRG_RST_BIT_RSA 4 #define CRG_CLK_BIT_RSA 5 #define CRG_RST_BIT_RNG 0 #define CRG_CLK_BIT_RNG 0 #else #error You need to define a correct chip type! #endif #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/cipher/drv_cipher_reg.h /****************************************************************************** Copyright (C), 2011-2014, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : drv_cipher_reg.h Version : Initial Draft Author : <NAME>isecurity team Created : Last Modified : Description : Function List : History : ******************************************************************************/ #ifndef __DRV_CIPHER_REG_H__ #define __DRV_CIPHER_REG_H__ /* add include here */ #ifdef __cplusplus extern "C" { #endif extern HI_U32 g_u32CipherBase; extern HI_U32 g_u32HashBase; extern HI_U32 g_u32RsaBase; extern HI_U32 g_u32RngBase; extern HI_U32 g_u32KladBase; #define REG_CI_BASE_SIZE 0x2000 #define CIPHER_REG_BASE_ADDR g_u32CipherBase #define CIPHER_REG_CHAN0_CIPHER_DOUT(id) (CIPHER_REG_BASE_ADDR + 0x0000 + (id)*0) #define CIPHER_REG_CHAN0_CIPHER_IVOUT(id) (CIPHER_REG_BASE_ADDR + 0x0010 + (id)*0) #define CIPHER_REG_CHAN_CIPHER_IVOUT(id) (CIPHER_REG_BASE_ADDR + 0x0010 + (id)*16) #define CIPHER_REG_CIPHER_KEY(id) (CIPHER_REG_BASE_ADDR + 0x0090 + (id)*32) #define CIPHER_REG_CTRL_ST0 (CIPHER_REG_BASE_ADDR + 0x0800) #define CIPHER_REG_CTRL_ST1 (CIPHER_REG_BASE_ADDR + 0x0804) #define CIPHER_REG_CTRL_ST2 (CIPHER_REG_BASE_ADDR + 0x0808) #define CIPHER_REG_SRAM_ST0 (CIPHER_REG_BASE_ADDR + 0x080c) #define CIPHER_REG_HDCP_HOST_ROOTKEY (CIPHER_REG_BASE_ADDR + 0x810) #define CIPHER_REG_HDCP_MODE_CTRL (CIPHER_REG_BASE_ADDR + 0x820) #define CIPHER_REG_SEC_CHN_CFG (CIPHER_REG_BASE_ADDR + 0x824) #define CIPHER_REG_HL_APP_CBC_CTRL (CIPHER_REG_BASE_ADDR + 0x828 ) #define CIPHER_REG_HL_APP_LEN (CIPHER_REG_BASE_ADDR + 0x82C ) #define CIPHER_REG_HL_APP_CBC_MAC_REF (CIPHER_REG_BASE_ADDR + 0x830 ) #define CIPHER_REG_CHAN0_CIPHER_CTRL (CIPHER_REG_BASE_ADDR + 0x1000) #define CIPHER_REG_CHAN0_CIPHER_IVIN(id) (CIPHER_REG_BASE_ADDR + 0x1004 + (id)*0) #define CIPHER_REG_CHAN0_CIPHER_DIN(id) (CIPHER_REG_BASE_ADDR + 0x1014 + (id)*0) #define CIPHER_REG_CHANn_IBUF_NUM(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 ) #define CIPHER_REG_CHANn_IBUF_CNT(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x4 ) #define CIPHER_REG_CHANn_IEMPTY_CNT(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x8 ) #define CIPHER_REG_CHANn_INT_ICNTCFG(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0xC ) #define CIPHER_REG_CHANn_CIPHER_CTRL(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x10) #define CIPHER_REG_CHANn_SRC_LST_SADDR(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x14) #define CIPHER_REG_CHANn_IAGE_TIMER(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x18) #define CIPHER_REG_CHANn_IAGE_CNT(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x1C) #define CIPHER_REG_CHANn_SRC_LST_RADDR(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x20) #define CIPHER_REG_CHANn_SRC_ADDR(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x24) #define CIPHER_REG_CHANn_SRC_LENGTH(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x28) #define CIPHER_REG_CHANn_IN_LEFT_BYTE0(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x2C) #define CIPHER_REG_CHANn_IN_LEFT_WORD0(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x30) #define CIPHER_REG_CHANn_IN_LEFT_WORD1(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x34) #define CIPHER_REG_CHANn_IN_LEFT_WORD2(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x38) #define CIPHER_REG_CHANn_OBUF_NUM(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x3C) #define CIPHER_REG_CHANn_OBUF_CNT(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x40) #define CIPHER_REG_CHANn_OFULL_CNT(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x44) #define CIPHER_REG_CHANn_INT_OCNTCFG(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x48) #define CIPHER_REG_CHANn_DEST_LST_SADDR(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x4C) #define CIPHER_REG_CHANn_OAGE_TIMER(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x50) #define CIPHER_REG_CHANn_OAGE_CNT(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x54) #define CIPHER_REG_CHANn_DEST_LST_RADDR(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x58) #define CIPHER_REG_CHANn_DEST_ADDR(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x5C) #define CIPHER_REG_CHANn_DEST_LENGTH(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x60) #define CIPHER_REG_CHANn_OUT_LEFT_BYTE(id) (CIPHER_REG_BASE_ADDR + 0x1000 + (id)*128 + 0x64) #define CIPHER_REG_INT_STATUS (CIPHER_REG_BASE_ADDR + 0x1400 ) #define CIPHER_REG_INT_EN (CIPHER_REG_BASE_ADDR + 0x1404 ) #define CIPHER_REG_INT_RAW (CIPHER_REG_BASE_ADDR + 0x1408 ) #define CIPHER_REG_CHAN0_CFG (CIPHER_REG_BASE_ADDR + 0x1410 ) #define CIPHER_REG_BRAM_ST0 (CIPHER_REG_BASE_ADDR + 0x1420 ) #define CIPHER_REG_IN_ST0 (CIPHER_REG_BASE_ADDR + 0x1424 ) #define CIPHER_REG_IN_ST1 (CIPHER_REG_BASE_ADDR + 0x1428 ) #define CIPHER_REG_IN_ST2 (CIPHER_REG_BASE_ADDR + 0x142C ) #define CIPHER_REG_IN_ST3 (CIPHER_REG_BASE_ADDR + 0x1430 ) #define CIPHER_REG_OUT_ST0 (CIPHER_REG_BASE_ADDR + 0x1434 ) #define CIPHER_REG_OUT_ST1 (CIPHER_REG_BASE_ADDR + 0x1438 ) #define CIPHER_REG_OUT_ST2 (CIPHER_REG_BASE_ADDR + 0x143C ) #define CIPHER_REG_CHANn_GCM_A_LEN_0(id) (CIPHER_REG_BASE_ADDR + 0x0840+ (id)*8) #define CIPHER_REG_CHANn_GCM_A_LEN_1(id) (CIPHER_REG_BASE_ADDR + 0x0840+ (id)*8 + 0x04) #define CIPHER_REG_CHANn_GCM_PC_LEN_0(id) (CIPHER_REG_BASE_ADDR + 0x0880+ (id)*8) #define CIPHER_REG_CHANn_GCM_PC_LEN_1(id) (CIPHER_REG_BASE_ADDR + 0x0880+ (id)*8 + 0x04) #define CIPHER_REG_CHANn_GCM_IV_LEN(id) (CIPHER_REG_BASE_ADDR + 0x08C0+ ((id)&0x04)) #define CIPHER_REG_CHANn_GCM_TAG_VLD (CIPHER_REG_BASE_ADDR + 0x08D0 ) #define CIPHER_REG_CHANn_GCM_GHASH_A_END (CIPHER_REG_BASE_ADDR + 0x08D4 ) #define CIPHER_REG_CHANn_GCM_TAG(id) (CIPHER_REG_BASE_ADDR + 0x0900+ (id)*0x10) #define KLAD_REG_BASE_ADDR g_u32KladBase #define KLAD_REG_KLAD_CTRL (KLAD_REG_BASE_ADDR + 0x00) #define KLAD_REG_DAT_IN (KLAD_REG_BASE_ADDR + 0x10) #define KLAD_REG_ENC_OUT (KLAD_REG_BASE_ADDR + 0x20) /* HASH REGISTERS AND STRUCTURES */ #define CIPHER_HASH_REG_BASE_ADDR g_u32HashBase #define CIPHER_HASH_REG_TOTALLEN_LOW_ADDR (CIPHER_HASH_REG_BASE_ADDR + 0x00) #define CIPHER_HASH_REG_TOTALLEN_HIGH_ADDR (CIPHER_HASH_REG_BASE_ADDR + 0x04) #define CIPHER_HASH_REG_STATUS_ADDR (CIPHER_HASH_REG_BASE_ADDR + 0x08) #define CIPHER_HASH_REG_CTRL_ADDR (CIPHER_HASH_REG_BASE_ADDR + 0x0C) #define CIPHER_HASH_REG_START_ADDR (CIPHER_HASH_REG_BASE_ADDR + 0x10) #define CIPHER_HASH_REG_DMA_START_ADDR (CIPHER_HASH_REG_BASE_ADDR + 0x14) #define CIPHER_HASH_REG_DMA_LEN (CIPHER_HASH_REG_BASE_ADDR + 0x18) #define CIPHER_HASH_REG_DATA_IN (CIPHER_HASH_REG_BASE_ADDR + 0x1C) #define CIPHER_HASH_REG_REC_LEN1 (CIPHER_HASH_REG_BASE_ADDR + 0x20) #define CIPHER_HASH_REG_REC_LEN2 (CIPHER_HASH_REG_BASE_ADDR + 0x24) #define CIPHER_HASH_REG_SHA_OUT1 (CIPHER_HASH_REG_BASE_ADDR + 0x30) #define CIPHER_HASH_REG_SHA_OUT2 (CIPHER_HASH_REG_BASE_ADDR + 0x34) #define CIPHER_HASH_REG_SHA_OUT3 (CIPHER_HASH_REG_BASE_ADDR + 0x38) #define CIPHER_HASH_REG_SHA_OUT4 (CIPHER_HASH_REG_BASE_ADDR + 0x3C) #define CIPHER_HASH_REG_SHA_OUT5 (CIPHER_HASH_REG_BASE_ADDR + 0x40) #define CIPHER_HASH_REG_SHA_OUT6 (CIPHER_HASH_REG_BASE_ADDR + 0x44) #define CIPHER_HASH_REG_SHA_OUT7 (CIPHER_HASH_REG_BASE_ADDR + 0x48) #define CIPHER_HASH_REG_SHA_OUT8 (CIPHER_HASH_REG_BASE_ADDR + 0x4C) #define CIPHER_HASH_REG_MCU_KEY0 (CIPHER_HASH_REG_BASE_ADDR + 0x70) #define CIPHER_HASH_REG_MCU_KEY1 (CIPHER_HASH_REG_BASE_ADDR + 0x74) #define CIPHER_HASH_REG_MCU_KEY2 (CIPHER_HASH_REG_BASE_ADDR + 0x78) #define CIPHER_HASH_REG_MCU_KEY3 (CIPHER_HASH_REG_BASE_ADDR + 0x7C) #define CIPHER_HASH_REG_KL_KEY0 (CIPHER_HASH_REG_BASE_ADDR + 0x80) #define CIPHER_HASH_REG_KL_KEY1 (CIPHER_HASH_REG_BASE_ADDR + 0x84) #define CIPHER_HASH_REG_KL_KEY2 (CIPHER_HASH_REG_BASE_ADDR + 0x88) #define CIPHER_HASH_REG_KL_KEY3 (CIPHER_HASH_REG_BASE_ADDR + 0x8C) #define CIPHER_HASH_REG_INIT1_UPDATE (CIPHER_HASH_REG_BASE_ADDR + 0x90) /* RSA REGISTERS AND STRUCTURES */ #define CIPHER_RSA_REG_BASE_RSA g_u32RsaBase #define SEC_RSA_BUSY_REG (CIPHER_RSA_REG_BASE_RSA + 0x50) #define SEC_RSA_MOD_REG (CIPHER_RSA_REG_BASE_RSA + 0x54) #define SEC_RSA_WSEC_REG (CIPHER_RSA_REG_BASE_RSA + 0x58) #define SEC_RSA_WDAT_REG (CIPHER_RSA_REG_BASE_RSA + 0x5c) #define SEC_RSA_RPKT_REG (CIPHER_RSA_REG_BASE_RSA + 0x60) #define SEC_RSA_RRSLT_REG (CIPHER_RSA_REG_BASE_RSA + 0x64) #define SEC_RSA_START_REG (CIPHER_RSA_REG_BASE_RSA + 0x68) #define SEC_RSA_ADDR_REG (CIPHER_RSA_REG_BASE_RSA + 0x6C) #define SEC_RSA_ERROR_REG (CIPHER_RSA_REG_BASE_RSA + 0x70) #define SEC_RSA_CRC16_REG (CIPHER_RSA_REG_BASE_RSA + 0x74) typedef union { struct { HI_U32 key_addr : 8; //[7:0] HI_U32 reserved : 24; //[31:8] }bits; HI_U32 u32; }CIPHER_CA_STB_KEY_CTRL_U; typedef union { struct { HI_U32 st_vld : 1; //[0] HI_U32 reserved : 31; //[31:1] }bits; HI_U32 u32; }CIPHER_CA_CONFIG_STATE_U; typedef union { struct { HI_U32 hash_rdy : 1; // [0] HI_U32 dma_rdy : 1; // [1] HI_U32 msg_rdy : 1; // [2] HI_U32 rec_rdy : 1; // [3] HI_U32 error_state : 2; // [5:4] HI_U32 len_err : 1; // [6] HI_U32 reserved : 25; // [31:7] } bits; HI_U32 u32; }CIPHER_SHA_STATUS_U; typedef union { struct { HI_U32 read_ctrl : 1; // [0] HI_U32 sha_sel : 2; // [2:1] HI_U32 hardkey_hmac_flag : 1; // [3] HI_U32 hardkey_sel : 1; // [4] HI_U32 small_end_en : 1; // [5] HI_U32 sha_init_update_en : 1; // [6] HI_U32 usedbyarm : 1; // [7] HI_U32 usedbyc51 : 1; // [8] HI_U32 reserved2 : 24; // [31:8] } bits; HI_U32 u32; }CIPHER_SHA_CTRL_U; typedef union { struct { HI_U32 sha_start : 1; // [0] HI_U32 reserved2 : 31; // [31:1] } bits; HI_U32 u32; }CIPHER_SHA_START_U; /*************************** Structure Definition ****************************/ typedef union { struct { HI_U32 hdcp_mode_en : 1; // [0] HI_U32 tx_read : 1; // [1] HI_U32 hdcp_rootkey_sel : 2; // [3:2] HI_U32 rx_read : 1; // [4] HI_U32 rx_sel : 1; // [5] HI_U32 reserved : 26; // [31:6] } bits; HI_U32 u32; } CIPHER_HDCP_MODE_CTRL_U; //Offset:0x820 /* RNG REGISTERS AND STRUCTURES */ #define REG_RNG_BASE_ADDR g_u32RngBase #ifdef CIPHER_RNG_VERSION_1 #define REG_RNG_CTRL_ADDR (REG_RNG_BASE_ADDR + 0x00) #define REG_RNG_NUMBER_ADDR (REG_RNG_BASE_ADDR + 0x04) #define REG_RNG_STAT_ADDR (REG_RNG_BASE_ADDR + 0x08) #elif defined(CIPHER_RNG_VERSION_2) #define HISEC_COM_TRNG_CTRL (REG_RNG_BASE_ADDR + 0x00) #define HISEC_COM_TRNG_FIFO_DATA (REG_RNG_BASE_ADDR + 0x04) #define HISEC_COM_TRNG_DATA_ST (REG_RNG_BASE_ADDR + 0x08) #define HISEC_COM_POKER_CTRL (REG_RNG_BASE_ADDR + 0x20) #define HISEC_COM_POKER_ST (REG_RNG_BASE_ADDR + 0x24) #endif #ifdef __cplusplus } #endif #endif /* end #ifndef __DRV_CIPHER_REG_H__ */ <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/sample/scene_auto/Makefile # Hisilicon Hi35xx sample Makefile include ../Makefile.param SRCS += $(wildcard *.c ./src/common/*.c) SRCS += $(wildcard ./src/adapt/$(HIARCH)/*.c) CFLAGS += -I./src/include -I$(REL_INC) TARGET := sample_scene # compile linux or HuaweiLite include $(PWD)/../Make.$(OSTYPE) <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/api/mpi_cipher.c /********************************************************************************* * * Copyright (C) 2014 Hisilicon Technologies Co., Ltd. All rights reserved. * * This program is confidential and proprietary to Hisilicon Technologies Co., Ltd. * (Hisilicon), and may not be copied, reproduced, modified, disclosed to * others, published or used, in whole or in part, without the express prior * written permission of Hisilicon. * ***********************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <pthread.h> #include <sys/time.h> #include "hi_mpi_cipher.h" #include "hi_error_mpi.h" #include "drv_cipher_reg.h" #include "hi_mmz_api.h" #include "hi_rsa.h" #include "config.h" #define HI_PRINT printf #define HI_FATAL_CIPHER(format, arg...) HI_PRINT( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #define HI_ERR_CIPHER(format, arg...) HI_PRINT( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) #define HI_INFO_CIPHER(format, arg...) //HI_PRINT( "%s,%d: " format , __FUNCTION__, __LINE__, ## arg) HI_S32 g_CipherDevFd = -1; static HI_S32 g_CipherInitCounter = -1; static pthread_mutex_t g_CipherMutex = PTHREAD_MUTEX_INITIALIZER; #define HI_CIPHER_LOCK() (void)pthread_mutex_lock(&g_CipherMutex); #define HI_CIPHER_UNLOCK() (void)pthread_mutex_unlock(&g_CipherMutex); #define CHECK_CIPHER_OPEN()\ do{\ HI_CIPHER_LOCK();\ if (g_CipherInitCounter < 0)\ {\ HI_ERR_CIPHER("CIPHER is not open.\n");\ HI_CIPHER_UNLOCK();\ return HI_ERR_CIPHER_NOT_INIT;\ }\ HI_CIPHER_UNLOCK();\ }while(0) #define RSA_SIGN 1 #define ASN1_HASH_SHA1 "\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14" #define ASN1_HASH_SHA256 "\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x05\x00\x04\x20" static const HI_S8 EMPTY_L_SHA1[] = "\xda\x39\xa3\xee\x5e\x6b\x4b\x0d\x32\x55\xbf\xef\x95\x60\x18\x90\xaf\xd8\x07\x09"; static const HI_S8 EMPTY_L_SHA256[] = "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24\x27\xae\x41\xe4\x64\x9b\x93\x4c\xa4\x95\x99\x1b\x78\x52\xb8\x55"; #ifdef CIPHER_HASH_SUPPORT static pthread_mutex_t g_HashMutex = PTHREAD_MUTEX_INITIALIZER; #define HI_HASH_LOCK() (void)pthread_mutex_lock(&g_HashMutex); #define HI_HASH_UNLOCK() (void)pthread_mutex_unlock(&g_HashMutex); #define HASH_BLOCK_SIZE (64) #define HASH_PAD_MAX_LEN (64) #define HASH1_SIGNATURE_SIZE (20) #define HASH256_SIGNATURE_SIZE (32) #define HASH_MMZ_BUF_LEN (1*1024*1024) //1M #define HASH_MMZ_TAIL_LEN (8*1024) //8K #define HASH_CHANNAL_MAX_NUM (8) #define RSA_SIGN 1 typedef struct hiCI_MMZ_BUF_S { HI_U32 u32StartPhyAddr; HI_U8* pu8StartVirAddr; HI_U32 u32Size; }MMZ_BUFFER_S; typedef struct hiHASH_INFO_S { HI_BOOL bIsUsed; HI_HANDLE hHandle; HI_UNF_CIPHER_HASH_TYPE_E enShaType; HI_U32 u32TotalDataLen; HI_U32 u32ShaVal[8]; HI_U32 u32ShaLen; HI_U8 u8LastBlock[HASH_BLOCK_SIZE]; HI_U8 u8Mac[HASH_BLOCK_SIZE]; HI_U32 u8LastBlockSize; MMZ_BUFFER_S stMMZBuffer; }HASH_INFO_S; static HASH_INFO_S g_stCipherHashData[HASH_CHANNAL_MAX_NUM]; static MMZ_BUFFER_S s_stMMZBuffer; HI_U32 g_u32HashBaseBufferLen = HASH_MMZ_BUF_LEN; static void _memset(void *s, int c, size_t n) { int i; char *p = s; for(i=0; i<n; i++) p[i] = c; return; } static HI_VOID Cipher_HashMmzDeInit(HI_VOID); static HI_S32 Cipher_HashMmzInit(HI_VOID) { HI_U32 u32Testcached = 0; HI_U32 u32HashBufLen = 0; if( s_stMMZBuffer.u32StartPhyAddr == 0) { u32HashBufLen = g_u32HashBaseBufferLen + HASH_MMZ_TAIL_LEN; s_stMMZBuffer.u32StartPhyAddr = (HI_U32)HI_MMZ_New(u32HashBufLen, 0, NULL, "CIPHER_HashBuffer"); if (0 == s_stMMZBuffer.u32StartPhyAddr) { g_u32HashBaseBufferLen = g_u32HashBaseBufferLen / 2; u32HashBufLen = g_u32HashBaseBufferLen + HASH_MMZ_TAIL_LEN; s_stMMZBuffer.u32StartPhyAddr = (HI_U32)HI_MMZ_New(u32HashBufLen, 0, NULL, "CIPHER_HashBuffer"); if (0 == s_stMMZBuffer.u32StartPhyAddr) { g_u32HashBaseBufferLen = g_u32HashBaseBufferLen / 2; u32HashBufLen = g_u32HashBaseBufferLen + HASH_MMZ_TAIL_LEN; s_stMMZBuffer.u32StartPhyAddr = (HI_U32)HI_MMZ_New(u32HashBufLen, 0, NULL, "CIPHER_HashBuffer"); if (0 == s_stMMZBuffer.u32StartPhyAddr) { HI_ERR_CIPHER("Error: Get mmz buffer for hash failed!\n"); return HI_FAILURE; } } } s_stMMZBuffer.pu8StartVirAddr = (HI_U8*)HI_MMZ_Map(s_stMMZBuffer.u32StartPhyAddr, u32Testcached); if( 0 == (HI_VOID *)s_stMMZBuffer.pu8StartVirAddr ) { HI_ERR_CIPHER("Error: Map mmz buffer for hash failed!\n"); HI_MMZ_Delete(s_stMMZBuffer.u32StartPhyAddr); _memset(&s_stMMZBuffer, 0, sizeof(s_stMMZBuffer)); return HI_FAILURE; } HI_INFO_CIPHER("Hash mmz, phy: 0x%x, via: %p, size: 0x%x\n", s_stMMZBuffer.u32StartPhyAddr, s_stMMZBuffer.pu8StartVirAddr, u32HashBufLen); } return HI_SUCCESS; } static HI_VOID Cipher_HashMmzDeInit(HI_VOID) { if (s_stMMZBuffer.u32StartPhyAddr == 0) { return; } (HI_VOID)HI_MMZ_Unmap(s_stMMZBuffer.u32StartPhyAddr); (HI_VOID)HI_MMZ_Delete(s_stMMZBuffer.u32StartPhyAddr); _memset(&s_stMMZBuffer, 0, sizeof(s_stMMZBuffer)); s_stMMZBuffer.u32StartPhyAddr = 0; } #endif HI_S32 HI_MPI_CIPHER_Init(HI_VOID) { HI_S32 ret = HI_SUCCESS; HI_CIPHER_LOCK(); if (g_CipherInitCounter > 0) { g_CipherInitCounter++; HI_CIPHER_UNLOCK(); return HI_SUCCESS; } g_CipherDevFd = open("/dev/"UMAP_DEVNAME_CIPHER, O_RDWR, 0); if (g_CipherDevFd < 0) { HI_FATAL_CIPHER("Open CIPHER err.\n"); HI_CIPHER_UNLOCK(); return HI_ERR_CIPHER_FAILED_INIT; } g_CipherInitCounter = 1; #ifdef CIPHER_HASH_SUPPORT _memset(g_stCipherHashData, 0, sizeof(g_stCipherHashData)); _memset(&s_stMMZBuffer, 0, sizeof(s_stMMZBuffer)); ret = Cipher_HashMmzInit(); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("Hash mmz buffer initial failed!\n"); HI_CIPHER_UNLOCK(); return HI_FAILURE; } #endif HI_CIPHER_UNLOCK(); return ret; } HI_S32 HI_MPI_CIPHER_DeInit(HI_VOID) { HI_S32 Ret; HI_CIPHER_LOCK(); if(g_CipherInitCounter > 0) { g_CipherInitCounter--; } if(g_CipherInitCounter != 0) { HI_CIPHER_UNLOCK(); return HI_SUCCESS; } Ret = close(g_CipherDevFd); if(HI_SUCCESS != Ret) { HI_FATAL_CIPHER("Close cipher err.\n"); g_CipherInitCounter++; HI_CIPHER_UNLOCK(); return HI_ERR_CIPHER_NOT_INIT; } g_CipherDevFd = -1; g_CipherInitCounter = -1; #ifdef CIPHER_HASH_SUPPORT Cipher_HashMmzDeInit(); _memset(&s_stMMZBuffer, 0, sizeof(s_stMMZBuffer)); #endif HI_CIPHER_UNLOCK(); return HI_SUCCESS; } #ifdef CIPHER_MULTICIPHER_SUPPORT HI_S32 HI_MPI_CIPHER_CreateHandle(HI_HANDLE* phCipher) { HI_S32 Ret = HI_SUCCESS; CIPHER_HANDLE_S stCIHandle = {0}; if ( NULL == phCipher ) { HI_ERR_CIPHER("Invalid param, null pointer!\n"); return HI_ERR_CIPHER_INVALID_PARA; } CHECK_CIPHER_OPEN(); Ret=ioctl(g_CipherDevFd, CMD_CIPHER_CREATEHANDLE, &stCIHandle); if (Ret != HI_SUCCESS) { return Ret; } *phCipher = stCIHandle.hCIHandle; return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_DestroyHandle(HI_HANDLE hCipher) { HI_S32 Ret; CHECK_CIPHER_OPEN(); Ret=ioctl(g_CipherDevFd, CMD_CIPHER_DESTROYHANDLE, &hCipher); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_ConfigHandle(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl) { HI_S32 Ret; CIPHER_Config_CTRL configdata; if (NULL == pstCtrl) { HI_ERR_CIPHER("para pstCtrl is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } memcpy(&configdata.CIpstCtrl, pstCtrl, sizeof(HI_UNF_CIPHER_CTRL_S)); configdata.CIHandle=hCipher; if(configdata.CIpstCtrl.enWorkMode >= HI_UNF_CIPHER_WORK_MODE_BUTT) { HI_ERR_CIPHER("para set CIPHER wokemode is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } CHECK_CIPHER_OPEN(); Ret=ioctl(g_CipherDevFd, CMD_CIPHER_CONFIGHANDLE, &configdata); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_Encrypt(HI_HANDLE hCipher, HI_U32 u32SrcPhyAddr, HI_U32 u32DestPhyAddr, HI_U32 u32ByteLength) { HI_S32 Ret; CIPHER_DATA_S CIdata; if ( u32ByteLength < HI_UNF_CIPHER_MIN_CRYPT_LEN || u32ByteLength > HI_UNF_CIPHER_MAX_CRYPT_LEN) { return HI_ERR_CIPHER_INVALID_PARA; } CIdata.ScrPhyAddr=u32SrcPhyAddr; CIdata.DestPhyAddr=u32DestPhyAddr; CIdata.u32DataLength=u32ByteLength; CIdata.CIHandle=hCipher; CHECK_CIPHER_OPEN(); Ret=ioctl(g_CipherDevFd, CMD_CIPHER_ENCRYPT, &CIdata); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_Decrypt(HI_HANDLE hCipher, HI_U32 u32SrcPhyAddr, HI_U32 u32DestPhyAddr, HI_U32 u32ByteLength) { HI_S32 Ret; CIPHER_DATA_S CIdata; if (u32ByteLength < HI_UNF_CIPHER_MIN_CRYPT_LEN || u32ByteLength > HI_UNF_CIPHER_MAX_CRYPT_LEN) { return HI_ERR_CIPHER_INVALID_PARA; } CIdata.ScrPhyAddr=u32SrcPhyAddr; CIdata.DestPhyAddr=u32DestPhyAddr; CIdata.u32DataLength = u32ByteLength; CIdata.CIHandle=hCipher; CHECK_CIPHER_OPEN(); Ret=ioctl(g_CipherDevFd,CMD_CIPHER_DECRYPT, &CIdata); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_EncryptMulti(HI_HANDLE hCipher, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { HI_S32 Ret; HI_U32 chnid; HI_U32 i; CIPHER_DATA_S CIdata; HI_UNF_CIPHER_DATA_S *pPkgTmp; chnid=hCipher&0x00ff; if ( 0 == chnid ) { HI_ERR_CIPHER("invalid chnid 0.\n"); return HI_ERR_CIPHER_INVALID_PARA; } for (i = 0; i < u32DataPkgNum; i++) { pPkgTmp = pstDataPkg + i; if (pPkgTmp->u32ByteLength < HI_UNF_CIPHER_MIN_CRYPT_LEN || pPkgTmp->u32ByteLength > HI_UNF_CIPHER_MAX_CRYPT_LEN) { HI_ERR_CIPHER("Pkg%d 's length(%d) invalid.\n", i, pPkgTmp->u32ByteLength); return HI_ERR_CIPHER_INVALID_PARA; } } CIdata.ScrPhyAddr=(HI_U32)pstDataPkg; CIdata.DestPhyAddr= 0; CIdata.u32DataLength=u32DataPkgNum; CIdata.CIHandle=hCipher; CHECK_CIPHER_OPEN(); Ret=ioctl(g_CipherDevFd,CMD_CIPHER_ENCRYPTMULTI, &CIdata); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_DecryptMulti(HI_HANDLE hCipher, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { HI_S32 Ret; HI_U32 chnid; HI_U32 i; CIPHER_DATA_S CIdata; HI_UNF_CIPHER_DATA_S *pPkgTmp; chnid=hCipher&0x00ff; if ( 0 == chnid ) { HI_ERR_CIPHER("invalid chnid 0.\n"); return HI_ERR_CIPHER_INVALID_PARA; } for (i = 0; i < u32DataPkgNum; i++) { pPkgTmp = pstDataPkg + i; if (pPkgTmp->u32ByteLength < HI_UNF_CIPHER_MIN_CRYPT_LEN || pPkgTmp->u32ByteLength > HI_UNF_CIPHER_MAX_CRYPT_LEN) { HI_ERR_CIPHER("Pkg%d 's length(%d) invalid.\n", i, pPkgTmp->u32ByteLength); return HI_ERR_CIPHER_INVALID_PARA; } } CIdata.ScrPhyAddr=(HI_U32)pstDataPkg; CIdata.DestPhyAddr= 0; CIdata.u32DataLength=u32DataPkgNum; CIdata.CIHandle=hCipher; CHECK_CIPHER_OPEN(); Ret = ioctl(g_CipherDevFd,CMD_CIPHER_DECRYPTMULTI, &CIdata); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_EncryptMultiEx(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { HI_S32 Ret; HI_U32 i; HI_UNF_CIPHER_DATA_S *pPkgTmp; CIPHER_MUTIL_EX_DATA_S stMutliEx; for (i = 0; i < u32DataPkgNum; i++) { pPkgTmp = pstDataPkg + i; if (pPkgTmp->u32ByteLength < 8 || pPkgTmp->u32ByteLength > 0xfffff) { printf("Pkg%d 's length(%d) invalid.\n", i, pPkgTmp->u32ByteLength); return HI_ERR_CIPHER_INVALID_PARA; } } stMutliEx.hCipher = hCipher; stMutliEx.CIpstCtrl = *pstCtrl; stMutliEx.pstPkg = pstDataPkg; stMutliEx.u32PkgNum = u32DataPkgNum; Ret=ioctl(g_CipherDevFd, HI_CIPHER_ENCRYPTMULTI_EX, &stMutliEx); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_DecryptMultiEx(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { HI_S32 Ret; HI_U32 i; HI_UNF_CIPHER_DATA_S *pPkgTmp; CIPHER_MUTIL_EX_DATA_S stMutliEx; for (i = 0; i < u32DataPkgNum; i++) { pPkgTmp = pstDataPkg + i; if (pPkgTmp->u32ByteLength < 8 || pPkgTmp->u32ByteLength > 0xfffff) { printf("Pkg%d 's length(%d) invalid.\n", i, pPkgTmp->u32ByteLength); return HI_ERR_CIPHER_INVALID_PARA; } } stMutliEx.hCipher = hCipher; stMutliEx.CIpstCtrl = *pstCtrl; stMutliEx.pstPkg = pstDataPkg; stMutliEx.u32PkgNum = u32DataPkgNum; Ret=ioctl(g_CipherDevFd, HI_CIPHER_DECRYPTMULTI_EX, &stMutliEx); if (Ret != HI_SUCCESS) { return Ret; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_GetTag(HI_HANDLE hCipherHandle, HI_U8 *pstTag) { HI_S32 Ret; CIPHER_TAG stTag; if (pstTag == HI_NULL) { HI_ERR_CIPHER("invalid para.\n"); return HI_ERR_CIPHER_INVALID_POINT; } stTag.CIHandle = hCipherHandle; Ret = ioctl(g_CipherDevFd,CMD_CIPHER_GETTAG, &stTag); if (Ret != HI_SUCCESS) { return Ret; } memcpy(pstTag, stTag.u32Tag, stTag.u32Len); return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_GetHandleConfig(HI_HANDLE hCipherHandle, HI_UNF_CIPHER_CTRL_S* pstCtrl) { HI_S32 Ret; CIPHER_Config_CTRL configdata; if (pstCtrl == HI_NULL) { HI_ERR_CIPHER("invalid para.\n"); return HI_ERR_CIPHER_INVALID_POINT; } CHECK_CIPHER_OPEN(); configdata.CIHandle = hCipherHandle; _memset(&configdata.CIpstCtrl, 0, sizeof(configdata.CIpstCtrl)); Ret = ioctl(g_CipherDevFd, CMD_CIPHER_GETHANDLECONFIG, &configdata); if (Ret != HI_SUCCESS) { return Ret; } memcpy(pstCtrl, &configdata.CIpstCtrl, sizeof(configdata.CIpstCtrl)); return HI_SUCCESS; } #ifdef CIPHER_KLAD_SUPPORT HI_S32 HI_MPI_CIPHER_KladEncryptKey(HI_UNF_CIPHER_KEY_SRC_E enRootKey, HI_UNF_CIPHER_KLAD_TARGET_E enTarget, HI_U8 *pu8CleanKey, HI_U8* pu8EcnryptKey, HI_U32 u32KeyLen) { HI_S32 Ret; CIPHER_KLAD_KEY_S stKlad; HI_U32 i; if ((pu8CleanKey == HI_NULL) || (pu8EcnryptKey == HI_NULL)) { HI_ERR_CIPHER("invalid para.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if ((u32KeyLen == 0) || (u32KeyLen % 16 != 0)) { HI_ERR_CIPHER("invalid key len 0x%x.\n", u32KeyLen); return HI_ERR_CIPHER_INVALID_POINT; } stKlad.enRootKey = enRootKey; stKlad.enTarget = enTarget; for(i=0; i<u32KeyLen/16; i++) { memcpy(stKlad.u32CleanKey, pu8CleanKey + i*16, 16); Ret=ioctl(g_CipherDevFd, CMD_CIPHER_KLAD_KEY, &stKlad); if (Ret != HI_SUCCESS) { return Ret; } memcpy(pu8EcnryptKey + i*16, stKlad.u32EncryptKey, 16); } return HI_SUCCESS; } #endif #endif #ifdef CIPHER_HASH_SUPPORT static HI_U32 HashMsgPadding(HI_U8 *pu8Msg, HI_U32 u32ByteLen, HI_U32 u32TotalLen) { HI_U32 u32Tmp = 0; HI_U32 u32PaddingLen; if( NULL == pu8Msg ) { HI_ERR_CIPHER("Error! Null pointer input!\n"); return -1; } u32Tmp = u32TotalLen % 64; /* 56 = 64 - 8, 120 = 56 + 64 */ u32PaddingLen = (u32Tmp < 56) ? (56 - u32Tmp) : (120 - u32Tmp); /* add 8 bytes fix data length */ u32PaddingLen += 8; /* Format(binary): {data|1000...00| fix_data_len(bits)} */ pu8Msg[u32ByteLen++] = 0x80; _memset(&pu8Msg[u32ByteLen], 0, u32PaddingLen - 1 - 8); u32ByteLen+=u32PaddingLen - 1 - 8; /* write 8 bytes fix data length */ pu8Msg[u32ByteLen++] = 0x00; pu8Msg[u32ByteLen++] = 0x00; pu8Msg[u32ByteLen++] = 0x00; pu8Msg[u32ByteLen++] = (HI_U8)((u32TotalLen >> 29)&0x07); pu8Msg[u32ByteLen++] = (HI_U8)((u32TotalLen >> 21)&0xff); pu8Msg[u32ByteLen++] = (HI_U8)((u32TotalLen >> 13)&0xff); pu8Msg[u32ByteLen++] = (HI_U8)((u32TotalLen >> 5)&0xff); pu8Msg[u32ByteLen++] = (HI_U8)((u32TotalLen << 3)&0xff); return u32ByteLen; } static HI_S32 CIPHER_HashInit(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_HANDLE *pHashHandle) { HI_S32 ret = HI_SUCCESS; CIPHER_HASH_DATA_S stHashData; HI_U32 u32SoftId; HASH_INFO_S *pstHashInfo; CHECK_CIPHER_OPEN(); if( (NULL == pstHashAttr) || (NULL == pHashHandle) || (pstHashAttr->eShaType >= HI_UNF_CIPHER_HASH_TYPE_BUTT)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_ERR_CIPHER_INVALID_PARA; } HI_HASH_LOCK(); for(u32SoftId=0; u32SoftId<HASH_CHANNAL_MAX_NUM; u32SoftId++) { if (!g_stCipherHashData[u32SoftId].bIsUsed) { break; } } if(u32SoftId >= HASH_CHANNAL_MAX_NUM) { HI_ERR_CIPHER("Hash module is busy!\n"); HI_HASH_UNLOCK(); return HI_FAILURE; } pstHashInfo = &g_stCipherHashData[u32SoftId]; _memset(pstHashInfo, 0, sizeof(HASH_INFO_S)); _memset(&stHashData, 0, sizeof(CIPHER_HASH_DATA_S)); pstHashInfo->stMMZBuffer = s_stMMZBuffer; pstHashInfo->enShaType = pstHashAttr->eShaType; if ( (HI_UNF_CIPHER_HASH_TYPE_SHA1 == pstHashAttr->eShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pstHashAttr->eShaType )) { stHashData.enShaType = HI_UNF_CIPHER_HASH_TYPE_SHA1; pstHashInfo->u32ShaLen = HASH1_SIGNATURE_SIZE; pstHashInfo->u32ShaVal[0] = 0x01234567; pstHashInfo->u32ShaVal[1] = 0x89abcdef; pstHashInfo->u32ShaVal[2] = 0xfedcba98; pstHashInfo->u32ShaVal[3] = 0x76543210; pstHashInfo->u32ShaVal[4] = 0xf0e1d2c3; } else if ( (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pstHashAttr->eShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pstHashAttr->eShaType)) { stHashData.enShaType = HI_UNF_CIPHER_HASH_TYPE_SHA256; pstHashInfo->u32ShaLen = HASH256_SIGNATURE_SIZE; pstHashInfo->u32ShaVal[0] = 0x67e6096a; pstHashInfo->u32ShaVal[1] = 0x85ae67bb; pstHashInfo->u32ShaVal[2] = 0x72f36e3c; pstHashInfo->u32ShaVal[3] = 0x3af54fa5; pstHashInfo->u32ShaVal[4] = 0x7f520e51; pstHashInfo->u32ShaVal[5] = 0x8c68059b; pstHashInfo->u32ShaVal[6] = 0xabd9831f; pstHashInfo->u32ShaVal[7] = 0x19cde05b; } else { ;/* Invalid hash/hmac type, no need to be processed, it have been processed before */ } ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCHASHINIT, &stHashData); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Error, ioctl for hash initial failed!\n"); HI_HASH_UNLOCK(); return ret; } pstHashInfo->bIsUsed = HI_TRUE; *pHashHandle = u32SoftId; HI_HASH_UNLOCK(); return HI_SUCCESS; } static HI_S32 CIPHER_HashUpdate(HI_HANDLE hHashHandle, HI_U8 *pu8InputData, HI_U32 u32InputDataLen) { HI_S32 ret = HI_SUCCESS; HASH_INFO_S *pstHashInfo = &g_stCipherHashData[hHashHandle]; HI_U32 u32Tmp = 0; HI_U32 u32TotalSize; HI_U32 u32CopySize; HI_U32 u32BufInUsedLen = 0; CIPHER_HASH_DATA_S stHashData; HI_U32 i = 0; CHECK_CIPHER_OPEN(); if((NULL == pu8InputData) || (hHashHandle >= HASH_CHANNAL_MAX_NUM)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_ERR_CIPHER_INVALID_PARA; } HI_HASH_LOCK(); if (0 == u32InputDataLen) { if( pstHashInfo->u32TotalDataLen > 0) { HI_HASH_UNLOCK(); return HI_SUCCESS; } else { pstHashInfo->bIsUsed = HI_FALSE; HI_HASH_UNLOCK(); return HI_ERR_CIPHER_INVALID_PARA; } } pstHashInfo->stMMZBuffer.u32Size = 0; pstHashInfo->u32TotalDataLen += u32InputDataLen; u32TotalSize = pstHashInfo->u8LastBlockSize + u32InputDataLen; if( u32TotalSize < HASH_BLOCK_SIZE) { memcpy(pstHashInfo->u8LastBlock+pstHashInfo->u8LastBlockSize, pu8InputData, u32InputDataLen); pstHashInfo->u8LastBlockSize+=u32InputDataLen; HI_HASH_UNLOCK(); return HI_SUCCESS; } else { memcpy(pstHashInfo->stMMZBuffer.pu8StartVirAddr, pstHashInfo->u8LastBlock, pstHashInfo->u8LastBlockSize); pstHashInfo->stMMZBuffer.u32Size = pstHashInfo->u8LastBlockSize; /* save tail data */ _memset(pstHashInfo->u8LastBlock, 0, HASH_BLOCK_SIZE); pstHashInfo->u8LastBlockSize = (u32InputDataLen + pstHashInfo->stMMZBuffer.u32Size) % HASH_BLOCK_SIZE; memcpy(pstHashInfo->u8LastBlock, pu8InputData + (u32InputDataLen - pstHashInfo->u8LastBlockSize), pstHashInfo->u8LastBlockSize); } u32TotalSize = u32InputDataLen - pstHashInfo->u8LastBlockSize; u32Tmp = (u32TotalSize + pstHashInfo->stMMZBuffer.u32Size + g_u32HashBaseBufferLen - 1) / g_u32HashBaseBufferLen; /* Send data down piece by piece */ for ( i = 0 ; i < u32Tmp; i++ ) { u32CopySize = g_u32HashBaseBufferLen - pstHashInfo->stMMZBuffer.u32Size; if (u32CopySize > (u32TotalSize - u32BufInUsedLen)) { u32CopySize = u32TotalSize - u32BufInUsedLen; } memcpy((HI_U8 *)pstHashInfo->stMMZBuffer.pu8StartVirAddr + pstHashInfo->stMMZBuffer.u32Size, pu8InputData + u32BufInUsedLen, u32CopySize); pstHashInfo->stMMZBuffer.u32Size += u32CopySize; u32BufInUsedLen+=u32CopySize; stHashData.enShaType = pstHashInfo->enShaType; stHashData.u32DataLen = pstHashInfo->stMMZBuffer.u32Size; stHashData.u32DataPhy = pstHashInfo->stMMZBuffer.u32StartPhyAddr; memcpy(stHashData.u32ShaVal, pstHashInfo->u32ShaVal, pstHashInfo->u32ShaLen); pstHashInfo->stMMZBuffer.u32Size = 0; ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCHASHUPDATE, &stHashData); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Error, ioctl for hash update failed!\n"); pstHashInfo->bIsUsed = HI_FALSE; HI_HASH_UNLOCK(); return ret; } memcpy(pstHashInfo->u32ShaVal, stHashData.u32ShaVal, pstHashInfo->u32ShaLen); } if((u32BufInUsedLen + pstHashInfo->u8LastBlockSize) != u32InputDataLen) { HI_ERR_CIPHER("Error, Invalid data size: 0x%x!\n", u32BufInUsedLen); pstHashInfo->bIsUsed = HI_FALSE; HI_HASH_UNLOCK(); return HI_FAILURE; } HI_HASH_UNLOCK(); return HI_SUCCESS; } static HI_S32 CIPHER_HashFinal(HI_HANDLE hHashHandle, HI_U8 *pu8OutputHash) { HI_S32 ret = HI_SUCCESS; HASH_INFO_S *pstHashInfo = &g_stCipherHashData[hHashHandle]; CIPHER_HASH_DATA_S stHashData; HI_U32 u32Tmp = 0; if(( NULL == pu8OutputHash ) || (hHashHandle >= HASH_CHANNAL_MAX_NUM)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_FAILURE; } CHECK_CIPHER_OPEN(); HI_HASH_LOCK(); memcpy(pstHashInfo->stMMZBuffer.pu8StartVirAddr, pstHashInfo->u8LastBlock, pstHashInfo->u8LastBlockSize); pstHashInfo->stMMZBuffer.u32Size = pstHashInfo->u8LastBlockSize; _memset(pstHashInfo->u8LastBlock, 0, HASH_BLOCK_SIZE); pstHashInfo->u8LastBlockSize = 0; u32Tmp = HashMsgPadding(pstHashInfo->stMMZBuffer.pu8StartVirAddr, pstHashInfo->stMMZBuffer.u32Size, pstHashInfo->u32TotalDataLen); // HI_PRINT_HEX("SHA", (HI_U8*)pstHashInfo->u32ShaVal, pstHashInfo->u32ShaLen); // HI_PRINT_HEX("DATA", pstHashInfo->stMMZBuffer.pu8StartVirAddr, u32Tmp); stHashData.enShaType = pstHashInfo->enShaType; stHashData.u32DataLen = u32Tmp; stHashData.u32DataPhy = pstHashInfo->stMMZBuffer.u32StartPhyAddr; memcpy(stHashData.u32ShaVal, pstHashInfo->u32ShaVal, pstHashInfo->u32ShaLen); ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCHASHFINAL, &stHashData); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Error, ioctl for hash final failed!\n"); pstHashInfo->bIsUsed = HI_FALSE; HI_HASH_UNLOCK(); return ret; } memcpy(pu8OutputHash, stHashData.u32ShaVal, pstHashInfo->u32ShaLen); pstHashInfo->bIsUsed = HI_FALSE; HI_HASH_UNLOCK(); return HI_SUCCESS; } static HI_S32 CIPHER_HmacKeyInit(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_U8 au8Hmackey[HASH_BLOCK_SIZE]) { HI_S32 ret = HI_SUCCESS; HI_HANDLE hHash = 0; if((pstHashAttr == NULL)||(pstHashAttr->pu8HMACKey == NULL)||(pstHashAttr->u32HMACKeyLen == 0)) { HI_ERR_CIPHER("Invalid parameters.\n"); return HI_ERR_CIPHER_INVALID_PARA; } /*key length is less than 64bytes, copy directly*/ if(pstHashAttr->u32HMACKeyLen <= HASH_BLOCK_SIZE) { memcpy(au8Hmackey, pstHashAttr->pu8HMACKey, pstHashAttr->u32HMACKeyLen); return HI_SUCCESS; } /*key length more than 64bytes, calcute the hash result*/ ret = CIPHER_HashInit(pstHashAttr, &hHash); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Cipher_HashInit failure, ret=%d\n", ret); return HI_FAILURE; } ret = CIPHER_HashUpdate(hHash, pstHashAttr->pu8HMACKey, pstHashAttr->u32HMACKeyLen); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Cipher_HashUpdate failure, ret=%d\n", ret); return HI_FAILURE; } ret = CIPHER_HashFinal(hHash,au8Hmackey); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Cipher_HashFinal failure, ret=%d\n", ret); return HI_FAILURE; } return HI_SUCCESS; } static HI_S32 CIPHER_HmacInit(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_HANDLE *pHashHandle) { HI_S32 ret = HI_SUCCESS; HI_U8 key_pad[HASH_BLOCK_SIZE]; HASH_INFO_S *pstHashInfo; HI_U32 i = 0; if( (NULL == pstHashAttr) || (NULL == pHashHandle) || (pstHashAttr->eShaType >= HI_UNF_CIPHER_HASH_TYPE_BUTT) || (NULL == pstHashAttr->pu8HMACKey) || (0 == pstHashAttr->u32HMACKeyLen)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_ERR_CIPHER_INVALID_PARA; } CHECK_CIPHER_OPEN(); /* Init hmac key */ _memset(key_pad, 0, sizeof(key_pad)); ret = CIPHER_HmacKeyInit(pstHashAttr, key_pad); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("Hmac key initial failed!\n"); return HI_FAILURE; } /* hash i_key_pad and message start */ ret = CIPHER_HashInit(pstHashAttr, pHashHandle); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("hash i_key_pad and message start failed!\n"); return HI_FAILURE; } pstHashInfo = (HASH_INFO_S *)&g_stCipherHashData[*pHashHandle]; memcpy(pstHashInfo->u8Mac, key_pad, HASH_BLOCK_SIZE); /* generate i_key_pad */ for(i=0; i < HASH_BLOCK_SIZE; i++) { key_pad[i] ^= 0x36; } /* hash i_key_pad update */ ret = CIPHER_HashUpdate(*pHashHandle, key_pad, HASH_BLOCK_SIZE); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("hash i_key_pad and message update failed!\n"); return HI_FAILURE; } return HI_SUCCESS; } static HI_S32 CIPHER_HmacUpdate(HI_HANDLE hHashHandle, HI_U8 *pu8InputData, HI_U32 u32InputDataLen) { HI_S32 ret = HI_SUCCESS; ret = CIPHER_HashUpdate(hHashHandle, pu8InputData, u32InputDataLen); if ( HI_SUCCESS != ret ) { HI_ERR_CIPHER("hmac message update failed!\n"); return HI_FAILURE; } return HI_SUCCESS; } static HI_S32 CIPHER_HmacFinal(HI_HANDLE hHashHandle, HI_U8 *pu8Output) { HI_S32 ret = HI_SUCCESS; HASH_INFO_S *pstHashInfo; HI_HANDLE hHash = HI_INVALID_HANDLE; HI_UNF_CIPHER_HASH_ATTS_S stHashAttr; HI_U8 hash_sum_1[HASH256_SIGNATURE_SIZE]; HI_U8 key_pad[HASH_BLOCK_SIZE]; HI_U32 i; if (( NULL == pu8Output ) || (hHashHandle >= HASH_CHANNAL_MAX_NUM)) { HI_ERR_CIPHER("Invalid param input, hmac final failed!\n"); return HI_ERR_CIPHER_INVALID_POINT; } pstHashInfo = &g_stCipherHashData[hHashHandle]; _memset(&stHashAttr, 0, sizeof(stHashAttr)); stHashAttr.eShaType = pstHashInfo->enShaType; memcpy(key_pad, pstHashInfo->u8Mac, HASH_BLOCK_SIZE); /* hash i_key_pad+message finished */ ret = CIPHER_HashFinal(hHashHandle, hash_sum_1); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Hash Final i_key_pad+message failure, ret=%d\n", ret); return HI_FAILURE; } /* generate o_key_pad */ for(i=0; i < HASH_BLOCK_SIZE; i++) { key_pad[i] ^= 0x5c; } /* hash o_key_pad+hash_sum_1 start */ ret = CIPHER_HashInit(&stHashAttr, &hHash); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Hash Init o_key_pad+hash_sum_1 failure, ret=%d\n", ret); return HI_FAILURE; } /* hash o_key_pad */ ret = CIPHER_HashUpdate(hHash, key_pad, HASH_BLOCK_SIZE); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Hash Update o_key_pad failure, ret=%d\n", ret); return HI_FAILURE; } /* hash hash_sum_1 */ if ( HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == stHashAttr.eShaType ) { ret = CIPHER_HashUpdate(hHash, (HI_U8 *)hash_sum_1, HASH1_SIGNATURE_SIZE); } else { ret = CIPHER_HashUpdate(hHash, (HI_U8 *)hash_sum_1, HASH256_SIGNATURE_SIZE); } if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Hash Update hash_sum_1 failure, ret=%d\n", ret); return HI_FAILURE; } /* hash o_key_pad+hash_sum_1 finished */ ret = CIPHER_HashFinal(hHash, pu8Output); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Hash Final o_key_pad+hash_sum_1 failure, ret=%d\n", ret); return HI_FAILURE; } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_HashInit(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_HANDLE *pHashHandle) { if ((HI_UNF_CIPHER_HASH_TYPE_SHA1 == pstHashAttr->eShaType) || (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pstHashAttr->eShaType) ) { return CIPHER_HashInit(pstHashAttr, pHashHandle); } else if ((HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pstHashAttr->eShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pstHashAttr->eShaType)) { return CIPHER_HmacInit(pstHashAttr, pHashHandle); } return HI_FAILURE; } HI_S32 HI_MPI_CIPHER_HashUpdate(HI_HANDLE hHashHandle, HI_U8 *pu8InputData, HI_U32 u32InputDataLen) { HASH_INFO_S *pstHashInfo = (HASH_INFO_S*)&g_stCipherHashData[hHashHandle]; if((NULL == pu8InputData) || (hHashHandle >= HASH_CHANNAL_MAX_NUM)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if ( (HI_UNF_CIPHER_HASH_TYPE_SHA1 == pstHashInfo->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pstHashInfo->enShaType ) ) { return CIPHER_HashUpdate(hHashHandle, pu8InputData, u32InputDataLen); } else if ((HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pstHashInfo->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pstHashInfo->enShaType)) { return CIPHER_HmacUpdate(hHashHandle, pu8InputData, u32InputDataLen); } return HI_FAILURE; } HI_S32 HI_MPI_CIPHER_HashFinal(HI_HANDLE hHashHandle, HI_U8 *pu8OutputHash) { HASH_INFO_S *pstHashInfo = (HASH_INFO_S*)&g_stCipherHashData[hHashHandle]; if((NULL == pu8OutputHash) || (hHashHandle >= HASH_CHANNAL_MAX_NUM)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if ((HI_UNF_CIPHER_HASH_TYPE_SHA1 == pstHashInfo->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pstHashInfo->enShaType) ) { return CIPHER_HashFinal(hHashHandle, pu8OutputHash); } else if ((HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA1 == pstHashInfo->enShaType) || (HI_UNF_CIPHER_HASH_TYPE_HMAC_SHA256 == pstHashInfo->enShaType)) { return CIPHER_HmacFinal(hHashHandle, pu8OutputHash); } return HI_FAILURE; } HI_S32 HI_MPI_CIPHER_Hash(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_U32 u32DataPhyAddr, HI_U32 u32ByteLength, HI_U8 *pu8OutputHash) { HI_S32 ret = HI_SUCCESS; CIPHER_HASH_DATA_S stHashData; HI_U32 u32ShaLen; if((NULL == pstHashAttr) || (NULL == pu8OutputHash)) { HI_ERR_CIPHER("Invalid parameter!\n"); return HI_ERR_CIPHER_INVALID_PARA; } HI_HASH_LOCK(); stHashData.enShaType = pstHashAttr->eShaType; stHashData.u32DataPhy = u32DataPhyAddr; stHashData.u32DataLen = u32ByteLength; if (HI_UNF_CIPHER_HASH_TYPE_SHA1 == pstHashAttr->eShaType) { u32ShaLen = 20; } else if (HI_UNF_CIPHER_HASH_TYPE_SHA256 == pstHashAttr->eShaType) { u32ShaLen = 32; } else { HI_ERR_CIPHER("Error, Invalid sha type 0x%x !\n", pstHashAttr->eShaType); HI_HASH_UNLOCK(); return HI_FAILURE; } ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCHASH, &stHashData); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("Error, ioctl for hash final failed!\n"); } memcpy(pu8OutputHash, stHashData.u32ShaVal, u32ShaLen); HI_HASH_UNLOCK(); return ret; } #endif #ifdef CIPHER_RNG_SUPPORT HI_S32 HI_MPI_CIPHER_GetRandomNumber(HI_U32 *pu32RandomNumber, HI_U32 u32TimeOutUs) { HI_S32 Ret = HI_SUCCESS; CIPHER_RNG_S stRNG; if (NULL == pu32RandomNumber) { HI_ERR_CIPHER("Input pointer is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } CHECK_CIPHER_OPEN(); stRNG.u32RNG = 0; stRNG.u32TimeOutUs = u32TimeOutUs; Ret = ioctl(g_CipherDevFd, CMD_CIPHER_GETRANDOMNUMBER, &stRNG); if (Ret != HI_SUCCESS) { HI_ERR_CIPHER("Get random number failed, ret = %x\n", Ret); return Ret; } *pu32RandomNumber = stRNG.u32RNG; return HI_SUCCESS; } #endif #ifdef CIPHER_RSA_SUPPORT static HI_S32 RSA_GetAttr(HI_U32 u32SchEme, HI_U16 u16NLen, HI_U32 *pu32HLen, HI_U32 *pu32KeyLen, HI_UNF_CIPHER_HASH_TYPE_E *pstenHashType) { HI_S32 ret = HI_SUCCESS; if ((pu32HLen == HI_NULL) || (pu32KeyLen == HI_NULL) || (pstenHashType == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } *pu32HLen = 0; *pu32KeyLen = 0; *pstenHashType = HI_UNF_CIPHER_HASH_TYPE_BUTT; if (u16NLen <= 512) { *pu32KeyLen = u16NLen; } else { HI_ERR_CIPHER("u16NLen(0x%x) is invalid\n", u16NLen); return HI_ERR_CIPHER_INVALID_POINT; } switch(u32SchEme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2: case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_PKCS1_V1_5: *pu32HLen = 0; *pstenHashType = HI_UNF_CIPHER_HASH_TYPE_BUTT; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA1: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA1: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA1: *pu32HLen = 20; *pstenHashType = HI_UNF_CIPHER_HASH_TYPE_SHA1; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA256: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA256: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA256: *pu32HLen = 32; *pstenHashType = HI_UNF_CIPHER_HASH_TYPE_SHA256; break; default: HI_ERR_CIPHER("RSA scheme (0x%x) is invalid.\n", u32SchEme); ret = HI_ERR_CIPHER_INVALID_PARA; } return ret; } static HI_S32 RSA_PKCS1_MGF1(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U8 *pu8Seed, HI_U32 u32Seedlen, HI_U8 *pu8Mask, HI_U32 u32MaskLen) { HI_S32 Ret = HI_SUCCESS; HI_U32 i,j, u32Outlen = 0; HI_U8 u8Cnt[4]; HI_U8 u8Md[32]; HI_U32 u32MdLen; HI_UNF_CIPHER_HASH_ATTS_S stHashAttr; HI_HANDLE HashHandle; if ((pu8Seed == HI_NULL) || (pu8Mask == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } _memset(&stHashAttr, 0, sizeof(HI_UNF_CIPHER_HASH_ATTS_S)); /*PKCS#1 V2.1 only use sha1 function, Others allow for future expansion*/ stHashAttr.eShaType = enHashType; if( enHashType == HI_UNF_CIPHER_HASH_TYPE_SHA1) { u32MdLen = 20; } else if( enHashType == HI_UNF_CIPHER_HASH_TYPE_SHA256) { u32MdLen = 32; } else { HI_ERR_CIPHER("hash type is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } for (i = 0; u32Outlen < u32MaskLen; i++) { u8Cnt[0] = (HI_U8)((i >> 24) & 0xFF); u8Cnt[1] = (HI_U8)((i >> 16) & 0xFF); u8Cnt[2] = (HI_U8)((i >> 8)) & 0xFF; u8Cnt[3] = (HI_U8)(i & 0xFF); Ret = HI_MPI_CIPHER_HashInit(&stHashAttr, &HashHandle); if (Ret != HI_SUCCESS) { return Ret; } Ret = HI_MPI_CIPHER_HashUpdate(HashHandle, pu8Seed, u32Seedlen); if (Ret != HI_SUCCESS) { return Ret; } Ret = HI_MPI_CIPHER_HashUpdate(HashHandle, u8Cnt, 4); if (Ret != HI_SUCCESS) { return Ret; } Ret = HI_MPI_CIPHER_HashFinal(HashHandle, u8Md); if (Ret != HI_SUCCESS) { return Ret; } for(j=0; (j<u32MdLen) && (u32Outlen < u32MaskLen); j++) { pu8Mask[u32Outlen++] ^= u8Md[j]; } } return HI_SUCCESS; } static HI_S32 RSA_GetRandomNumber(HI_U8 *pu8Rand, HI_U32 u32Size) { HI_S32 ret = HI_SUCCESS; HI_U32 i; HI_U32 u32Rand; _memset(pu8Rand, 0, u32Size); for(i=0; i<u32Size; i+=4) { ret = HI_MPI_CIPHER_GetRandomNumber(&u32Rand, -1); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("Get random number failed, ret = %x\n", ret); return HI_FAILURE; } pu8Rand[i+3] = (HI_U8)(u32Rand >> 24)& 0xFF; pu8Rand[i+2] = (HI_U8)(u32Rand >> 16)& 0xFF; pu8Rand[i+1] = (HI_U8)(u32Rand >> 8)& 0xFF; pu8Rand[i+0] = (HI_U8)(u32Rand) & 0xFF; } /*non-zero random octet string*/ for(i=0; i<u32Size; i++) { if (pu8Rand[i] == 0x00) { ret = HI_MPI_CIPHER_GetRandomNumber(&u32Rand, -1); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("Get random number failed, ret = %x\n", ret); return HI_FAILURE; } pu8Rand[i] = (HI_U8)(u32Rand) & 0xFF; i = 0; } } return HI_SUCCESS; } static HI_U32 HI_MPI_CIPHER_GetBitNum(HI_U8 *pu8BigNum, HI_U32 u32NumLen) { static const HI_S8 u8Bits[16] = {0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4}; HI_U32 i; HI_U32 u32Num; for(i=0; i<u32NumLen; i++) { u32Num = u8Bits[(pu8BigNum[i] & 0xF0) >> 4] ; if(u32Num > 0) { return (u32NumLen - i - 1) * 8 + u32Num + 4; } u32Num = u8Bits[pu8BigNum[i] & 0xF] ; if(u32Num > 0) { return (u32NumLen - i - 1) * 8 + u32Num; } } return 0; } /*PKCS #1: EME-OAEP encoding*/ /************************************************************* +----------+---------+--+-------+ DB = | lHash | PS |01| M | +----------+---------+--+-------+ | +----------+ V | seed |--> MGF ---> xor +----------+ | | | +--+ V | |00| xor <----- MGF <-----| +--+ | | | | | V V V +--+----------+----------------------------+ EM = |00|maskedSeed| maskedDB | +--+----------+----------------------------+ 1 hlen k - hlen- 1 so: PS_LEN = k - hlen - 1 - (hlen + mlen + 1) = k - 2hlen - mlen - 2 > 0 so: mlen < k - 2hlen - 2 *************************************************************/ static HI_S32 RSA_padding_add_PKCS1_OAEP(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U32 u32HLen, HI_U32 u32KeyLen, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; HI_U32 u32DBLen; HI_U8 *pu8DB; HI_U8 *pu8Seed; const HI_S8 *pu8LHASH = EMPTY_L_SHA1; CHECK_CIPHER_OPEN(); if ((pu8Input == HI_NULL) || (pu8Output == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } /*In the v2.1 of PKCS #1, L is the empty string; */ /*other uses outside the scope of rsa specifications*/ if( enHashType == HI_UNF_CIPHER_HASH_TYPE_SHA256) { pu8LHASH = EMPTY_L_SHA256; } if (u32InLen > u32KeyLen - 2 * u32HLen - 2) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } *pu32OutLen = 0; pu8Output[0] = 0; pu8Seed = pu8Output + 1; pu8DB = pu8Output + u32HLen + 1; u32DBLen = u32KeyLen - u32HLen -1; memcpy(pu8DB, pu8LHASH, u32HLen); /*set lHash*/ _memset(&pu8DB[u32HLen], 0, u32DBLen - u32InLen - u32HLen -1); /*set PS with 0x00*/ pu8DB[u32DBLen - u32InLen - 1] = 0x01; /*set 0x01 after PS*/ memcpy(&pu8DB[u32DBLen - u32InLen], pu8Input, u32InLen); /*set M*/ ret = RSA_GetRandomNumber(pu8Seed, u32HLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_GetRandomNumber failed, ret = %x\n", ret); return HI_FAILURE; } ret = RSA_PKCS1_MGF1(enHashType, pu8Seed, u32HLen, pu8DB, u32KeyLen - u32HLen - 1); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_PKCS1_MGF1 failed, ret = %x\n", ret); return HI_FAILURE; } ret = RSA_PKCS1_MGF1(enHashType, pu8DB, u32KeyLen - u32HLen - 1, pu8Seed, u32HLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_PKCS1_MGF1 failed, ret = %x\n", ret); return HI_FAILURE; } *pu32OutLen = u32KeyLen; return HI_SUCCESS; } /*PKCS #1: RSAES-PKCS1-V1_5-ENCRYPT*/ /************************************************* EM = 0x00 || 0x02 || PS || 0x00 || M PS_LEN > 8, mlen < u32KeyLen - 11 *************************************************/ static HI_S32 RSA_padding_add_PKCS1_V15( HI_U32 u32KeyLen, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; HI_U32 u32Index = 0; CHECK_CIPHER_OPEN(); if ((pu8Input == HI_NULL) || (pu8Output == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if (u32InLen > u32KeyLen - 11) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } *pu32OutLen = 0; pu8Output[u32Index++] = 0x00; pu8Output[u32Index++] = 0x02; ret = RSA_GetRandomNumber(&pu8Output[u32Index], u32KeyLen - u32InLen -3); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_GetRandomNumber failed, ret = %x\n", ret); return HI_FAILURE; } u32Index+=u32KeyLen - u32InLen -3; pu8Output[u32Index++] = 0x00; memcpy(&pu8Output[u32Index], pu8Input, u32InLen); *pu32OutLen = u32KeyLen; return HI_SUCCESS; } /*PKCS #1: block type 0,1,2 message padding*/ /************************************************* EB = 00 || BT || PS || 00 || D PS_LEN >= 8, mlen < u32KeyLen - 11 *************************************************/ static HI_S32 RSA_padding_add_PKCS1_type(HI_U32 u32KeyLen, HI_U8 u8BT, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; HI_U32 u32PLen; HI_U8 *pu8EB; if (u32InLen > u32KeyLen - 11) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } *pu32OutLen =0; pu8EB = pu8Output; *(pu8EB++) = 0; *(pu8EB++) = u8BT; /* Private Key BT (Block Type) */ /* pad out with 0xff data */ u32PLen = u32KeyLen - 3 - u32InLen; switch(u8BT) { case 0x00: _memset(pu8EB, 0x00, u32PLen); break; case 0x01: _memset(pu8EB, 0xFF, u32PLen); break; case 0x02: ret = RSA_GetRandomNumber(pu8EB, u32PLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_GetRandomNumber failed, ret = %x\n", ret); return HI_FAILURE; } break; default: HI_ERR_CIPHER("BT(0x%x) is invalid.\n", u8BT); return HI_ERR_CIPHER_INVALID_PARA; } pu8EB += u32PLen; *(pu8EB++) = 0x00; memcpy(pu8EB, pu8Input, u32InLen); *pu32OutLen = u32KeyLen; return HI_SUCCESS; } /*PKCS #1: RSAES-PKCS1-V1_5-Signature*/ /********************************************************* EM = 0x00 || 0x01 || PS || 0x00 || T T ::= SEQUENCE { digestAlgorithm AlgorithmIdentifier, digest OCTET STRING } The first field identifies the hash function and the second contains the hash value **********************************************************/ static HI_S32 RSA_padding_add_EMSA_PKCS1_v15(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U32 u32HLen, HI_U32 u32KeyLen, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_U32 u32PadLen; HI_U8 *p; if ((pu8Input == HI_NULL) || (pu8Output == HI_NULL) || (pu8Output == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if (u32HLen != u32InLen) { HI_ERR_CIPHER("Error, the u32InLen must be 0x%x\n", u32HLen); return HI_ERR_CIPHER_INVALID_PARA; } *pu32OutLen = u32KeyLen; p = pu8Output; *p++ = 0; *p++ = RSA_SIGN; switch(enHashType) { case HI_UNF_CIPHER_HASH_TYPE_SHA1: u32PadLen = u32KeyLen - 3 - 35; _memset(p, 0xFF, u32PadLen); p += u32PadLen; *p++ = 0; memcpy(p, ASN1_HASH_SHA1, 15); memcpy(p + 15, pu8Input, u32InLen); break; case HI_UNF_CIPHER_HASH_TYPE_SHA256: u32PadLen = u32KeyLen - 3 - 51; _memset(p, 0xFF, u32PadLen); p += u32PadLen; *p++ = 0; memcpy( p, ASN1_HASH_SHA256, 19); memcpy( p + 19, pu8Input, u32InLen); break; default: HI_ERR_CIPHER("RSA unsuporrt hash type: 0x%x.\n", enHashType); return HI_ERR_CIPHER_INVALID_PARA; } return HI_SUCCESS; } /****************************************************************** +-----------+ | M | +-----------+ | V Hash | V +--------+----------+----------+ M' = |Padding1| mHash | salt | +--------+----------+----------+ | +--------+----------+ V DB = |Padding2|maskedseed| Hash +--------+----------+ | | | V | +--+ xor <----- MGF <----| |bc| | | +--+ | | | V V V +-------------------+----- -------+--+ EM = | maskedDB | maskedseed |bc| +-------------------+-------------+--+ ******************************************************************/ static HI_S32 RSA_padding_add_PKCS1_PSS(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U32 u32HLen, HI_U32 u32EmBit, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_U32 ret = 0; HI_U32 u32SLen; HI_U8 *pu8M = HI_NULL; HI_U8 u8Salt[32]; HI_U8 *pu8MaskedDB; HI_U8 *pu8Maskedseed; HI_U32 u32Index; HI_U32 u32KeyLen; HI_U32 u32MSBits; HI_HANDLE HashHandle = 0; HI_UNF_CIPHER_HASH_ATTS_S stHashAttr; if ((pu8Input == NULL) || (pu8Output == NULL)) { HI_ERR_CIPHER("zero point\n"); return HI_ERR_CIPHER_INVALID_POINT; } u32SLen = u32HLen; u32KeyLen = (u32EmBit + 7)/8; u32MSBits = (u32EmBit - 1) & 0x07; *pu32OutLen = u32KeyLen; if (u32KeyLen < (u32HLen + u32SLen + 2)) { HI_ERR_CIPHER("message too long\n"); return HI_ERR_CIPHER_INVALID_PARA; } _memset(&stHashAttr, 0, sizeof(HI_UNF_CIPHER_HASH_ATTS_S)); if (u32MSBits == 0) { *pu8Output++ = 0; u32KeyLen--; } pu8MaskedDB = pu8Output; pu8Maskedseed = pu8Output + u32KeyLen - u32HLen -1; /* Generate a random octet string salt of length sLen */ ret = RSA_GetRandomNumber(u8Salt, u32SLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("GET_GetRandomNumber failed\n"); return ret; } pu8M = (HI_U8*)malloc(u32SLen + u32HLen + 8); if (pu8M == HI_NULL) { HI_ERR_CIPHER("malloc failed\n"); return HI_FAILURE; } /*M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt*/ u32Index = 0; _memset(pu8M, 0x00, 8); u32Index+=8; memcpy(&pu8M[u32Index], pu8Input, u32InLen); u32Index+=u32InLen; memcpy(&pu8M[u32Index], u8Salt, u32SLen); u32Index+=u32SLen; stHashAttr.eShaType = enHashType; ret = HI_MPI_CIPHER_HashInit(&stHashAttr, &HashHandle); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HashInit failed\n"); free(pu8M); pu8M = HI_NULL; return ret; } ret = HI_MPI_CIPHER_HashUpdate(HashHandle, pu8M, u32Index); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HashUpdate failed\n"); free(pu8M); pu8M = HI_NULL; return ret; } ret = HI_MPI_CIPHER_HashFinal(HashHandle, pu8Maskedseed); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HashFinal failed\n"); free(pu8M); pu8M = HI_NULL; return ret; } free(pu8M); pu8M = HI_NULL; /*maskedDB = DB xor dbMask, DB = PS || 0x01 || salt*/ u32Index = 0; _memset(&pu8MaskedDB[u32Index], 0x00, u32KeyLen - u32SLen -u32HLen - 2); u32Index+=u32KeyLen - u32SLen -u32HLen - 2; pu8MaskedDB[u32Index++] = 0x01; memcpy(&pu8MaskedDB[u32Index], u8Salt, u32SLen); ret = RSA_PKCS1_MGF1(enHashType, pu8Maskedseed, u32HLen, pu8MaskedDB, u32KeyLen - u32HLen -1); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_PKCS1_MGF1 failed, ret = %x\n", ret); return HI_FAILURE; } pu8Output[u32KeyLen - 1] = 0xBC; if (u32MSBits) { pu8Output[0] &= 0xFF >> (8 - u32MSBits); } return HI_SUCCESS; } HI_S32 HI_MPI_CIPHER_RsaPublicEnc(HI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaEnc, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; CIPHER_RSA_DATA_S stRsaData; HI_U32 u32HLen; HI_U32 u32KeyLen; HI_U8 u8BT; HI_UNF_CIPHER_HASH_TYPE_E enHashType; HI_U8 u8EM[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; CHECK_CIPHER_OPEN(); if (pstRsaEnc == HI_NULL) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if (u32InLen == 0) { HI_ERR_CIPHER("inlen is 0.\n"); return HI_ERR_CIPHER_INVALID_PARA; } ret = RSA_GetAttr(pstRsaEnc->enScheme, pstRsaEnc->stPubKey.u16NLen, &u32HLen, &u32KeyLen, &enHashType); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA attr config error\n"); return ret; } _memset(u8EM, 0, sizeof(u8EM)); switch(pstRsaEnc->enScheme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING: /*if u32InLen < u32KeyLen, padding 0 before input data*/ *pu32OutLen = u32KeyLen; memcpy(u8EM+(u32KeyLen - u32InLen), pu8Input, u32InLen); ret = HI_SUCCESS; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: HI_ERR_CIPHER("RSA padding mode error, mode = 0x%x.\n", pstRsaEnc->enScheme); HI_ERR_CIPHER("For a public key encryption operation, the block type shall be 02.\n"); ret = HI_ERR_CIPHER_INVALID_PARA; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2: u8BT = (HI_U8)(pstRsaEnc->enScheme - HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0); ret = RSA_padding_add_PKCS1_type(u32KeyLen, u8BT, pu8Input, u32InLen, u8EM, pu32OutLen); break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA1: case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA256: ret = RSA_padding_add_PKCS1_OAEP(enHashType, u32HLen, u32KeyLen, pu8Input, u32InLen, u8EM, pu32OutLen); break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_PKCS1_V1_5: ret = RSA_padding_add_PKCS1_V15(u32KeyLen, pu8Input, u32InLen, u8EM, pu32OutLen); break; default: HI_ERR_CIPHER("RSA padding mode error, mode = 0x%x.\n", pstRsaEnc->enScheme); ret = HI_ERR_CIPHER_INVALID_PARA; break; } if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA padding error, ret = 0x%x.\n", ret); return ret; } if(*pu32OutLen != u32KeyLen) { HI_ERR_CIPHER("Error, u32OutLen != u32KeyLen.\n"); return HI_ERR_CIPHER_INVALID_POINT; } stRsaData.pu8N = pstRsaEnc->stPubKey.pu8N; stRsaData.pu8K = pstRsaEnc->stPubKey.pu8E; stRsaData.u16NLen = pstRsaEnc->stPubKey.u16NLen; stRsaData.u16KLen = pstRsaEnc->stPubKey.u16ELen; stRsaData.pu8Input = u8EM; stRsaData.pu8Output = pu8Output; stRsaData.u32DataLen = u32KeyLen; #ifdef CIPHER_KLAD_SUPPORT stRsaData.enKeySrc = HI_UNF_CIPHER_KEY_SRC_USER; #endif ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCRSA, &stRsaData); return ret; } static HI_S32 RSA_padding_check_PKCS1_OAEP(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U32 u32HLen, HI_U32 u32KeyLen, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; HI_U32 i; const HI_S8 *pu8LHASH = EMPTY_L_SHA1; HI_U8 *pu8Seed; HI_U8 *pu8DB; HI_U8 *pu8MaskedDB; CHECK_CIPHER_OPEN(); if ((pu8Input == HI_NULL) || (pu8Output == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if(enHashType == HI_UNF_CIPHER_HASH_TYPE_SHA256) { pu8LHASH = EMPTY_L_SHA256; } if (u32InLen != u32KeyLen) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } if (u32KeyLen < 2 * u32HLen + 2) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } if(pu8Input[0] != 0x00) { HI_ERR_CIPHER("EM[0] != 0.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } *pu32OutLen = 0; pu8MaskedDB= pu8Input + u32HLen + 1; pu8Seed = pu8Input + 1; pu8DB = pu8Input + u32HLen + 1; ret = RSA_PKCS1_MGF1(enHashType, pu8MaskedDB, u32KeyLen - u32HLen - 1, pu8Seed, u32HLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_PKCS1_MGF1 failed, ret = %x\n", ret); return HI_FAILURE; } ret = RSA_PKCS1_MGF1(enHashType, pu8Seed, u32HLen, pu8DB, u32KeyLen - u32HLen - 1); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_PKCS1_MGF1 failed, ret = %x\n", ret); return HI_FAILURE; } if(memcmp(pu8DB, pu8LHASH, u32HLen) != 0) { HI_ERR_CIPHER("LHASH error.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } for(i=u32HLen; i < u32KeyLen - u32HLen - 1; i++) { if((pu8DB[i] == 0x01)) { memcpy(pu8Output, pu8DB+i+1, u32KeyLen - u32HLen - i - 2); *pu32OutLen = u32KeyLen - u32HLen - i - 2; break; } } if (i >= u32KeyLen - u32HLen - 1) { HI_ERR_CIPHER("PS error.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } return HI_SUCCESS; } static HI_S32 RSA_padding_check_PKCS1_V15(HI_U32 u32KeyLen, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_U32 u32Index = 0; CHECK_CIPHER_OPEN(); if ((pu8Input == HI_NULL) || (pu8Output == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if ((u32InLen != u32KeyLen) || (u32KeyLen < 11)) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } if(pu8Input[u32Index] != 0x00) { HI_ERR_CIPHER("EM[0] != 0x00.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } u32Index++; if(pu8Input[u32Index] != 0x02) { HI_ERR_CIPHER("EM[1] != 0x02.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } u32Index++; for( ; u32Index < u32KeyLen; u32Index++) { if( (u32Index >= 10) //The length of PS is large than 8 octets && (pu8Input[u32Index] == 0x00)) { memcpy(pu8Output, &pu8Input[u32Index+1], u32KeyLen - 1 - u32Index); *pu32OutLen = u32KeyLen - 1 - u32Index; break; } } if (u32Index >= u32KeyLen) { HI_ERR_CIPHER("PS error.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } return HI_SUCCESS; } static HI_S32 RSA_padding_check_PKCS1_type(HI_U32 u32KeyLen, HI_U8 u8BT, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_U8 *pu8EB; if (u32InLen != u32KeyLen) { HI_ERR_CIPHER("u32InLen is invalid.\n"); return HI_ERR_CIPHER_INVALID_PARA; } *pu32OutLen = 0x00; pu8EB = pu8Input; if(*pu8EB != 0x00) { HI_ERR_CIPHER("EB[0] != 0x00.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } pu8EB++; if(*pu8EB != u8BT) { HI_ERR_CIPHER("EB[1] != BT(0x%x).\n", u8BT); return HI_ERR_CIPHER_FAILED_DECRYPT; } pu8EB++; switch(u8BT) { case 0x00: for( ; pu8EB < pu8Input + u32InLen - 1; pu8EB++) { if( (*pu8EB == 0x00) && (*(pu8EB+1) != 0)) { break; } } break; case 0x01: for( ; pu8EB < pu8Input + u32InLen - 1; pu8EB++) { if(*pu8EB == 0xFF) { continue; } else if (*pu8EB == 0x00) { break; } else { pu8EB = pu8Input + u32InLen - 1; break; } } break; case 0x02: for( ; pu8EB < pu8Input + u32InLen - 1; pu8EB++) { if(*pu8EB == 0x00) { break; } } break; default: HI_ERR_CIPHER("BT(0x%x) is invalid.\n", u8BT); return HI_ERR_CIPHER_INVALID_PARA; } if(pu8EB >= (pu8Input + u32InLen - 1)) { HI_ERR_CIPHER("PS Error.\n"); return HI_ERR_CIPHER_FAILED_DECRYPT; } pu8EB++; *pu32OutLen = pu8Input + u32KeyLen - pu8EB; memcpy(pu8Output, pu8EB, *pu32OutLen); return HI_SUCCESS; } static HI_S32 RSA_padding_check_EMSA_PKCS1_v15(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U32 u32HLen, HI_U32 u32KeyLen, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_U32 ret = HI_SUCCESS; HI_U32 u32Len; HI_U8 *p; if ((pu8Input == HI_NULL) || (pu8Output == HI_NULL) || (pu8Output == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if (u32KeyLen != u32InLen) { HI_ERR_CIPHER("Error, the u32InLen must be 0x%x\n", u32KeyLen); return ret; } *pu32OutLen = u32HLen; CHECK_CIPHER_OPEN(); /*EM = 01 || PS || 00 || T*/ p = pu8Input; if( *p++ != 0 || *p++ != RSA_SIGN ) { HI_ERR_CIPHER("RSA EM head error\n"); return HI_FAILURE; } while( *p != 0 ) { if( p >= pu8Input + u32KeyLen - 1 || *p != 0xFF ) { HI_ERR_CIPHER("RSA PS error\n"); return HI_FAILURE; } p++; } p++; //skip 0x00 u32Len = u32KeyLen - (HI_U32)( p - pu8Input); ret = HI_FAILURE; switch(enHashType) { case HI_UNF_CIPHER_HASH_TYPE_SHA1: if (u32Len != 35) { HI_ERR_CIPHER("RSA T len error: %d\n", u32Len); break; } if(memcmp(p, ASN1_HASH_SHA1, 15) == 0) { memcpy(pu8Output, p + 15, u32HLen); ret = HI_SUCCESS; } break; case HI_UNF_CIPHER_HASH_TYPE_SHA256: if (u32Len != 51) { HI_ERR_CIPHER("RSA T len error: %d\n", u32Len); break; } if(memcmp(p, ASN1_HASH_SHA256, 19) == 0) { memcpy(pu8Output, p + 19, u32HLen); ret = HI_SUCCESS; } break; default: HI_ERR_CIPHER("RSA unsuporrt hash type: 0x%x.\n", enHashType); } return ret; } static HI_U32 RSA_padding_check_PKCS1_PSS(HI_UNF_CIPHER_HASH_TYPE_E enHashType, HI_U32 u32HLen, HI_U32 u32EmBit, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8MHash) { HI_U32 ret = 0; HI_U32 u32SLen; HI_U8 *pu8M = HI_NULL; HI_U8 u8Salt[32] = {0}; HI_U8 u8H[32] = {0}; HI_U8 *pu8MaskedDB; HI_U8 *pu8Maskedseed; HI_U32 u32Index; HI_U32 u32KeyLen; HI_U32 u32MSBits; HI_HANDLE HashHandle = 0; HI_UNF_CIPHER_HASH_ATTS_S stHashAttr; if ((pu8Input == NULL) || (pu8MHash == NULL)) { HI_ERR_CIPHER("zero point\n"); return HI_ERR_CIPHER_INVALID_POINT; } u32SLen = u32HLen; u32KeyLen = (u32EmBit + 7)/8; u32MSBits = (u32EmBit - 1) & 0x07; if (u32KeyLen < (u32HLen + u32SLen + 2)) { HI_ERR_CIPHER("message too long\n"); return HI_ERR_CIPHER_INVALID_PARA; } if (u32InLen != u32KeyLen) { HI_ERR_CIPHER("inconsistent, u32InLen != 0xBC\n"); return HI_ERR_CIPHER_INVALID_PARA; } if (pu8Input[0] & (0xFF << u32MSBits)) { HI_ERR_CIPHER("inconsistent, EM[0] invalid\n"); return HI_FAILURE; } _memset(&stHashAttr, 0, sizeof(HI_UNF_CIPHER_HASH_ATTS_S)); if (u32MSBits == 0) { pu8Input++; u32KeyLen--; } pu8MaskedDB = pu8Input; pu8Maskedseed = pu8Input + u32KeyLen - u32HLen -1; if (pu8Input[u32KeyLen - 1] != 0xBC) { HI_ERR_CIPHER("inconsistent, EM[u32KeyLen - 1] != 0xBC\n"); return HI_ERR_CIPHER_INVALID_PARA; } /*maskedDB = DB xor dbMask, DB = PS || 0x01 || salt*/ ret = RSA_PKCS1_MGF1(enHashType, pu8Maskedseed, u32HLen, pu8MaskedDB, u32KeyLen - u32HLen -1); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_PKCS1_MGF1 failed, ret = %x\n", ret); return ret; } if (u32MSBits) { pu8MaskedDB[0] &= 0xFF >> (8 - u32MSBits); } for (u32Index=0; u32Index<u32KeyLen - u32SLen -u32HLen - 2; u32Index++) { if (pu8MaskedDB[u32Index] != 0x00) { HI_ERR_CIPHER("inconsistent, PS != 0x00 in DB\n"); return HI_FAILURE; } } if (pu8MaskedDB[u32Index++] != 0x01) { HI_ERR_CIPHER("inconsistent, can't find 0x01 in DB\n"); return HI_FAILURE; } memcpy(u8Salt, &pu8MaskedDB[u32Index], u32SLen); pu8M = (HI_U8*)malloc(u32SLen + u32HLen + 8); if (pu8M == NULL) { HI_ERR_CIPHER("malloc failed\n"); return HI_FAILURE; } /*M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt*/ u32Index = 0; _memset(pu8M, 0x00, 8); u32Index+=8; memcpy(&pu8M[u32Index], pu8MHash, u32HLen); u32Index+=u32HLen; memcpy(&pu8M[u32Index], u8Salt, u32SLen); u32Index+=u32SLen; stHashAttr.eShaType = enHashType; ret = HI_MPI_CIPHER_HashInit(&stHashAttr, &HashHandle); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HashInit failed\n"); free(pu8M); pu8M = HI_NULL; return ret; } ret = HI_MPI_CIPHER_HashUpdate(HashHandle, pu8M, u32Index); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HashUpdate failed\n"); free(pu8M); pu8M = HI_NULL; return ret; } ret = HI_MPI_CIPHER_HashFinal(HashHandle, u8H); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HashFinal failed\n"); free(pu8M); pu8M = HI_NULL; return ret; } free(pu8M); pu8M = HI_NULL; ret = memcmp(u8H, pu8Maskedseed, u32HLen); if (ret != 0) { HI_ERR_CIPHER("consistent, hash compare failed\n"); ret = HI_FAILURE; } return ret; } HI_S32 HI_MPI_CIPHER_RsaPrivateDec(HI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaDec, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; CIPHER_RSA_DATA_S stRsaData; HI_U8 u8EM[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; HI_U32 u32HLen; HI_U32 u32KeyLen; HI_U8 u8BT; HI_UNF_CIPHER_HASH_TYPE_E enHashType; CHECK_CIPHER_OPEN(); ret = RSA_GetAttr(pstRsaDec->enScheme, pstRsaDec->stPriKey.u16NLen, &u32HLen, &u32KeyLen, &enHashType); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA attr config error\n"); return ret; } if(u32InLen != u32KeyLen) { HI_ERR_CIPHER("Error, u32InLen != u32KeyLen.\n"); return HI_ERR_CIPHER_INVALID_POINT; } stRsaData.pu8N = pstRsaDec->stPriKey.pu8N; stRsaData.pu8K = pstRsaDec->stPriKey.pu8D; stRsaData.u16NLen = pstRsaDec->stPriKey.u16NLen; stRsaData.u16KLen = pstRsaDec->stPriKey.u16DLen; stRsaData.pu8Input = pu8Input; stRsaData.pu8Output = u8EM; stRsaData.u32DataLen = u32KeyLen; #ifdef CIPHER_KLAD_SUPPORT stRsaData.enKeySrc = pstRsaDec->enKeySrc; #endif ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCRSA, &stRsaData); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("CMD_CIPHER_CALCRSA failed, ret = %x\n", ret); return HI_FAILURE; } switch(pstRsaDec->enScheme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING: *pu32OutLen = u32InLen; memcpy(pu8Output, u8EM, u32KeyLen); ret = HI_SUCCESS; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: HI_ERR_CIPHER("RSA padding mode error, mode = 0x%x.\n", pstRsaDec->enScheme); HI_ERR_CIPHER("For a private key decryption operation, the block type shall be 02.\n"); ret = HI_ERR_CIPHER_INVALID_PARA; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2: u8BT = (HI_U8)(pstRsaDec->enScheme - HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0); ret = RSA_padding_check_PKCS1_type(u32KeyLen, u8BT, u8EM, u32InLen, pu8Output, pu32OutLen); break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA1: case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_OAEP_SHA256: ret = RSA_padding_check_PKCS1_OAEP(enHashType, u32HLen, u32KeyLen, u8EM, u32InLen, pu8Output, pu32OutLen); break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_RSAES_PKCS1_V1_5: ret = RSA_padding_check_PKCS1_V15(u32KeyLen, u8EM, u32InLen, pu8Output, pu32OutLen); break; default: HI_ERR_CIPHER("RSA scheme error, scheme = 0x%x.\n", pstRsaDec->enScheme); ret = HI_ERR_CIPHER_INVALID_PARA; break; } if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA padding error, ret = 0x%x.\n", ret); return ret; } return ret; } HI_S32 HI_MPI_CIPHER_RsaSign(HI_UNF_CIPHER_RSA_SIGN_S *pstRsaSign, HI_U8 *pu8InData, HI_U32 u32InDataLen, HI_U8 *pu8HashData, HI_U8 *pu8OutSign, HI_U32 *pu32OutSignLen) { HI_U32 u32KeyLen; HI_U32 u32HLen; HI_U32 u32EmBit; HI_U8 u8Hash[32]; HI_U8 u8EM[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; HI_S32 ret = HI_SUCCESS; CIPHER_RSA_DATA_S stRsaData; HI_UNF_CIPHER_HASH_TYPE_E enHashType; HI_UNF_CIPHER_HASH_ATTS_S stHashAttr; HI_HANDLE HashHandle; HI_U8 *pHash; if (pstRsaSign == HI_NULL) { HI_ERR_CIPHER("pstRsaSign is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if ((pstRsaSign->stPriKey.pu8N == HI_NULL) || (pstRsaSign->stPriKey.pu8D == HI_NULL)) { HI_ERR_CIPHER("key is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if ((u32InDataLen == 0) && (pu8HashData == HI_NULL)) { HI_ERR_CIPHER("inlen is 0.\n"); return HI_ERR_CIPHER_INVALID_PARA; } CHECK_CIPHER_OPEN(); _memset(&stHashAttr, 0, sizeof(HI_UNF_CIPHER_HASH_ATTS_S)); ret = RSA_GetAttr(pstRsaSign->enScheme, pstRsaSign->stPriKey.u16NLen, &u32HLen, &u32KeyLen, &enHashType); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA attr config error\n"); return ret; } /*hash is NULl, need to calc by self*/ if (pu8HashData == HI_NULL) { stHashAttr.eShaType = enHashType; ret = HI_MPI_CIPHER_HashInit(&stHashAttr, &HashHandle); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HI_MPI_CIPHER_HashInit error\n"); return ret; } ret = HI_MPI_CIPHER_HashUpdate(HashHandle, pu8InData, u32InDataLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HI_MPI_CIPHER_HashUpdate error\n"); return ret; } ret = HI_MPI_CIPHER_HashFinal(HashHandle, u8Hash); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HI_MPI_CIPHER_HashUpdate error\n"); return ret; } pHash = u8Hash; } else { pHash = pu8HashData; } _memset(u8EM, 0, sizeof(u8EM)); switch(pstRsaSign->enScheme) { case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA1: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA256: ret = RSA_padding_add_EMSA_PKCS1_v15(enHashType, u32HLen, u32KeyLen, pHash, u32HLen, u8EM, pu32OutSignLen); break; case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA1: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA256: u32EmBit = HI_MPI_CIPHER_GetBitNum(pstRsaSign->stPriKey.pu8N, u32KeyLen); ret = RSA_padding_add_PKCS1_PSS(enHashType, u32HLen, u32EmBit, pHash, u32HLen, u8EM, pu32OutSignLen); break; default: HI_ERR_CIPHER("invalid scheme; 0x%x\n", pstRsaSign->enScheme); return HI_ERR_CIPHER_INVALID_PARA; } if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA sign padding error\n"); return ret; } if(*pu32OutSignLen != u32KeyLen) { HI_ERR_CIPHER("Error, u32InSigntLen != u32KeyLen.\n"); return HI_ERR_CIPHER_INVALID_POINT; } stRsaData.pu8N = pstRsaSign->stPriKey.pu8N; stRsaData.pu8K = pstRsaSign->stPriKey.pu8D; stRsaData.u16NLen = pstRsaSign->stPriKey.u16NLen; stRsaData.u16KLen = pstRsaSign->stPriKey.u16DLen; stRsaData.pu8Input = u8EM; stRsaData.pu8Output = pu8OutSign; stRsaData.u32DataLen = u32KeyLen; #ifdef CIPHER_KLAD_SUPPORT stRsaData.enKeySrc = pstRsaSign->enKeySrc; #endif // HI_PRINT_HEX ("N", stRsaData.pu8N, stRsaData.u16NLen); // HI_PRINT_HEX ("K", stRsaData.pu8K, stRsaData.u16KLen); // HI_PRINT_HEX ("M", stRsaData.pu8Input, stRsaData.u32DataLen); ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCRSA, &stRsaData); return ret; } HI_S32 HI_MPI_CIPHER_RsaPrivateEnc(HI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaEnc, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; CIPHER_RSA_DATA_S stRsaData; HI_U32 u32HLen; HI_U32 u32KeyLen; HI_U8 u8BT; HI_UNF_CIPHER_HASH_TYPE_E enHashType; HI_U8 u8EM[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; CHECK_CIPHER_OPEN(); if (pstRsaEnc == HI_NULL) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if (u32InLen == 0) { HI_ERR_CIPHER("inlen is 0.\n"); return HI_ERR_CIPHER_INVALID_PARA; } ret = RSA_GetAttr(pstRsaEnc->enScheme, pstRsaEnc->stPriKey.u16NLen, &u32HLen, &u32KeyLen, &enHashType); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA attr config error\n"); return ret; } _memset(u8EM, 0, sizeof(u8EM)); switch(pstRsaEnc->enScheme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING: /*if u32InLen < u32KeyLen, padding 0 before input data*/ *pu32OutLen = u32KeyLen; memcpy(u8EM+(u32KeyLen - u32InLen), pu8Input, u32InLen); ret = HI_SUCCESS; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: u8BT = (HI_U8)(pstRsaEnc->enScheme - HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0); ret = RSA_padding_add_PKCS1_type(u32KeyLen, u8BT, pu8Input, u32InLen, u8EM, pu32OutLen); break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2: HI_ERR_CIPHER("RSA padding mode error, mode = 0x%x.\n", pstRsaEnc->enScheme); HI_ERR_CIPHER("For a private- key encryption operation, the block type shall be 00 or 01.\n"); ret = HI_ERR_CIPHER_INVALID_PARA; break; default: HI_ERR_CIPHER("RSA padding mode error, mode = 0x%x.\n", pstRsaEnc->enScheme); ret = HI_ERR_CIPHER_INVALID_PARA; break; } if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA padding error, ret = 0x%x.\n", ret); return ret; } if(*pu32OutLen != u32KeyLen) { HI_ERR_CIPHER("Error, u32OutLen != u32KeyLen.\n"); return HI_ERR_CIPHER_INVALID_POINT; } stRsaData.pu8N = pstRsaEnc->stPriKey.pu8N; stRsaData.pu8K = pstRsaEnc->stPriKey.pu8D; stRsaData.u16NLen = pstRsaEnc->stPriKey.u16NLen; stRsaData.u16KLen = pstRsaEnc->stPriKey.u16DLen; stRsaData.pu8Input = u8EM; stRsaData.pu8Output = pu8Output; stRsaData.u32DataLen = u32KeyLen; #ifdef CIPHER_KLAD_SUPPORT stRsaData.enKeySrc = pstRsaEnc->enKeySrc; #endif ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCRSA, &stRsaData); return ret; } HI_S32 HI_MPI_CIPHER_RsaVerify(HI_UNF_CIPHER_RSA_VERIFY_S *pstRsaVerify, HI_U8 *pu8InData, HI_U32 u32InDataLen, HI_U8 *pu8HashData, HI_U8 *pu8InSign, HI_U32 u32InSignLen) { HI_U32 ret = HI_SUCCESS; HI_U32 u32KeyLen; HI_U8 u8EM[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; CIPHER_RSA_DATA_S stRsaData; HI_UNF_CIPHER_HASH_TYPE_E enHashType; HI_UNF_CIPHER_HASH_ATTS_S stHashAttr; HI_HANDLE HashHandle = 0; HI_U8 u8Hash[32] = {0}; HI_U8 u8SignHash[32] = {0}; HI_U32 u32HLen; HI_U32 u32EmBit; HI_U8 *pHash; if (pstRsaVerify == HI_NULL) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if ((pstRsaVerify->stPubKey.pu8N == HI_NULL) || (pstRsaVerify->stPubKey.pu8E == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } ret = RSA_GetAttr(pstRsaVerify->enScheme, pstRsaVerify->stPubKey.u16NLen, &u32HLen, &u32KeyLen, &enHashType); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA attr config error\n"); return ret; } if(u32InSignLen != u32KeyLen) { HI_ERR_CIPHER("Error, u32InSigntLen != u32KeyLen.\n"); return HI_ERR_CIPHER_INVALID_POINT; } CHECK_CIPHER_OPEN(); _memset(&stHashAttr, 0, sizeof(HI_UNF_CIPHER_HASH_ATTS_S)); stRsaData.pu8N = pstRsaVerify->stPubKey.pu8N; stRsaData.pu8K = pstRsaVerify->stPubKey.pu8E; stRsaData.u16NLen = pstRsaVerify->stPubKey.u16NLen; stRsaData.u16KLen = pstRsaVerify->stPubKey.u16ELen; stRsaData.pu8Input = pu8InSign; stRsaData.pu8Output = u8EM; stRsaData.u32DataLen = u32KeyLen; #ifdef CIPHER_KLAD_SUPPORT stRsaData.enKeySrc = HI_UNF_CIPHER_KEY_SRC_USER; #endif ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCRSA, &stRsaData); if(ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA verify dec error, ret=%d\n", ret); return HI_ERR_CIPHER_FAILED_DECRYPT; } if (pu8HashData == HI_NULL) { stHashAttr.eShaType = enHashType; ret = HI_MPI_CIPHER_HashInit(&stHashAttr, &HashHandle); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HI_MPI_CIPHER_HashInit error\n"); return ret; } ret = HI_MPI_CIPHER_HashUpdate(HashHandle, pu8InData, u32InDataLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HI_MPI_CIPHER_HashUpdate error\n"); return ret; } ret = HI_MPI_CIPHER_HashFinal(HashHandle, u8Hash); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("HI_MPI_CIPHER_HashUpdate error\n"); return ret; } pHash = u8Hash; } else { pHash = pu8HashData; } switch(pstRsaVerify->enScheme) { case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA1: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_V15_SHA256: ret = RSA_padding_check_EMSA_PKCS1_v15(enHashType, u32HLen, u32KeyLen, u8EM, u32InSignLen, u8SignHash, &u32HLen); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA_padding_add_RSASSA_PKCS1_v15 error\n"); return ret; } if (memcmp(pHash, u8SignHash, u32HLen) != 0) { HI_ERR_CIPHER("RSA verify, hash error\n"); ret = HI_ERR_CIPHER_FAILED_DECRYPT; } break; case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA1: case HI_UNF_CIPHER_RSA_SIGN_SCHEME_RSASSA_PKCS1_PSS_SHA256: u32EmBit = HI_MPI_CIPHER_GetBitNum(pstRsaVerify->stPubKey.pu8N, u32KeyLen); ret = RSA_padding_check_PKCS1_PSS(enHashType, u32HLen, u32EmBit, u8EM, u32InSignLen, pHash); break; default: HI_ERR_CIPHER("invalid scheme; 0x%x\n", pstRsaVerify->enScheme); return HI_ERR_CIPHER_INVALID_PARA; } return ret; } HI_S32 HI_MPI_CIPHER_RsaPublicDec(HI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaDec, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { HI_S32 ret = HI_SUCCESS; CIPHER_RSA_DATA_S stRsaData; HI_U8 u8EM[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; HI_U32 u32HLen; HI_U32 u32KeyLen; HI_U8 u8BT; HI_UNF_CIPHER_HASH_TYPE_E enHashType; CHECK_CIPHER_OPEN(); ret = RSA_GetAttr(pstRsaDec->enScheme, pstRsaDec->stPubKey.u16NLen, &u32HLen, &u32KeyLen, &enHashType); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA attr config error\n"); return ret; } if(u32InLen != u32KeyLen) { HI_ERR_CIPHER("Error, u32InLen != u32KeyLen.\n"); return HI_ERR_CIPHER_INVALID_POINT; } stRsaData.pu8N = pstRsaDec->stPubKey.pu8N; stRsaData.pu8K = pstRsaDec->stPubKey.pu8E; stRsaData.u16NLen = pstRsaDec->stPubKey.u16NLen; stRsaData.u16KLen = pstRsaDec->stPubKey.u16ELen; stRsaData.pu8Input = pu8Input; stRsaData.pu8Output = u8EM; stRsaData.u32DataLen = u32KeyLen; #ifdef CIPHER_KLAD_SUPPORT stRsaData.enKeySrc = HI_UNF_CIPHER_KEY_SRC_USER; #endif ret = ioctl(g_CipherDevFd, CMD_CIPHER_CALCRSA, &stRsaData); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("CMD_CIPHER_CALCRSA failed, ret = %x\n", ret); return HI_FAILURE; } switch(pstRsaDec->enScheme) { case HI_UNF_CIPHER_RSA_ENC_SCHEME_NO_PADDING: *pu32OutLen = u32InLen; memcpy(pu8Output, u8EM, u32KeyLen); ret = HI_SUCCESS; break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0: case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_1: u8BT = (HI_U8)(pstRsaDec->enScheme - HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_0); ret = RSA_padding_check_PKCS1_type(u32KeyLen, u8BT, u8EM, u32InLen, pu8Output, pu32OutLen); break; case HI_UNF_CIPHER_RSA_ENC_SCHEME_BLOCK_TYPE_2: HI_ERR_CIPHER("RSA padding mode error, mode = 0x%x.\n", pstRsaDec->enScheme); HI_ERR_CIPHER("For a public key decryption operation, the block type shall be 00 or 01.\n"); ret = HI_ERR_CIPHER_INVALID_PARA; break; default: HI_ERR_CIPHER("RSA scheme error, scheme = 0x%x.\n", pstRsaDec->enScheme); ret = HI_ERR_CIPHER_INVALID_PARA; break; } if (ret != HI_SUCCESS) { HI_ERR_CIPHER("RSA padding error, ret = 0x%x.\n", ret); return ret; } return ret; } static HI_S32 CIPHER_RsaRandomNumber(HI_VOID *param, HI_U8 *rng, HI_U32 size) { HI_U32 u32Randnum = 0x165e9fb5; HI_U32 u32RngStat; HI_U32 u32Timeout = 0; HI_U32 u32RngBase; HI_U32 i, byte; u32RngBase = (HI_U32)param; for(i=0; i<size; i+=4) { while(u32Timeout < 10000) { #ifdef CIPHER_RNG_VERSION_1 u32RngStat = *(volatile unsigned int *)(u32RngBase + 0x08); //REG_RNG_STAT if((u32RngStat & 0x7) > 0) { u32Randnum = *(volatile unsigned int *)(u32RngBase + 0x04);//REG_RNG_NUMBER break; } #elif defined(CIPHER_RNG_VERSION_2) u32RngStat = *(volatile unsigned int *)(u32RngBase + 0x08); //REG_RNG_STAT if(((u32RngStat >> 8) & 0x3F) > 0) { u32Randnum = *(volatile unsigned int *)(u32RngBase + 0x04);//REG_RNG_NUMBER break; } #endif } byte = size - i; byte = byte > 4 ? 4: byte; memcpy(rng+i, &u32Randnum, byte); } return HI_SUCCESS; } static HI_VOID CIPHER_CopyKey(mbedtls_mpi *X, HI_U8 *buf) { HI_S32 ret = 0; if (buf == HI_NULL) { return; } ret = mbedtls_mpi_write_binary(X, buf, mbedtls_mpi_size(X)); if( 0 != ret ) { HI_ERR_CIPHER("mbedtls_mpi_write_binary error!\n"); } } static HI_S32 CIPHER_GenRsaKey_SW(CIPHER_RSA_KEY_S *pstRsaKey) { HI_S32 ret = 0; mbedtls_rsa_context rsa; HI_U32 u32RngBase; u32RngBase = (HI_U32)HI_SYS_Mmap(REG_BASE_PHY_ADDR_RNG, 0x100); if (u32RngBase == 0) { HI_ERR_CIPHER("Map RNG regiest failed!\n"); return HI_FAILURE; } mbedtls_rsa_init(&rsa, MBEDTLS_RSA_PKCS_V15, 0); ret = mbedtls_rsa_gen_key(&rsa, CIPHER_RsaRandomNumber, (HI_VOID*)u32RngBase, pstRsaKey->u32NumBits, (HI_S32)pstRsaKey->u32Exponent); if( 0 == ret ) { pstRsaKey->stPriKey.u16NLen = mbedtls_mpi_size(&rsa.N); pstRsaKey->stPriKey.u16ELen = mbedtls_mpi_size(&rsa.E); pstRsaKey->stPriKey.u16DLen = mbedtls_mpi_size(&rsa.D); pstRsaKey->stPriKey.u16PLen = mbedtls_mpi_size(&rsa.P); pstRsaKey->stPriKey.u16QLen = mbedtls_mpi_size(&rsa.Q); pstRsaKey->stPriKey.u16DPLen = mbedtls_mpi_size(&rsa.DP); pstRsaKey->stPriKey.u16DQLen = mbedtls_mpi_size(&rsa.DQ); pstRsaKey->stPriKey.u16QPLen = mbedtls_mpi_size(&rsa.QP); CIPHER_CopyKey(&rsa.N, pstRsaKey->stPriKey.pu8N); CIPHER_CopyKey(&rsa.E, pstRsaKey->stPriKey.pu8E); CIPHER_CopyKey(&rsa.D, pstRsaKey->stPriKey.pu8D); CIPHER_CopyKey(&rsa.P, pstRsaKey->stPriKey.pu8P); CIPHER_CopyKey(&rsa.Q, pstRsaKey->stPriKey.pu8Q); CIPHER_CopyKey(&rsa.DP, pstRsaKey->stPriKey.pu8DP); CIPHER_CopyKey(&rsa.DQ, pstRsaKey->stPriKey.pu8DQ); CIPHER_CopyKey(&rsa.QP, pstRsaKey->stPriKey.pu8QP); } else { HI_ERR_CIPHER("RSA public error!\n"); ret = HI_FAILURE; } mbedtls_rsa_free(&rsa); HI_SYS_Munmap((HI_VOID*)u32RngBase, 0x100); return ret; } HI_S32 HI_MPI_CIPHER_RsaGenKey(HI_U32 u32NumBits, HI_U32 u32Exponent, HI_UNF_CIPHER_RSA_PRI_KEY_S *pstRsaPriKey) { HI_S32 ret = HI_SUCCESS; CIPHER_RSA_KEY_S stRsaKey; CHECK_CIPHER_OPEN(); memcpy(&stRsaKey.stPriKey, pstRsaPriKey, sizeof(HI_UNF_CIPHER_RSA_PRI_KEY_S)); stRsaKey.u32Exponent = u32Exponent; stRsaKey.u32NumBits = u32NumBits; ret = CIPHER_GenRsaKey_SW(&stRsaKey); memcpy(pstRsaPriKey, &stRsaKey.stPriKey, sizeof(HI_UNF_CIPHER_RSA_PRI_KEY_S)); return ret; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/mcu_uart/mcu_uart.c #include <stdio.h> #include "sys/types.h" #include "sys/time.h" #include "hi_type.h" #include "sys/prctl.h" #include "eth_drv.h" #include "fcntl.h" #include "asm/io.h" #include "hi_ext_hal_mcu.h" #if 0 #include "wifi_info.h" #endif #define himm(address, value) writel(value, address) #if 0 #if(WIFITYPE==WIFI_8801) static int is_dhcpd_start = 0; void hi_start_wifi_exit(UINT32 argc, CHAR **argv) { struct netif *dev; int ret; if(is_dhcpd_start) { ret = mrvl_wlan_open(&dev); if(ret == 0) { printf("stop dhcpd \n"); netifapi_dhcps_stop(dev); is_dhcpd_start = 0; } else printf("faile to stop dhcpd since wlan interface can't be opened\n"); } wifi_driver_exit(); } void hi_wifi_sleep(void) { char ap_par[15][40] = {"wlan0","mefcfg","hscfg","0","1","100",\ "fast_link_sync_enable","1"}; char * ap_argv[4]; ap_argv[0] = ap_par[0]; ap_argv[1] = ap_par[1]; hi_start_mlanutl(2,ap_argv); msleep(500); ap_argv[0] = ap_par[0]; ap_argv[1] = ap_par[2]; ap_argv[2] = ap_par[3]; ap_argv[3] = ap_par[4]; ap_argv[4] = ap_par[5]; hi_start_mlanutl(5,ap_argv); msleep(500); ap_argv[0] = ap_par[0]; ap_argv[1] = ap_par[6]; ap_argv[2] = ap_par[7]; hi_start_mlanutl(3,ap_argv); msleep(500); hi_start_wifi_exit(0,0); } #endif #endif HI_S32 HI_Product_McuHost_Event_proc(HAL_MCUHOST_EVENT_E eMCUHOSTEVENT) { HI_S32 s32Ret = HI_SUCCESS; #if 0 #if(WIFITYPE==WIFI_6214) switch (eMCUHOSTEVENT) { case MCUHOST_SYSTEMCLOSE: { #ifdef CFG_SUPPORT_WIFI_STA //Wl scansuppress 1 mhd_get_scansuppress(); mhd_wifi_set_scansuppress(1); // set scansuppress to 1 mhd_get_scansuppress(); //Wl PM 1 mhd_sta_set_powersave(1, 0); //Wl bcn_li_dtim 10 mhd_sta_get_bcn_li_dtim(); mhd_sta_set_bcn_li_dtim(10); // if ap router dtim is 2 seconds mhd_sta_get_bcn_li_dtim(); //wl host_sleep 1 mhd_set_host_sleep(1); extern int wifi_info_suspend(); wifi_info_suspend(); #endif #ifdef CFG_SUPPORT_WIFI_AP extern void mhd_wowl_ap_enable(void); mhd_wowl_ap_enable(); #else mhd_wowl_sta_add("0x983B16F8F39C", 66); mhd_wowl_sta_enable(); #endif host_oob_interrupt_disable(); break; } default: printf("err when switch eMCUHOSTEVENT\n"); return HI_FAILURE; } #elif (WIFITYPE==WIFI_8801) switch (eMCUHOSTEVENT) { case MCUHOST_SYSTEMCLOSE: { hi_wifi_sleep(); break; } default: printf("err when switch eMCUHOSTEVENT\n"); return HI_FAILURE; } #endif #endif return HI_SUCCESS; } int uart2_fd = -1; void hi_uart2_open(void) { #ifdef HISI_WIFI_PLATFORM_HI3518EV200 writew(0x04, IO_MUX_REG_BASE + 0x088); writew(0x04, IO_MUX_REG_BASE + 0x094); #else /*default HISI_WIFI_PLATFORM_HI3516CV200*/ writew(0x3, IO_MUX_REG_BASE + 0x0CC); writew(0x3, IO_MUX_REG_BASE + 0x0D0); #endif printf(" -----%s line=%d \n",__FUNCTION__,__LINE__); uart2_fd = open("/dev/uartdev-2", O_RDWR); if (uart2_fd < 0) { uart2_fd = -1; printf("open %s with %d ret = %d\n", "/dev/uartdev-2", O_RDWR, uart2_fd); } else { printf("\nhi_uart2_open success\n"); } } void hi_uart2_close(void) { close(uart2_fd); uart2_fd = -1; } extern int g_bMcuHostInit; void mcu_uart_proc() { hi_uart2_open(); extern HI_S32 HI_Product_McuHost_Event_proc(HAL_MCUHOST_EVENT_E eMCUHOSTEVENT); dprintf("g_bMcuHostInit33 %d\n",g_bMcuHostInit); HI_HAL_MCUHOST_Init(); printf(" >>>>>%s line=%d \n",__FUNCTION__,__LINE__); HI_HAL_MCUHOST_RegisterNotifyProc(HI_Product_McuHost_Event_proc); } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/rtc.h #ifndef __RTC_H #define __RTC_H typedef struct { RTC_AlarmTypeDef rtc_alarm; u8 flag; u8 hours; u8 minutes; } RTC_Alarm_Event_T; extern u8 g_RTC_Alarm_Flag; extern RTC_Alarm_Event_T g_Alarm_Event; void RTC_Init_Handle(void); int RTC_Alarm_Duration_Check(u8 hours, u8 minutes); int RTC_Alarm_Evetn_Set(RTC_Alarm_Event_T *alarm_event); void RTC_Handle(void); #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3516cv200/stm8l15x/adc.h #ifndef __ADC_H #define __ADC_H void ADC_Init_Handle(); #endif<file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/init/HuaweiLite/mipi_init.c #include "hi_type.h" #include "hi_mipi.h" extern int mipi_init(void); extern void mipi_exit(void); int mipi_mod_init(void) { return mipi_init(); } void mipi_mod_exit(void) { mipi_exit(); } /**************************************************************************** * Export symbol * ****************************************************************************/ extern int mipi_set_combo_dev_attr(combo_dev_attr_t* p_attr); extern int mipi_drv_set_phy_reg_start(HI_BOOL en); <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/component/isp/firmware/init/HuaweiLite/isp_init.c #include "hi_type.h" #include "hi_common.h" #include "hi_isp_param.h" extern HI_U32 pwm_num; extern HI_U32 proc_param; extern HI_U32 update_pos; extern HI_BOOL lsc_update_mode; extern int ISP_ModInit(void); extern void ISP_ModExit(void); int isp_mod_init(void *pArgs) { ISP_MODULE_PARAMS_S* pstIspModuleParam = (ISP_MODULE_PARAMS_S*)pArgs; if(NULL != pstIspModuleParam) { pwm_num = pstIspModuleParam->u32PwmNum; proc_param = pstIspModuleParam->u32ProcParam; update_pos = pstIspModuleParam->u32UpdatePos; lsc_update_mode = pstIspModuleParam->u32LscUpdateMode; } ISP_ModInit(); return 0; } void isp_mod_exit(void) { ISP_ModExit(); } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/piris/arch/hi3518e/piris_hal.h /* here is piris arch . * * * This file defines piris micro-definitions for user. * * History: * 03-Mar-2016 Start of Hi351xx Digital Camera,H6 * */ #ifndef __PIRIS_HAL_H__ #define __PIRIS_HAL_H__ #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ /***************base addr***********************/ #define PIRISI_ADRESS_BASE 0x20170000 #define PIRISI_REG_LEN 0x10000 #define HI_IO_PIRISI_ADDRESS(base_va, x) (base_va + ((x)-(PIRISI_ADRESS_BASE))) #define PIRIS_WRITE_REG(Addr, Value) ((*(volatile unsigned int *)(Addr)) = (Value)) #define PIRIS_READ_REG(Addr) (*(volatile unsigned int *)(Addr)) #define PIRIS_CFG_REG0(base_va) HI_IO_PIRISI_ADDRESS(base_va, PIRISI_ADRESS_BASE + 0x0200) #define PIRIS_CTRL_REG0(base_va) HI_IO_PIRISI_ADDRESS(base_va, PIRISI_ADRESS_BASE + 0x0400) #define PIRIS_CFG_REG1(base_va) HI_IO_PIRISI_ADDRESS(base_va, PIRISI_ADRESS_BASE + 0x10000 + 0x001C) #define PIRIS_CTRL_REG1(base_va) HI_IO_PIRISI_ADDRESS(base_va, PIRISI_ADRESS_BASE + 0x10000 + 0x0400) /***************PIRIS_DRV_Write REG value***********************/ #define PIRIS_HAL_PHASE0(base_va) \ do \ { \ PIRIS_WRITE_REG(PIRIS_CTRL_REG0(base_va), 0x80);\ PIRIS_WRITE_REG(PIRIS_CFG_REG0(base_va) , 0x80);\ PIRIS_WRITE_REG(PIRIS_CTRL_REG1(base_va), 0x7); \ PIRIS_WRITE_REG(PIRIS_CFG_REG1(base_va) , 0x2); \ } while ( 0 ); #define PIRIS_HAL_PHASE1(base_va) \ do \ { \ PIRIS_WRITE_REG(PIRIS_CTRL_REG0(base_va), 0x80);\ PIRIS_WRITE_REG(PIRIS_CFG_REG0(base_va) , 0x0); \ PIRIS_WRITE_REG(PIRIS_CTRL_REG1(base_va), 0x7); \ PIRIS_WRITE_REG(PIRIS_CFG_REG1(base_va) , 0x3); \ } while ( 0 ); #define PIRIS_HAL_PHASE2(base_va) \ do \ { \ PIRIS_WRITE_REG(PIRIS_CTRL_REG0(base_va), 0x80);\ PIRIS_WRITE_REG(PIRIS_CFG_REG0(base_va) , 0x0); \ PIRIS_WRITE_REG(PIRIS_CTRL_REG1(base_va), 0x7); \ PIRIS_WRITE_REG(PIRIS_CFG_REG1(base_va) , 0x5); \ } while ( 0 ); #define PIRIS_HAL_PHASE3(base_va) \ do \ { \ PIRIS_WRITE_REG(PIRIS_CTRL_REG0(base_va), 0x80);\ PIRIS_WRITE_REG(PIRIS_CFG_REG0(base_va) , 0x80);\ PIRIS_WRITE_REG(PIRIS_CTRL_REG1(base_va), 0x7); \ PIRIS_WRITE_REG(PIRIS_CFG_REG1(base_va) , 0x4); \ } while ( 0 ); #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ #endif /*__PIRIS_HAL_H__*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/init/sdk_init.c /****************************************************************************** Some simple Hisilicon Hi3516A system functions. Copyright (C), 2010-2015, Hisilicon Tech. Co., Ltd. ****************************************************************************** Modification: 2015-6 Created ******************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* End of #ifdef __cplusplus */ #include <stdio.h> #include "hi_type.h" #include "hi_comm_sys.h" #include "hi_comm_vi.h" #include "hi_comm_vpss.h" #include "hi_comm_vo.h" #include "hi_comm_venc.h" #include "hi_comm_vgs.h" #include "hi_comm_isp.h" #include "hi_module_param.h" //#include "hi_venc_param.h" #include "hi_isp_param.h" #include "isp_ext.h" #include "sensor_spi.h" #include "osal_mmz.h" #include "hifb.h" #define CHIP_HI3516C_V200 0x3516C200 #define CHIP_HI3518E_V200 0x3518E200 #define CHIP_HI3518E_V201 0x3518E201 #define himm(address, value) writel(value, address) #define M_SIZE (1024*1024) #define MEM_ALIGN(x) (((x)+ M_SIZE - 1)&(~(M_SIZE - 1))) HI_CHAR* hi_chip = "hi3518e"; //hi3518e HI_U32 g_u32vi_vpss_online = 1; //0, 1 HI_CHAR* sensor_type = "ar0130"; // ov9732 ar0230 ar0130 imx222 9m034 ov9750 HI_CHAR* vo_type = "BT656"; //BT656 LCD HI_CHAR* pin_mux_select = "net"; //vo net #ifndef CHIP_ID #define MEM_TOTAL_SIZE 64U /* MB, total mem */ #define MEM_START 0x80000000 /* phy mem start */ #define MEM_OS_SIZE 32U /* MB, os mem size */ #define MEM_USB_SIZE 1U /* MB, usb mem size */ #endif #if (CHIP_ID == CHIP_HI3518E_V200) #define MEM_TOTAL_SIZE 64U /* MB, total mem */ #define MEM_START 0x80000000 /* phy mem start */ #define MEM_OS_SIZE 32U /* MB, os mem size */ #define MEM_USB_SIZE 1U /* MB, usb mem size */ #elif (CHIP_ID == CHIP_HI3518E_V201) #define MEM_TOTAL_SIZE 32U /* MB, total mem */ #define MEM_START 0x80000000 /* phy mem start */ #define MEM_OS_SIZE 20U /* MB, os mem size */ #define MEM_USB_SIZE 1U /* MB, usb mem size */ #elif (CHIP_ID == CHIP_HI3516C_V200) #define MEM_TOTAL_SIZE 256U /* MB, total mem */ #define MEM_START 0x80000000 /* phy mem start */ #define MEM_OS_SIZE 64U /* MB, os mem size */ #define MEM_USB_SIZE 1U /* MB, usb mem size */ #endif /*disable audio mute*/ static HI_VOID audio_disable_mute(void) { himm(0x200f0078, 0x00000000); himm(0x201A0400, 0x00000008); himm(0x201A0020, 0x00000008); } static HI_VOID vicap_pin_mux(void) { himm(0x200f0000, 0x00000001); // 0: GPIO0_4 1: SENSOR_CLK himm(0x200f0004, 0x00000000); // 0: SENSOR_RSTN 1: GPIO0_5 himm(0x200f0008, 0x00000001); // 0: GPIO0_6 1£ºFLASH_TRIG 2: SFC_EMMC_BOOT_MODE 3£ºSPI1_CSN1 4:VI_VS himm(0x200f000c, 0x00000001); // 0£ºGPIO0_7 1£ºSHUTTER_TRIG 2£ºSFC_DEVICE_MODE 4: VI_HS } //SPI1 -> LCD static HI_VOID spi1_pim_mux(void) { himm(0x200f0050, 0x1); // 001£ºSPI1_SCLK£» himm(0x200f0054, 0x1); // 001£ºSPI1_SDO£» himm(0x200f0058, 0x1); // 001£ºSPI1_SDI£» himm(0x200f005c, 0x1); // 001£ºSPI1_CSN0£» } #if 0 //I2C0 -> sensor static HI_VOID i2c0_pin_mux(void) { himm(0x200f0040, 0x00000002); // 0: GPIO3_3 1:spi0_sclk 2:i2c0_scl himm(0x200f0044, 0x00000002); // 0: GPIO3_4 1:spi0_sdo 2:i2c0_sda } #endif //I2C1 -> 7179 static HI_VOID i2c1_pin_mux(void) { himm(0x200f0050, 0x00000002); // 010£ºI2C1_SCL£» himm(0x200f0054, 0x00000002); // 010£ºI2C1_SDA£» } #if 0 static HI_VOID i2c2_pin_mux(void) { himm(0x200f0060, 0x1); // i2c2_sda himm(0x200f0064, 0x1); // i2c2_scl } #endif static HI_VOID vo_output_mode(void) { himm(0x200f0010, 0x00000003); // 3£ºVO_CLK & 0: GPIO2_0 & 1: RMII_CLK himm(0x200f0014, 0x00000000); // 3£ºVO_VS & 0: GPIO2_1 & 1: RMII_TX_EN & 4: SDIO1_CARD_DETECT himm(0x200f0018, 0x00000003); // 3£ºVO_DATA5 & 0: GPIO2_2 & 1: RMII_TXD0 & 4: SDIO1_CWPR himm(0x200f001c, 0x00000000); // 3£ºVO_DE & 0: GPIO2_3 & 1: RMII_TXD1 & 4: SDIO1_CDATA1 himm(0x200f0020, 0x00000003); // 3£ºVO_DATA7 & 0: GPIO2_4 & 1: RMII_RX_DV & 4: SDIO1_CDATA0 himm(0x200f0024, 0x00000003); // 3£ºVO_DATA2 & 0: GPIO2_5 & 1: RMII_RXD0 & 4: SDIO1_CDATA3 himm(0x200f0028, 0x00000003); // 3£ºVO_DATA3 & 0: GPIO2_6 & 1: RMII_RXD1 & 4: SDIO1_CCMD himm(0x200f002c, 0x00000000); // 3£ºVO_HS & 0: GPIO2_7 & 1: EPHY_RST & 2: BOOT_SEL & 4: SDIO1_CARD_POWER_EN himm(0x200f0030, 0x00000003); // 3£ºVO_DATA0 & 0: GPIO0_3 & 1: SPI1_CSN1 himm(0x200f0034, 0x00000003); // 3£ºVO_DATA1 & 0: GPIO3_0 & 1: EPHY_CLK & 4: SDIO1_CDATA2 himm(0x200f0038, 0x00000003); // 3: VO_DATA6 & 0: GPIO3_1 & 1: MDCK & 2£ºBOOTROM_SEL himm(0x200f003c, 0x00000003); // 3£ºVO_DATA4 & 0: GPIO3_2 & 1: MDIO } static HI_VOID bt656_drive_capability(void) { //BT656 drive capability config himm(0x200f0810, 0xd0); // VO_CLK himm(0x200f0830, 0x90); // VO_DATA0 himm(0x200f0834, 0xd0); // VO_DATA1 himm(0x200f0824, 0x90); // VO_DATA2 himm(0x200f0828, 0x90); // VO_DATA3 himm(0x200f083c, 0x90); // VO_DATA4 himm(0x200f0818, 0x90); // VO_DATA5 himm(0x200f0838, 0x90); // VO_DATA6 himm(0x200f0820, 0x90); // VO_DATA7 } static HI_VOID lcd_drive_capability(void) { //LCD drive capability config himm(0x200f0810, 0xe0); himm(0x200f0830, 0xa0); himm(0x200f0834, 0xe0); himm(0x200f0824, 0xa0); himm(0x200f0828, 0xa0); himm(0x200f083c, 0xa0); himm(0x200f0818, 0xa0); himm(0x200f0838, 0xa0); himm(0x200f0820, 0xa0); himm(0x200f081c, 0xa0); } //RMII static HI_VOID net_rmii_mode(void) { //echo "------net_rmii_mode------" himm(0x200f002c, 0x00000001); // 1: EPHY_RST & 0: GPIO2_7 & 2: BOOT_SEL & 3£ºVO_HS & 4: SDIO1_CARD_POWER_EN himm(0x200f0034, 0x00000001); // 1: EPHY_CLK & 0: GPIO3_0 & 3£ºVO_DATA1 & 4: SDIO1_CDATA2 // himm(0x200f0010, 0x00000001); // 1: RMII_CLK & 0: GPIO2_0 & 3£ºVO_CLK himm(0x200f0014, 0x00000001); // 1: RMII_TX_EN & 0: GPIO2_1 & 3£ºVO_VS & 4: SDIO1_CARD_DETECT himm(0x200f0018, 0x00000001); // 1: RMII_TXD0 & 0: GPIO2_2 & 3£ºVO_DATA5 & 4: SDIO1_CWPR himm(0x200f001c, 0x00000001); // 1: RMII_TXD1 & 0: GPIO2_3 & 3£ºVO_DE & 4: SDIO1_CDATA1 himm(0x200f0020, 0x00000001); // 1: RMII_RX_DV & 0: GPIO2_4 & 3£ºVO_DATA7 & 4: SDIO1_CDATA himm(0x200f0024, 0x00000001); // 1: RMII_RXD0 & 0: GPIO2_5 & 3£ºVO_DATA2 & 4: SDIO1_CDATA3 himm(0x200f0028, 0x00000001); // 1: RMII_RXD1 & 0: GPIO2_6 & 3£ºVO_DATA3 & 4: SDIO1_CCMD£» // himm(0x200f0038, 0x00000001); // 1: MDCK & 0: GPIO3_1 & 2£ºBOOTROM_SEL & 3: VO_DATA6 himm(0x200f003c, 0x00000001); // 1: MDIO & 0: GPIO3_2 & 3£ºVO_DATA4 //ephy drive capability config himm(0x200f0810, 0xd0); // RMII_CLK himm(0x200f0814, 0xa0); // RMII_TX_EN himm(0x200f0818, 0xa0); // RMII_TXD0 himm(0x200f081c, 0xa0); // RMII_TXD1 himm(0x200f0820, 0xb0); // RMII_RX_DV himm(0x200f0824, 0xb0); // RMII_RXD0 himm(0x200f0828, 0xb0); // RMII_RXD1 himm(0x200f082c, 0xb0); // EPHY_RST himm(0x200f0834, 0xd0); // EPHY_CLK himm(0x200f0838, 0x90); // MDCK himm(0x200f083c, 0xa0); // MDIO } #if 0 static HI_VOID i2s_pin_mux(void) { // pin_mux with GPIO1 //himm(0x200f007c, 0x3); // i2s_bclk_tx //himm(0x200f0080, 0x3); // i2s_sd_tx //himm(0x200f0084, 0x3); // i2s_mclk //himm(0x200f0088, 0x3); // i2s_ws_tx //himm(0x200f008c, 0x3); // i2s_ws_rx //himm(0x200f0090, 0x3); // i2s_bclk_rx //himm(0x200f0094, 0x3); // i2s_sd_rx // pin_mux with UART1 himm(0x200f00bc, 0x2); // i2s_sd_tx himm(0x200f00c0, 0x2); // i2s_ws_tx himm(0x200f00c4, 0x2); // i2s_mclk himm(0x200f00c8, 0x2); // i2s_sd_rx himm(0x200f00d0, 0x2); // i2s_bclk_tx // pin_mux with JTAG //himm(0x200f00d4, 0x3); // i2s_mclk //himm(0x200f00d8, 0x3); // i2s_ws_tx //himm(0x200f00dc, 0x3); // i2s_sd_tx //himm(0x200f00e0, 0x3); // i2s_sd_rx //himm(0x200f00e4, 0x3); // i2s_bclk_tx } #endif static HI_VOID pinmux_hi3518e(void) { if (!strcmp(pin_mux_select, "vo")) { if (!strcmp(vo_type, "BT656")) { i2c1_pin_mux(); vo_output_mode(); bt656_drive_capability(); /* load peripheral equipment */ } else if (!strcmp(vo_type, "LCD")) { spi1_pim_mux(); vo_output_mode(); lcd_drive_capability(); himm(0x200f0014, 0x00000003); // 3£ºVO_VS & 0: GPIO2_1 & 1: RMII_TX_EN & 4: SDIO1_CARD_DETECT himm(0x200f002c, 0x00000003); // 3£ºVO_HS & 0: GPIO2_7 & 1: EPHY_RST & 2: BOOT_SEL & 4: SDIO1_CARD_POWER_EN himm(0x200f001c, 0x00000003); /* load peripheral equipment */ } else {} } else if (!strcmp(pin_mux_select, "net")) { net_rmii_mode(); } else { } //i2c0_pin_mux(); //i2c2_pin_mux(); vicap_pin_mux(); //i2s_pin_mux(); //vo_bt656_mode(); } static HI_VOID clkcfg_hi3518e(void) { himm(0x2003002c, 0xc4003); // VICAP, ISP unreset & clock enable, Sensor clock enable, clk reverse himm(0x20030034, 0x64ff4); // 6bit LCD himm(0x20030034, 0x164ff4); // 8bit LCD himm(0x20030034, 0xff4); // bt656 himm(0x20030040, 0x2000); // AVC unreset, code also config himm(0x20030048, 0x2); // VPSS unreset, code also config himm(0x20030058, 0x2); // TDE unreset himm(0x2003005c, 0x2); // VGS himm(0x20030060, 0x2); // JPGE unreset himm(0x20030068, 0x02000000); // LCD 27M:0x04000000, 13.5M:0x02000000 himm(0x2003006c, 0xa); // IVE/HASH unreset himm(0x2003007c, 0x2); // Cipher himm(0x200300d4, 0x7); // GZIP himm(0x200300d8, 0x2a); // DDRT¡¢Efuse¡¢DMA himm(0x2003008c, 0x2); // AIO unreset and clock enable,m/f/bclk config in code. himm(0x20030100, 0x20); // RSA himm(0x20030104, 0x0); // AVC-148.5M VGS-148.5M VPSS-99M } static HI_VOID sysctl_hi3518e(void) { //# msic config himm(0x201200E0, 0xd); // internal codec£¬AIO MCLK out, CODEC AIO TX MCLK //himm(0x201200E0, 0xe); // external codec: AIC31£¬AIO MCLK out, CODEC AIO TX MCLK #if 1 //write command priority himm(0x201100c0, 0x76543210); // ports0 himm(0x201100c4, 0x76543210); // ports1 himm(0x201100c8, 0x76543210); // ports2 himm(0x201100cc, 0x76543210); // ports3 himm(0x201100d0, 0x76543210); // ports4 himm(0x201100d4, 0x76543210); // ports5 himm(0x201100d8, 0x76543210); // ports6 //read command priority himm(0x20110100, 0x76543210); // ports0 himm(0x20110104, 0x76543210); // ports1 himm(0x20110108, 0x76543210); // ports2 himm(0x2011010c, 0x76543210); // ports3 himm(0x20110110, 0x76543210); // ports4 himm(0x20110114, 0x76543210); // ports5 himm(0x20110118, 0x76543210); // ports6 //write command timeout himm(0x20110140, 0x08040200); // ports0 himm(0x20110144, 0x08040100); // ports1 himm(0x20110148, 0x08040200); // ports2 himm(0x2011014c, 0x08040200); // ports3 himm(0x20110150, 0x08040200); // ports4 himm(0x20110154, 0x08040200); // ports5 himm(0x20110158, 0x08040200); // ports6 //read command timeout himm(0x20110180, 0x08040200); // ports0 himm(0x20110184, 0x08040200); // ports1 himm(0x20110188, 0x08040200); // ports2 himm(0x2011018c, 0x08040200); // ports3 himm(0x20110190, 0x08040200); // ports4 himm(0x20110194, 0x08040200); // ports5 himm(0x20110198, 0x08040200); // ports6 //map mode himm(0x20110040, 0x01001000); // ports0 himm(0x20110044, 0x01001000); // ports1 himm(0x20110048, 0x01001000); // ports2 himm(0x2011004c, 0x01001000); // ports3 himm(0x20110050, 0x01001000); // ports4 himm(0x20110054, 0x01001000); // ports5 himm(0x20110058, 0x01001000); // ports6 #endif if (g_u32vi_vpss_online) { //echo "==============vi_vpss_online=============="; himm(0x20120004, 0x40001000); // online, SPI1 CS0; [12]-ive //#pri config himm(0x20120058, 0x26666401); // each module 4bit£ºvedu ddrt_md ive aio jpge tde vicap vdp himm(0x2012005c, 0x66666103); // each module 4bit£ºsfc_nand sfc_nor nfc sdio1 sdio0 a7 vpss vgs himm(0x20120060, 0x66266666); // each module 4bit£ºreserve reserve avc usb cipher dma2 dma1 gsf //timeout config himm(0x20120064, 0x00000011); // each module 4bit£ºvedu ddrt_md ive aio jpge tde vicap vdp himm(0x20120068, 0x00000010); // each module 4bit£ºsfc_nand sfc_nor nfc sdio1 sdio0 a7 vpss vgs himm(0x2012006c, 0x00000000); // each module 4bit£ºreserve reserve avc usb cipher dma2 dma1 gsf } else { //echo "==============vi_vpss_offline=============="; himm(0x20120004, 0x1000); // offline, mipi SPI1 CS0; [12]-ive //# pri config himm(0x20120058, 0x26666400); // each module 4bit£ºvedu ddrt_md ive aio jpge tde vicap vdp himm(0x2012005c, 0x66666123); // each module 4bit£ºsfc_nand sfc_nor nfc sdio1 sdio0 a7 vpss vgs himm(0x20120060, 0x66266666); // each module 4bit£ºreserve reserve avc usb cipher dma2 dma1 gsf //# timeout config himm(0x20120064, 0x00000011); // each module 4bit£ºvedu ddrt_md ive aio jpge tde vicap vdp himm(0x20120068, 0x00000000); // each module 4bit£ºsfc_nand sfc_nor nfc sdio1 sdio0 a7 vpss vgs himm(0x2012006c, 0x00000000); // each module 4bit£ºreserve reserve avc usb cipher dma2 dma1 gsf } // ive utili himm(0x206A0000, 0x2); // Open utili statistic himm(0x206A0080, 0x11E1A300); // Utili peri,default 0x11E1A300 cycle } static HI_VOID insert_sns(void) { if (!strcmp(sensor_type, "9m034") || !strcmp(sensor_type, "ar0130")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA //cmos pinmux himm(0x200f007c, 0x1); // VI_DATA13 himm(0x200f0080, 0x1); // VI_DATA10 himm(0x200f0084, 0x1); // VI_DATA12 himm(0x200f0088, 0x1); // VI_DATA11 himm(0x200f008c, 0x2); // VI_VS himm(0x200f0090, 0x2); // VI_HS himm(0x200f0094, 0x1); // VI_DATA9 himm(0x2003002c, 0xb4001); // sensor unreset, clk 27MHz, VI 99MHz } else if (!strcmp(sensor_type, "ar0230")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA himm(0x20030104, 0x1); // AVC-148.5M VGS-148.5M VPSS-99M himm(0x2003002c, 0xb4005); // sensor unreset, clk 27MHz, VI 148.5MHz } else if (!strcmp(sensor_type, "imx222")) { himm(0x200f0040, 0x1); // SPI0_SCLK himm(0x200f0044, 0x1); // SPI0_SDO himm(0x200f0048, 0x1); // SPI0_SDI himm(0x200f004c, 0x1); // SPI0_CSN //cmos pinmux himm(0x200f007c, 0x1); // VI_DATA13 himm(0x200f0080, 0x1); // VI_DATA10 himm(0x200f0084, 0x1); // VI_DATA12 himm(0x200f0088, 0x1); // VI_DATA11 himm(0x200f008c, 0x2); // VI_VS himm(0x200f0090, 0x2); // VI_HS himm(0x200f0094, 0x1); // VI_DATA9 himm(0x2003002c, 0x94001); // sensor unreset, clk 37.125MHz, VI 99MHz //insmod extdrv/sensor_spi.ko; } else if (!strcmp(sensor_type, "ov9712")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA //cmos pinmux himm(0x200f007c, 0x1); // VI_DATA13 himm(0x200f0080, 0x1); // VI_DATA10 himm(0x200f0084, 0x1); // VI_DATA12 himm(0x200f0088, 0x1); // VI_DATA11 himm(0x200f008c, 0x2); // VI_VS himm(0x200f0090, 0x2); // VI_HS himm(0x200f0094, 0x1); // VI_DATA9 himm(0x2003002c, 0xc4001); // sensor unreset, clk 24MHz, VI 99MHz } else if (!strcmp(sensor_type, "ov9752") || !strcmp(sensor_type, "ov9750")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA himm(0x2003002c, 0xc4001); // sensor unreset, clk 24MHz, VI 99MHz } else if (!strcmp(sensor_type, "mn34220")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA himm(0x2003002c, 0xc4001); // sensor unreset, clk 24MHz, VI 99MHz } else if (!strcmp(sensor_type, "mn34222")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA himm(0x2003002c, 0x94001); // sensor unreset, clk 37.125MHz, VI 99MHz } else if (!strcmp(sensor_type, "ov4682")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA himm(0x2003002c, 0xc4001); // sensor unreset, clk 24MHz, VI 99MHz } else if (!strcmp(sensor_type, "ov9732")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA //cmos pinmux himm(0x200f007c, 0x1); // VI_DATA13 himm(0x200f0080, 0x1); // VI_DATA10 himm(0x200f0084, 0x1); // VI_DATA12 himm(0x200f0088, 0x1); // VI_DATA11 himm(0x200f008c, 0x2); // VI_VS himm(0x200f0090, 0x2); // VI_HS himm(0x200f0094, 0x1); // VI_DATA9 himm(0x2003002c, 0xc4001); // sensor unreset, clk 24MHz, VI 99MHz } else if (!strcmp(sensor_type, "ov2718")) { himm(0x200f0040, 0x2); // I2C0_SCL himm(0x200f0044, 0x2); // I2C0_SDA himm(0x2003002c, 0xc4001); // sensor unreset, clk 24MHz, VI 99MHz } else if (!strcmp(sensor_type, "bt1120")) { } else { printf("sensor_type '%s' is error!!!\n", sensor_type); } } /*static HI_VOID ir_light_off(void) { // # pin_mux himm(0x200f00e0, 0x0); //# GPIO0_3 himm(0x20140400, 0xa); //dir himm(0x20140020, 0x8); //data }*/ static HI_VOID SYS_cfg(void) { pinmux_hi3518e(); clkcfg_hi3518e(); sysctl_hi3518e(); //ir_light_off(); } static HI_S32 BASE_init(void) { extern int base_mod_init(void); return base_mod_init(); } /* calculate the MMZ info */ extern unsigned long g_usb_mem_size; extern unsigned int g_sys_mem_addr_end; static HI_S32 MMZ_init(void) { extern int media_mem_init(void *); MMZ_MODULE_PARAMS_S stMMZ_Param; HI_U32 u32MmzStart, u32MmzSize; u32MmzStart = g_sys_mem_addr_end + g_usb_mem_size; u32MmzSize = (SYS_MEM_BASE + MEM_TOTAL_SIZE*M_SIZE - u32MmzStart)/M_SIZE; snprintf(stMMZ_Param.mmz, MMZ_SETUP_CMDLINE_LEN, "anonymous,0,0x%x,%dM", u32MmzStart, u32MmzSize); stMMZ_Param.anony = 1; dprintf("mem_start=0x%x, MEM_OS_SIZE=%dM, MEM_USB_SIZE=%dM, mmz_start=0x%x, mmz_size=%dM\n", SYS_MEM_BASE, (g_sys_mem_addr_end-SYS_MEM_BASE)/M_SIZE, MEM_ALIGN(g_usb_mem_size)/M_SIZE, u32MmzStart, u32MmzSize); dprintf("mmz param= %s\n", stMMZ_Param.mmz); return media_mem_init(&stMMZ_Param); } static HI_S32 SYS_init(void) { extern int sys_mod_init(void *pArgs); SYS_MODULE_PARAMS_S stSYS_Param; stSYS_Param.u32VI_VPSS_online = g_u32vi_vpss_online; stSYS_Param.u32SensorNum = 1; snprintf(stSYS_Param.cSensor[0], sizeof(stSYS_Param.cSensor[0]), sensor_type); return sys_mod_init(&stSYS_Param); } static HI_S32 TDE_init(void) { extern int TDE_DRV_ModInit(void); return TDE_DRV_ModInit(); } static HI_S32 REGION_init(void) { extern int rgn_mod_init(void); return rgn_mod_init(); } static HI_S32 VGS_init(void) { extern int vgs_mod_init(void *pArgs); return vgs_mod_init(NULL); } static HI_S32 ISP_init(void) { extern int isp_mod_init(void *pArgs); ISP_MODULE_PARAMS_S stIsp_Param; stIsp_Param.u32PwmNum = 1; stIsp_Param.u32ProcParam = 0; stIsp_Param.u32UpdatePos = 0; stIsp_Param.u32LscUpdateMode = 0; return isp_mod_init(&stIsp_Param); } static HI_S32 VI_init(void) { extern int viu_mod_init(void *pArgs); VI_MODULE_PARAMS_S stVI_Param; stVI_Param.u32DetectErrFrame = 10; stVI_Param.u32DropErrFrame = 0; stVI_Param.u32StopIntLevel = 0; stVI_Param.u32DiscardInt = 0; stVI_Param.u32IntdetInterval = 10; stVI_Param.bCscTvEnable = HI_FALSE; stVI_Param.bCscCtMode = HI_FALSE; stVI_Param.bYuvSkip = HI_FALSE; return viu_mod_init(&stVI_Param); } static HI_S32 VPSS_init(void) { extern int vpss_mod_init(void *pArgs); return vpss_mod_init(NULL); } static HI_S32 VO_init(void) { extern int vou_mod_init(void *pArgs); return vou_mod_init(NULL); } static HI_S32 RC_init(void) { extern int rc_mod_init(void); return rc_mod_init(); } static HI_S32 VENC_init(void) { extern int venc_mod_init(void * pArgs); return venc_mod_init(NULL); } static HI_S32 CHNL_init(void) { extern int chnl_mod_init(void); return chnl_mod_init(); } static HI_S32 H264E_init(void) { extern int h264e_mod_init(void * pArgs); return h264e_mod_init(NULL); } static HI_S32 JPEGE_init(void) { extern int jpege_mod_init(void * pArgs); return jpege_mod_init(NULL); } static HI_S32 SENSOR_I2C_init(void) { extern int hi_dev_init(void); return hi_dev_init(); } static HI_S32 SENSOR_SPI_init(void) { extern int sensor_spi_dev_init(void *pArgs); SPI_MODULE_PARAMS_S stSpiModuleParam; snprintf(stSpiModuleParam.cSensor, 64, sensor_type); stSpiModuleParam.u32csn = 0; stSpiModuleParam.u32BusNum = 0; return sensor_spi_dev_init(&stSpiModuleParam); } static HI_S32 PWM_init(void) { extern int pwm_init(void); return pwm_init(); } static HI_S32 Piris_init(void) { extern int piris_init(void); return piris_init(); } static HI_S32 MIPI_init(void) { extern int mipi_init(void); return mipi_init(); } static HI_S32 CIPHER_init(void) { extern int CIPHER_DRV_ModInit(void); return CIPHER_DRV_ModInit(); } static HI_S32 AiaoMod_init(void) { extern int aiao_mod_init(void); return aiao_mod_init(); } static HI_S32 AiMod_init(void) { extern int ai_mod_init(void); return ai_mod_init(); } static HI_S32 AoMod_init(void) { extern int ao_mod_init(void * pArgs); return ao_mod_init(NULL); } static HI_S32 AencMod_init(void) { extern int aenc_mod_init(void * pArgs); return aenc_mod_init(NULL); } static HI_S32 AdecMod_init(void) { extern int adec_mod_init(void * pArgs); return adec_mod_init(NULL); } #ifdef HI_ACODEC_TYPE_INNER static HI_S32 AcodecMod_init(void) { extern int acodec_mod_init(void * pArgs); ACODEC_MODULE_PARAMS_S stModParam; stModParam.u32InitDelayTimeMs = 10; return acodec_mod_init((void *)&stModParam); } #endif #ifdef HI_ACODEC_TYPE_TLV320AIC31 static HI_S32 tlv320aic31Mod_init(void) { extern int tlv320aic31_init(void); return tlv320aic31_init(); } #endif static HI_S32 HIFB_init(void) { extern HI_S32 __init hifb_init(void* pArgs); HIFB_MODULE_PARAMS_S stHIFB_Param; snprintf(stHIFB_Param.video, 64, "hifb:vram0_size:1620"); snprintf(stHIFB_Param.softcursor, 8, "off"); return hifb_init(&stHIFB_Param); } static HI_S32 IveMod_init(void) { extern int ive_mod_init(void *pvArg); IVE_MODULE_PARAMS_S stParam = {0}; stParam.bSavePowerEn = HI_FALSE; return ive_mod_init(&stParam); } #if 0 static HI_S32 Adv7179Mod_init(void) { ADV7179_MODULE_PARAMS_S stAdv7179Param; stAdv7179Param.Norm_mode = 0; return adv7179_init(&stAdv7179Param); } #endif extern void osal_proc_init(void); HI_VOID SDK_init(void) { HI_S32 ret = 0; osal_proc_init(); SYS_cfg(); ret = MMZ_init(); if (ret != 0) { printf("mmz init error.\n"); } ret = BASE_init(); if (ret != 0) { printf("base init error.\n"); } ret = SYS_init(); if (ret != 0) { printf("sys init error.\n"); } ret = TDE_init(); if (ret != 0) { printf("tde init error.\n"); } ret = REGION_init(); if (ret != 0) { printf("region init error.\n"); } ret = VGS_init(); if (ret != 0) { printf("vgs init error.\n"); } ret = VI_init(); if (ret != 0) { printf("vi init error.\n"); } ret = ISP_init(); if (ret != 0) { printf("isp init error.\n"); } ret = VPSS_init(); if (ret != 0) { printf("vpss init error.\n"); } ret = VO_init(); if (ret != 0) { printf("vo init error.\n"); } ret = HIFB_init(); if (ret != 0) { printf("hifb init error.\n"); } ret = RC_init(); if (ret != 0) { printf("rc init error.\n"); } ret = VENC_init(); if (ret != 0) { printf("venc init error.\n"); } ret = CHNL_init(); if (ret != 0) { printf("chnl init error.\n"); } ret = H264E_init(); if (ret != 0) { printf("h264e init error.\n"); } ret = JPEGE_init(); if (ret != 0) { printf("jpege init error.\n"); } ret = SENSOR_I2C_init(); if (ret != 0) { printf("sensor'i2c init error.\n"); } ret = SENSOR_SPI_init(); if (ret != 0) { printf("sensor'spi init error.\n"); } ret = PWM_init(); if (ret != 0) { printf("pwm init error.\n"); } ret = Piris_init(); if (ret != 0) { printf("piris init error.\n"); } ret = CIPHER_init(); if (ret != 0) { printf("cipher init error.\n"); } insert_sns(); ret = MIPI_init(); if (ret != 0) { printf("mipi init error.\n"); } ret = AiaoMod_init(); if (ret != 0) { printf("aiao init error.\n"); } ret = AiMod_init(); if (ret != 0) { printf("ai init error.\n"); } ret = AoMod_init(); if (ret != 0) { printf("ao init error.\n"); } ret = AencMod_init(); if (ret != 0) { printf("aenc init error.\n"); } ret = AdecMod_init(); if (ret != 0) { printf("adec init error.\n"); } #ifdef HI_ACODEC_TYPE_INNER ret = AcodecMod_init(); if (ret != 0) { printf("acodec init error.\n"); } #endif #ifdef HI_ACODEC_TYPE_TLV320AIC31 ret = tlv320aic31Mod_init(); if (ret != 0) { printf("tlv320aic31 init error.\n"); } #endif audio_disable_mute(); ret = IveMod_init(); if (ret != 0) { printf("Ive init error.\n"); } //sample config as demo board, don't need this ko. /* ret = Adv7179Mod_init(); if (ret != 0) { printf("adv7179 init error.\n"); } */ printf("SDK init ok...\n"); } #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/init/HuaweiLite/readme.txt This file get the method to use the inter drv in HuaweLite. 1.build the drv and then create the object lib (libxxx.a) in mpp/lib/; 2.add the link of the object lib to Make.HuaweiLite a. add the library path: SDK_LIB_PATH := -Lxxx ... b. add the library link: SDK_LIB := $(SDK_LIB_PATH) --start-group -llibxxx ... --end-group 3.update the file: mpp/init/sdk_init.c a. add the head file "hi_interdrv_param.h"(path:drv/interdrv/init/HuaweiLite) if the drv has module param b. add the drv init declare which in xxx_init.c export int xxx_mod_init(...); static unsigned int xxx_init() { XXX_MODULE_PARAMS_S stXxxParam; ... return xxx_mod_init( &stXxxParam ); } c. add the drv_init to sdk init HI_VOID SDK_init(void) { ... xxx_init(); ... } 4. rebuild the app and get it. <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/pwm/pwm.c /* extdrv/interface/pwm.c * * Copyright (c) 2006 Hisilicon Co., Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; * * History: * 23-march-2011 create this file */ #include <linux/module.h> #include <linux/errno.h> #ifndef CONFIG_HISI_SNAPSHOT_BOOT #include <linux/miscdevice.h> #endif #include <linux/fcntl.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/proc_fs.h> #include <linux/workqueue.h> #include <asm/uaccess.h> #include <linux/version.h> //#include <asm/system.h> #include <asm/io.h> #include "pwm.h" #ifndef __HuaweiLite__ //#include <mach/io.h>/* for IO_ADDRESS */ #ifdef CONFIG_HISI_SNAPSHOT_BOOT #include "himedia.h" #endif #else #ifndef __iomem #define __iomem #endif #ifndef ENOIOCTLCMD #define ENOIOCTLCMD 515 /* No ioctl command */ #endif #endif #include "pwm_arch.h" void __iomem *reg_pwmI_base_va = 0; #define PWM_WRITE_REG(Addr, Value) ((*(volatile unsigned int *)(Addr)) = (Value)) #define PWM_READ_REG(Addr) (*(volatile unsigned int *)(Addr)) //PWM #define PWM_ENABLE 0x01 #define PWM_DISABLE 0x00 #define PWM_DEVNAME "pwm" #ifdef CONFIG_HISI_SNAPSHOT_BOOT static struct himedia_device s_stPwmDevice; #endif static int PWM_DRV_Disable(unsigned char pwm_num) { if (pwm_num >= PWM_NUM_MAX) { printk("The pwm number is big than the max value!\n"); return -1; } switch (pwm_num) { case 0: PWM_WRITE_REG(PWM0_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 1: PWM_WRITE_REG(PWM1_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 2: PWM_WRITE_REG(PWM2_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 3: PWM_WRITE_REG(PWM3_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 4: PWM_WRITE_REG(PWM4_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 5: PWM_WRITE_REG(PWM5_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 6: PWM_WRITE_REG(PWM6_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; case 7: PWM_WRITE_REG(PWM7_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); break; default: break; } return 0; } int PWM_DRV_Write(unsigned char pwm_num, unsigned int duty, unsigned int period, unsigned char enable) { if (pwm_num >= PWM_NUM_MAX) { printk("The pwm number is big than the max value!\n"); return -1; } if (enable) { switch (pwm_num) { case 0: PWM_WRITE_REG(PWM0_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM0_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM0_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM0_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM0_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; //printk("The PWMI0 state %x\n",PWM_READ_REG(PWM0_STATE_REG)); break; case 1: PWM_WRITE_REG(PWM1_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM1_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM1_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM1_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM1_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; //printk("The PWMI1 state %x\n",PWM_READ_REG(PWM1_STATE_REG)); break; case 2: PWM_WRITE_REG(PWM2_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM2_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM2_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM2_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM2_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; //printk("The PWMI2 state %x\n",PWM_READ_REG(PWM2_STATE_REG)); break; case 3: PWM_WRITE_REG(PWM3_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM3_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM3_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM3_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM3_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; //printk("The PWMI3 state %x\n",PWM_READ_REG(PWM3_STATE_REG)); break; case 4: PWM_WRITE_REG(PWM4_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM4_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM4_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM4_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM4_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; break; case 5: PWM_WRITE_REG(PWM5_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM5_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM5_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM5_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM5_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; break; case 6: PWM_WRITE_REG(PWM6_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM6_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM6_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM6_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM6_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; break; case 7: PWM_WRITE_REG(PWM7_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM7_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM7_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM7_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM7_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; break; default: PWM_WRITE_REG(PWM0_CTRL_REG(reg_pwmI_base_va), PWM_DISABLE); PWM_WRITE_REG(PWM0_CFG_REG0(reg_pwmI_base_va), period); PWM_WRITE_REG(PWM0_CFG_REG1(reg_pwmI_base_va), duty); PWM_WRITE_REG(PWM0_CFG_REG2(reg_pwmI_base_va), 10); //pwm output number PWM_WRITE_REG(PWM0_CTRL_REG(reg_pwmI_base_va), (1 << 2 | PWM_ENABLE)); // keep the pwm always output; //printk("The PWMII0 state %x\n",PWM_READ_REG(PWM0_STATE_REG)); break; } } else { PWM_DRV_Disable(pwm_num); } return 0; } /* file operation */ #ifdef __HuaweiLite__ int PWM_Open(struct file* file) { return 0 ; } int PWM_Close(struct file* file) { return 0; } #else int PWM_Open(struct inode * inode, struct file * file) { return 0 ; } int PWM_Close(struct inode * inode, struct file * file) { return 0; } #endif static long PWM_Ioctl(struct file *file, unsigned int cmd, unsigned long arg) { PWM_DATA_S __user *argp = (PWM_DATA_S __user*)arg; unsigned char PwmNum; unsigned int Duty; unsigned int Period; unsigned char enable; switch (cmd) { case PWM_CMD_WRITE: { PwmNum = argp->pwm_num; Duty = argp->duty; Period = argp->period; enable = argp->enable; PWM_DRV_Write(PwmNum, Duty, Period, enable); break; } case PWM_CMD_READ: { break; } default: { printk("invalid ioctl command!\n"); return -ENOIOCTLCMD; } } return 0 ; } #ifdef CONFIG_HISI_SNAPSHOT_BOOT static int PWM_freeze(struct himedia_device *pdev) { printk(KERN_DEBUG "%s %d\n", __FUNCTION__, __LINE__); return 0; } static int PWM_restore(struct himedia_device *pdev) { printk(KERN_DEBUG "%s %d\n", __FUNCTION__, __LINE__); return 0; } #endif #ifdef __HuaweiLite__ const static struct file_operations_vfs pwm_fops = { .open = PWM_Open, .close = PWM_Close, .ioctl = PWM_Ioctl, }; #else static struct file_operations pwm_fops = { .owner = THIS_MODULE, .unlocked_ioctl = PWM_Ioctl, .open = PWM_Open , .release = PWM_Close , }; #endif #ifdef CONFIG_HISI_SNAPSHOT_BOOT struct himedia_ops stPwmDrvOps = { .pm_freeze = PWM_freeze, .pm_restore = PWM_restore }; #else static struct miscdevice pwm_dev = { .minor = MISC_DYNAMIC_MINOR, .name = "pwm" , .fops = &pwm_fops, }; #endif /* module init and exit */ #ifdef __HuaweiLite__ int pwm_init(void) { int ret; reg_pwmI_base_va = (void __iomem*)IO_ADDRESS(PWMI_ADRESS_BASE); ret = register_driver("/dev/pwm", &pwm_fops, 0666, 0); if (ret) { printk("register pwd device failed with %#x!\n", ret); return -1; } return 0; } void pwm_exit(void) { int i; for (i = 0; i < PWM_NUM_MAX; i++) { PWM_DRV_Disable(i); } reg_pwmI_base_va = NULL; unregister_driver("/dev/pwm"); } #else #if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) static int __init pwm_init(void) #else static int pwm_init(void) #endif { int ret; if(!reg_pwmI_base_va) { #if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) reg_pwmI_base_va = (void __iomem*)ioremap_nocache(PWMI_ADRESS_BASE, 0x1000); #else reg_pwmI_base_va = NULL; #endif } #ifdef CONFIG_HISI_SNAPSHOT_BOOT snprintf(s_stPwmDevice.devfs_name, sizeof(s_stPwmDevice.devfs_name), PWM_DEVNAME); s_stPwmDevice.minor = HIMEDIA_DYNAMIC_MINOR; s_stPwmDevice.fops = &pwm_fops; s_stPwmDevice.drvops = &stPwmDrvOps; s_stPwmDevice.owner = THIS_MODULE; ret = himedia_register(&s_stPwmDevice); if (ret) { printk("register i2c device failed with %#x!\n", ret); return -1; } #else ret = misc_register(&pwm_dev); if (ret != 0) { printk("register i2c device failed with %#x!\n", ret); return -1; } #endif return 0; } static void __exit pwm_exit(void) { int i; for (i = 0; i < PWM_NUM_MAX; i++) { PWM_DRV_Disable(i); } reg_pwmI_base_va = NULL; #ifdef CONFIG_HISI_SNAPSHOT_BOOT himedia_unregister(&s_stPwmDevice); #else misc_deregister(&pwm_dev); #endif } #endif #ifndef __HuaweiLite__ #if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) module_init(pwm_init); module_exit(pwm_exit); MODULE_DESCRIPTION("PWM Driver"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Hisilicon"); #else #include <linux/of_platform.h> static int pwm_probe(struct platform_device *pdev) { struct resource *mem; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); reg_pwmI_base_va = devm_ioremap_resource(&pdev->dev, mem); if (IS_ERR(reg_pwmI_base_va)) return PTR_ERR(reg_pwmI_base_va); printk("++++++++++ reg_pwmI_base_va = %p\n",reg_pwmI_base_va); pwm_init(); return 0; } static int pwm_remove(struct platform_device *pdev) { printk("<%s> is called\n",__FUNCTION__); pwm_exit(); return 0; } static const struct of_device_id pwm_match[] = { { .compatible = "hisilicon,pwm" }, {}, }; MODULE_DEVICE_TABLE(of, pwm_match); static struct platform_driver pwm_driver = { .probe = pwm_probe, .remove = pwm_remove, .driver = { .name = "pwm", .of_match_table = pwm_match, } }; module_platform_driver(pwm_driver); MODULE_LICENSE("GPL"); #endif #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/drv/cipher/drv_cipher.c /****************************************************************************** Copyright (C), 2011-2014, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : drv_cipher.c Version : Initial Draft Author : <NAME> Created : Last Modified : Description : Function List : History : ******************************************************************************/ #include "hi_osal.h" #include "hi_type.h" #include "drv_cipher_define.h" #include "drv_cipher_ioctl.h" #include "hal_cipher.h" #include "drv_cipher.h" #include "drv_hash.h" #include "hal_efuse.h" #include "config.h" osal_mutex_t g_CipherMutexKernel; osal_mutex_t g_RsaMutexKernel; #define CI_BUF_LIST_SetIVFlag(u32Flags) #define CI_BUF_LIST_SetEndFlag(u32Flags) #define AES_BLOCK_SIZE (16) #define CIPHER_TEMP_MMZ_SIZE (AES_BLOCK_SIZE*32)//512 #define CIPHER_MXA_PKG_SIZE (0x100000 - 16) #ifndef ALIGN #define ALIGN(x,a) (((x)+(a)-1)&~(a-1)) #endif #define ALIGN16(val) ALIGN(val, 16) #define CIPHER_TIME_OUT 10000 #ifdef CIPHER_MULTICIPHER_SUPPORT typedef struct hiCIPHER_IV_VALUE_S { HI_U32 u32PhyAddr; HI_U32 *pu32VirAddr; //HI_U8 au8IVValue[CI_IV_SIZE]; } CIPHER_IV_VALUE_S; /* ----------------------------------------------------------- 0 | input buf list Node(16Byte) | ... * CIPHER_MAX_LIST_NUM | = 16*CIPHER_MAX_LIST_NUM ----------------------------------------------------------- | output buf list Node(16Byte)| ... * CIPHER_MAX_LIST_NUM | ----------------------------------------------------------- | IV (16Byte) | ... * CIPHER_MAX_LIST_NUM | ----------------------------------------------------------- ... * 7 Channels */ typedef struct hiCIPHER_PKGN_MNG_S { HI_U32 u32TotalPkg; /* */ HI_U32 u32Head; HI_U32 u32Tail; } CIPHER_PKGN_MNG_S; typedef struct hiCIPHER_PKG1_MNG_S { HI_U32 au32Data[4]; } CIPHER_PKG1_MNG_S; typedef union hiCIPHER_DATA_MNG_U { CIPHER_PKGN_MNG_S stPkgNMng; CIPHER_PKG1_MNG_S stPkg1Mng; }CIPHER_DATA_MNG_U; typedef struct hiCIPHER_CHAN_S { HI_U32 chnId; CI_BUF_LIST_ENTRY_S *pstInBuf; CI_BUF_LIST_ENTRY_S *pstOutBuf; CIPHER_IV_VALUE_S astCipherIVValue[CIPHER_MAX_LIST_NUM]; /* */ HI_U32 au32WitchSoftChn[CIPHER_MAX_LIST_NUM]; HI_U32 au32CallBackArg[CIPHER_MAX_LIST_NUM]; HI_BOOL bNeedCallback[CIPHER_MAX_LIST_NUM]; CIPHER_DATA_MNG_U unInData; CIPHER_DATA_MNG_U unOutData; } CIPHER_CHAN_S; typedef struct hiCIPHER_CCM_STATUS_S { HI_U32 u32S0[4]; HI_U32 u32CTRm[4]; HI_U32 u32Yi[4]; HI_U32 u32Plen; }CIPHER_CCM_STATUS_S; typedef struct hiCIPHER_GCM_STATUS_S { HI_U32 u32Plen; }CIPHER_GCM_STATUS_S; typedef struct hiCIPHER_SOFTCHAN_S { HI_BOOL bOpen; HI_U32 u32HardWareChn; HI_UNF_CIPHER_CTRL_S stCtrl; HI_BOOL bIVChange; HI_BOOL bKeyChange; HI_U32 u32LastPkg; /* save which pkg's IV we should use for next pkg */ HI_BOOL bDecrypt; /* hi_false: encrypt */ HI_U32 u32PrivateData; funcCipherCallback pfnCallBack; MMZ_BUFFER_S stMmzTemp; CIPHER_CCM_STATUS_S stCcmStatus; CIPHER_GCM_STATUS_S stGcmStatus; } CIPHER_SOFTCHAN_S; /********************** Global Variable declaration **************************/ extern HI_U32 g_u32CipherStartCase; extern HI_U32 g_u32CipherEndCase; CIPHER_COMM_S g_stCipherComm; CIPHER_CHAN_S g_stCipherChans[CIPHER_CHAN_NUM]; CIPHER_SOFTCHAN_S g_stCipherSoftChans[CIPHER_SOFT_CHAN_NUM]; CIPHER_OSR_CHN_S g_stCipherOsrChn[CIPHER_SOFT_CHAN_NUM]; #define CIPHER_CheckHandle(ChanId) \ do \ { \ if (ChanId >= CIPHER_SOFT_CHAN_NUM) \ { \ HI_ERR_CIPHER("chan %d is too large, max: %d\n", ChanId, CIPHER_SOFT_CHAN_NUM); \ osal_mutex_unlock(&g_CipherMutexKernel); \ return HI_ERR_CIPHER_INVALID_PARA; \ } \ if (HI_FALSE == g_stCipherOsrChn[ChanId].g_bSoftChnOpen) \ { \ HI_ERR_CIPHER("chan %d is not open\n", ChanId); \ osal_mutex_unlock(&g_CipherMutexKernel); \ return HI_ERR_CIPHER_INVALID_HANDLE; \ } \ } while (0) HI_VOID DRV_CIPHER_UserCommCallBack(HI_U32 arg) { HI_INFO_CIPHER("arg=%#x.\n", arg); g_stCipherOsrChn[arg].g_bDataDone = HI_TRUE; osal_wakeup(&(g_stCipherOsrChn[arg].cipher_wait_queue)); return ; } HI_S32 DRV_CIPHER_ReadReg(HI_U32 addr, HI_U32 *pVal) { if ( NULL == pVal ) { return HI_ERR_CIPHER_INVALID_PARA; } (HI_VOID)HAL_CIPHER_ReadReg(addr, pVal); return HI_SUCCESS;; } HI_S32 DRV_CIPHER_WriteReg(HI_U32 addr, HI_U32 Val) { (HI_VOID)HAL_CIPHER_WriteReg(addr, Val); return HI_SUCCESS; } HI_S32 DRV_CipherInitHardWareChn(HI_U32 chnId ) { HI_U32 i; HAL_Cipher_SetInBufNum(chnId, CIPHER_MAX_LIST_NUM); HAL_Cipher_SetInBufCnt(chnId, 0); HAL_Cipher_SetOutBufNum(chnId, CIPHER_MAX_LIST_NUM); HAL_Cipher_SetOutBufCnt(chnId, CIPHER_MAX_LIST_NUM); HAL_Cipher_SetAGEThreshold(chnId, CIPHER_INT_TYPE_OUT_BUF, 0); HAL_Cipher_SetAGEThreshold(chnId, CIPHER_INT_TYPE_IN_BUF, 0); HAL_Cipher_DisableInt(chnId, CIPHER_INT_TYPE_OUT_BUF | CIPHER_INT_TYPE_IN_BUF); for (i = 0; i < CIPHER_MAX_LIST_NUM; i++) { ; } return HI_SUCCESS; } HI_S32 DRV_CipherDeInitHardWareChn(HI_U32 chnId) { HAL_Cipher_DisableInt(chnId, CIPHER_INT_TYPE_OUT_BUF | CIPHER_INT_TYPE_IN_BUF); return HI_SUCCESS; } /* set interrupt threshold level and enable it, and flag soft channel opened */ HI_S32 DRV_CIPHER_OpenChn(HI_U32 softChnId) { HI_S32 ret = 0; CIPHER_CHAN_S *pChan; CIPHER_SOFTCHAN_S *pSoftChan; pSoftChan = &g_stCipherSoftChans[softChnId]; pSoftChan->u32HardWareChn = softChnId; pChan = &g_stCipherChans[pSoftChan->u32HardWareChn]; HAL_Cipher_SetIntThreshold(pChan->chnId, CIPHER_INT_TYPE_OUT_BUF, CIPHER_DEFAULT_INT_NUM); //ret = HAL_Cipher_EnableInt(pChan->chnId, CIPHER_INT_TYPE_OUT_BUF | CIPHER_INT_TYPE_IN_BUF); ret = HAL_Cipher_EnableInt(pChan->chnId, CIPHER_INT_TYPE_OUT_BUF); if (HI_SUCCESS != ret) { return HI_FAILURE; } g_stCipherOsrChn[softChnId].g_bSoftChnOpen = HI_TRUE; pSoftChan->bOpen = HI_TRUE; return ret; } HI_S32 DRV_CIPHER_CloseChn(HI_U32 softChnId) { g_stCipherSoftChans[softChnId].bOpen = HI_FALSE; return HI_SUCCESS; } #ifdef CIPHER_CCM_GCM_SUPPORT HI_S32 DRV_CIPHER_CCM_Init(HI_U32 u32SoftChanId) { HI_S32 Ret; MMZ_BUFFER_S *pstMmzTemp; HI_UNF_CIPHER_CTRL_S *pstCtrl; HI_UNF_CIPHER_CCM_INFO_S *pstCCM; HI_U32 u32Index = 0; HI_U8 *pu8Buf = 0; CIPHER_SOFTCHAN_S *pSoftChan; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstMmzTemp = &pSoftChan->stMmzTemp; pstCtrl = &pSoftChan->stCtrl; pu8Buf = (HI_U8*)pstMmzTemp->pu8StartVirAddr; pstCCM = &pstCtrl->unModeInfo.stCCM; if ((pstCCM->u8NLen < 7) || (pstCCM->u8NLen > 13)) { HI_ERR_CIPHER("Invalid Nlen: 0x%x!\n", pstCCM->u8NLen); return HI_ERR_CIPHER_INVALID_PARA; } osal_memset(&pSoftChan->stCcmStatus, 0, sizeof(CIPHER_CCM_STATUS_S)); pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CBC; osal_memset(pstCtrl->u32IV, 0x00, CI_IV_SIZE); osal_memset(pu8Buf, 0, pstMmzTemp->u32Size); pu8Buf[u32Index] = (pstCCM->u32ALen > 0 ? 1 : 0) << 6;//Adata pu8Buf[u32Index] |= ((pstCCM->u8TLen - 2)/2) << 3;// ( t -2)/2 pu8Buf[u32Index] |= ((15 - pstCCM->u8NLen) - 1);// q-1, n+q=15 u32Index++; osal_memcpy(&pu8Buf[u32Index], pstCCM->u8Nonce, pstCCM->u8NLen); u32Index+=pstCCM->u8NLen; if(u32Index <= 12) { u32Index = 12; //in fact, mlen <= 2^32, so skip to the last 4 bytes fo Q pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen >> 24); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen >> 16); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen >> 8); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen); } else if ((u32Index == 13) && (pstCCM->u32MLen <= 0xFFFFFF)) { pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen >> 16); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen >> 8); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen); } else if ((u32Index == 14) && (pstCCM->u32MLen <= 0xFFFF)) { pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen >> 8); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32MLen); } else { HI_ERR_CIPHER("Invalid Mlen: 0x%x, q: 0x%x!\n", pstCCM->u32MLen, 16 - u32Index); return HI_ERR_CIPHER_INVALID_PARA; } // HI_PRINT_HEX ("B0", pu8Buf, 16); pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstMmzTemp->u32StartPhyAddr, pstMmzTemp->u32StartPhyAddr, AES_BLOCK_SIZE, HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pSoftChan->stCcmStatus.u32Yi, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); // HI_PRINT_HEX ("Y0", (HI_U8*)pSoftChan->stCcmStatus.u32Yi, 16); pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CCM; pu8Buf = (HI_U8*)pstCtrl->u32IV; osal_memset(pu8Buf, 0x00, CI_IV_SIZE); *pu8Buf = (15 - pstCCM->u8NLen) - 1; osal_memcpy(pu8Buf+1, pstCCM->u8Nonce, pstCCM->u8NLen); pSoftChan->bIVChange = HI_TRUE; osal_memset((void*)pstMmzTemp->pu8StartVirAddr, 0, AES_BLOCK_SIZE); Ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstMmzTemp->u32StartPhyAddr, pstMmzTemp->u32StartPhyAddr, AES_BLOCK_SIZE, HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } osal_memcpy((HI_U8*)pSoftChan->stCcmStatus.u32S0, (HI_U8*)pstMmzTemp->pu8StartVirAddr, AES_BLOCK_SIZE); HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pSoftChan->stCcmStatus.u32CTRm, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CCM; return HI_SUCCESS; } HI_S32 DRV_CIPHER_GCM_Init(HI_U32 u32SoftChanId) { HI_S32 Ret; CIPHER_SOFTCHAN_S *pSoftChan; HI_UNF_CIPHER_CTRL_S *pstCtrl; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstCtrl = &pSoftChan->stCtrl; osal_memset(&pSoftChan->stGcmStatus, 0, sizeof(CIPHER_GCM_STATUS_S)); if ((pstCtrl->unModeInfo.stGCM.u32IVLen < 1)||(pstCtrl->unModeInfo.stGCM.u32IVLen > 16)) { HI_ERR_CIPHER("Invalid IVlen: 0x%x, must not large than 16!\n", pstCtrl->unModeInfo.stGCM.u32IVLen); return HI_ERR_CIPHER_INVALID_PARA; } if ((pstCtrl->unModeInfo.stGCM.u32MLen + pstCtrl->unModeInfo.stGCM.u32ALen) == 0) { HI_ERR_CIPHER("Invalid u32MLen + u32ALen: 0, must be large than 0!\n"); return HI_ERR_CIPHER_INVALID_PARA; } Ret = HAL_Cipher_SetLen (u32SoftChanId, pstCtrl); if (HI_SUCCESS != Ret) { return Ret; } Ret = HAL_Cipher_CleanTagVld(u32SoftChanId, pstCtrl); if (HI_SUCCESS != Ret) { return Ret; } return Ret; } HI_S32 DRV_CIPHER_CCM_Aad(HI_U32 u32SoftChanId) { HI_S32 Ret; MMZ_BUFFER_S *pstMmzTemp; HI_UNF_CIPHER_CTRL_S *pstCtrl; HI_UNF_CIPHER_CCM_INFO_S *pstCCM; HI_U32 u32Index = 0; HI_U32 u32CopySize = 0; HI_U32 u32TotalCopySize = 0; HI_U8 *pu8Buf = 0; CIPHER_SOFTCHAN_S *pSoftChan; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstMmzTemp = &pSoftChan->stMmzTemp; pstCtrl = &pSoftChan->stCtrl; pstCCM = &pstCtrl->unModeInfo.stCCM; pu8Buf = (HI_U8*)pstMmzTemp->pu8StartVirAddr; if (pstCCM->u32ALen == 0) { return HI_SUCCESS; } pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CBC; osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)pSoftChan->stCcmStatus.u32Yi, CI_IV_SIZE); osal_memset((HI_U8*)pstMmzTemp->pu8StartVirAddr, 0, pstMmzTemp->u32Size); pSoftChan->bIVChange = HI_TRUE; u32Index = 0; if (pstCCM->u32ALen < (0x10000 - 0x100)) { pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32ALen >> 8); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32ALen); } else { pu8Buf[u32Index++] = 0xFF; pu8Buf[u32Index++] = 0xFE; pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32ALen >> 24); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32ALen >> 16); pu8Buf[u32Index++] = (HI_U8)(pstCCM->u32ALen >> 8); pu8Buf[u32Index++] = (HI_U8)pstCCM->u32ALen; } if (pstCCM->u32ALen > (pstMmzTemp->u32Size - u32Index)) { u32CopySize = pstMmzTemp->u32Size - u32Index; } else { u32CopySize = pstCCM->u32ALen; } if(osal_copy_from_user(&pu8Buf[u32Index], pstCCM->pu8Aad, u32CopySize)) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } u32Index += u32CopySize; u32TotalCopySize = u32CopySize; // HI_PRINT_HEX ("B(A)", (HI_U8*)stAadMmzBuf.pu8StartVirAddr, ALIGN16(u32Index)); Ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstMmzTemp->u32StartPhyAddr, pstMmzTemp->u32StartPhyAddr, ALIGN16(u32Index), HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } while(u32TotalCopySize < pstCCM->u32ALen) { if ((pstCCM->u32ALen - u32TotalCopySize) > pstMmzTemp->u32Size) { u32CopySize = pstMmzTemp->u32Size; } else { u32CopySize = pstCCM->u32ALen - u32TotalCopySize; osal_memset(pu8Buf, 0, pstMmzTemp->u32Size); } if(osal_copy_from_user(pu8Buf, pstCCM->pu8Aad+u32TotalCopySize, u32CopySize)) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } Ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstMmzTemp->u32StartPhyAddr, pstMmzTemp->u32StartPhyAddr, ALIGN16(u32CopySize), HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } u32TotalCopySize += u32CopySize; } HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pSoftChan->stCcmStatus.u32Yi, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); // HI_PRINT_HEX ("Y(A)", (HI_U8*)pSoftChan->stCcmStatus.u32Yi, CI_IV_SIZE); pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CCM; return HI_SUCCESS; } HI_S32 DRV_CIPHER_GCM_Aad(HI_U32 u32SoftChanId) { HI_S32 Ret; HI_U32 fullCnt; HI_UNF_CIPHER_CTRL_S *pstCtrl; CIPHER_SOFTCHAN_S *pSoftChan; CIPHER_CHAN_S *pChan = NULL; HI_UNF_CIPHER_GCM_INFO_S *pstGCM; MMZ_BUFFER_S *pstMmzTemp; HI_U32 u32CopySize = 0; HI_U32 u32TotalCopySize = 0; HI_U8 *pu8Buf = 0; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstMmzTemp = &pSoftChan->stMmzTemp; pstCtrl = &pSoftChan->stCtrl; pstGCM = &pstCtrl->unModeInfo.stGCM; pu8Buf = (HI_U8*)pstMmzTemp->pu8StartVirAddr; if (pstCtrl->unModeInfo.stGCM.u32ALen == 0) { return HI_SUCCESS; } Ret = HAL_Cipher_CleanAadEnd(u32SoftChanId, pstCtrl); if (HI_SUCCESS != Ret) { return Ret; } while(u32TotalCopySize < pstGCM->u32ALen) { if ((pstGCM->u32ALen - u32TotalCopySize) > pstMmzTemp->u32Size) { u32CopySize = pstMmzTemp->u32Size; } else { u32CopySize = pstGCM->u32ALen - u32TotalCopySize; osal_memset(pu8Buf, 0, pstMmzTemp->u32Size); } if(osal_copy_from_user(pu8Buf, pstGCM->pu8Aad+u32TotalCopySize, u32CopySize)) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } Ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstMmzTemp->u32StartPhyAddr, HI_NULL, ALIGN16(u32CopySize), HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } u32TotalCopySize += u32CopySize; } /*compute aad without Output data, interrupt did not occur*/ Ret = HAL_Cipher_WaitAadEnd(u32SoftChanId, pstCtrl); if (HI_SUCCESS != Ret) { return Ret; } /*process input queue*/ pChan = &g_stCipherChans[u32SoftChanId]; Ret = HAL_Cipher_GetInBufEmpty(u32SoftChanId, &fullCnt); if (HI_SUCCESS != Ret) { return Ret; } HAL_Cipher_SetInBufEmpty(u32SoftChanId, fullCnt); pChan->unInData.stPkgNMng.u32Tail++; pChan->unInData.stPkgNMng.u32Tail %= CIPHER_MAX_LIST_NUM; return Ret; } #endif HI_S32 DRV_CIPHER_ConfigChn(HI_U32 softChnId, HI_UNF_CIPHER_CTRL_S *pConfig) { HI_S32 ret = HI_SUCCESS; HI_BOOL bDecrypt = HI_FALSE; HI_U32 hardWareChn; HI_BOOL bIVSet; CIPHER_CHAN_S *pChan; CIPHER_SOFTCHAN_S *pSoftChan; CIPHER_CheckHandle(softChnId); pSoftChan = &g_stCipherSoftChans[softChnId]; hardWareChn = pSoftChan->u32HardWareChn; pChan = &g_stCipherChans[pSoftChan->u32HardWareChn]; pSoftChan->pfnCallBack = DRV_CIPHER_UserCommCallBack; bIVSet = (pConfig->stChangeFlags.bit1IV & 0x1) ? HI_TRUE : HI_FALSE; ret = HAL_Cipher_Config(pChan->chnId, bDecrypt, bIVSet, pConfig); pSoftChan->bIVChange = bIVSet; pSoftChan->bKeyChange = HI_TRUE; osal_memcpy(&(pSoftChan->stCtrl), pConfig, sizeof(HI_UNF_CIPHER_CTRL_S)); /* set Key */ if (pSoftChan->bKeyChange) { switch(pSoftChan->stCtrl.enKeySrc) { case HI_UNF_CIPHER_KEY_SRC_USER: ret = HAL_Cipher_SetKey(hardWareChn, &(pSoftChan->stCtrl)); break; #ifdef CIPHER_KLAD_SUPPORT case HI_UNF_CIPHER_KEY_SRC_KLAD_1: case HI_UNF_CIPHER_KEY_SRC_KLAD_2: case HI_UNF_CIPHER_KEY_SRC_KLAD_3: ret = DRV_Cipher_KladLoadKey(softChnId, pSoftChan->stCtrl.enKeySrc, HI_UNF_CIPHER_KLAD_TARGET_AES, (HI_U8*)pSoftChan->stCtrl.u32Key, 16); break; #elif defined (CIPHER_EFUSE_SUPPORT) case HI_UNF_CIPHER_KEY_SRC_EFUSE_0: case HI_UNF_CIPHER_KEY_SRC_EFUSE_1: case HI_UNF_CIPHER_KEY_SRC_EFUSE_2: case HI_UNF_CIPHER_KEY_SRC_EFUSE_3: ret = HAL_Cipher_SetKey(hardWareChn, &(pSoftChan->stCtrl)); break; #endif default: HI_ERR_CIPHER("Invalid key src 0x%x!\n", pSoftChan->stCtrl.enKeySrc); return HI_FAILURE; } pSoftChan->bKeyChange = HI_FALSE; } switch(pSoftChan->stCtrl.enWorkMode) { case HI_UNF_CIPHER_WORK_MODE_ECB: case HI_UNF_CIPHER_WORK_MODE_CBC: case HI_UNF_CIPHER_WORK_MODE_CFB: case HI_UNF_CIPHER_WORK_MODE_OFB: case HI_UNF_CIPHER_WORK_MODE_CTR: break; #ifdef CIPHER_CCM_GCM_SUPPORT case HI_UNF_CIPHER_WORK_MODE_CCM: ret = DRV_CIPHER_CCM_Init(softChnId); break; case HI_UNF_CIPHER_WORK_MODE_GCM: ret = DRV_CIPHER_GCM_Init(softChnId); break; #endif default: HI_ERR_CIPHER("Cipher mode 0x%x unsupport!\n", pSoftChan->stCtrl.enWorkMode); return HI_FAILURE; } return ret; } HI_S32 HI_DRV_CIPHER_ConfigChn(HI_U32 softChnId, HI_UNF_CIPHER_CTRL_S *pConfig) { HI_S32 ret = HI_SUCCESS; HI_U32 u32IVSet; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } u32IVSet = pConfig->stChangeFlags.bit1IV; ret = DRV_CIPHER_ConfigChn(softChnId, pConfig); if (ret != HI_SUCCESS) { osal_mutex_unlock(&g_CipherMutexKernel); return ret; } switch(pConfig->enWorkMode) { #ifdef CIPHER_CCM_GCM_SUPPORT case HI_UNF_CIPHER_WORK_MODE_CCM: ret = DRV_CIPHER_CCM_Aad(softChnId); break; case HI_UNF_CIPHER_WORK_MODE_GCM: if (u32IVSet) { ret = DRV_CIPHER_GCM_Aad(softChnId); } break; #endif default: break; } osal_mutex_unlock(&g_CipherMutexKernel); return ret; } HI_S32 DRV_CipherStartSinglePkgChn(HI_U32 softChnId, HI_DRV_CIPHER_DATA_INFO_S *pBuf2Process) { HI_U32 ret = HI_SUCCESS; CIPHER_CHAN_S *pChan; CIPHER_SOFTCHAN_S *pSoftChan; pSoftChan = &g_stCipherSoftChans[softChnId]; pChan = &g_stCipherChans[pSoftChan->u32HardWareChn]; HAL_Cipher_Config(0, pBuf2Process->bDecrypt, pSoftChan->bIVChange, &(pSoftChan->stCtrl)); #if 1 if (pSoftChan->bIVChange) { HAL_Cipher_SetInIV(0, &(pSoftChan->stCtrl)); pSoftChan->bIVChange = HI_FALSE; } if (pSoftChan->bKeyChange) { if (pSoftChan->bKeyChange) { switch(pSoftChan->stCtrl.enKeySrc) { case HI_UNF_CIPHER_KEY_SRC_USER: ret = HAL_Cipher_SetKey(softChnId, &(pSoftChan->stCtrl)); break; #ifdef CIPHER_KLAD_SUPPORT case HI_UNF_CIPHER_KEY_SRC_KLAD_1: case HI_UNF_CIPHER_KEY_SRC_KLAD_2: case HI_UNF_CIPHER_KEY_SRC_KLAD_3: ret = DRV_Cipher_KladLoadKey(softChnId, pSoftChan->stCtrl.enKeySrc, HI_UNF_CIPHER_KLAD_TARGET_AES, (HI_U8*)pSoftChan->stCtrl.u32Key, 16); break; #elif defined (CIPHER_EFUSE_SUPPORT) case HI_UNF_CIPHER_KEY_SRC_EFUSE_0: case HI_UNF_CIPHER_KEY_SRC_EFUSE_1: case HI_UNF_CIPHER_KEY_SRC_EFUSE_2: case HI_UNF_CIPHER_KEY_SRC_EFUSE_3: ret = HAL_Cipher_SetKey(softChnId, &(pSoftChan->stCtrl)); break; #endif default: HI_ERR_CIPHER("Invalid key src 0x%x!\n", pSoftChan->stCtrl.enKeySrc); return HI_FAILURE; } pSoftChan->bKeyChange = HI_FALSE; } } #else pSoftChan->bIVChange = HI_FALSE; #endif if (HI_SUCCESS != ret) { HI_ERR_CIPHER("set key failed!\n"); return ret; } HAL_Cipher_SetDataSinglePkg(pBuf2Process); HAL_Cipher_StartSinglePkg(pChan->chnId); ret = HAL_Cipher_WaitIdle(); if (HI_SUCCESS != ret) { return HI_FAILURE; } HAL_Cipher_ReadDataSinglePkg(pBuf2Process->u32DataPkg); return ret; } HI_S32 DRV_CipherStartMultiPkgChn(HI_U32 softChnId, HI_DRV_CIPHER_DATA_INFO_S *pBuf2Process, HI_U32 pkgNum, HI_BOOL isMultiIV, HI_U32 callBackArg) { HI_S32 ret = HI_SUCCESS; HI_U32 hardWareChn; HI_U32 BusyCnt = 0; HI_U32 currentInPtr; HI_U32 currentOutPtr; HI_U32 i; HI_U32 u32OutCnt = 0; HI_U32 u32InCnt = 0; CI_BUF_LIST_ENTRY_S *pInBuf; CI_BUF_LIST_ENTRY_S *pOutBuf; CIPHER_CHAN_S *pChan; CIPHER_SOFTCHAN_S *pSoftChan; pSoftChan = &g_stCipherSoftChans[softChnId]; hardWareChn = pSoftChan->u32HardWareChn; pChan = &g_stCipherChans[hardWareChn]; HAL_Cipher_GetInBufCnt(hardWareChn, &BusyCnt); currentInPtr = pChan->unInData.stPkgNMng.u32Head; currentOutPtr = pChan->unOutData.stPkgNMng.u32Head; if ((pBuf2Process == HI_NULL) || (pkgNum== 0)) { HI_ERR_CIPHER("Invalid param\n"); return HI_ERR_CIPHER_INVALID_PARA; } if (BusyCnt + pkgNum > CIPHER_MAX_LIST_NUM) /* */ { HI_ERR_CIPHER("pkg want to do: %u, free pkg num:%u.\n", pkgNum, CIPHER_MAX_LIST_NUM - BusyCnt); return HI_ERR_CIPHER_BUSY; } /* set Key */ if (pSoftChan->bKeyChange) { ret = HAL_Cipher_SetKey(hardWareChn, &(pSoftChan->stCtrl)); if (HI_SUCCESS != ret) { return ret; } pSoftChan->bKeyChange = HI_FALSE; } ret = HAL_Cipher_Config(hardWareChn, pBuf2Process[0].bDecrypt, pSoftChan->bIVChange, &(pSoftChan->stCtrl)); if (HI_SUCCESS != ret) { return ret; } for (i = 0; i < pkgNum; i++) { /*Config IN buf*/ if (pBuf2Process[i].u32src > 0) { // HI_PRINT("input:%d/%d: 0x%x, currentInPtr: %d\n", i, pkgNum, pBuf2Process[i].u32length, currentInPtr); pInBuf = pChan->pstInBuf + currentInPtr; pInBuf->u32DataAddr = pBuf2Process[i].u32src; pInBuf->U32DataLen = pBuf2Process[i].u32length; pInBuf->u32Flags = 0; if (pSoftChan->bIVChange) { osal_memcpy(pChan->astCipherIVValue[currentInPtr].pu32VirAddr, pSoftChan->stCtrl.u32IV, CI_IV_SIZE); osal_mb(); pInBuf->u32IVStartAddr = pChan->astCipherIVValue[currentInPtr].u32PhyAddr; pInBuf->u32Flags |= (1 << CI_BUF_LIST_FLAG_IVSET_BIT); } if (isMultiIV) { pInBuf->u32Flags |= (1 << CI_BUF_LIST_FLAG_EOL_BIT); } else { pSoftChan->bIVChange = HI_FALSE; } u32InCnt++; currentInPtr = (currentInPtr + 1) % CIPHER_MAX_LIST_NUM; pChan->unInData.stPkgNMng.u32TotalPkg++; } /*Config OUT buf*/ if (pBuf2Process[i].u32dest > 0) { // HI_PRINT("output:%d/%d: 0x%x, currentOutPtr: %d\n", i, pkgNum, pBuf2Process[i].u32length, currentOutPtr); pOutBuf = pChan->pstOutBuf + currentOutPtr; pOutBuf->u32DataAddr = pBuf2Process[i].u32dest; pOutBuf->U32DataLen = pBuf2Process[i].u32length; pChan->au32WitchSoftChn[currentOutPtr] = softChnId; pChan->au32CallBackArg[currentOutPtr] = callBackArg; pSoftChan->u32PrivateData = callBackArg; pChan->bNeedCallback[currentOutPtr] = ((i + 1) == pkgNum ? HI_TRUE : HI_FALSE); pOutBuf->u32Flags = 0; pOutBuf->u32Flags &= ~(1 << CI_BUF_LIST_FLAG_EOL_BIT); pOutBuf->u32Flags |= (isMultiIV << CI_BUF_LIST_FLAG_EOL_BIT); currentOutPtr = (currentOutPtr + 1) % CIPHER_MAX_LIST_NUM; pChan->unOutData.stPkgNMng.u32TotalPkg++; u32OutCnt++; } HI_INFO_CIPHER("%s %#x->%#x, LEN:%#x\n", pBuf2Process[i].bDecrypt ? "Dec" : "ENC", pBuf2Process[i].u32src, pBuf2Process[i].u32dest,pBuf2Process[i].u32length ); } pSoftChan->bIVChange = HI_FALSE; if (u32OutCnt > 0) { HAL_Cipher_SetIntThreshold(hardWareChn, CIPHER_INT_TYPE_OUT_BUF, u32OutCnt); } if (u32InCnt > 0) { HAL_Cipher_SetInBufCnt(hardWareChn, u32InCnt); /* +1 */ } /* save list Node */ pChan->unInData.stPkgNMng.u32Head = currentInPtr; pChan->unOutData.stPkgNMng.u32Head = currentOutPtr; pSoftChan->bIVChange = HI_FALSE; return ret; } HI_S32 DRV_CIPHER_CreatMultiPkgTask(HI_U32 softChnId, HI_DRV_CIPHER_DATA_INFO_S *pBuf2Process, HI_U32 pkgNum, HI_BOOL isMultiIV, HI_U32 callBackArg) { return DRV_CipherStartMultiPkgChn(softChnId, pBuf2Process, pkgNum, isMultiIV, callBackArg); } /* */ HI_S32 DRV_CIPHER_CreatTask(HI_U32 softChnId, HI_DRV_CIPHER_TASK_S *pTask, HI_U32 *pKey, HI_U32 *pIV) { HI_S32 ret; CIPHER_CHAN_S *pChan; CIPHER_SOFTCHAN_S *pSoftChan; pSoftChan = &g_stCipherSoftChans[softChnId]; pChan = &g_stCipherChans[pSoftChan->u32HardWareChn]; if (pKey) { pSoftChan->bKeyChange = HI_TRUE; osal_memcpy(pSoftChan->stCtrl.u32Key, pKey, CI_KEY_SIZE); } if (pIV) { pSoftChan->bIVChange = HI_TRUE; osal_memcpy(pSoftChan->stCtrl.u32IV, pIV, CI_IV_SIZE); } HAL_Cipher_SetIntThreshold(pChan->chnId, CIPHER_INT_TYPE_OUT_BUF, 1); if (CIPHER_PKGx1_CHAN == pSoftChan->u32HardWareChn) { ret = DRV_CipherStartSinglePkgChn(softChnId, &(pTask->stData2Process)); } else { ret = DRV_CipherStartMultiPkgChn(softChnId, &(pTask->stData2Process), 1, HI_TRUE, pTask->u32CallBackArg); } if (HI_SUCCESS != ret) { HI_ERR_CIPHER("can't create task, ERR=%#x.\n", ret); return ret; } return HI_SUCCESS; } HI_S32 DRV_CipherDataDoneMultiPkg(HI_U32 chnId) { HI_S32 ret; HI_U32 currentInPtr = 0; HI_U32 currentOutPtr = 0; HI_U32 softChnId = 0; HI_U32 fullCnt = 0; HI_U32 i; CIPHER_CHAN_S *pChan = NULL; CIPHER_SOFTCHAN_S *pSoftChan = NULL; CI_BUF_LIST_ENTRY_S *pInBuf = NULL; CI_BUF_LIST_ENTRY_S *pOutBuf = NULL; pChan = &g_stCipherChans[chnId]; HI_DEBUG_CIPHER("Data DONE, hwChn:%d\n", chnId); ret = HAL_Cipher_GetInBufEmpty(chnId, &fullCnt); if (HI_SUCCESS != ret) { return ret; } HAL_Cipher_SetInBufEmpty(chnId, fullCnt); /* - */ currentInPtr = pChan->unInData.stPkgNMng.u32Tail; pChan->unInData.stPkgNMng.u32Tail = (currentInPtr + fullCnt) % CIPHER_MAX_LIST_NUM; HI_DEBUG_CIPHER("Data DONE, In Cnt:%d\n", fullCnt); /* get the finished output data buffer count */ ret = HAL_Cipher_GetOutBufFull(chnId, &fullCnt); if (HI_SUCCESS != ret) { return ret; } currentOutPtr = pChan->unOutData.stPkgNMng.u32Tail; if(currentOutPtr >= CIPHER_MAX_LIST_NUM) { HI_ERR_CIPHER("idx error: idx=%u, chnId=%d \n", currentOutPtr, chnId); return HI_FAILURE; } HI_DEBUG_CIPHER("fullCnt:%d\n", fullCnt); if (fullCnt > 0) /* have list entry */ { for (i = 0; i < fullCnt; i++) { softChnId = pChan->au32WitchSoftChn[currentOutPtr]; pChan->au32WitchSoftChn[currentOutPtr] = CIPHER_INVALID_CHN; pSoftChan = &g_stCipherSoftChans[softChnId]; pSoftChan->u32LastPkg = currentOutPtr; HI_INFO_CIPHER("softChnId=%d, %d-idx=%u, needCallback:%d\n", softChnId, fullCnt, currentOutPtr, pChan->bNeedCallback[currentOutPtr]); if (pSoftChan->pfnCallBack && pChan->bNeedCallback[currentOutPtr]) { HI_DEBUG_CIPHER("CallBack function\n"); pSoftChan->pfnCallBack(pSoftChan->u32PrivateData); } pInBuf = pChan->pstInBuf + currentOutPtr; pInBuf->u32Flags = 0; pOutBuf = pChan->pstOutBuf + currentOutPtr; pOutBuf->u32Flags = 0; currentOutPtr = (currentOutPtr + 1) % CIPHER_MAX_LIST_NUM; } pChan->unOutData.stPkgNMng.u32Tail = currentOutPtr; HAL_Cipher_SetOutBufFull(chnId, fullCnt); /* - */ HAL_Cipher_SetOutBufCnt(chnId, fullCnt); /* + */ } else { HI_U32 regValue = 0xabcd; HI_ERR_CIPHER("Data done, but fullCnt=0, chn%d\n", chnId); HAL_Cipher_GetIntState(&regValue); HI_ERR_CIPHER("INTSt:%#x\n", regValue); HAL_Cipher_GetIntEnState(&regValue); HI_ERR_CIPHER("INTEnSt:%#x\n", regValue); HAL_Cipher_GetRawIntState(&regValue); HI_ERR_CIPHER("INTRawSt:%#x\n", regValue); return HI_FAILURE; } return HI_SUCCESS; } #ifdef CIPHER_KLAD_SUPPORT HI_VOID DRV_Cipher_Invbuf(HI_U8 *buf, HI_U32 u32len) { HI_U32 i; HI_U8 ch; for(i=0; i<u32len/2; i++) { ch = buf[i]; buf[i] = buf[u32len - i - 1]; buf[u32len - i - 1] = ch; } } HI_S32 DRV_Cipher_KladLoadKey(HI_U32 chnId, HI_UNF_CIPHER_KEY_SRC_E enRootKey, HI_UNF_CIPHER_KLAD_TARGET_E enTarget, HI_U8 *pu8DataIn, HI_U32 u32KeyLen) { HI_S32 ret; HI_U32 i; HI_U32 u32Key[4]; HI_U32 u32OptId; if((enRootKey < HI_UNF_CIPHER_KEY_SRC_KLAD_1) || (enRootKey > HI_UNF_CIPHER_KEY_SRC_KLAD_3)) { HI_ERR_CIPHER("Error: Invalid Root Key src 0x%x!\n", enRootKey); return HI_FAILURE; } if(((u32KeyLen % 16 ) != 0) || (u32KeyLen == 0)) { HI_ERR_CIPHER("Error: Invalid key len 0x%x!\n", u32KeyLen); return HI_FAILURE; } u32OptId = enRootKey - HI_UNF_CIPHER_KEY_SRC_KLAD_1 + 1; ret = HAL_Cipher_KladConfig(chnId, u32OptId, enTarget, HI_TRUE); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Error: cipher klad config failed!\n"); return HI_FAILURE; } for(i=0; i<u32KeyLen/16; i++) { osal_memcpy(u32Key, pu8DataIn+i*16, 16); HAL_Cipher_SetKladData(u32Key); HAL_Cipher_StartKlad(); ret = HAL_Cipher_WaitKladDone(); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Error: cipher klad wait done failed!\n"); return HI_FAILURE; } } return HI_SUCCESS; } HI_S32 DRV_Cipher_KladEncryptKey(CIPHER_KLAD_KEY_S *pstKladKey) { HI_S32 ret; HI_U32 u32OptId; if((pstKladKey->enRootKey <= HI_UNF_CIPHER_KEY_SRC_EFUSE_0) || (pstKladKey->enRootKey >= HI_UNF_CIPHER_KEY_SRC_BUTT)) { HI_ERR_CIPHER("Error: Invalid Root Key src 0x%x!\n", pstKladKey->enRootKey); return HI_FAILURE; } u32OptId = pstKladKey->enRootKey - HI_UNF_CIPHER_KEY_SRC_EFUSE_0; ret = HAL_Cipher_KladConfig(0, u32OptId, HI_UNF_CIPHER_KLAD_TARGET_AES, HI_FALSE); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Error: cipher klad config failed!\n"); return HI_FAILURE; } if (pstKladKey->enTarget == HI_UNF_CIPHER_KLAD_TARGET_RSA) { DRV_Cipher_Invbuf((HI_U8*)pstKladKey->u32CleanKey, 16); } HAL_Cipher_SetKladData(pstKladKey->u32CleanKey); HAL_Cipher_StartKlad(); ret = HAL_Cipher_WaitKladDone(); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Error: cipher klad wait done failed!\n"); return HI_FAILURE; } HAL_Cipher_GetKladData(pstKladKey->u32EncryptKey); return HI_SUCCESS; } HI_S32 HI_DRV_CIPHER_KladEncryptKey(CIPHER_KLAD_KEY_S *pstKladKey) { HI_S32 ret = HI_SUCCESS; if(pstKladKey == HI_NULL) { HI_ERR_CIPHER("Invalid params!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("down_interruptible failed!\n"); return HI_FAILURE; } ret = DRV_Cipher_KladEncryptKey(pstKladKey); osal_mutex_unlock(&g_CipherMutexKernel); return ret; } #endif /* interrupt routine, callback */ HI_S32 DRV_Cipher_ISR(HI_S32 irq, HI_VOID *devId) { HI_U32 i; HI_U32 INTValue = 0; HAL_Cipher_GetIntState(&INTValue); HAL_Cipher_ClrIntState(INTValue); HI_INFO_CIPHER(" in the isr INTValue=%#x!\n", INTValue); for(i = 1; i < CIPHER_CHAN_NUM; i++) { if ((INTValue >> (i+8)) & 0x1) { DRV_CipherDataDoneMultiPkg(i); } } // HAL_Cipher_ClrIntState(); return OSAL_IRQ_HANDLED; } HI_S32 DRV_CIPHER_Init(HI_VOID) { HI_U32 i,j, hwChnId; HI_S32 ret; HI_U32 bufSizeChn = 0; /* all the buffer list size, included data buffer size and IV buffer size */ HI_U32 databufSizeChn = 0; /* max list number data buffer size */ HI_U32 ivbufSizeChn = 0; /* all the list IV size */ HI_U32 bufSizeTotal = 0; /* all the channel buffer size */ MMZ_BUFFER_S cipherListBuf; CIPHER_CHAN_S *pChan; osal_mutex_init(&g_CipherMutexKernel); osal_mutex_init(&g_RsaMutexKernel); osal_memset(&g_stCipherComm, 0, sizeof(g_stCipherComm)); osal_memset(&g_stCipherChans, 0, sizeof(g_stCipherChans)); osal_memset(&g_stCipherSoftChans, 0, sizeof(g_stCipherSoftChans)); ret = HI_DRV_MMZ_AllocAndMap("CIPHER_TEMP", NULL, 4096, 0, &g_stCipherComm.stTempPhyBuf); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Error: new phyaddr for last block failed!\n"); return HI_FAILURE; } for (i = 0; i < CIPHER_SOFT_CHAN_NUM; i++) { g_stCipherOsrChn[i].g_bSoftChnOpen = HI_FALSE; g_stCipherOsrChn[i].g_bDataDone = HI_FALSE; g_stCipherOsrChn[i].pWichFile = NULL; osal_wait_init(&(g_stCipherOsrChn[i].cipher_wait_queue)); osal_memcpy(&g_stCipherSoftChans[i].stMmzTemp, &g_stCipherComm.stTempPhyBuf, sizeof(MMZ_BUFFER_S)); } /* ==========================channel-1============================= *---------------------------------------------------------------------- *| +++++++++++++++++++ +++++++++++++++++++ | *| +byte1|byte2|byte3|byte4 + ... ... +byte1|byte2|byte3|byte4 + |inBuf *| +++++++++++++++++++ +++++++++++++++++++ | *| list-1 ... ... list-128(MAX_LIST) | *---------------------------------------------------------------------- *| +++++++++++++++++++ +++++++++++++++++++ | *| +byte1|byte2|byte3|byte4 + ... ... +byte1|byte2|byte3|byte4 + |outBuf *| +++++++++++++++++++ +++++++++++++++++++ | *| list-1 ... ... list-128(MAX_LIST) | *---------------------------------------------------------------------- *| +++++++++++++++++++ +++++++++++++++++++ | *| +byte1|byte2|byte3|byte4 + ... ... +byte1|byte2|byte3|byte4 + |keyBuf *| +++++++++++++++++++ +++++++++++++++++++ | *| list-1 ... ... list-128(MAX_LIST) | *---------------------------------------------------------------------- ============================================================= ... ... ... ==========================channel-7============================= *---------------------------------------------------------------------- *| +++++++++++++++++++ +++++++++++++++++++ | *| +byte1|byte2|byte3|byte4 + ... ... +byte1|byte2|byte3|byte4 + |inBuf *| +++++++++++++++++++ +++++++++++++++++++ | *| list-1 ... ... list-128(MAX_LIST) | *---------------------------------------------------------------------- *| +++++++++++++++++++ +++++++++++++++++++ | *| +byte1|byte2|byte3|byte4 + ... ... +byte1|byte2|byte3|byte4 + |outBuf *| +++++++++++++++++++ +++++++++++++++++++ | *| list-1 ... ... list-128(MAX_LIST) | *---------------------------------------------------------------------- *| +++++++++++++++++++ +++++++++++++++++++ | *| +byte1|byte2|byte3|byte4 + ... ... +byte1|byte2|byte3|byte4 + |keyBuf *| +++++++++++++++++++ +++++++++++++++++++ | *| list-1 ... ... list-128(MAX_LIST) | *---------------------------------------------------------------------- ============================================================= */ databufSizeChn = sizeof(CI_BUF_LIST_ENTRY_S) * CIPHER_MAX_LIST_NUM; ivbufSizeChn = CI_IV_SIZE * CIPHER_MAX_LIST_NUM; bufSizeChn = (databufSizeChn * 2) + ivbufSizeChn;/* inBuf + outBuf + keyBuf */ bufSizeTotal = bufSizeChn * (CIPHER_PKGxN_CHAN_MAX - CIPHER_PKGxN_CHAN_MIN + 1) ; /* only 7 channels need buf */ HAL_Cipher_Init(); HAL_Cipher_DisableAllInt(); /* allocate 7 channels size */ ret = HI_DRV_MMZ_AllocAndMap("CIPHER_ChnBuf",NULL, bufSizeTotal, 0, &(cipherListBuf)); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Can NOT get mem for cipher, init failed, exit...\n"); return HI_FAILURE; } else { osal_memset((void*)(cipherListBuf.pu8StartVirAddr), 0, cipherListBuf.u32Size); osal_memcpy(&(g_stCipherComm.stChainedListPhyBuf), &(cipherListBuf), sizeof(g_stCipherComm.stChainedListPhyBuf)); } HI_DEBUG_CIPHER("TOTAL BUF: %#x/%p", cipherListBuf.u32StartPhyAddr, cipherListBuf.pu8StartVirAddr); /* assign hardware channel ID from 0 to 7 */ for (i = 0; i <= CIPHER_PKGxN_CHAN_MAX; i++) { pChan = &g_stCipherChans[i]; pChan->chnId = i; } /* channel layout ============================================================== | | ============================================================== /\ /\ /\ | IV buf | IN buf | OUT buf startPhyAddr ============================================================== | | ============================================================== /\ /\ /\ | IV buf | IN buf | OUT buf startVirAddr */ for (i = 0; i < CIPHER_PKGxN_CHAN_MAX; i++) { /* config channel from 1 to 7 */ hwChnId = i+CIPHER_PKGxN_CHAN_MIN; pChan = &g_stCipherChans[hwChnId]; pChan->astCipherIVValue[0].u32PhyAddr = cipherListBuf.u32StartPhyAddr + (i * bufSizeChn); pChan->astCipherIVValue[0].pu32VirAddr = (HI_U32 *)(cipherListBuf.pu8StartVirAddr + (i * bufSizeChn)); for (j = 1; j < CIPHER_MAX_LIST_NUM; j++) { pChan->astCipherIVValue[j].u32PhyAddr = pChan->astCipherIVValue[0].u32PhyAddr + (CI_IV_SIZE * j); pChan->astCipherIVValue[j].pu32VirAddr = (HI_U32*)(((HI_U32)pChan->astCipherIVValue[0].pu32VirAddr) + (CI_IV_SIZE * j)); pChan->bNeedCallback[j] = HI_FALSE; } pChan->pstInBuf = (CI_BUF_LIST_ENTRY_S*)((HI_U32)(pChan->astCipherIVValue[0].pu32VirAddr) + ivbufSizeChn); pChan->pstOutBuf = (CI_BUF_LIST_ENTRY_S*)((HI_U32)(pChan->pstInBuf) + databufSizeChn); HAL_Cipher_SetBufAddr(hwChnId, CIPHER_BUF_TYPE_IN, pChan->astCipherIVValue[0].u32PhyAddr + ivbufSizeChn); HAL_Cipher_SetBufAddr(hwChnId, CIPHER_BUF_TYPE_OUT, pChan->astCipherIVValue[0].u32PhyAddr + ivbufSizeChn + databufSizeChn); DRV_CipherInitHardWareChn(hwChnId); } /* debug info */ for (i = 0; i < CIPHER_PKGxN_CHAN_MAX; i++) { hwChnId = i+CIPHER_PKGxN_CHAN_MIN; pChan = &g_stCipherChans[hwChnId]; HI_INFO_CIPHER("Chn%02x, IV:%#x/%p In:%#x/%p, Out:%#x/%p.\n", i, pChan->astCipherIVValue[0].u32PhyAddr, pChan->astCipherIVValue[0].pu32VirAddr, pChan->astCipherIVValue[0].u32PhyAddr + ivbufSizeChn, pChan->pstInBuf, pChan->astCipherIVValue[0].u32PhyAddr + ivbufSizeChn + databufSizeChn, pChan->pstOutBuf ); } HAL_Cipher_ClrIntState(0xffffffff); /* request irq */ ret = osal_request_irq(CIPHER_IRQ_NUMBER, DRV_Cipher_ISR, HI_NULL, "hi_cipher_irq", &g_stCipherComm); if(HI_SUCCESS != ret) { HAL_Cipher_DisableAllInt(); HAL_Cipher_ClrIntState(0xffffffff); HI_ERR_CIPHER("Irq request failure, irq =0x%x.", CIPHER_IRQ_NUMBER); HI_DRV_MMZ_UnmapAndRelease(&(g_stCipherComm.stChainedListPhyBuf)); return HI_FAILURE; } #if 0 HAL_Cipher_EnableAllSecChn(); #endif return HI_SUCCESS; } HI_VOID DRV_CIPHER_DeInit(HI_VOID) { HI_U32 i, hwChnId; HAL_Cipher_DisableAllInt(); HAL_Cipher_ClrIntState(0xffffffff); for (i = 0; i < CIPHER_PKGxN_CHAN_MAX; i++) { hwChnId = i+CIPHER_PKGxN_CHAN_MIN; DRV_CipherDeInitHardWareChn(hwChnId); } /* free irq */ osal_free_irq(CIPHER_IRQ_NUMBER, &g_stCipherComm); HI_DRV_MMZ_UnmapAndRelease(&g_stCipherComm.stChainedListPhyBuf); HI_DRV_MMZ_UnmapAndRelease(&g_stCipherComm.stTempPhyBuf); HAL_Cipher_DeInit(); osal_mutex_destory(&g_CipherMutexKernel); osal_mutex_destory(&g_RsaMutexKernel); return; } HI_VOID HI_DRV_CIPHER_Suspend(HI_VOID) { DRV_CIPHER_DeInit(); return; } HI_S32 HI_DRV_CIPHER_Resume(HI_VOID) { return DRV_CIPHER_Init(); } HI_S32 DRV_CIPHER_GetHandleConfig(CIPHER_Config_CTRL *pstCipherConfig) { CIPHER_SOFTCHAN_S *pSoftChan = NULL; HI_U32 u32SoftChanId = 0; if(pstCipherConfig == NULL) { HI_ERR_CIPHER("Error! NULL pointer!\n"); return HI_FAILURE; } u32SoftChanId = HI_HANDLE_GET_CHNID(pstCipherConfig->CIHandle); CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; osal_memcpy(&pstCipherConfig->CIpstCtrl, &(pSoftChan->stCtrl), sizeof(HI_UNF_CIPHER_CTRL_S)); return HI_SUCCESS; } HI_S32 HI_DRV_CIPHER_GetHandleConfig(CIPHER_Config_CTRL *pstCipherConfig) { HI_S32 ret; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } ret = DRV_CIPHER_GetHandleConfig(pstCipherConfig); osal_mutex_unlock(&g_CipherMutexKernel); return ret; } HI_S32 DRV_CIPHER_CreateHandle(CIPHER_HANDLE_S *pstCIHandle, HI_VOID *file) { HI_S32 ret = HI_SUCCESS; HI_U32 i = 0; HI_HANDLE hCipherchn = 0; HI_U32 softChnId = 0; if ( NULL == pstCIHandle) { HI_ERR_CIPHER("Invalid params!\n"); return HI_FAILURE; } for(i = CIPHER_PKGxN_CHAN_MIN; i < CIPHER_SOFT_CHAN_NUM; i++) { if (0 == g_stCipherOsrChn[i].g_bSoftChnOpen) { break; } } if (i >= CIPHER_SOFT_CHAN_NUM) { HI_ERR_CIPHER("No more cipher chan left.\n"); return HI_ERR_CIPHER_FAILED_GETHANDLE; } else { g_stCipherOsrChn[i].pstDataPkg = HI_VMALLOC(HI_ID_CIPHER, sizeof(HI_UNF_CIPHER_DATA_S) * CIPHER_MAX_LIST_NUM); if (NULL == g_stCipherOsrChn[i].pstDataPkg) { HI_ERR_CIPHER("can NOT malloc memory for cipher.\n"); return HI_ERR_CIPHER_FAILED_GETHANDLE; } softChnId = i; g_stCipherOsrChn[softChnId].g_bSoftChnOpen = HI_TRUE; } hCipherchn = HI_HANDLE_MAKEHANDLE(HI_ID_CIPHER, 0, softChnId); ret = DRV_CIPHER_OpenChn(softChnId); if (HI_SUCCESS != ret) { HI_VFREE(HI_ID_CIPHER, g_stCipherOsrChn[i].pstDataPkg); g_stCipherOsrChn[i].pstDataPkg = NULL; return HI_FAILURE; } g_stCipherOsrChn[i].pWichFile = file; pstCIHandle->hCIHandle = hCipherchn; return HI_SUCCESS; } HI_S32 HI_DRV_CIPHER_CreateHandle(CIPHER_HANDLE_S *pstCIHandle, HI_U32 file) { HI_S32 ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } ret = DRV_CIPHER_CreateHandle(pstCIHandle, (HI_VOID*)file); osal_mutex_unlock(&g_CipherMutexKernel); return ret; } HI_S32 DRV_CIPHER_DestroyHandle(HI_HANDLE hCipherchn) { HI_U32 softChnId = 0; HI_S32 ret = HI_SUCCESS; softChnId = HI_HANDLE_GET_CHNID(hCipherchn); CIPHER_CheckHandle(softChnId); if (HI_FALSE == g_stCipherOsrChn[softChnId].g_bSoftChnOpen) { return HI_SUCCESS; } if (g_stCipherOsrChn[softChnId].pstDataPkg) { HI_VFREE(HI_ID_CIPHER, g_stCipherOsrChn[softChnId].pstDataPkg); g_stCipherOsrChn[softChnId].pstDataPkg = NULL; } g_stCipherOsrChn[softChnId].g_bSoftChnOpen = HI_FALSE; g_stCipherOsrChn[softChnId].pWichFile = NULL; ret = DRV_CIPHER_CloseChn(softChnId); return ret; } HI_S32 HI_DRV_CIPHER_DestroyHandle(HI_HANDLE hCipherchn) { HI_S32 ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } ret = DRV_CIPHER_DestroyHandle(hCipherchn); osal_mutex_unlock(&g_CipherMutexKernel); return ret; } HI_S32 DRV_CIPHER_Encrypt(HI_U32 softChnId, HI_U32 ScrPhyAddr, HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt) { return DRV_CIPHER_EncryptEx(softChnId, ScrPhyAddr, DestPhyAddr, u32DataLength, bIsDescrypt, HI_NULL); } static HI_S32 CIPHER_LengthCheck(HI_UNF_CIPHER_CTRL_S *pstCtrl, HI_U32 u32ByteLength) { HI_S32 Ret = HI_SUCCESS; HI_U32 u32S; HI_U32 u32B; HI_U32 u32BlockSize; if ( u32ByteLength < HI_UNF_CIPHER_MIN_CRYPT_LEN || u32ByteLength > HI_UNF_CIPHER_MAX_CRYPT_LEN) { return HI_ERR_CIPHER_INVALID_PARA; } switch(pstCtrl->enAlg) { case HI_UNF_CIPHER_ALG_DES: case HI_UNF_CIPHER_ALG_3DES: u32BlockSize = 8; break; case HI_UNF_CIPHER_ALG_AES: u32BlockSize = 16; break; default: HI_ERR_CIPHER("Error: alg(0x%X)!\n", pstCtrl->enAlg); return HI_ERR_CIPHER_INVALID_PARA; } u32S = u32ByteLength % u32BlockSize; if(u32S == 0) { return HI_SUCCESS; } switch(pstCtrl->enBitWidth) { case HI_UNF_CIPHER_BIT_WIDTH_1BIT: u32B = 1; break; case HI_UNF_CIPHER_BIT_WIDTH_8BIT: u32B = 1; break; case HI_UNF_CIPHER_BIT_WIDTH_64BIT: u32B = 8; break; case HI_UNF_CIPHER_BIT_WIDTH_128BIT: u32B = 16; break; default: HI_ERR_CIPHER("Error: BitWidth(0x%X)!\n", pstCtrl->enBitWidth); return HI_ERR_CIPHER_INVALID_PARA; } switch(pstCtrl->enWorkMode) { case HI_UNF_CIPHER_WORK_MODE_ECB: case HI_UNF_CIPHER_WORK_MODE_CBC: case HI_UNF_CIPHER_WORK_MODE_CBC_CTS: if (u32S != 0) { HI_ERR_CIPHER("Error: Length not align at %d!\n", u32B); Ret = HI_ERR_CIPHER_INVALID_PARA; } break; case HI_UNF_CIPHER_WORK_MODE_CFB: case HI_UNF_CIPHER_WORK_MODE_OFB: if ((u32ByteLength % u32B) != 0) { HI_ERR_CIPHER("Error: Length not align at %d!\n", u32B); Ret = HI_ERR_CIPHER_INVALID_PARA; } break; case HI_UNF_CIPHER_WORK_MODE_CTR: break; #ifdef CIPHER_CCM_GCM_SUPPORT case HI_UNF_CIPHER_WORK_MODE_CCM: break; case HI_UNF_CIPHER_WORK_MODE_GCM: break; #endif default: HI_ERR_CIPHER("Error: Alg invalid!\n"); Ret = HI_ERR_CIPHER_INVALID_PARA; } return Ret; } HI_S32 DRV_CIPHER_WaitConditionCallBack(HI_VOID *pParam) { HI_U32* pu32SoftChanId; HI_S32 s32Ret = 0; pu32SoftChanId = (HI_U32*)pParam; s32Ret = g_stCipherOsrChn[*pu32SoftChanId].g_bDataDone != HI_FALSE; return s32Ret; } HI_S32 DRV_CIPHER_EncryptEx(HI_U32 u32SoftChanId, HI_U32 ScrPhyAddr, HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt, HI_U8 *pLastBlock) { HI_S32 Ret = HI_SUCCESS; MMZ_BUFFER_S *pstMmzTemp; HI_U8 *pu8Buf = 0; CIPHER_SOFTCHAN_S *pSoftChan; HI_U32 u32PkgNum = 0; HI_U32 u32Offset = 0; HI_U32 u32Copysize = 0; MMZ_BUFFER_S stSrcMmzBuf = {0}; MMZ_BUFFER_S stDestMmzBuf = {0}; HI_DRV_CIPHER_TASK_S stCITask; HI_U32 u32Cnt; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstMmzTemp = &pSoftChan->stMmzTemp; if (u32DataLength == 0) { return HI_SUCCESS; } stSrcMmzBuf.u32Size = u32DataLength; stSrcMmzBuf.u32StartPhyAddr = ScrPhyAddr; HI_DRV_MMZ_Map(&stSrcMmzBuf); if ( stSrcMmzBuf.pu8StartVirAddr == 0) { HI_ERR_CIPHER("DRV SRC MMZ MAP(0x%x) ERROR, sizse = 0x%x!\n", ScrPhyAddr, u32DataLength); return HI_FAILURE; } if (DestPhyAddr != 0) { stDestMmzBuf.u32Size = u32DataLength; stDestMmzBuf.u32StartPhyAddr = DestPhyAddr; HI_DRV_MMZ_Map(&stDestMmzBuf); if ( stDestMmzBuf.pu8StartVirAddr == 0) { HI_ERR_CIPHER("DRV Dest MMZ MAP(0x%x) ERROR, , sizse = 0x%x!\n", DestPhyAddr, u32DataLength); return HI_FAILURE;; } } if ( 0 != u32SoftChanId ) { HI_DRV_CIPHER_DATA_INFO_S Buf2Process[2]; u32Copysize = u32DataLength & (~0x0F); if (u32Copysize > 0) { Buf2Process[u32PkgNum].u32src = ScrPhyAddr; Buf2Process[u32PkgNum].u32dest = DestPhyAddr; Buf2Process[u32PkgNum].u32length = u32Copysize; Buf2Process[u32PkgNum].bDecrypt = bIsDescrypt; // HI_PRINT_HEX ("in", (HI_U8*)stSrcMmzBuf.pu8StartVirAddr, u32Copysize); u32PkgNum++; } u32Copysize = u32DataLength & 0x0F; if (u32Copysize > 0) { pu8Buf = (HI_U8*)(stSrcMmzBuf.pu8StartVirAddr + u32DataLength - u32Copysize); if (pLastBlock != HI_NULL) { osal_memcpy((HI_U8*)pstMmzTemp->pu8StartVirAddr, pLastBlock, AES_BLOCK_SIZE); } else { osal_memset((HI_U8*)pstMmzTemp->pu8StartVirAddr, 0, AES_BLOCK_SIZE); } osal_memcpy((HI_U8*)pstMmzTemp->pu8StartVirAddr, pu8Buf, u32Copysize); Buf2Process[u32PkgNum].u32src = pstMmzTemp->u32StartPhyAddr; Buf2Process[u32PkgNum].u32dest = (DestPhyAddr == 0 ? 0 : pstMmzTemp->u32StartPhyAddr); Buf2Process[u32PkgNum].u32length = AES_BLOCK_SIZE;//16 - u32Copysize; Buf2Process[u32PkgNum].bDecrypt = bIsDescrypt; u32PkgNum++; // HI_PRINT_HEX ("in", (HI_U8*)pstMmzTemp->pu8StartVirAddr, AES_BLOCK_SIZE); } g_stCipherOsrChn[u32SoftChanId].g_bDataDone = HI_FALSE; Ret = DRV_CIPHER_CreatMultiPkgTask(u32SoftChanId, Buf2Process, u32PkgNum, HI_FALSE, u32SoftChanId); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher create multi task failed!\n"); goto exit; } if (stDestMmzBuf.pu8StartVirAddr != 0) { if(u32DataLength < 4096) { for(u32Cnt=100; u32Cnt>0; u32Cnt--) { if (g_stCipherOsrChn[u32SoftChanId].g_bDataDone != HI_FALSE) { break; } osal_udelay(1); } } else { u32Cnt = osal_wait_event_timeout(&g_stCipherOsrChn[u32SoftChanId].cipher_wait_queue, DRV_CIPHER_WaitConditionCallBack, &u32SoftChanId, CIPHER_TIME_OUT); } if (0 == u32Cnt) { HI_ERR_CIPHER("DRV_CIPHER_CreatMultiPkgTask() - Encrypt time out! DataDone : 0x%x\n", g_stCipherOsrChn[u32SoftChanId].g_bDataDone); Ret = HI_FAILURE; goto exit; } if (u32Copysize > 0) { pu8Buf = (HI_U8*)(stDestMmzBuf.pu8StartVirAddr + u32DataLength - u32Copysize); osal_memcpy (pu8Buf, (HI_U8*)pstMmzTemp->pu8StartVirAddr, u32Copysize); } } } else { while(u32Offset < u32DataLength) { if ((u32DataLength - u32Offset) > 16) { u32Copysize = 16; } else { u32Copysize =u32DataLength - u32Offset; if (pLastBlock != HI_NULL) { osal_memcpy((HI_U8 *)stCITask.stData2Process.u32DataPkg, pLastBlock, AES_BLOCK_SIZE); } else { osal_memset((HI_U8 *)stCITask.stData2Process.u32DataPkg, 0, AES_BLOCK_SIZE); } } pu8Buf = (HI_U8*)(stSrcMmzBuf.pu8StartVirAddr + u32Offset); osal_memcpy((HI_U8 *)stCITask.stData2Process.u32DataPkg, pu8Buf, u32Copysize); stCITask.stData2Process.u32length = 16; stCITask.stData2Process.bDecrypt = bIsDescrypt; stCITask.u32CallBackArg = u32SoftChanId; // HI_PRINT_HEX ("in", (HI_U8 *)(stCITask.stData2Process.u32DataPkg), 16); Ret = DRV_CIPHER_CreatTask(u32SoftChanId, &stCITask, NULL, NULL); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher create task failed!\n"); goto exit; } if (stDestMmzBuf.pu8StartVirAddr != 0) { pu8Buf = (HI_U8*)(stDestMmzBuf.pu8StartVirAddr + u32Offset); osal_memcpy (pu8Buf, (HI_U8 *)stCITask.stData2Process.u32DataPkg, u32Copysize); // HI_PRINT_HEX ("out", (HI_U8 *)(stCITask.stData2Process.u32DataPkg), 16); } u32Offset += 16; } } exit: if(stSrcMmzBuf.pu8StartVirAddr != 0) { HI_DRV_MMZ_Unmap(&stSrcMmzBuf); } if(stDestMmzBuf.pu8StartVirAddr != 0) { HI_DRV_MMZ_Unmap(&stDestMmzBuf); } return Ret; } #ifdef CIPHER_CCM_GCM_SUPPORT HI_S32 DRV_CIPHER_CCM(HI_U32 u32SoftChanId, HI_U32 ScrPhyAddr, HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt) { HI_S32 Ret; HI_UNF_CIPHER_CTRL_S *pstCtrl; HI_UNF_CIPHER_CCM_INFO_S *pstCCM; CIPHER_CCM_STATUS_S *pstCcmStatus; CIPHER_SOFTCHAN_S *pSoftChan; HI_U32 u32IV[4]; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstCtrl = &pSoftChan->stCtrl; pstCCM = &pstCtrl->unModeInfo.stCCM; pstCcmStatus = &pSoftChan->stCcmStatus; if((u32DataLength+pstCcmStatus->u32Plen) > pstCCM->u32MLen) { HI_ERR_CIPHER("Cipher process failed, datasize overflow!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if (bIsDescrypt) { /*CTR Start, diphertext descrypt*/ pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CCM; osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)(pstCcmStatus->u32CTRm), CI_IV_SIZE); //Recover CTR IV CTRM pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_Encrypt(u32SoftChanId, ScrPhyAddr, DestPhyAddr, u32DataLength, HI_TRUE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pstCcmStatus->u32CTRm, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); // HI_PRINT_HEX ("CTRM", (HI_U8*)pstCcmStatus->u32CTRm, 16); /*AES-CBC Start, calculate MAC of plaintext*/ pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CBC; osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)(pstCcmStatus->u32Yi), CI_IV_SIZE); osal_memcpy((HI_U8*)u32IV, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE);//Recover CBC IV Yi pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_Encrypt(u32SoftChanId, DestPhyAddr, DestPhyAddr, u32DataLength, HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pstCcmStatus->u32Yi, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)u32IV, CI_IV_SIZE); pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_EncryptEx(u32SoftChanId, DestPhyAddr, DestPhyAddr, u32DataLength, HI_TRUE, (HI_U8*)pstCcmStatus->u32Yi); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } } else //Encrypt { /*AES-CBC Start, calculate MAC of plaintext*/ pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CBC; osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)(pstCcmStatus->u32Yi), CI_IV_SIZE); osal_memcpy((HI_U8*)u32IV, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_Encrypt(u32SoftChanId, ScrPhyAddr, DestPhyAddr, u32DataLength, HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pstCcmStatus->u32Yi, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); // HI_PRINT_HEX ("Y", (HI_U8*)pstCcmStatus->u32Yi, 16); osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)u32IV, CI_IV_SIZE); pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_EncryptEx(u32SoftChanId, DestPhyAddr, DestPhyAddr, u32DataLength, HI_TRUE, (HI_U8*)pstCcmStatus->u32Yi); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } /*CTR Start, plaintext encrypt*/ pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CCM; osal_memcpy((HI_U8*)pstCtrl->u32IV, (HI_U8*)(pstCcmStatus->u32CTRm), CI_IV_SIZE); pSoftChan->bIVChange = HI_TRUE; Ret = DRV_CIPHER_Encrypt(u32SoftChanId, ScrPhyAddr, DestPhyAddr, u32DataLength, HI_FALSE); if (HI_SUCCESS != Ret) { HI_ERR_CIPHER("Cipher encrypt failed!\n"); return Ret; } HAL_Cipher_GetOutIV(pSoftChan->u32HardWareChn, pstCtrl); osal_memcpy((HI_U8*)pstCcmStatus->u32CTRm, (HI_U8*)pstCtrl->u32IV, CI_IV_SIZE); // HI_PRINT_HEX ("CTRM", (HI_U8*)pstCcmStatus->u32CTRm, 16); } pstCtrl->enWorkMode = HI_UNF_CIPHER_WORK_MODE_CCM; pstCcmStatus->u32Plen += u32DataLength; return Ret; } HI_S32 DRV_CIPHER_GCM(HI_U32 u32SoftChanId, HI_U32 ScrPhyAddr, HI_U32 DestPhyAddr, HI_U32 u32DataLength, HI_BOOL bIsDescrypt) { HI_S32 ret; CIPHER_SOFTCHAN_S *pSoftChan; HI_UNF_CIPHER_CTRL_S *pstCtrl; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstCtrl = &pSoftChan->stCtrl; if ((pSoftChan->stGcmStatus.u32Plen + u32DataLength) <= pstCtrl->unModeInfo.stGCM.u32MLen) { ret = DRV_CIPHER_Encrypt(u32SoftChanId, ScrPhyAddr, DestPhyAddr, u32DataLength, bIsDescrypt); pSoftChan->stGcmStatus.u32Plen+=u32DataLength; } else { HI_ERR_CIPHER("Error: CIPHER Length Check failed, Mlen: 0x%x, datalength: 0x%x!\n", pstCtrl->unModeInfo.stGCM.u32MLen, u32DataLength); ret = HI_ERR_CIPHER_INVALID_PARA; } return ret; } HI_S32 DRV_CIPHER_GetTag(HI_U32 u32SoftChanId, HI_U32 *pu32Tag, HI_U32 *pu32Len) { HI_S32 ret = HI_SUCCESS; CIPHER_SOFTCHAN_S *pSoftChan; HI_UNF_CIPHER_CTRL_S *pstCtrl; HI_U32 i; CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstCtrl = &pSoftChan->stCtrl; ret = HAL_RSA_WaitTagVld(u32SoftChanId, pstCtrl); if (HI_SUCCESS != ret) { return ret; } switch(pstCtrl->enWorkMode) { case HI_UNF_CIPHER_WORK_MODE_CCM: if (pSoftChan->stCcmStatus.u32Plen != pstCtrl->unModeInfo.stCCM.u32MLen) { HI_ERR_CIPHER ("Can't get TAG before complete the compute, already compute: 0x%x, total: 0x%x\n", pSoftChan->stCcmStatus.u32Plen, pstCtrl->unModeInfo.stCCM.u32MLen); ret = HI_ERR_CIPHER_INVALID_PARA; break; } for(i=0; i<4; i++) { pu32Tag[i] = pSoftChan->stCcmStatus.u32Yi[i] ^ pSoftChan->stCcmStatus.u32S0[i]; } osal_memset((HI_U8*)pu32Tag + pstCtrl->unModeInfo.stCCM.u8TLen, 0, AES_BLOCK_SIZE - pstCtrl->unModeInfo.stCCM.u8TLen); *pu32Len = pstCtrl->unModeInfo.stCCM.u8TLen; break; case HI_UNF_CIPHER_WORK_MODE_GCM: if (pSoftChan->stGcmStatus.u32Plen != pstCtrl->unModeInfo.stGCM.u32MLen) { HI_ERR_CIPHER ("Can't get TAG before complete the compute, already compute: 0x%x, total: 0x%x\n", pSoftChan->stGcmStatus.u32Plen, pstCtrl->unModeInfo.stGCM.u32MLen); ret = HI_ERR_CIPHER_INVALID_PARA; break; } ret = HAL_Cipher_GetTag(u32SoftChanId, pstCtrl, pu32Tag); *pu32Len = 16; break; default: HI_ERR_CIPHER ("Can't get TAG with mode 0x%x\n", pstCtrl->enWorkMode); ret = HI_ERR_CIPHER_INVALID_PARA; break; } return ret; } HI_S32 HI_DRV_CIPHER_GetTag(CIPHER_TAG *pstTag) { HI_S32 ret = HI_SUCCESS; HI_U32 u32SoftChanId; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } u32SoftChanId = HI_HANDLE_GET_CHNID(pstTag->CIHandle); ret = DRV_CIPHER_GetTag(u32SoftChanId, pstTag->u32Tag, &pstTag->u32Len); osal_mutex_unlock(&g_CipherMutexKernel); return ret; } #endif HI_S32 HI_DRV_CIPHER_Encrypt(CIPHER_DATA_S *pstCIData) { HI_S32 ret = HI_SUCCESS; HI_U32 u32SoftChanId = 0; CIPHER_SOFTCHAN_S *pSoftChan; HI_UNF_CIPHER_CTRL_S *pstCtrl; HI_U32 u32Offset = 0; HI_U32 u32TempLen = 0; if (pstCIData->u32DataLength == 0) { return HI_SUCCESS; } if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } u32SoftChanId = HI_HANDLE_GET_CHNID(pstCIData->CIHandle); CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstCtrl = &pSoftChan->stCtrl; ret = CIPHER_LengthCheck(pstCtrl, pstCIData->u32DataLength); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("Error: CIPHER Length Check failed!\n"); osal_mutex_unlock(&g_CipherMutexKernel); return HI_ERR_CIPHER_INVALID_PARA; } while(u32Offset < pstCIData->u32DataLength) { if((pstCIData->u32DataLength - u32Offset) > CIPHER_MXA_PKG_SIZE) { u32TempLen = CIPHER_MXA_PKG_SIZE; } else { u32TempLen = pstCIData->u32DataLength - u32Offset; } switch(pstCtrl->enWorkMode) { #ifdef CIPHER_CCM_GCM_SUPPORT case HI_UNF_CIPHER_WORK_MODE_CCM: ret = DRV_CIPHER_CCM(u32SoftChanId, pstCIData->ScrPhyAddr, pstCIData->DestPhyAddr, pstCIData->u32DataLength, HI_FALSE); break; case HI_UNF_CIPHER_WORK_MODE_GCM: ret = DRV_CIPHER_GCM(u32SoftChanId, pstCIData->ScrPhyAddr, pstCIData->DestPhyAddr, pstCIData->u32DataLength, HI_FALSE); break; #endif default: ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstCIData->ScrPhyAddr, pstCIData->DestPhyAddr, pstCIData->u32DataLength, HI_FALSE); break; } if(ret != HI_SUCCESS) { osal_mutex_unlock(&g_CipherMutexKernel); HI_ERR_CIPHER("Cipher_Decrypt failure, ret=0x%x\n", ret); return HI_FAILURE; } u32Offset += u32TempLen; } osal_mutex_unlock(&g_CipherMutexKernel); return ret; } HI_S32 HI_DRV_CIPHER_Decrypt(CIPHER_DATA_S *pstCIData) { HI_S32 ret = HI_SUCCESS; HI_U32 u32SoftChanId = 0; CIPHER_SOFTCHAN_S *pSoftChan; HI_UNF_CIPHER_CTRL_S *pstCtrl; HI_U32 u32Offset = 0; HI_U32 u32TempLen = 0; if (pstCIData->u32DataLength == 0) { return HI_SUCCESS; } if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } u32SoftChanId = HI_HANDLE_GET_CHNID(pstCIData->CIHandle); CIPHER_CheckHandle(u32SoftChanId); pSoftChan = &g_stCipherSoftChans[u32SoftChanId]; pstCtrl = &pSoftChan->stCtrl; ret = CIPHER_LengthCheck(pstCtrl, pstCIData->u32DataLength); if (ret != HI_SUCCESS) { HI_ERR_CIPHER("Error: CIPHER Length Check failed!\n"); osal_mutex_unlock(&g_CipherMutexKernel); return HI_ERR_CIPHER_INVALID_PARA; } while(u32Offset < pstCIData->u32DataLength) { if((pstCIData->u32DataLength - u32Offset) > CIPHER_MXA_PKG_SIZE) { u32TempLen = CIPHER_MXA_PKG_SIZE; } else { u32TempLen = pstCIData->u32DataLength - u32Offset; } switch(pstCtrl->enWorkMode) { #ifdef CIPHER_CCM_GCM_SUPPORT case HI_UNF_CIPHER_WORK_MODE_CCM: ret = DRV_CIPHER_CCM(u32SoftChanId, pstCIData->ScrPhyAddr, pstCIData->DestPhyAddr, pstCIData->u32DataLength, HI_TRUE); break; case HI_UNF_CIPHER_WORK_MODE_GCM: ret = DRV_CIPHER_GCM(u32SoftChanId, pstCIData->ScrPhyAddr, pstCIData->DestPhyAddr, pstCIData->u32DataLength, HI_TRUE); break; #endif default: ret = DRV_CIPHER_Encrypt(u32SoftChanId, pstCIData->ScrPhyAddr, pstCIData->DestPhyAddr, pstCIData->u32DataLength, HI_TRUE); break; } if(ret != HI_SUCCESS) { osal_mutex_unlock(&g_CipherMutexKernel); HI_ERR_CIPHER("Cipher_Decrypt failure, ret=0x%x\n", ret); return HI_FAILURE; } u32Offset += u32TempLen; } osal_mutex_unlock(&g_CipherMutexKernel); return ret; } HI_S32 DRV_CIPHER_EncryptMulti(CIPHER_DATA_S *pstCIData) { HI_U32 i = 0; HI_U32 softChnId = 0; static HI_DRV_CIPHER_DATA_INFO_S tmpData[CIPHER_MAX_LIST_NUM]; HI_UNF_CIPHER_DATA_S *pTmp = NULL; HI_U32 pkgNum = 0; HI_S32 ret = HI_SUCCESS; HI_U32 raw = 0, count = 0; if(NULL == pstCIData) { HI_ERR_CIPHER("Invalid params!\n"); return HI_FAILURE; } softChnId = HI_HANDLE_GET_CHNID(pstCIData->CIHandle); CIPHER_CheckHandle(softChnId); if ((g_stCipherSoftChans[softChnId].stCtrl.enWorkMode == HI_UNF_CIPHER_WORK_MODE_CCM) || (g_stCipherSoftChans[softChnId].stCtrl.enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM)) { HI_ERR_CIPHER("Error: Multi cipher unsuport CCM/GCM mode.\n"); return HI_ERR_CIPHER_INVALID_PARA; } pkgNum = pstCIData->u32DataLength; if (pkgNum > CIPHER_MAX_LIST_NUM) { HI_ERR_CIPHER("Error: you send too many pkg(%d), must < %d.\n",pkgNum, CIPHER_MAX_LIST_NUM); return HI_ERR_CIPHER_INVALID_PARA; } if (osal_copy_from_user(g_stCipherOsrChn[softChnId].pstDataPkg, (void*)pstCIData->ScrPhyAddr, pkgNum * sizeof(HI_UNF_CIPHER_DATA_S))) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } for (i = 0; i < pstCIData->u32DataLength; i++) { pTmp = g_stCipherOsrChn[softChnId].pstDataPkg + i; tmpData[i].bDecrypt = HI_FALSE; tmpData[i].u32src = pTmp->u32SrcPhyAddr; tmpData[i].u32dest = pTmp->u32DestPhyAddr; tmpData[i].u32length = pTmp->u32ByteLength; } HI_INFO_CIPHER("Start to DecryptMultiPkg, chnNum = %#x, pkgNum=%d!\n", softChnId, pkgNum); #if 0 g_stCipherOsrChn[softChnId].g_bDataDone = HI_FALSE; ret = DRV_CIPHER_CreatMultiPkgTask(softChnId, tmpData, pkgNum, HI_TRUE, softChnId); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Cipher create multi task failed!\n"); return ret; } if (0== osal_wait_event_timeout(g_stCipherOsrChn[softChnId].cipher_wait_queue, DRV_CIPHER_WaitConditionCallBack, &softChnId, CIPHER_TIME_OUT)) { HI_ERR_CIPHER("Decrypt time out \n"); return HI_FAILURE; } #else HAL_Cipher_DisableInt(softChnId, CIPHER_INT_TYPE_OUT_BUF); ret = DRV_CIPHER_CreatMultiPkgTask(softChnId, tmpData, pkgNum, HI_TRUE, softChnId); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Cipher create multi task failed!\n"); return ret; } while((((raw >>(softChnId + 8)) & 0x01) == 0x00) && (count++ < 0x10000000)) { HAL_Cipher_GetRawIntState(&raw); } if (count < 0x10000000) { HAL_Cipher_ClrIntState(1 << (softChnId + 8)); DRV_CipherDataDoneMultiPkg(softChnId); } else { HI_ERR_CIPHER ("Wait raw int timeout, raw = 0x%x\n", raw); ret = HI_FAILURE; } HAL_Cipher_EnableInt(softChnId, CIPHER_INT_TYPE_OUT_BUF); #endif HI_INFO_CIPHER("Decrypt OK, chnNum = %#x!\n", softChnId); return ret; } HI_S32 DRV_CIPHER_DecryptMulti(CIPHER_DATA_S *pstCIData) { HI_U32 i; HI_U32 softChnId = 0; static HI_DRV_CIPHER_DATA_INFO_S tmpData[CIPHER_MAX_LIST_NUM]; HI_UNF_CIPHER_DATA_S *pTmp = NULL; HI_U32 pkgNum = 0; HI_S32 ret = HI_SUCCESS; HI_U32 raw = 0, count = 0; if(NULL == pstCIData) { HI_ERR_CIPHER("Invalid params!\n"); return HI_ERR_CIPHER_INVALID_PARA; } softChnId = HI_HANDLE_GET_CHNID(pstCIData->CIHandle); CIPHER_CheckHandle(softChnId); if ((g_stCipherSoftChans[softChnId].stCtrl.enWorkMode == HI_UNF_CIPHER_WORK_MODE_CCM) || (g_stCipherSoftChans[softChnId].stCtrl.enWorkMode == HI_UNF_CIPHER_WORK_MODE_GCM)) { HI_ERR_CIPHER("Error: Multi cipher unsuport CCM/GCM mode.\n"); return HI_ERR_CIPHER_INVALID_PARA; } pkgNum = pstCIData->u32DataLength; if (pkgNum > CIPHER_MAX_LIST_NUM) { HI_ERR_CIPHER("Error: you send too many pkg(%d), must < %d.\n",pkgNum, CIPHER_MAX_LIST_NUM); return HI_ERR_CIPHER_INVALID_PARA; } if (osal_copy_from_user(g_stCipherOsrChn[softChnId].pstDataPkg, (void*)pstCIData->ScrPhyAddr, pkgNum * sizeof(HI_UNF_CIPHER_DATA_S))) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } for (i = 0; i < pstCIData->u32DataLength; i++) { pTmp = g_stCipherOsrChn[softChnId].pstDataPkg + i; tmpData[i].bDecrypt = HI_TRUE; tmpData[i].u32src = pTmp->u32SrcPhyAddr; tmpData[i].u32dest = pTmp->u32DestPhyAddr; tmpData[i].u32length = pTmp->u32ByteLength; } HI_INFO_CIPHER("Start to DecryptMultiPkg, chnNum = %#x, pkgNum=%d!\n", softChnId, pkgNum); #if 0 g_stCipherOsrChn[softChnId].g_bDataDone = HI_FALSE; ret = DRV_CIPHER_CreatMultiPkgTask(softChnId, tmpData, pkgNum, HI_TRUE, softChnId); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Cipher create multi task failed!\n"); return ret; } if (0== osal_wait_event_timeout(g_stCipherOsrChn[softChnId].cipher_wait_queue, DRV_CIPHER_WaitConditionCallBack, &softChnId, CIPHER_TIME_OUT)) { HI_ERR_CIPHER("Decrypt time out \n"); return HI_FAILURE; } #else HAL_Cipher_DisableInt(softChnId, CIPHER_INT_TYPE_OUT_BUF); ret = DRV_CIPHER_CreatMultiPkgTask(softChnId, tmpData, pkgNum, HI_TRUE, softChnId); if (HI_SUCCESS != ret) { HI_ERR_CIPHER("Cipher create multi task failed!\n"); return ret; } while((((raw >>(softChnId + 8)) & 0x01) == 0x00) && (count++ < 0x10000000)) { HAL_Cipher_GetRawIntState(&raw); } if (count < 0x10000000) { HAL_Cipher_ClrIntState(1 << (softChnId + 8)); DRV_CipherDataDoneMultiPkg(softChnId); } else { HI_ERR_CIPHER ("Wait raw int timeout, raw = 0x%x\n", raw); ret = HI_FAILURE; } HAL_Cipher_EnableInt(softChnId, CIPHER_INT_TYPE_OUT_BUF); #endif HI_INFO_CIPHER("Decrypt OK, chnNum = %#x!\n", softChnId); return ret; } HI_S32 HI_DRV_CIPHER_EncryptMultiEx(CIPHER_MUTIL_EX_DATA_S *pstCIDataEx) { HI_U32 softChnId = 0; CIPHER_DATA_S stCIData; HI_S32 s32Ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } softChnId = HI_HANDLE_GET_CHNID(pstCIDataEx->hCipher); CIPHER_CheckHandle(softChnId); s32Ret = DRV_CIPHER_ConfigChn(softChnId, &pstCIDataEx->CIpstCtrl); if (HI_SUCCESS != s32Ret) { osal_mutex_unlock(&g_CipherMutexKernel); return s32Ret; } stCIData.CIHandle = pstCIDataEx->hCipher; stCIData.ScrPhyAddr = (HI_U32)pstCIDataEx->pstPkg; stCIData.u32DataLength = pstCIDataEx->u32PkgNum; s32Ret = DRV_CIPHER_EncryptMulti(&stCIData); osal_mutex_unlock(&g_CipherMutexKernel); return s32Ret; } HI_S32 HI_DRV_CIPHER_DecryptMultiEx(CIPHER_MUTIL_EX_DATA_S *pstCIDataEx) { HI_U32 softChnId = 0; CIPHER_DATA_S stCIData; HI_S32 s32Ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } softChnId = HI_HANDLE_GET_CHNID(pstCIDataEx->hCipher); CIPHER_CheckHandle(softChnId); s32Ret = DRV_CIPHER_ConfigChn(softChnId, &pstCIDataEx->CIpstCtrl); if (HI_SUCCESS != s32Ret) { osal_mutex_unlock(&g_CipherMutexKernel); return s32Ret; } stCIData.CIHandle = pstCIDataEx->hCipher; stCIData.ScrPhyAddr = (HI_U32)pstCIDataEx->pstPkg; stCIData.u32DataLength = pstCIDataEx->u32PkgNum; s32Ret = DRV_CIPHER_DecryptMulti(&stCIData); osal_mutex_unlock(&g_CipherMutexKernel); return s32Ret; } HI_S32 HI_DRV_CIPHER_EncryptMulti(CIPHER_DATA_S *pstCIData) { HI_S32 s32Ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } s32Ret = DRV_CIPHER_EncryptMulti(pstCIData); osal_mutex_unlock(&g_CipherMutexKernel); return s32Ret; } HI_S32 HI_DRV_CIPHER_DecryptMulti(CIPHER_DATA_S *pstCIData) { HI_S32 s32Ret = HI_SUCCESS; if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } s32Ret = DRV_CIPHER_DecryptMulti(pstCIData); osal_mutex_unlock(&g_CipherMutexKernel); return s32Ret; } HI_S32 HI_DRV_CIPHER_SoftReset(void) { HI_S32 ret = HI_SUCCESS; (HI_VOID)HI_DRV_CIPHER_Suspend(); ret = HI_DRV_CIPHER_Resume(); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("Cipher Soft Reset failed in cipher resume!\n"); return HI_FAILURE; } return HI_SUCCESS; } HI_S32 DRV_CIPHER_ProcGetStatus(CIPHER_CHN_STATUS_S *pstCipherStatus) { HI_U32 i = 0; for (i = 0; i < 8; i++) { if (HI_TRUE == g_stCipherSoftChans[i].bOpen) { pstCipherStatus[i].ps8Openstatus = "open "; } else { pstCipherStatus[i].ps8Openstatus = "close"; } } return HAL_CIPHER_ProcGetStatus(pstCipherStatus); } #endif //CIPHER_MULTICIPHER_SUPPORT HI_S32 DRV_CIPHER_Open(HI_VOID *private_data) { return HI_SUCCESS; } HI_S32 DRV_CIPHER_Release(HI_VOID *private_data) { #ifdef CIPHER_MULTICIPHER_SUPPORT HI_U32 i; for (i = 0; i < CIPHER_SOFT_CHAN_NUM; i++) { if (g_stCipherOsrChn[i].pWichFile == private_data) { DRV_CIPHER_CloseChn(i); g_stCipherOsrChn[i].g_bSoftChnOpen = HI_FALSE; g_stCipherOsrChn[i].pWichFile = NULL; if (g_stCipherOsrChn[i].pstDataPkg) { HI_VFREE(HI_ID_CIPHER, g_stCipherOsrChn[i].pstDataPkg); g_stCipherOsrChn[i].pstDataPkg = NULL; } } } #endif return 0; } #ifdef CIPHER_RNG_SUPPORT HI_S32 HI_DRV_CIPHER_GetRandomNumber(CIPHER_RNG_S *pstRNG) { HI_S32 ret = HI_SUCCESS; if(NULL == pstRNG) { HI_ERR_CIPHER("Invalid params!\n"); return HI_FAILURE; } if(osal_mutex_lock_interruptible(&g_CipherMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } ret = HAL_Cipher_GetRandomNumber(pstRNG); osal_mutex_unlock(&g_CipherMutexKernel); return ret; } #endif #ifdef CIPHER_RSA_SUPPORT HI_S32 DRV_CIPHER_CheckRsaData(HI_U8 *N, HI_U8 *E, HI_U8 *MC, HI_U32 u32Len) { HI_U32 i; /*MC > 0*/ for(i=0; i<u32Len; i++) { if(MC[i] > 0) { break; } } if(i>=u32Len) { HI_ERR_CIPHER("RSA M/C is zero, error!\n"); return HI_ERR_CIPHER_INVALID_PARA; } /*MC < N*/ for(i=0; i<u32Len; i++) { if(MC[i] < N[i]) { break; } } if(i>=u32Len) { HI_ERR_CIPHER("RSA M/C is larger than N, error!\n"); return HI_ERR_CIPHER_INVALID_PARA; } /*E > 1*/ for(i=0; i<u32Len; i++) { if(E[i] > 0) { break; } } if(i>=u32Len) { HI_ERR_CIPHER("RSA D/E is zero, error!\n"); return HI_ERR_CIPHER_INVALID_PARA; } // HI_PRINT_HEX("N", N, u32Len); // HI_PRINT_HEX("K", E, u32Len); return HI_SUCCESS; } HI_S32 DRV_CIPHER_ClearRsaRam(HI_VOID) { HI_S32 ret = HI_SUCCESS; ret = HAL_RSA_WaitFree(); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("RSA is busy and timeout,error!\n"); return HI_FAILURE; } HAL_RSA_ClearRam(); HAL_RSA_Start(); ret = HAL_RSA_WaitFree(); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("RSA is busy and timeout,error!\n"); return HI_FAILURE; } return HI_SUCCESS; } HI_S32 DRV_CIPHER_CalcRsa_ex(CIPHER_RSA_DATA_S *pCipherRsaData) { HI_S32 ret = HI_SUCCESS; HI_U32 u32ErrorCode; HI_U32 u32KeyLen; CIPHER_RSA_KEY_WIDTH_E enKeyWidth; if ((pCipherRsaData->pu8Input == HI_NULL) ||(pCipherRsaData->pu8Output== HI_NULL) || (pCipherRsaData->pu8N == HI_NULL) || (pCipherRsaData->pu8K == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); return HI_ERR_CIPHER_INVALID_POINT; } if ((pCipherRsaData->u16NLen == 0) || (pCipherRsaData->u16KLen == 0)) { HI_ERR_CIPHER("RSA K size is zero.\n"); return HI_ERR_CIPHER_INVALID_PARA; } if(pCipherRsaData->u32DataLen != pCipherRsaData->u16NLen) { HI_ERR_CIPHER("Error, DataLen != u16NLen!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if (pCipherRsaData->u16NLen <= 128) { u32KeyLen = 128; enKeyWidth = CIPHER_RSA_KEY_WIDTH_1K; } else if (pCipherRsaData->u16NLen <= 256) { u32KeyLen = 256; enKeyWidth = CIPHER_RSA_KEY_WIDTH_2K; } else if (pCipherRsaData->u16NLen <= 512) { u32KeyLen = 512; enKeyWidth = CIPHER_RSA_KEY_WIDTH_4K; } else { HI_ERR_CIPHER("u16NLen(0x%x) is invalid\n", pCipherRsaData->u16NLen); return HI_ERR_CIPHER_INVALID_POINT; } ret = DRV_CIPHER_CheckRsaData(pCipherRsaData->pu8N, pCipherRsaData->pu8K, pCipherRsaData->pu8Input, u32KeyLen); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("RSA data invalid!\n"); return HI_ERR_CIPHER_INVALID_PARA; } ret = DRV_CIPHER_ClearRsaRam(); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("RSA clear ram error!\n"); return HI_FAILURE; } /*Config Mode*/ HAL_RSA_ConfigMode(enKeyWidth); /*Write N,E,M*/ HAL_RSA_WriteData(CIPHER_RSA_DATA_TYPE_MODULE, pCipherRsaData->pu8N, pCipherRsaData->u16NLen, u32KeyLen); #ifdef CIPHER_KLAD_SUPPORT if (pCipherRsaData->enKeySrc != HI_UNF_CIPHER_KEY_SRC_USER) { ret = DRV_Cipher_KladLoadKey(0, pCipherRsaData->enKeySrc, HI_UNF_CIPHER_KLAD_TARGET_RSA, pCipherRsaData->pu8K, pCipherRsaData->u16KLen); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("DRV_Cipher_KladLoadKey, error!\n"); return HI_FAILURE; } } else #endif { HAL_RSA_WriteData(CIPHER_RSA_DATA_TYPE_KEY, pCipherRsaData->pu8K, pCipherRsaData->u16KLen, u32KeyLen); } HAL_RSA_WriteData(CIPHER_RSA_DATA_TYPE_CONTEXT, pCipherRsaData->pu8Input, pCipherRsaData->u16NLen, u32KeyLen); // HI_PRINT_HEX("M_IN", pCipherRsaData->pu8Input, u32KeyLen); /*Sart*/ HAL_RSA_Start(); ret = HAL_RSA_WaitFree(); if( HI_SUCCESS != ret ) { HI_ERR_CIPHER("RSA is busy and timeout,error!\n"); return HI_FAILURE; } u32ErrorCode = HAL_RSA_GetErrorCode(); if( 0 != u32ErrorCode ) { HI_ERR_CIPHER("RSA is err: chipset error code: 0x%x!\n", u32ErrorCode); return HI_FAILURE; } /*Get result*/ HAL_RSA_ReadData(pCipherRsaData->pu8Output, pCipherRsaData->u16NLen, u32KeyLen); // HI_PRINT_HEX("M_OUT", pCipherRsaData->pu8Output, u32KeyLen); return HI_SUCCESS; } HI_S32 DRV_CIPHER_CalcRsa(CIPHER_RSA_DATA_S *pCipherRsaData) { static HI_U8 N[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; static HI_U8 K[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; static HI_U8 M[HI_UNF_CIPHER_MAX_RSA_KEY_LEN]; HI_S32 ret = HI_SUCCESS; HI_U32 u32KeyLen; CIPHER_RSA_DATA_S stCipherRsaData; HI_U8 *p; if(pCipherRsaData == HI_NULL) { HI_ERR_CIPHER("Invalid params!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if ((pCipherRsaData->pu8Input == HI_NULL) ||(pCipherRsaData->pu8Output== HI_NULL) || (pCipherRsaData->pu8N == HI_NULL) || (pCipherRsaData->pu8K == HI_NULL)) { HI_ERR_CIPHER("para is null.\n"); HI_ERR_CIPHER("pu8Input:0x%p, pu8Output:0x%p, pu8N:0x%p, pu8K:0x%p\n", pCipherRsaData->pu8Input, pCipherRsaData->pu8Output, pCipherRsaData->pu8N,pCipherRsaData->pu8K); return HI_ERR_CIPHER_INVALID_POINT; } if(pCipherRsaData->u32DataLen != pCipherRsaData->u16NLen) { HI_ERR_CIPHER("Error, DataLen != u16NLen!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if(pCipherRsaData->u16KLen > pCipherRsaData->u16NLen) { HI_ERR_CIPHER("Error, KLen > u16NLen!\n"); return HI_ERR_CIPHER_INVALID_PARA; } osal_memset(N, 0, sizeof(N)); osal_memset(K, 0, sizeof(K)); osal_memset(M, 0, sizeof(M)); /*Only support the key width of 1024,2048 and 4096*/ if (pCipherRsaData->u16NLen <= 128) { u32KeyLen = 128; } else if (pCipherRsaData->u16NLen <= 256) { u32KeyLen = 256; } else if (pCipherRsaData->u16NLen <= 512) { u32KeyLen = 512; } else { HI_ERR_CIPHER("u16NLen(0x%x) is invalid\n", pCipherRsaData->u16NLen); return HI_ERR_CIPHER_INVALID_POINT; } /*if dataLen < u32KeyLen, padding 0 before data*/ p = N + (u32KeyLen - pCipherRsaData->u16NLen); if (osal_copy_from_user(p, pCipherRsaData->pu8N, pCipherRsaData->u16NLen)) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } p = K + (u32KeyLen - pCipherRsaData->u16KLen); if (osal_copy_from_user(p, pCipherRsaData->pu8K, pCipherRsaData->u16KLen)) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } p = M + (u32KeyLen - pCipherRsaData->u32DataLen); if (osal_copy_from_user(p, pCipherRsaData->pu8Input, pCipherRsaData->u32DataLen)) { HI_ERR_CIPHER("copy data from user fail!\n"); return HI_FAILURE; } stCipherRsaData.pu8N = N; stCipherRsaData.pu8K = K; stCipherRsaData.pu8Input = M; stCipherRsaData.u16NLen = u32KeyLen; stCipherRsaData.u16KLen = u32KeyLen; stCipherRsaData.u32DataLen = u32KeyLen; stCipherRsaData.pu8Output = M; stCipherRsaData.enKeySrc = pCipherRsaData->enKeySrc; ret = DRV_CIPHER_CalcRsa_ex(&stCipherRsaData); if( HI_SUCCESS != ret ) { return HI_FAILURE; } if (osal_copy_to_user(pCipherRsaData->pu8Output, M+(u32KeyLen - pCipherRsaData->u16NLen), pCipherRsaData->u16NLen)) { HI_ERR_CIPHER("copy data to user fail!\n"); return HI_FAILURE; } return ret; } HI_S32 HI_DRV_CIPHER_CalcRsa(CIPHER_RSA_DATA_S *pCipherRsaData) { HI_S32 ret = HI_SUCCESS; if(pCipherRsaData == HI_NULL) { HI_ERR_CIPHER("Invalid params!\n"); return HI_ERR_CIPHER_INVALID_PARA; } if(osal_mutex_lock_interruptible(&g_RsaMutexKernel)) { HI_ERR_CIPHER("osal_mutex_lock_interruptible failed!\n"); return HI_FAILURE; } ret = DRV_CIPHER_CalcRsa(pCipherRsaData); osal_mutex_unlock(&g_RsaMutexKernel); return ret; } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/init/HuaweiLite/hi_interdrv_param.h #ifndef __HI_INTERDRV_PARAM__ #define __HI_INTERDRV_PARAM__ #include "hi_type.h" typedef struct tagRTC_MODULE_PARAMS_S { int t_second; }RTC_MODULE_PARAMS_S; typedef struct tagWTDG_MODULE_PARAMS_S { int default_margin; // int nowayout; int nodeamon; }WTDG_MODULE_PARAMS_S; #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/stm8l15x_it.c /** ****************************************************************************** * @file TIM4/TIM4_TimeBase/stm8l15x_it.c * @author MCD Application Team * @version V1.5.2 * @date 30-September-2014 * @brief Main Interrupt Service Routines. * This file provides template for all peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm8l15x_it.h" #include "boardconfig.h" #include "kfifo.h" /** @addtogroup STM8L15x_StdPeriph_Examples * @{ */ /** @addtogroup TIM4_TimeBase * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ extern u32 couter; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /* Public functions ----------------------------------------------------------*/ #ifdef _COSMIC_ /** * @brief Dummy interrupt routine * @param None * @retval None */ INTERRUPT_HANDLER(NonHandledInterrupt, 0) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } #endif /** * @brief TRAP interrupt routine * @param None * @retval None */ INTERRUPT_HANDLER_TRAP(TRAP_IRQHandler) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief FLASH Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(FLASH_IRQHandler, 1) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief DMA1 channel0 and channel1 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(DMA1_CHANNEL0_1_IRQHandler, 2) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief DMA1 channel2 and channel3 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(DMA1_CHANNEL2_3_IRQHandler, 3) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief RTC / CSS_LSE Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(RTC_CSSLSE_IRQHandler, 4) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ g_RTC_Alarm_Flag = 1; RTC_AlarmCmd(DISABLE); RTC_ITConfig(RTC_IT_ALRA, DISABLE); RTC_ClearITPendingBit(RTC_IT_ALRA); } /** * @brief External IT PORTE/F and PVD Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTIE_F_PVD_IRQHandler, 5) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PORTB / PORTG Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTIB_G_IRQHandler, 6) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PORTD /PORTH Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTID_H_IRQHandler, 7) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PIN0 Interrupt routine. * @param None * @retval None */ extern u8 g_PIR_Check; INTERRUPT_HANDLER(EXTI0_IRQHandler, 8) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ disableInterrupts(); #if 0 if(g_IsSystemOn==0) //PIR从halt模式唤醒 { g_PIR_Check = 1; } #endif if(g_IsSystemOn==0)//WIFI从halt模式唤醒 { g_Wifi_WakeUp =1; } EXTI_ClearITPendingBit(EXTI_IT_Pin0); enableInterrupts(); } /** * @brief External IT PIN1 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTI1_IRQHandler, 9) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ disableInterrupts(); if(g_IsSystemOn==0)//开机键 从halt模式唤醒 { g_WakeUp_Halt_Flag =1; } EXTI_ClearITPendingBit(EXTI_IT_Pin1); enableInterrupts(); } /** * @brief External IT PIN2 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTI2_IRQHandler, 10) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ u8 key_val; disableInterrupts(); //WIFI待机中电池电量低 检测 if(g_Bar_Det_Flag==0) { key_val = GPIO_ReadInputDataBit(BAT_LOW_DET_GPIO, BAT_LOW_DET_GPIO_Pin); if(!key_val)//检测到为低 { g_Bar_Det_Flag = 1; } } EXTI_ClearITPendingBit(EXTI_IT_Pin2); enableInterrupts(); } /** * @brief External IT PIN3 Interrupt routine. PB * @param None * @retval None */ INTERRUPT_HANDLER(EXTI3_IRQHandler, 11) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PIN4 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTI4_IRQHandler, 12) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PIN5 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTI5_IRQHandler, 13) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PIN6 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTI6_IRQHandler, 14) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief External IT PIN7 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(EXTI7_IRQHandler, 15) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ disableInterrupts(); if(g_IsSystemOn==0)//WIFI从halt模式唤醒 { g_Wifi_WakeUp =1; } EXTI_ClearITPendingBit(EXTI_IT_Pin7); enableInterrupts(); } /** * @brief LCD /AES Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(LCD_AES_IRQHandler, 16) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief CLK switch/CSS/TIM1 break Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(SWITCH_CSS_BREAK_DAC_IRQHandler, 17) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief ADC1/Comparator Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(ADC1_COMP_IRQHandler, 18) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief TIM2 Update/Overflow/Trigger/Break /USART2 TX Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(TIM2_UPD_OVF_TRG_BRK_USART2_TX_IRQHandler, 19) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief Timer2 Capture/Compare / USART2 RX Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(TIM2_CC_USART2_RX_IRQHandler, 20) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief Timer3 Update/Overflow/Trigger/Break Interrupt routine. * @param None * @retval None */ extern u8 g_poweroff_check_flg;//检测是否满足断电条件无按键、无pir触发 extern u8 g_pir_ok_poweroff; // PIR满足关机条件 extern u8 g_key_ok_poweroff; // 按键满足关机条件 extern u8 g_Wifi_Reg_Det_Flag; INTERRUPT_HANDLER(TIM3_UPD_OVF_TRG_BRK_USART3_TX_IRQHandler, 21) { #if 0 u8 key_val; static u16 pir_conut = 0; static u16 key_keep_count = 0; static u16 key_release_count = 0; key_val = GPIO_ReadInputDataBit(SW_KEY_GPIO, SW_KEY_GPIO_Pin); if (key_val != KEY_VALID_LEVEL) // no key press { if(g_WakeUp_Key_Flag) { g_WakeUp_Key_Flag --; } if(g_poweroff_check_flg) { key_release_count++; if(key_release_count > 1250 && !g_key_ok_poweroff){ g_key_ok_poweroff = 1; } } key_keep_count = 0; } else { if (!g_IsSystemOn) //按键按下 唤醒时计数 { g_WakeUp_Key_Flag = 1 ; } //if (!g_IsSystemOn) { if(key_keep_count >= 1750){ g_Key_Handle_Flag = 2; key_keep_count = 0 ; } else if (key_keep_count >= 25 )// PWR_ON_KEY_KEEP_COUNT) 800ms { g_Key_Handle_Flag = 1; //key_keep_count = 0 ; } } key_keep_count ++ ; key_release_count = 0; g_key_ok_poweroff = 0; } key_val = GPIO_ReadInputDataBit(PIR_GPIO, PIR_GPIO_Pin); if(key_val == KEY_VALID_LEVEL) //无触发 { if(g_poweroff_check_flg) { pir_conut ++; if(pir_conut > 1250 && !g_pir_ok_poweroff) g_pir_ok_poweroff = 1; } } else {//有触发 pir_conut = 0; g_pir_ok_poweroff = 0; } #endif if(USART_Receive_Timeout < U16_MAX) USART_Receive_Timeout++; TIM3_ClearITPendingBit(TIM3_IT_Update); } /** * @brief Timer3 Capture/Compare /USART3 RX Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(TIM3_CC_USART3_RX_IRQHandler, 22) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief TIM1 Update/Overflow/Trigger/Commutation Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(TIM1_UPD_OVF_TRG_COM_IRQHandler, 23) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief TIM1 Capture/Compare Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(TIM1_CC_IRQHandler, 24) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief TIM4 Update/Overflow/Trigger Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(TIM4_UPD_OVF_TRG_IRQHandler, 25) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief SPI1 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(SPI1_IRQHandler, 26) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @brief USART1 TX / TIM5 Update/Overflow/Trigger/Break Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(USART1_TX_TIM5_UPD_OVF_TRG_BRK_IRQHandler, 27) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } extern void dev_wlan_power_handle(u8 val); extern void dev_wlan_reset_handle(u8 val); extern void host_clr_wkup_reason(void); /** * @brief USART1 RX / Timer5 Capture/Compare Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(USART1_RX_TIM5_CC_IRQHandler, 28) { unsigned char temdata; /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ temdata = USART_ReceiveData8(USART1); USART_ClearITPendingBit(USART1,USART_IT_RXNE); __kfifo_put_singlebyte(&recvfifo, temdata); } /** * @brief I2C1 / SPI2 Interrupt routine. * @param None * @retval None */ INTERRUPT_HANDLER(I2C1_SPI2_IRQHandler, 29) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ } /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/tools/HuaweiLite/tools_shell_cmd.c /*------------------------------------------------------------------------- -------------------------------------------------------------------------*/ #include "los_task.h" #include "hi_type.h" #include "shell.h" #include "tools_shell_cmd.h" extern HI_S32 vou_chn_dump(int argc, char* argv[]); extern HI_S32 vou_screen_dump(int argc, char* argv[]); extern HI_S32 vo_video_csc_main(int argc, char* argv[]); extern HI_S32 vpss_attr(int argc, char* argv[]); extern HI_S32 vpss_chn_dump(int argc, char* argv[]); extern HI_S32 vpss_src_dump(int argc, char* argv[]); //extern HI_S32 rc_attr(int argc, char* argv[]); //extern HI_S32 vi_fisheye_attr(int argc, char* argv[]); extern HI_S32 aenc_dump(int argc, char* argv[]); extern HI_S32 ai_dump(int argc, char* argv[]); extern HI_S32 ao_dump(int argc, char *argv[]); #if 1 extern HI_S32 isp_debug(int argc, char* argv[]); #endif extern HI_S32 vi_bayerdump(int argc, char* argv[]); extern HI_S32 vi_dump(int argc, char* argv[]); #define ARGS_SIZE_T 20 #define ARG_BUF_LEN_T 256 static char *ptask_args[ARGS_SIZE_T]; static char *args_buf_t = NULL; void tools_cmd_com(unsigned int p0, unsigned int p1, unsigned int p2, unsigned int p3) { int i = 0, ret; unsigned int argc = p0; char **argv = (char **)p1; //Set_Interupt(0); dprintf("\ntools input command:\n"); for(i=0; i<argc; i++) { dprintf("%s ", argv[i]); } dprintf("\n"); if(strcmp(argv[0],"vpss_chn_dump")==0) //vpss_chn_dump { ret = vpss_chn_dump(argc,argv); dprintf("\vpss_chn_dump finshed\n"); } else if(strcmp(argv[0],"vpss_src_dump")==0) //vpss_src_dump { ret = vpss_src_dump(argc,argv); dprintf("\nvpss_src_dump finshed\n"); } else if(strcmp(argv[0],"vpss_attr")==0) //vpss_attr { ret = vpss_attr(argc,argv); dprintf("\nvpss_attr finshed\n"); } #if 0 else if(strcmp(argv[0],"rc_attr")==0) //rc_attr { ret = rc_attr(argc,argv); dprintf("\nrc_attr finshed\n"); } #endif else if(strcmp(argv[0],"vou_chn_dump")==0) //vou_chn_dump { ret = vou_chn_dump(argc,argv); dprintf("\nvou_chn_dump finshed\n"); } else if(strcmp(argv[0],"vou_screen_dump")==0) //vou_screen_dump { ret = vou_screen_dump(argc,argv); dprintf("\nvou_screen_dump finshed\n"); } else if(strcmp(argv[0],"vo_csc_config")==0) //vo_csc_config { ret = vo_video_csc_main(argc,argv); dprintf("\nvo_csc_config finshed\n"); } else if(strcmp(argv[0],"ai_dump")==0) //ai_dump { ret = ai_dump(argc,argv); dprintf("\nai_dump finshed\n"); } else if(strcmp(argv[0],"ao_dump")==0) //ao_dump { ret = ao_dump(argc,argv); dprintf("\nao_dump finshed\n"); } else if(strcmp(argv[0],"aenc_dump")==0) //aenc_dump { ret = aenc_dump(argc,argv); dprintf("\naenc_dump finshed\n"); } else if(strcmp(argv[0],"vi_bayerdump")==0) //vi_bayerdump { ret = vi_bayerdump(argc,argv); dprintf("\nvi_bayerdump finshed\n"); } else if(strcmp(argv[0],"vi_dump")==0) //vi_dump { ret = vi_dump(argc,argv); dprintf("\nvi_dump finshed\n"); } else if(strcmp(argv[0],"isp_debug")==0) //vi_dump { ret = isp_debug(argc,argv); dprintf("\nisp_debug finshed\n"); } //taskid = -1; } void tools_cmd_app(int argc, char **argv ) { int i = 0, ret = 0; int len = 0; char *pch = NULL; TSK_INIT_PARAM_S stappTask; int taskid = -1; // printf("xxxx %d,%s,%s,%s,%s\n",argc,argv[0],argv[1],argv[2],argv[3]); if (taskid != -1) { dprintf("There's a app_main task existed."); } args_buf_t = zalloc(ARG_BUF_LEN_T); pch = args_buf_t; for(i=0; i<ARGS_SIZE_T; i++) { ptask_args[i] = NULL; } for(i = 0; i < argc; i++) { len = strlen(argv[i]); memcpy(pch , argv[i], len); ptask_args[i] = pch; //keep a '\0' at the end of a string. pch = pch + len + 1; if (pch >= args_buf_t +ARG_BUF_LEN_T) { dprintf("args out of range!\n"); break; } } memset(&stappTask, 0, sizeof(TSK_INIT_PARAM_S)); stappTask.pfnTaskEntry = (TSK_ENTRY_FUNC)tools_cmd_com; stappTask.uwStackSize = 0x80000; stappTask.pcName = "vpss_chn_dump"; stappTask.usTaskPrio = 10; stappTask.uwResved = LOS_TASK_STATUS_DETACHED; stappTask.auwArgs[0] = argc; stappTask.auwArgs[1] = (UINT32)ptask_args; ret = LOS_TaskCreate(&taskid, &stappTask); dprintf("Task %d\n", taskid); } void tools_cmd_register(void) { osCmdReg(CMD_TYPE_STD,"vou_chn_dump",3,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"vou_screen_dump",2,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"vo_csc_config",6,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"vpss_attr",3,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"vpss_chn_dump",6,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"vpss_src_dump",1,(CMD_CBK_FUNC)tools_cmd_app); // osCmdReg(CMD_TYPE_STD,"rc_attr",2,(CMD_CBK_FUNC)tools_cmd_app); // osCmdReg(CMD_TYPE_STD,"vi_fisheye_attr",3,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"aenc_dump",4,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"ai_dump",5,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"ao_dump",5,(CMD_CBK_FUNC)tools_cmd_app); #if 1 osCmdReg(CMD_TYPE_STD,"isp_debug",3,(CMD_CBK_FUNC)tools_cmd_app); #endif osCmdReg(CMD_TYPE_STD,"vi_bayerdump",3,(CMD_CBK_FUNC)tools_cmd_app); osCmdReg(CMD_TYPE_STD,"vi_dump",2,(CMD_CBK_FUNC)tools_cmd_app); } <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/sample/sample.c /****************************************************************************** Copyright (C), 2011-2021, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : sample_rng.c Version : Initial Draft Author : Hisilicon Created : 2012/07/10 Last Modified : Description : sample for cipher Function List : History : ******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <assert.h> #include "hi_type.h" extern HI_S32 sample_cipher(); extern HI_S32 sample_mutiltcipher(); extern HI_S32 sample_cipher_efuse(); extern HI_S32 sample_hash(); extern HI_S32 sample_rng(); extern HI_S32 sample_rsa_sign(); extern HI_S32 sample_rsa_enc(); #ifdef __HuaweiLite__ int app_main(int argc, char *argv[]) #else int main(int argc, char *argv[]) #endif { HI_S32 s32Ret = HI_SUCCESS; HI_U32 funcNumber = 0; char u8Cmd[32]; while (1) { printf("\n##########----Run a cipher sample----###############\n"); printf(" You can selset a cipher sample to run as fllow:\n" " [0] CIPHER\n" " [1] CIPHER-MUTILT\n" " [2] CIPHER-EFUSE\n" " [3] HASH\n" " [4] RNG\n" " [5] RSA-SIGN\n" " [6] RSA-ENC\n" " [q] EXIT\n"); printf("Please enter the function number:\n"); fgets(u8Cmd, sizeof(u8Cmd)-1, stdin); if (u8Cmd[0] == '\0') { printf("Error, function number invalid.\n"); continue; } else if (u8Cmd[0] == 'q') { printf("Cipher sample exit, thank you for test, byebye ~^~\n"); break; } else if ((u8Cmd[0] < '0') || (u8Cmd[0] > '6')) { printf("Error, function number invalid: %c.\n", u8Cmd[0]); continue; } funcNumber = strtol(u8Cmd,NULL,0); if ( 0 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_cipher ~~~~~~~~~~~~~~~~~~~\n"); s32Ret = sample_cipher(); } else if ( 1 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_mutiltcipher ~~~~~~~~~~~~~~~~~~~\n"); s32Ret = sample_mutiltcipher(); } else if ( 2 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_cipher_efuse ~~~~~~~~~~~~~~~~~~~\n"); printf("please burn the efuse key before run this sample\n"); printf("you can config register refer to write_efuse_key.sh\n"); s32Ret = sample_cipher_efuse(); } else if ( 3 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_hash ~~~~~~~~~~~~~~~~~~~\n"); s32Ret = sample_hash(); } else if ( 4 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_rng ~~~~~~~~~~~~~~~~~~~\n"); s32Ret = sample_rng(); } else if ( 5 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_rsa_sign ~~~~~~~~~~~~~~~~~~~\n"); s32Ret = sample_rsa_sign(); } else if ( 6 == funcNumber ) { printf("\n~~~~~~~~~~~~~~~~~~~~~ run sample_rsa_enc ~~~~~~~~~~~~~~~~~~~\n"); s32Ret = sample_rsa_enc(); } else { printf("Function Number %d do not exist!\n", funcNumber); } if(HI_SUCCESS == s32Ret) { printf("\033[0;1;32m""\n################# FUNCTION %d RUN SUCCESS #################\n\n""\033[0m", funcNumber); } else { printf("\033[0;1;31m""\n################# FUNCTION %d RUN FAILURE #################\n\n""\033[0m", funcNumber); } sleep(1); } return HI_SUCCESS; } <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/hi1131_wifi/hisi_app_demo/hilink_demo.c /****************************************************************************** 版权所有 (C), 2001-2011, 华为技术有限公司 ****************************************************************************** 文 件 名 : hilink_demo.c 版 本 号 : 初稿 作 者 : 生成日期 : 2016年12月30日 最近修改 : 功能描述 : hilink demo程序 函数列表 : 修改历史 : 1.日 期 : 2016年12月30日 作 者 : 修改内容 : 创建文件 ******************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif #include "driver_hisi_lib_api.h" #include "hilink_adapt.h" #include "hostapd/hostapd_if.h" #include "wpa_supplicant/wpa_supplicant.h" #include "los_task.h" #include "sys/prctl.h" #include <pthread.h> #include "driver_hisi_lib_api.h" #include "hisilink_ext.h" #include <linux/completion.h> #ifndef CONFIG_NO_CONFIG_WRITE #define WPA_SUPPLICANT_CONFIG_PATH "/jffs0/etc/hisi_wifi/wifi/wpa_supplicant.conf" #endif #define HILINK_PERIOD_CHANNEL 50 //切信道周期 #define HILINK_PERIOD_TIMEOUT 120000 //hisilink超时时间 typedef enum { HILINK_STATUS_UNCREATE, HILINK_STATUS_RECEIVE, //hilink处于接收组播阶段 HILINK_STATUS_CONNECT, //hilink处于关联阶段 HILINK_STATUS_BUTT }hilink_status_enum; typedef unsigned char hilink_status_enum_type; unsigned int gul_hilink_taskid; /* hilink_demo_task_channel_change的taskid */ hilink_s_context g_st_hilink_context; /* hilink内部使用结构体变量 */ hilink_s_result gst_hilink_result; /* 存放hilink结果的结构体变量 */ hilink_status_enum_type guc_hilink_status = 0; extern unsigned char hilink_receive_flag; /* 是否需要接收数据的标识 */ /***************************************************************************** 函数声明 ******************************************************************************/ int hilink_demo_connect_prepare(void); int hilink_demo_set_status(hilink_status_enum_type uc_type); unsigned char hilink_demo_get_status(void); unsigned int hilink_get_time(); /***************************************************************************** 函 数 名 : hilink_demo_prepare 功能描述 : hilink启动hostapd 输入参数 : 无 输出参数 : 无 返 回 值 : 成功返回HISI_SUCC,异常返回-HISI_EFAIL 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_prepare(void) { hilink_s_pkt0len st_pkt_len; int l_ret; char auc_ssid[33]; unsigned int ul_ssid_len = 0; struct hostapd_conf hapd_conf; /* 设备信息 */ unsigned char auc_ssid_type[] = "01"; unsigned char auc_device_id[] = "9001"; unsigned char auc_device_sn[] = "X"; unsigned char auc_sec_type[] = "B"; unsigned char auc_sec_key[] = "0000000000000000000000"; /* 尝试删除wpa_supplicant和hostapd */ l_ret = wpa_supplicant_stop(); if (HISI_SUCC != l_ret) { HISI_PRINT_WARNING("%s[%d]:wpa_supplicant stop fail",__func__,__LINE__); } l_ret = hostapd_stop(); if (HISI_SUCC != l_ret) { HISI_PRINT_WARNING("%s[%d]:hostapd stop fail",__func__,__LINE__); } memset(&g_st_hilink_context, 0, sizeof(hilink_s_context)); /* 初始化hilink库函数 */ l_ret = hilink_link_init(&g_st_hilink_context); if (HISI_SUCC == l_ret) { hilink_link_reset(); st_pkt_len.len_open = OPEN_BASE_LEN; st_pkt_len.len_wep = WEP_BASE_LEN; st_pkt_len.len_tkip = TKIP_BASE_LEN; st_pkt_len.len_aes = AES_BASE_LEN; /* 设置基准长度 */ hilink_link_set_pkt0len(&st_pkt_len); } memset(auc_ssid, 0, sizeof(unsigned char)*33); /* 启动hostapd */ hilink_link_get_devicessid(auc_ssid_type,auc_device_id,auc_device_sn,auc_sec_type,auc_sec_key,auc_ssid,&ul_ssid_len); /* 设置AP参数 */ memset(&hapd_conf, 0, sizeof(struct hostapd_conf)); if (ul_ssid_len > MAX_ESSID_LEN + 1) { HISI_PRINT_ERROR("%s[%d]:ul_ssid_len = %d more than 33",__func__,__LINE__,ul_ssid_len); return -HISI_EFAIL; } memcpy(hapd_conf.ssid, auc_ssid, ul_ssid_len); memcpy(hapd_conf.ht_capab, "[HT40+]", strlen("[HT40+]")); hapd_conf.channel_num = 6; hapd_conf.wpa_key_mgmt = WPA_KEY_MGMT_PSK; hapd_conf.authmode = HOSTAPD_SECURITY_WPAPSK; hapd_conf.wpa = 2; hapd_conf.wpa_pairwise = WPA_CIPHER_TKIP | WPA_CIPHER_CCMP; memcpy(hapd_conf.driver, "hisi", 5); memcpy((char *)hapd_conf.key,"hilink123",strlen("hilink123")); l_ret = hostapd_start(NULL, &hapd_conf); if (0 != l_ret) { HISI_PRINT_ERROR("%s[%d]:hostapd start failed[%d]",__func__,__LINE__,l_ret); return -HISI_EFAIL; } return HISI_SUCC; } /***************************************************************************** 函 数 名 : hilink_demo_init 功能描述 : hilink demo的初始化wifi驱动与hilink相关的配置 输入参数 : 无 输出参数 : 无 返 回 值 : 成功返回HISI_SUCC,异常返回-HISI_EFAIL 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_init(void) { #if 0 /* 由于hilink团队尚未提供适配B051的SO库,故hilink暂时选择不编译, 相应的无法用编译宏控制的调用位置暂时用if 0注掉 */ int l_ret; memset(&gst_hilink_result, 0, sizeof(hilink_s_result)); l_ret = hisi_hilink_adapt_init(); if (HISI_SUCC != l_ret) { HISI_PRINT_ERROR("%s[%d]:hilink_adapt_init fail",__func__,__LINE__); return -HISI_EFAIL; } return HISI_SUCC; #endif } /***************************************************************************** 函 数 名 : hilink_demo_task_channel_change 功能描述 : hilink demo的切信道线程处理函数 输入参数 : 无 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ void hilink_demo_task_channel_change(void) { int l_ret; unsigned int ul_ret; unsigned int ul_time = 0; unsigned int ul_time_temp = 0; unsigned int ul_wait_time = 0; unsigned char uc_status; struct netif *pst_netif; ul_time_temp = hilink_get_time(); ul_time = ul_time_temp; uc_status = hilink_demo_get_status(); while((HILINK_STATUS_RECEIVE == uc_status) && (HILINK_PERIOD_TIMEOUT >= ul_wait_time)) { if (RECEIVE_FLAG_ON == hilink_receive_flag) { ul_time_temp = hilink_get_time(); if (HILINK_PERIOD_CHANNEL < (ul_time_temp - ul_time)) { ul_wait_time += (ul_time_temp - ul_time); ul_time = ul_time_temp; l_ret = hilink_link_get_lock_ready(); if (0 == l_ret) { l_ret = hisi_hilink_change_channel(); if (HISI_SUCC != l_ret) { HISI_PRINT_WARNING("%s[%d]:change channel fail\n",__func__,__LINE__); } /* 复位一下hilink参数 */ hilink_link_reset(); } } } l_ret = hisi_hilink_parse_data(); if (HI_WIFI_STATUS_FINISH == l_ret) { LOS_TaskLock(); hilink_receive_flag = RECEIVE_FLAG_OFF; LOS_TaskUnlock(); hilink_demo_set_status(HILINK_STATUS_CONNECT); break; } msleep(1); uc_status = hilink_demo_get_status(); } hisi_hilink_adapt_deinit(); if (HILINK_PERIOD_TIMEOUT >= ul_wait_time) { hsl_memset(&gst_hilink_result, 0, sizeof(hilink_s_result)); l_ret = hilink_link_get_result(&gst_hilink_result); if (HISI_SUCC == l_ret) { l_ret = hilink_demo_connect_prepare(); if (HISI_SUCC != l_ret) { HISI_PRINT_ERROR("hilink_demo_task_channel_change:connect prepare fail[%d]\n",l_ret); } } } else { HISI_PRINT_INFO("hilink timeout\n"); /* 删除AP模式 */ pst_netif = netif_find("wlan0"); if (HISI_NULL != pst_netif) { dhcps_stop(pst_netif); } l_ret = hostapd_stop(); if (0 != l_ret) { HISI_PRINT_ERROR("%s[%d]:stop hostapd fail",__func__,__LINE__); } } hilink_demo_set_status(HILINK_STATUS_UNCREATE); ul_ret = LOS_TaskDelete(gul_hilink_taskid); if (HISI_SUCC != ul_ret) { HISI_PRINT_WARNING("%s[%d]:delete task fail[%d]",__func__,__LINE__,ul_ret); } } /***************************************************************************** 函 数 名 : hilink_demo_get_status 功能描述 : 获取hilink所处的状态 输入参数 : 无 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ unsigned char hilink_demo_get_status(void) { unsigned char uc_type; LOS_TaskLock(); uc_type = guc_hilink_status; LOS_TaskUnlock(); return uc_type; } /***************************************************************************** 函 数 名 : hilink_demo_set_status 功能描述 : 设置hilink所处的状态 输入参数 : 无 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_set_status(hilink_status_enum_type uc_type) { LOS_TaskLock(); guc_hilink_status = uc_type; LOS_TaskUnlock(); return HISI_SUCC; } /***************************************************************************** 函 数 名 : hilink_demo_get_result 功能描述 : 获取hilink接收到的AP信息 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ hilink_s_result* hilink_demo_get_result(void) { hilink_s_result *pst_result; pst_result = &gst_hilink_result; return pst_result; } /***************************************************************************** 函 数 名 : hilink_get_time 功能描述 : 获取系统时间 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ unsigned int hilink_get_time(void) { unsigned int ul_time = 0; struct timeval tv; gettimeofday(&tv, HISI_NULL); ul_time = tv.tv_usec / 1000 + tv.tv_sec * 1000; return ul_time; } /***************************************************************************** 函 数 名 : hilink_demo_online 功能描述 : 发送上线包 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_online(hilink_s_result* pst_result) { if (HISI_NULL == pst_result) { HISI_PRINT_ERROR("%s[%d]:pst_params is null",__func__,__LINE__); return -HISI_EFAIL; } hisi_hilink_online_notice(pst_result); return HISI_SUCC; } extern struct completion dhcp_complet; /***************************************************************************** 函 数 名 : hilink_demo_connect_prepare 功能描述 : 获取AP信息后,切换到STA模式为关联做准备 输入参数 : 无 输出参数 : 无 返 回 值 : 成功返回HISI_SUCC,异常返回-HISI_EFAIL 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_connect_prepare(void) { int l_ret; unsigned int ul_ret; hilink_s_result *pst_result; /* 删除AP模式 */ l_ret = hostapd_stop(); if (HISI_SUCC!= l_ret) { HISI_PRINT_ERROR("%s[%d]:stop hostapd fail\n",__func__,__LINE__); return -HISI_EFAIL; } init_completion(&dhcp_complet); #ifdef CONFIG_NO_CONFIG_WRITE l_ret = wpa_supplicant_start("wlan0", "hisi", NULL); #else l_ret = wpa_supplicant_start("wlan0", "hisi", WPA_SUPPLICANT_CONFIG_PATH); #endif if (HISI_SUCC != l_ret) { HISI_PRINT_ERROR("%s[%d]:start wpa_supplicant fail\n",__func__,__LINE__); return -HISI_EFAIL; } ul_ret = wait_for_completion_timeout(&dhcp_complet, LOS_MS2Tick(40000));//40s超时 if (0 == ul_ret) { HISI_PRINT_ERROR("hilink_demo_connect_prepare:cannot get ip\n"); return -HISI_EFAIL; } pst_result = hilink_demo_get_result(); if (HISI_NULL != pst_result) { hilink_demo_online(pst_result); } return HISI_SUCC; } /***************************************************************************** 函 数 名 : hilink_demo_connect 功能描述 : 根据获取的AP信息发起关联 输入参数 : 无 输出参数 : 无 返 回 值 : 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_connect(hilink_s_result* pst_result) { struct wpa_assoc_request wpa_assoc_req; memset(&wpa_assoc_req, 0, sizeof(struct wpa_assoc_request)); wpa_assoc_req.hidden_ssid = 1; if (33 < pst_result->ssid_len) { HISI_PRINT_ERROR("%s[%d]:ssd_len = %d more than 33",__func__,__LINE__,pst_result->ssid_len); wpa_supplicant_stop(); return -HISI_EFAIL; } strncpy(wpa_assoc_req.ssid, pst_result->ssid, pst_result->ssid_len); HISI_PRINT_ERROR("SSID:%s\n",pst_result->ssid); HISI_PRINT_ERROR("en_type:%d\n",pst_result->enc_type); HISI_PRINT_ERROR("sendtype:%d\n",pst_result->sendtype); wpa_assoc_req.auth = pst_result->enc_type; if (HI_WIFI_ENC_OPEN != wpa_assoc_req.auth) { if (128 < pst_result->pwd_len) { HISI_PRINT_ERROR("%s[%d]:pwd_len = %d is more than 128",__func__,__LINE__,pst_result->pwd_len); wpa_supplicant_stop(); return -HISI_EFAIL; } strncpy(wpa_assoc_req.key, pst_result->pwd, pst_result->pwd_len); } wpa_connect_interface(&wpa_assoc_req); return HISI_SUCC; } extern int hsl_demo_get_status(void); /***************************************************************************** 函 数 名 : hilink_demo_main 功能描述 : hilink demo的入口函数 输入参数 : 无 输出参数 : 无 返 回 值 : 成功返回HISI_SUCC,异常返回-HISI_EFAIL 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2016年6月25日 作 者 : 修改内容 : 新生成函数 *****************************************************************************/ int hilink_demo_main(void) { int l_ret; unsigned int ul_ret; unsigned char uc_status; TSK_INIT_PARAM_S stappTask; uc_status = hsl_demo_get_status(); if (0 != uc_status) { HISI_PRINT_ERROR("hisilink already start,cannot start hilink\n"); return -HISI_EFAIL; } uc_status = hilink_demo_get_status(); if (HILINK_STATUS_UNCREATE != uc_status) { HISI_PRINT_ERROR("hilink already start,cannot start again"); return -HISI_EFAIL; } hilink_demo_set_status(HILINK_STATUS_RECEIVE); l_ret = hilink_demo_prepare(); if (HISI_SUCC != l_ret) { HISI_PRINT_ERROR("%s[%d]:demo init fail\n",__func__,__LINE__); hilink_demo_set_status(HILINK_STATUS_UNCREATE); return -HISI_EFAIL; } /* 创建切信道线程,线程结束后自动释放 */ memset(&stappTask, 0, sizeof(TSK_INIT_PARAM_S)); stappTask.pfnTaskEntry = (TSK_ENTRY_FUNC)hilink_demo_task_channel_change; stappTask.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; stappTask.pcName = "hilink_thread"; stappTask.usTaskPrio = 8; stappTask.uwResved = LOS_TASK_STATUS_DETACHED; ul_ret = LOS_TaskCreate(&gul_hilink_taskid, &stappTask); if(0 != ul_ret) { HISI_PRINT_ERROR("%s[%d]:create task fail[%d]\n",__func__,__LINE__,ul_ret); hilink_demo_set_status(HILINK_STATUS_UNCREATE); return -HISI_EFAIL; } return HISI_SUCC; } #ifdef __cplusplus #if __cplusplus } #endif #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/cipher/src/api/unf_cipher.c /********************************************************************************* * * Copyright (C) 2014 Hisilicon Technologies Co., Ltd. All rights reserved. * * This program is confidential and proprietary to Hisilicon Technologies Co., Ltd. * (Hisilicon), and may not be copied, reproduced, modified, disclosed to * others, published or used, in whole or in part, without the express prior * written permission of Hisilicon. * ***********************************************************************************/ #include "config.h" #include "hi_mpi_cipher.h" HI_S32 HI_UNF_CIPHER_Init(HI_VOID) { return HI_MPI_CIPHER_Init(); } HI_S32 HI_UNF_CIPHER_DeInit(HI_VOID) { return HI_MPI_CIPHER_DeInit(); } #ifdef CIPHER_MULTICIPHER_SUPPORT HI_S32 HI_UNF_CIPHER_CreateHandle(HI_HANDLE* phCipher) { return HI_MPI_CIPHER_CreateHandle(phCipher); } HI_S32 HI_UNF_CIPHER_DestroyHandle(HI_HANDLE hCipher) { return HI_MPI_CIPHER_DestroyHandle(hCipher); } #ifdef CIPHER_RNG_SUPPORT HI_S32 HI_UNF_CIPHER_GetRandomNumber(HI_U32 *pu32RandomNumber) { return HI_MPI_CIPHER_GetRandomNumber(pu32RandomNumber, -1); } #endif HI_S32 HI_UNF_CIPHER_ConfigHandle(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl) { return HI_MPI_CIPHER_ConfigHandle(hCipher, pstCtrl); } HI_S32 HI_UNF_CIPHER_Encrypt(HI_HANDLE hCipher, HI_U32 u32SrcPhyAddr, HI_U32 u32DestPhyAddr, HI_U32 u32ByteLength) { return HI_MPI_CIPHER_Encrypt(hCipher, u32SrcPhyAddr, u32DestPhyAddr, u32ByteLength); } HI_S32 HI_UNF_CIPHER_Decrypt(HI_HANDLE hCipher, HI_U32 u32SrcPhyAddr, HI_U32 u32DestPhyAddr, HI_U32 u32ByteLength) { return HI_MPI_CIPHER_Decrypt(hCipher, u32SrcPhyAddr, u32DestPhyAddr, u32ByteLength); } HI_S32 HI_UNF_CIPHER_EncryptMulti(HI_HANDLE hCipher, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { return HI_MPI_CIPHER_EncryptMulti(hCipher, pstDataPkg, u32DataPkgNum); } HI_S32 HI_UNF_CIPHER_DecryptMulti(HI_HANDLE hCipher, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { return HI_MPI_CIPHER_DecryptMulti(hCipher, pstDataPkg, u32DataPkgNum); } HI_S32 HI_UNF_CIPHER_EncryptMultiEx(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { return HI_MPI_CIPHER_EncryptMultiEx(hCipher, pstCtrl, pstDataPkg, u32DataPkgNum); } HI_S32 HI_UNF_CIPHER_DecryptMultiEx(HI_HANDLE hCipher, HI_UNF_CIPHER_CTRL_S* pstCtrl, HI_UNF_CIPHER_DATA_S *pstDataPkg, HI_U32 u32DataPkgNum) { return HI_MPI_CIPHER_DecryptMultiEx(hCipher, pstCtrl, pstDataPkg, u32DataPkgNum); } HI_S32 HI_UNF_CIPHER_GetTag(HI_HANDLE hCipher, HI_U8 *pstTag) { return HI_MPI_CIPHER_GetTag(hCipher, pstTag); } HI_S32 HI_UNF_CIPHER_GetHandleConfig(HI_HANDLE hCipherHandle, HI_UNF_CIPHER_CTRL_S* pstCtrl) { return HI_MPI_CIPHER_GetHandleConfig(hCipherHandle, pstCtrl); } #endif #ifdef CIPHER_KLAD_SUPPORT HI_S32 HI_UNF_CIPHER_KladEncryptKey(HI_UNF_CIPHER_KEY_SRC_E enRootKey, HI_UNF_CIPHER_KLAD_TARGET_E enTarget, HI_U8 *pu8CleanKey, HI_U8* pu8EcnryptKey, HI_U32 u32KeyLen) { return HI_MPI_CIPHER_KladEncryptKey(enRootKey, enTarget, pu8CleanKey, pu8EcnryptKey, u32KeyLen); } #endif #ifdef CIPHER_HASH_SUPPORT HI_S32 HI_UNF_CIPHER_HashInit(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_HANDLE *pHashHandle) { return HI_MPI_CIPHER_HashInit(pstHashAttr, pHashHandle); } HI_S32 HI_UNF_CIPHER_HashUpdate(HI_HANDLE hHashHandle, HI_U8 *pu8InputData, HI_U32 u32InputDataLen) { return HI_MPI_CIPHER_HashUpdate(hHashHandle, pu8InputData, u32InputDataLen); } HI_S32 HI_UNF_CIPHER_HashFinal(HI_HANDLE hHashHandle, HI_U8 *pu8OutputHash) { return HI_MPI_CIPHER_HashFinal(hHashHandle, pu8OutputHash); } HI_S32 HI_UNF_CIPHER_Hash(HI_UNF_CIPHER_HASH_ATTS_S *pstHashAttr, HI_U32 u32DataPhyAddr, HI_U32 u32ByteLength, HI_U8 *pu8OutputHash) { return HI_MPI_CIPHER_Hash(pstHashAttr, u32DataPhyAddr, u32ByteLength, pu8OutputHash); } #endif #ifdef CIPHER_RSA_SUPPORT HI_S32 HI_UNF_CIPHER_RsaPublicEnc(HI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaEnc, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { return HI_MPI_CIPHER_RsaPublicEnc(pstRsaEnc, pu8Input, u32InLen, pu8Output, pu32OutLen); } HI_S32 HI_UNF_CIPHER_RsaPrivateDec(HI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaDec, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { return HI_MPI_CIPHER_RsaPrivateDec(pstRsaDec, pu8Input, u32InLen, pu8Output, pu32OutLen); } HI_S32 HI_UNF_CIPHER_RsaSign(HI_UNF_CIPHER_RSA_SIGN_S *pstRsaSign, HI_U8 *pu8InData, HI_U32 u32InDataLen, HI_U8 *pu8HashData, HI_U8 *pu8OutSign, HI_U32 *pu32OutSignLen) { return HI_MPI_CIPHER_RsaSign(pstRsaSign, pu8InData, u32InDataLen, pu8HashData, pu8OutSign, pu32OutSignLen); } HI_S32 HI_UNF_CIPHER_RsaVerify(HI_UNF_CIPHER_RSA_VERIFY_S *pstRsaVerify, HI_U8 *pu8InData, HI_U32 u32InDataLen, HI_U8 *pu8HashData, HI_U8 *pu8InSign, HI_U32 u32InSignLen) { return HI_MPI_CIPHER_RsaVerify(pstRsaVerify, pu8InData, u32InDataLen, pu8HashData, pu8InSign, u32InSignLen); } HI_S32 HI_UNF_CIPHER_RsaPrivateEnc(HI_UNF_CIPHER_RSA_PRI_ENC_S *pstRsaEnc, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { return HI_MPI_CIPHER_RsaPrivateEnc(pstRsaEnc, pu8Input, u32InLen, pu8Output, pu32OutLen); } HI_S32 HI_UNF_CIPHER_RsaPublicDec(HI_UNF_CIPHER_RSA_PUB_ENC_S *pstRsaDec, HI_U8 *pu8Input, HI_U32 u32InLen, HI_U8 *pu8Output, HI_U32 *pu32OutLen) { return HI_MPI_CIPHER_RsaPublicDec(pstRsaDec, pu8Input, u32InLen, pu8Output,pu32OutLen); } HI_S32 HI_UNF_CIPHER_RsaGenKey(HI_U32 u32NumBits, HI_U32 u32Exponent, HI_UNF_CIPHER_RSA_PRI_KEY_S *pstRsaPriKey) { return HI_MPI_CIPHER_RsaGenKey(u32NumBits, u32Exponent, pstRsaPriKey); } #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/adv7179/arch/hi3518e/adv7179_hal.h /* here is adv7179 arch . * * * This file defines adv7179 micro-definitions for user. * * History: * 03-Mar-2016 Start of Hi351xx Digital Camera,H6 * */ #ifndef __ADV7179_HAL_H__ #define __ADV7179_HAL_H__ #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* End of #ifdef __cplusplus */ /***************I2C device num***********************/ #define ADV7179_I2C_ADAPTER_ID 1 #ifdef __cplusplus #if __cplusplus } #endif #endif /* End of #ifdef __cplusplus */ #endif /*__ADV7179_HAL_H__*/ <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/sensor_spi/sensor_spi.h #ifndef __SENSOR_SPI_H__ #define __SENSOR_SPI_H__ typedef struct hiSPI_MODULE_PARAMS_S { HI_U32 u32BusNum; HI_U32 u32csn; HI_CHAR cSensor[64]; } SPI_MODULE_PARAMS_S; int ssp_write_alt(unsigned int u32DevAddr, unsigned int u32DevAddrByteNum, unsigned int u32RegAddr, unsigned int u32RegAddrByteNum, unsigned int u32Data , unsigned int u32DataByteNum); int ssp_read_alt(unsigned char devaddr, unsigned char addr, unsigned char *data); #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/drv/interdrv/init/HuaweiLite/ir_init.c #include "hi_interdrv_param.h" #ifdef __cplusplus #if __cplusplus extern "C"{ #endif #endif /* __cplusplus */ extern int hiir_init(void); extern void hiir_exit(void); int hiir_mod_init(void *pArgs) { return hiir_init(); } void hiir_mod_exit() { hiir_exit(); } #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ <file_sep>/Hi3518E_SDK_V5.0.5.1/mpp/component/isp/firmware/init/HuaweiLite/hi_isp_param.h #ifndef __HI_ISP_MOD_PARAM__ #define __HI_ISP_MOD_PARAM__ #include "hi_type.h" typedef struct hiISP_MODULE_PARAMS_S { HI_U32 u32PwmNum; HI_U32 u32ProcParam; HI_U32 u32UpdatePos; HI_U32 u32LscUpdateMode; }ISP_MODULE_PARAMS_S; #endif <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/wifi_project/sample/sdio_hi1131sv100/mcu_uart/hi_ext_hal_mcu.h /****************************************************************************** Copyright (C), 2015-2035, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name: hi_ext_hal_ext.h Version: Initial Draft Author: Hisilicon multimedia software group Created: 2015/09/08 Description: History: modify ******************************************************************************/ #ifndef __HI_EXT_HAL_MCU_H__ #define __HI_EXT_HAL_MCU_H__ #include "hi_type.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* __cplusplus */ typedef enum hiHAL_MCUHOST_EVENT_E { MCUHOST_SYSTEMCLOSE, MCUHOST_BUTT } HAL_MCUHOST_EVENT_E; typedef HI_S32(*PFN_MCUHOST_NotifyProc)(HAL_MCUHOST_EVENT_E eMCUHOSTEVENT); /********************************************************************* Function: HI_HAL_MCUHOST_Init Description: Parameter: Return: HI_SUCCESS 成功 HI_FAILURE 打开设备失败 ********************************************************************/ HI_S32 HI_HAL_MCUHOST_Init(); /********************************************************************* Function: HI_HAL_MCUHOST_Deinit Description: Parameter: Return: HI_SUCCESS 成功 HI_FAILURE 打开设备失败 ********************************************************************/ HI_S32 HI_HAL_MCUHOST_Deinit(); /********************************************************************* Function: HI_HAL_MCUHOST_RegisterNotifyProc Description: Parameter: Return: HI_SUCCESS 成功 HI_FAILURE 打开设备失败 ********************************************************************/ HI_S32 HI_HAL_MCUHOST_RegisterNotifyProc(PFN_MCUHOST_NotifyProc pfnNotifyProc); /********************************************************************* Function: HI_HAL_MCUHOST_RegOn_Control Description: Parameter: Return: HI_SUCCESS 成功 HI_FAILURE 打开设备失败 ********************************************************************/ HI_S32 HI_HAL_MCUHOST_RegOn_Control(HI_CHAR u8enable); /********************************************************************* Function: HI_HAL_MCUHOST_RegOn_Control Description: Parameter: Return: HI_SUCCESS 成功 HI_FAILURE 打开设备失败 ********************************************************************/ HI_S32 HI_HAL_MCUHOST_PowreOff_Request(); /********************************************************************* Function: HI_HAL_MCUHOST_Set_ShutDown_Interval Description: Parameter: Return: HI_SUCCESS 成功 HI_FAILURE 打开设备失败 ********************************************************************/ HI_S32 HI_HAL_MCUHOST_Set_ShutDown_Interval(HI_U32 u32Interval); #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ #endif /* __HI_EXT_HAL_MCU_H__ */ <file_sep>/Hi3518E_SDK_V5.0.5.1/wifi/mcu/hi3518ev200/stm8l15x_dvs/adc.h #ifndef __ADC_H #define __ADC_H uint16_t ADC_GetBatVal(); void ADC_Init_adc0(); void ADC_Deinit_adc0(); uint16_t ADC_GetBatVal_ori(); #endif<file_sep>/Hi3518E_SDK_V5.0.5.1/drv/extdrv/tlv320aic31/Makefile ifeq ($(EXTDRV_PARAM_FILE), ) EXTDRV_PARAM_FILE:=../Makefile.param include $(EXTDRV_PARAM_FILE) endif #ifeq ($(CONFIG_GPIO_I2C),y) # EXTRA_CFLAGS += -DHI_GPIO_I2C # EXTRA_CFLAGS+=-I$(PWD)/../gpio-i2c-ex #else # EXTRA_CFLAGS += -DHI_I2C # EXTRA_CFLAGS+=-I$(PWD)/../hi_i2c #endif #SRCS = $(wildcard *.c) SRCS := tlv320aic31.c INC := -I$(REL_INC) INC += -I$(OSAL_ROOT)/linux/kernel/himedia INC += -I$(OSAL_ROOT)/include INC += -I$(DRV_ROOT)/extdrv/$(EXTDRVVER)/tlv320aic31/arch/$(ARCH_DIR)/ ifeq ($(CONFIG_GPIO_I2C),y) INC += -DHI_GPIO_I2C INC+=-I$(PWD)/../gpio-i2c-ex else INC += -DHI_I2C INC+=-I$(PWD)/../hi_i2c endif EXTDRV_CFLAGS += $(INC) #************************************************************************* TARGET := hi_tlv320aic31 #************************************************************************* # compile linux or HuaweiLite include $(PWD)/../Make.$(OSTYPE)
59aea7f2604c9a02971ea2a06b2f88e2a1101124
[ "Text", "C", "Makefile", "Shell" ]
81
C
x-falcon/liteos_18e_1
ae13559770d6a0a508f3e76fe23c08a1fd7f99df
4ef232992149587c940f0b7eb428b79ed969bde1
refs/heads/master
<file_sep>#include <Keypad.h> //Keypad Bibliothek einbinden int state=0; char P1='1';char P2='2';char P3='3';char P4='4'; //Zahlen des Codes eingeben char C1,C2,C3,C4; //Code wird gespeichert const byte COLS=4; //4 Spalten const byte ROWS=4; //4 Reihen int z1=0,z2,z3,z4; //Variablen zum Freischalten des Codes char hexakeys[ROWS][COLS]={ {'D', '#', '0', '*'}, {'C', '9', '8', '7'}, {'B', '6', '5', '4'}, {'A', '3', '2', '1'} }; byte colPins[COLS]={2,3,4,5}; //Definition der Pins für die 4 Spalten byte rowPins[ROWS]={6,7,8,9}; //Definition der Pins für die 4 Reihen char Taste; //Variable für die gedrückte taste Keypad mykeypad=Keypad(makeKeymap(hexakeys),rowPins, colPins,ROWS,COLS); //keypad wird mit mykeypad angesprochen void setup() { Serial.begin(9600); //Beginn serielle Kommunikation } void loop() { if(Serial.available()>0){ //Wenn Daten empfangen werden state=Serial.read(); //Daten auslesen } Anfang: // Hierher wird mit goto gesprungen Taste = mykeypad.getKey(); //gedrückte Taste auslesen if (Taste) //Wenn eine Taste gedrückt wurde... { if (Taste=='*') // Wenn die "*" Taste gedrückt wurde ist der Automat gesperrt { delay(3000); //Drei Sekunden warten z1=0; z2=1; z3=1; z4=1; // Zugang zur ersten Zeicheneingabe freischalten goto Anfang; } if (Taste=='#') // Wenn die Rautetaste gedrückt wurde... { if (C1==P1&&C2==P2&&C3==P3&&C4==P4) //Eingegebenen Code überprüfen { Serial.write('x'); //Wenn Code richtig, x Senden } else // ist das nicht der Fall... { Serial.write('y'); //y senden z1=0; z2=1; z3=1; z4=1; // Der Zugang für die erste Zeicheneingabe wird wieder freigeschaltet goto Anfang; } } // Ab hier werden die Zeichen an der richtigen Position gespeichert if (z1==0) // Wenn das erste Zeichen noch nicht gespeichert wurde... { C1=Taste; z1=1; z2=0; z3=1; z4=1; // Zugang zur zweiten Zeicheneingabe freischalten goto Anfang; } if (z2==0) // Wenn das zweite Zeichen noch nicht gespeichert wurde... { C2=Taste; z1=1; z2=1; z3=0; z4=1; // Zugang zur dritten Zeicheneingabe freischalten goto Anfang; } if (z3==0) // Wenn das dritte Zeichen noch nicht gespeichert wurde... { C3=Taste; z1=1; z2=1; z3=1; z4=0; // Zugang zur vierten Zeicheneingabe freischalten goto Anfang; } if (z4==0) // Wenn das vierte Zeichen noch nicht gespeichert wurde... { C4=Taste; z1=1; z2=1; z3=1; z4=1; // Zugang zur weiteren Zeicheneingabe sperren } } } <file_sep>#include <Stepper.h> //Schrittmotor Bibliothek #include <Servo.h> //Servo Bibliothek Servo servoklappe; //Servo mit servoklappe ansprechen const int stepsPerRevolution = 200; //Schritte des Steppers pro Umdrehung int state = 0; int richtungA =12; //Richtung Motor A an Pin 12 int pwmA =3; //Geschwindigkeit Motor A an Pin 3 int bremseA =9; //Bremse Motor A an Pin 9 int richtungB =13; //Richtung Motor B an Pin 13 int pwmB =11; //Geschwindigkeit Motor B an Pin 11 int bremseB =8; //Bremse Motor B an Pin 8 int geschwindigkeit =255; //Maximalgeschwindigkeit Stepper myStepper(stepsPerRevolution,12,13); //Stepper Library auf //Pin 12 und 13 initialisieren void setup() { Serial.begin(9600); //serielle Kommunikation starten servoklappe.attach(6); //Servo an Pin 6 servoklappe.write(180); //Servo auf 180 Grad stellen pinMode(richtungA, OUTPUT); //Richtung A als Output pinMode(richtungB, OUTPUT); //Richtung B als Output pinMode(bremseA, OUTPUT); //Bremse A als Output pinMode(bremseB, OUTPUT); //Bremse B als Output pinMode(pwmA,OUTPUT); //pwmA als Output digitalWrite(pwmA, HIGH); //pwmA auf High setzen pinMode(pwmA,OUTPUT); //pwmB als Output digitalWrite(pwmB, HIGH); //pwmB auf High setzen myStepper.setSpeed(40); //Geschwindigkeit des Steppers festlegen digitalWrite(bremseA, HIGH); //Motor A aus digitalWrite(bremseB, HIGH); } void loop() { if(Serial.available()>0) //Wenn Daten empfangen werden { state=Serial.read(); //Daten auslesen Serial.write(state); //Status schreiben } if (state == 'x') //wenn x empfangen wird { digitalWrite(bremseA, LOW); //Motor A aus digitalWrite(bremseB, LOW); delay(1000); //Eine Sekunde warten myStepper.step(60); //Stepper 60 Schritte vor digitalWrite(bremseA, HIGH); //Motor A aus digitalWrite(bremseB, HIGH); delay(1500); //1500ms warten servoklappe.write(80); //Servo auf 80 Grad delay(4000); //Vier Sekunden warten servoklappe.write(180); //Servo auf 180 Grad state = 0; } else if (state == 'y') //Wenn y empfangen wird { digitalWrite(bremseA, HIGH); //Motor aus digitalWrite(bremseB, HIGH); state=0; } }
6ad6a32bcbfeac44fb0989a99b9997f6ce8eaacf
[ "C++" ]
2
C++
der-aumueller/schokotresor
91c3728c72477e785de8812b12558ae5cf8fa8a3
40f45d9ded4181e3c3ef63650f483c09d7864487
refs/heads/master
<repo_name>thebrightshade/practice_pandas<file_sep>/practice.py import pdb from os.path import isfile, join from os import listdir import pandas as pd list_of_files = [] for file in listdir('./data'): if isfile(join('./data', file)): list_of_files.append(file) for item in list_of_files: item_name = item.split('.')[0].lower() exec( "{} = {} ".format( item_name, "pd.read_csv('data/{}'.format(item), index_col=0, header=None, names=['Value','Age'])")) exec("{}_dict = {}.T.to_dict()".format(item_name, item_name)) def get_adults(df): adults = 0 minors = 0 for item in df.index: if df.loc[item]['Age'] >= 18: adults = adults + 1 elif df.loc[item]['Age'] < 18: minors = minors + 1 return adults, minors pdb.set_trace()
345717943f52b3e6ef5206c75c88887bc2afb251
[ "Python" ]
1
Python
thebrightshade/practice_pandas
11f3e7d2970c13a5aa81cfdcd7cfa476df72ec74
6049fb7a433edcd926860108268cfee911c16291
refs/heads/master
<file_sep>package net.franckbenault.bdd.price; import java.util.HashMap; import java.util.Map; public class CoffeeShop { Map<String,Integer> prices; int orderPrice; public CoffeeShop(Map<String,Integer> newPrices) { prices = new HashMap<String, Integer>(); prices.putAll(newPrices); } public void order(String product, int quantity) { Integer productPrice = prices.get(product); if(productPrice!=null) { orderPrice += productPrice*quantity; } } public int getOrderPrice() { return orderPrice; } } <file_sep>package net.franckbenault.bdd.price; import cucumber.api.DataTable; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import static org.testng.Assert.assertTrue; import java.util.HashMap; import java.util.List; import java.util.Map; public class SimplePriceStepdefs { CoffeeShop shop; @Given("^the price list for a coffee shop$") public void shouldGiveThePriceListForACoffeeShop(DataTable dtPrices) throws Throwable { Map<String, Integer> prices = new HashMap<>(); for(List<String> aprice : dtPrices.raw()) { prices.put(aprice.get(0), Integer.valueOf(aprice.get(1))); } shop = new CoffeeShop(prices); } @When("^I order (\\d+) \"([^\"]*)\"$") public void shouldOrder(int quantity, String product) throws Throwable { shop.order(product, quantity); } @Then("^should I pay (\\d+)$") public void shouldPay(int expectedValue) throws Throwable { assertTrue(shop.getOrderPrice()==expectedValue); } } <file_sep># BDD-Examples example of BDD (Behavior Driven Development ## List of main BDD frameworks in Java World I am taking in account only the frameworks based on Java language. ### list of active frameworks * Cucumber-jvm * JBehave * Concordion * JGiven * Serenity BDD ### list of dead project * JDave (2011) * Easyb (2014) ## Cucumber-jvm Cucumber can be consider as the reference framework for BDD. Cucumber is not limited in Java but exists in a lot of language. The java version is called Cucumber-jvm. Cucumber-jvm works both with JUnit and TestNG. Cucumber-jvm has a plugin Eclipse. The scenario is written in plain text. ## JBehave JBehave has a plugin Eclipse. ## Concordion Concordion works well with JUnit. But it does not work with testNG. With Concordion the scenario is written in HTML or in md files. ## JGiven JGiven works both with JUnit and TestNG. With JGiven, the scenario is not written but generated from the java code. ## Frameworks comparison Framework | First version | Language | JUnit and TestNG integration | Eclipse integration ------------ | ------------- | ----------------------------------- | -----------------------------|-------------------- Cucumber-jvm | 2012 | plain test (Gherkin syntaxe) + java | JUnit + TestNG | Yes JBehave | 2008 | | | Yes Concordion | 2008 | Html or md + java | JUnit only | ? JGiven | 2014 | java only | JUnit + TestNG | ? Serenity BDD | 2015 | | | ? <file_sep>package net.franckbenault.bdd.splitting; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import static org.junit.Assert.assertEquals; public class SplittingStepdefs { private String fullName; private FirstLastName firstLastName; @Given("^the full name \"([^\"]*)\"$") public void given_the_full_name(String fullName) { this.fullName = fullName; } @When("^this full name is broken$") public void when_the_full_name_is_broken() { firstLastName = Splitter.split(fullName); } @Then("the first name is \"([^\"]*)\"$") public void then_first_name_is(String firstName) { assertEquals(firstLastName.getFirstName(), firstName); } @Then("the last name is \"([^\"]*)\"$") public void then_last_name_is(String lastName) { if(lastName.equals("(null)")) lastName=null; assertEquals(firstLastName.getLastName(), lastName); } } <file_sep># Splitting Names To help personalise our mailshots we want to have the first name and last name of the customer. Unfortunately the customer data that we are supplied only contains full names. The system therefore attempts to break a supplied full name into its constituents by splitting around whitespace. ### [Example - basic](- "basic") The full name [<NAME>](- "#name") is [broken](- "#firstLastName = split(#name)") into first name [Jane](- "?=#firstLastName.firstName") and last name [Smith](- "?=#firstLastName.lastName"). ### [Example - no last name](- "no last name") The full name [Sting](- "#name") is [broken](- "#firstLastName = split(#name)") into first name [Sting](- "?=#firstLastName.firstName") and last name is [(null)] (- "?=#firstLastName.lastName"). ### [Example - with title](- "with title") The full name [<NAME>](- "#name") is [broken](- "#firstLastName = split(#name)") into first name [Bob](- "?=#firstLastName.firstName") and last name is [Geldof] (- "?=#firstLastName.lastName"). ### [Example - with long last name](- "with long last name") The full name [<NAME>](- "#name") is [broken](- "#firstLastName = split(#name)") into first name [Maria](- "?=#firstLastName.firstName") and last name is [de los Santos] (- "?=#firstLastName.lastName"). ### [Example - Given when then](- "Given when then") Given The full name [<NAME>](- "#name") When this full name is [broken](- "#firstLastName = split(#name)") Then the first name is [Jose] (- "?=#firstLastName.firstName") And the last name is [de la grande Pina] (- "?=#firstLastName.lastName").<file_sep>package net.franckbenault.bdd.splitting; public class Splitter { public static FirstLastName split(String fullName) { String[] words = fullName.split(" ",2); if(isTitle(words[0])) { words = words[1].split(" ",2); } if(words.length>1) { return new FirstLastName(words[0], words[1]); } else { return new FirstLastName(words[0], null); } } private static boolean isTitle(String input) { if ("Sir".equals(input)) { return true; } return false; } } <file_sep>package net.franckbenault.bdd.search; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions( plugin = {"json:target/cucumber-search.json","html:target/cucumber-search"}) public class RunCukesTest { }<file_sep>package net.franckbenault.bdd.price; import cucumber.api.CucumberOptions; import cucumber.api.testng.AbstractTestNGCucumberTests; @CucumberOptions( plugin = {"json:target/cucumber-price.json","html:target/cucumber-price"}) public class RunCukesTest extends AbstractTestNGCucumberTests { }
6e665d273e42f5e4cf7744ec03f40724979fee4f
[ "Markdown", "Java" ]
8
Java
SammyThige/BDD-Examples
a73b841be7b23c6d27043ab04d6b1dd26d1681b1
2c95c5ad126c97ccf15cb5983307051c5287e7a2
refs/heads/master
<repo_name>SYJ0905/Sort-Vue<file_sep>/js/sort.js var app = new Vue({ el: '#app', data: { data: [ { name: '巧呼呼蘇打水', price: 30, expiryDate: 90 }, { name: '心驚膽跳羊肉飯', price: 65, expiryDate: 2 }, { name: '郭師傅武功麵包', price: 32, expiryDate: 1 }, { name: '不太會過期的新鮮牛奶', price: 75, expiryDate: 600 }, { name: '金殺 巧粒粒', price: 120, expiryDate: 200 } ], // 點擊後是否反轉icon用 reverse: false, // 確認點擊時的字串候顯示icon sortTitle: '' }, // 請在此撰寫 JavaScript computed: { sortData: function () { var vm = this; // 先顯示全部資料 // if (this.sortTitle == ''){ // return this.data; // } // 以上code 不寫 ,一開始也能顯示未排序陣列內容 if (this.reverse == true) { // 排序: 小 > 大 return this.data.sort(function (a, b) { return a[vm.sortTitle] - b[vm.sortTitle]; }); } else if (this.reverse == false) { // 排序: 大 > 小 return this.data.sort(function (a, b) { return b[vm.sortTitle] - a[vm.sortTitle]; }); } } } });
c80f7e82324343346f180199ec29417fbc842732
[ "JavaScript" ]
1
JavaScript
SYJ0905/Sort-Vue
4dc0882cdec9c3c4fa814f47b2ca4c1115a23631
b38ca9ef0ced001254fb8196d72006734876b6c0
refs/heads/master
<file_sep>import { Component, OnInit, Input } from '@angular/core'; import { Recepie } from '../recepie.model'; import { RecepieServices } from 'src/app/shared/services/recepie.service'; import { ActivatedRoute, Params } from '@angular/router'; @Component({ selector: 'app-recepie-details', templateUrl: 'recepie-details.component.html', styleUrls: ['recepie-details.component.css'] }) export class RecepieDetailsComponent implements OnInit { itemDisplay: Recepie; constructor(private recepieService: RecepieServices, private route: ActivatedRoute) { } addToCart() { this.recepieService.addToCart(this.itemDisplay.ingList); } ngOnInit(): void { this.route.params.subscribe((param: Params) => { this.itemDisplay = this.recepieService.getRecepie(+param['id']); }); } } <file_sep>import { Component, OnInit } from '@angular/core'; import { Ingredients } from './ingredients.model'; import { IngredientsServices } from '../shared/services/ingredients.service'; @Component({ selector: 'app-shopping-list', templateUrl: './shopping-list.component.html', styleUrls: ['./shopping-list.component.css'] }) export class ShoppingListComponent implements OnInit { ingredients: Ingredients[]; constructor(private ingredientService: IngredientsServices) { } ngOnInit() { this.ingredients = this.ingredientService.getIngredients(); this.ingredientService.ingredientChangeEvent .subscribe((ingArr: Ingredients[]) => { this.ingredients = ingArr; }); } } <file_sep>import { Component, OnInit, ViewChild, ElementRef, Output, EventEmitter } from '@angular/core'; import { Ingredients } from '../ingredients.model'; import { IngredientsServices } from 'src/app/shared/services/ingredients.service'; @Component({ selector: 'app-shopping-edit', templateUrl: './shopping-edit.component.html', styleUrls: ['./shopping-edit.component.css'] }) export class ShoppingEditComponent implements OnInit { @ViewChild('name', {static: false}) name: ElementRef; @ViewChild('amt', {static: false}) amt: ElementRef; @Output() itemAdded = new EventEmitter<Ingredients>(); constructor(private ingredientService: IngredientsServices) { } onAddItem() { if (this.name.nativeElement.value && this.amt.nativeElement.value) { const newIngredient = new Ingredients(this.name.nativeElement.value, this.amt.nativeElement.value); // this.itemAdded.emit(newIngredient); this.ingredientService.onAddItem(newIngredient); } else { alert('Enter Name and Amount'); } } ngOnInit() { } } <file_sep>import { Component, OnInit } from '@angular/core'; import { Recepie } from '../recepie.model'; import { RecepieServices } from 'src/app/shared/services/recepie.service'; @Component({ selector: 'app-recepie-list', templateUrl: 'recepie-list.component.html', styleUrls: ['recepie-list.component.css'] }) export class RecepieListComponent implements OnInit { recepies: Recepie[]; constructor(private recepieService: RecepieServices) { } ngOnInit(): void { this.recepies = this.recepieService.getRecepies(); } } <file_sep>import { Ingredients } from 'src/app/shopping-list/ingredients.model'; import { EventEmitter } from '@angular/core'; export class IngredientsServices { ingredients: Ingredients[] = [ new Ingredients('Bun', 2), new Ingredients('Butter', 1) ]; ingredientChangeEvent = new EventEmitter<Ingredients[]>(); getIngredients() { return this.ingredients.slice(); } onAddItem(ingredient: Ingredients) { this.ingredients.push(ingredient); this.ingredientChangeEvent.emit(this.ingredients.slice()); } constructor() { } } <file_sep># Angular Tutorial A repository to practice [Angular](https://angular.io/). ### Applications - **receipe app** from [Angular 8 - The Complete Guide](https://www.udemy.com/course/the-complete-guide-to-angular-2/). <file_sep>import { Recepie } from 'src/app/recepies/recepie.model'; import { EventEmitter, Injectable } from '@angular/core'; import { Ingredients } from 'src/app/shopping-list/ingredients.model'; import { IngredientsServices } from './ingredients.service'; @Injectable() export class RecepieServices { private recepies: Recepie[] = [ new Recepie('Burger', 'A tasty li\'l Burger', 'https://www.seriouseats.com/assets_c/2015/07/20150702-sous-vide-hamburger-anova-16-thumb-1500xauto-424812.jpg', [ new Ingredients('Bun', 2), new Ingredients('Butter', 1) ]), new Recepie('Pizza', 'Yummy Black Olive pizza', 'https://www.seriouseats.com/assets_c/2015/07/20150702-sous-vide-hamburger-anova-16-thumb-1500xauto-424812.jpg', [ new Ingredients('Pizza Base', 1), new Ingredients('Butter', 2) ]) ]; getRecepies() { return this.recepies.slice(); } getRecepie(index: number) { return this.recepies.slice()[index]; } addToCart(ingList: Ingredients[]) { ingList.forEach((ing: Ingredients) => { this.ingredientService.onAddItem(ing); }); } constructor(private ingredientService: IngredientsServices) { } } <file_sep>import { Ingredients } from '../shopping-list/ingredients.model'; export class Recepie { constructor(public name: string, public desc: string, public imgUrl: string, public ingList: Ingredients[]) { } }
61da7359e7dddf7230076706058bf97217584ffe
[ "Markdown", "TypeScript" ]
8
TypeScript
salif-04/angular-tutorial
fa7896e500479a1cff83a59e9371f3e9182fa2fb
a8181edbdb95a76dfdba1e0543a97f2a064b5f40
refs/heads/master
<repo_name>KalaxWar/RandoTroll<file_sep>/application/views/Organisation/Ajout_Commission.php <div class='col-sm-5' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"><?php echo form_open('Administrateur_Organisation/Gestion_Benevoles'); // j'ouvre mon form ?> <h2 align='center' class='TextBlanc'><b>Ajouter une commission</b></h2><br> <p align='center'> <label for="txtCommission"><span class='textBlanc'>Nom de la commission à ajouter: *</span></label> <input type="text" name='txtCommission' class='form-control' required><br> <input type='submit' name='submitAjout' value='Ajouter' class='btn btn-warning'> </p> </form> </div></div></div></section><file_sep>/application/controllers/Recapitulatif.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Recapitulatif extends CI_Controller { public function index() { } public function TableauDeBord() { $Lesparcours['LesParcours'] = $this->ModeleUtilisateur->GetParcours(); foreach ($Lesparcours['LesParcours'] as $UnParcour) { $km = $UnParcour['KILOMETRAGE']; $NombreEquipeParParcours['NBEquipe'] = $this->ModeleUtilisateur->GetNombreEquipeInscrite($Utilisateur = array('ANNEE' =>date('Y'),'NOPARCOURS' => $UnParcour['NOPARCOURS'])); $NombreEquipeParParcours['kms'] = $UnParcour['KILOMETRAGE']; $Donnee[$km] = $NombreEquipeParParcours; //------------------------------------------------- $date= $this->session->AnneeEnCours['DATECOURSE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $an = $an - $this->session->AnneeEnCours['LIMITEAGE']; $NombreParticipantAdulteParParcours['NBparticipantAdultes'] = $this->ModeleUtilisateur->GetNombreParticipantAdulteInscrit($Utilisateur = array('ANNEE' =>date('Y'),'NOPARCOURS' => $UnParcour['NOPARCOURS'],'DATE'=> $an.'-'.$mois.'-'.$jour)); $NombreParticipantAdulteParParcours['kms'] = $UnParcour['KILOMETRAGE']; array_push($Donnee[$km],$NombreParticipantAdulteParParcours['NBparticipantAdultes']); //------------------------------------------------- $NombreParticipantEnfantParParcours['NBparticipantEnfants'] = $this->ModeleUtilisateur->GetNombreParticipantEnfantInscrit($Utilisateur = array('ANNEE' =>date('Y'),'NOPARCOURS' => $UnParcour['NOPARCOURS'],'DATE'=> $an.'-'.$mois.'-'.$jour)); $NombreParticipantEnfantParParcours['kms'] = $UnParcour['KILOMETRAGE']; array_push($Donnee[$km],$NombreParticipantEnfantParParcours['NBparticipantEnfants']); //------------------------------------------------ $Montant = $this->ModeleUtilisateur->getTotalEncaisse($Utilisateur = array('ANNEE' =>date('Y'))); $TotalEncaisse = $Montant['MONTANTPAYE'] - $Montant['MONTANTREMBOURSE']; //------------------------------------------------ array_push($Donnee[$km],$UnParcour['NBDEPARTICIPANTSMAXI']); } $tout['Lesparcours'] = $Donnee; $NombreRepasAdultes = $this->ModeleUtilisateur->GetRepasAdultes($Utilisateur = array('ANNEE' =>date('Y'),'DATE'=> $an.'-'.$mois.'-'.$jour)); //------------------------------------------------ $NombreRepasEnfants = $this->ModeleUtilisateur->GetRepasEnfants($Utilisateur = array('ANNEE' =>date('Y'),'DATE'=> $an.'-'.$mois.'-'.$jour)); $tout['NombreRepasAdultes'] = $NombreRepasAdultes; $tout['NombreRepasEnfants'] = $NombreRepasEnfants; $tout['TotalEncaisse'] = $TotalEncaisse; $this->load->view('Template/EnTete'); if ($this->session->profil == 'inscription') { $this->load->view('Inscription/DonneeFixe'); } if ($this->session->profil == 'organisation') { $this->load->view('Organisation/DonneeFixe'); } $this->load->view('Recapitulatif/TableauDeBord',$tout); } public function AffectationVague() { $this->load->view('Template/EnTete'); if ($this->session->profil == 'inscription') { $this->load->view('Inscription/DonneeFixe'); } if ($this->session->profil == 'organisation') { $this->load->view('Organisation/DonneeFixe'); } $Données['LesEquipes'] = $this->ModeleUtilisateur->GetEquipeValide(); $this->load->view('Recapitulatif/AffectationVague',$Données); if($this->input->post('submit')) { $noequipe = 0; foreach ($Données['LesEquipes'] as $UneEquipe) { if ($UneEquipe['NOEQUIPE'] <> $noequipe) { $noequipe = $UneEquipe['NOEQUIPE']; $this->ModeleUtilisateur->UpdateChoisir($choisir = array('ANNEE' =>date('Y'),'NOEQUIPE' => $noequipe,'VAGUE' =>$this->input->post($noequipe))); } } redirect('Recapitulatif/AffectationVague'); } } } ?><file_sep>/application/views/Inscription/ticket.php <?php $pdf = new CI_FPDF('L','mm','A3'); $NOEQUIPE = null; $i = 0; $x = 30; $y = 55; $j = 0; $numéroTicket = 0; foreach ($LesEquipes as $UneEquipe) { if ($UneEquipe['NOEQUIPE'] !=$NOEQUIPE || $i == 12) { $NOEQUIPE == $UneEquipe['NOEQUIPE']; $i = 0; $x = 30; $y = 55; $j = 0; $pdf->AddPage(); $pdf->SetFont('Times','B',20); $pdf->Cell(140); $pdf->Cell(230,10,iconv("UTF-8", "ISO-8859-1", "Planche de ticket pour l'équipe \"".$UneEquipe['NOMEQUIPE']."\"")); $pdf->Ln(15); } $NOEQUIPE = $UneEquipe['NOEQUIPE']; $numéroTicket++; $i++; $pdf->SetFont('Times','B',15); if ($UneEquipe['REPASSURPLACE'] == 1) { $REPAS = 'REPAS SUR PLACE'; } else { $REPAS = 'PAS DE REPAS'; } $pdf->TourneTexte(0,$x-15,$y-20,iconv("UTF-8", "ISO-8859-1",$numéroTicket)); $pdf->cell(95,75,iconv("UTF-8", "ISO-8859-1",$UneEquipe['NOM']." ".$UneEquipe['PRENOM']." ".$UneEquipe['DATEDENAISSANCE']),1,0,'C'); $pdf->TourneTexte(0,$x,$y-10,iconv("UTF-8", "ISO-8859-1",'TICKET PERSONNEL')); $pdf->TourneTexte(0,$x,$y,iconv("UTF-8", "ISO-8859-1",$REPAS)); $CHEMINIMAGEAFFICHETTE = $this->session->AnneeEnCours['CHEMINIMAGEAFFICHETTE']; $cheminImage = img_url($CHEMINIMAGEAFFICHETTE); $pdf->Image($cheminImage,$x,$y+15,50,20); $pdf->Cell(3); $x += 100; if ($i == ($j+4)) { $j = $i; $y += 78; $x = 30; $pdf->Ln(80); } } $pdf->Output(); ?> <file_sep>/application/controllers/Administrateur_Organisation.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Administrateur_Organisation extends CI_Controller { public function __construct() { parent::__construct(); if (!($this->session->profil == 'organisation' || $this->session->profil == 'super')) // 0 : statut visiteur { redirect('Visiteur'); // pas les droits : redirection vers connexion } } public function index() { $this->load->view('Template/EnTete'); $this->load->view('Organisation/DonneeFixe'); } public function Gestion_Contributeur() { $this->load->view('Template/EnTete'); $this->load->view('Organisation/DonneeFixe'); $LesContributeurs['LesContributeurs'] = $this->ModeleUtilisateur->GetContributeur(); $this->load->view('Organisation/Recherche_Contributeur',$LesContributeurs); if($this->input->post('submit')) { $UnContributeur = $this->ModeleUtilisateur->GetWhereContributeur($Utilisateur = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); $UnContributeur['sponso'] = $this->ModeleUtilisateur->GetWhereApporteurDesSponsors($Utilisateur = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); $UnContributeur['bene'] = $this->ModeleUtilisateur->GetWhereBenevole($Utilisateur = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); $this->load->view('Organisation/Gestion_Contributeur',$UnContributeur); } else { $this->load->view('Organisation/Gestion_Contributeur'); } if($this->input->post('submitForm')) { if ($this->input->post('txtTelPortable') == '') { $telport = null;} else {$telport = $this->input->post('txtTelPortable');} if ($this->input->post('txtTelFixe') == '') { $telfixe = null;} else {$telfixe = $this->input->post('txtTelFixe');} if ($this->input->post('txtAdresse') == '') { $adresse = null;} else {$adresse = $this->input->post('txtAdresse');} if ($this->input->post('txtCP') == '') { $cp = null;} else {$cp = $this->input->post('txtCP');} if ($this->input->post('txtVille') == '') { $ville = null;} else {$ville = $this->input->post('txtVille');} $UnContributeur = array ( 'NOM' => $this->input->post('txtNom'), 'PRENOM' => $this->input->post('txtPrenom'), 'EMAIL' => $this->input->post('txtMail'), 'TELPORTABLE' => $telport, 'TELFIXE' => $telfixe, 'ADRESSE' => $adresse, 'CODEPOSTAL' => $cp, 'VILLE' => $ville ); $NoContributeur = $this->ModeleUtilisateur->AddContributeur($UnContributeur); if ($this->input->post('Sponso')) { $this->ModeleUtilisateur->AddApporteurDesSponsors($arrayName = array('NOCONTRIBUTEUR' =>$NoContributeur)); } if ($this->input->post('Bene')) { $this->ModeleUtilisateur->AddBenevole($arrayName = array('NOCONTRIBUTEUR' =>$NoContributeur)); } redirect('Administrateur_Organisation/Gestion_Contributeur'); } if($this->input->post('submitModif')) { if ($this->input->post('txtTelPortable') == '') { $telport = null;} else {$telport = $this->input->post('txtTelPortable');} if ($this->input->post('txtTelFixe') == '') { $telfixe = null;} else {$telfixe = $this->input->post('txtTelFixe');} if ($this->input->post('txtAdresse') == '') { $adresse = null;} else {$adresse = $this->input->post('txtAdresse');} if ($this->input->post('txtCP') == '') { $cp = null;} else {$cp = $this->input->post('txtCP');} if ($this->input->post('txtVille') == '') { $ville = null;} else {$ville = $this->input->post('txtVille');} $LeContributeur = array ( 'NOCONTRIBUTEUR' => $this->input->post('nocontributeur'), 'NOM' => $this->input->post('txtNom'), 'PRENOM' => $this->input->post('txtPrenom'), 'EMAIL' => $this->input->post('txtMail'), 'TELPORTABLE' => $telport, 'TELFIXE' => $telfixe, 'ADRESSE' => $adresse, 'CODEPOSTAL' => $cp, 'VILLE' => $ville ); $this->ModeleUtilisateur->UpdateContributeur($LeContributeur); $UnContributeur['sponso'] = $this->ModeleUtilisateur->GetWhereApporteurDesSponsors($Utilisateur = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); $UnContributeur['bene'] = $this->ModeleUtilisateur->GetWhereBenevole($Utilisateur = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); if (!(isset($UnContributeur['sponso']))) { if ($this->input->post('Sponso')) { $this->ModeleUtilisateur->AddApporteurDesSponsors($arrayName = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); } } if (!(isset($UnContributeur['bene']))) { if ($this->input->post('Bene')) { $this->ModeleUtilisateur->AddBenevole($arrayName = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); } } redirect('Administrateur_Organisation/Gestion_Contributeur'); } } public function Gestion_Benevoles() { $this->load->view('Template/EnTete'); $this->load->view('Organisation/DonneeFixe'); $LesBénévoles['LesBénévoles'] = $this->ModeleUtilisateur->GetBenevole(); $this->load->view('Organisation/Recherche_Benevoles',$LesBénévoles); $this->load->view('Organisation/Ajout_Commission'); $Donnée['LesCommissions'] = $this->ModeleUtilisateur->GetCommission(); $Donnée['Participer']=$this->ModeleUtilisateur->GetParticiper(); $this->load->view('Organisation/Benevoles_Commis',$Donnée); if($this->input->post('submitRecherche')) { $Commission['personne'] = $this->ModeleUtilisateur->GetWhereContributeur($Utilisateur = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); $Commission['LesCommissionsPasInscrit'] = $this->ModeleUtilisateur->GetWhereCommission($this->input->post('nocontributeur')); $Commission['LesCommissionsInscrit'] = $this->ModeleUtilisateur->GetWhereBenevoleCommis($this->input->post('nocontributeur')); $this->load->view('Organisation/Selection_Commission',$Commission); } if($this->input->post('submitAjout')) { $this->ModeleUtilisateur->AddBenevoleCommission($Commission = array('LIBELLE' => $this->input->post('txtCommission'))); redirect('Administrateur_Organisation/Gestion_Benevoles'); } } public function Gestion_Sponsor() { $this->load->view('Template/EnTete'); $this->load->view('Organisation/DonneeFixe'); $LesSponsors['LesSponsors'] = $this->ModeleUtilisateur->GetSponsor(); $LesSponsors['LesContributeurs'] = $this->ModeleUtilisateur->GetApporteurDesSponsors(); $this->load->view('Organisation/Recherche_Sponsor',$LesSponsors); if($this->input->post('submitRecherche')) { $LesSponsors['LeSponso'] = $this->ModeleUtilisateur->GetWhereSponsor($this->input->post('nosponsor')); $LesSponsors['LeContributeur'] = $this->ModeleUtilisateur->GetWhereApporter($this->input->post('nosponsor')); $LesSponsors['Contribution'] = $this->ModeleUtilisateur->GetWhereContribuer($this->input->post('nosponsor')); $this->load->view('Organisation/Contribution_Sponsor',$LesSponsors); $this->load->view('Organisation/Ajout_Sponsor',$LesSponsors); } else { $this->load->view('Organisation/Ajout_Sponsor',$LesSponsors); } if($this->input->post('SubmitContribution')) { $Montant = $this->ModeleUtilisateur->GetWhereContribuer($this->input->post('nosponsor')); if (!(empty($Montant))) { $this->ModeleUtilisateur->UpdateContribuer($arrayName = array('NOSPONSOR' =>$this->input->post('nosponsor'),'ANNEE' => date('Y'),'MONTANT'=>$this->input->post('txtMontant'))); } else { $this->ModeleUtilisateur->AddContribuer($arrayName = array('NOSPONSOR' =>$this->input->post('nosponsor'),'ANNEE' => date('Y'),'MONTANT'=>$this->input->post('txtMontant'))); } } if($this->input->post('submitForm')) { if ($this->input->post('txtMail') == '') { $mail = null;} else {$mail = $this->input->post('txtMail');} if ($this->input->post('txtTelPortable') == '') { $telport = null;} else {$telport = $this->input->post('txtTelPortable');} if ($this->input->post('txtTelFixe') == '') { $telfixe = null;} else {$telfixe = $this->input->post('txtTelFixe');} if ($this->input->post('txtAdresse') == '') { $adresse = null;} else {$adresse = $this->input->post('txtAdresse');} if ($this->input->post('txtCP') == '') { $cp = null;} else {$cp = $this->input->post('txtCP');} if ($this->input->post('txtVille') == '') { $ville = null;} else {$ville = $this->input->post('txtVille');} $Sponsor = array ( 'NOM' => $this->input->post('txtNom'), 'MAILCONTACT' => $mail, 'TELPORTABLECONTACT' => $telport, 'TELFIXE' => $telfixe, 'ADRESSE' => $adresse, 'CODEPOSTAL' => $cp, 'VILLE' => $ville ); $idSponsor = $this->ModeleUtilisateur->AddSponsor($Sponsor); if ($this->input->post('nocontributeur')) { $this->ModeleUtilisateur->AddApporter($arrayName = array('NOCONTRIBUTEUR' => $this->input->post('nocontributeur'),'NOSPONSOR'=>$idSponsor)); } redirect('Administrateur_Organisation/Gestion_Sponsor'); } if($this->input->post('submitModif')) { if ($this->input->post('txtMail') == '') { $mail = null;} else {$mail = $this->input->post('txtMail');} if ($this->input->post('txtTelPortable') == '') { $telport = null;} else {$telport = $this->input->post('txtTelPortable');} if ($this->input->post('txtTelFixe') == '') { $telfixe = null;} else {$telfixe = $this->input->post('txtTelFixe');} if ($this->input->post('txtAdresse') == '') { $adresse = null;} else {$adresse = $this->input->post('txtAdresse');} if ($this->input->post('txtCP') == '') { $cp = null;} else {$cp = $this->input->post('txtCP');} if ($this->input->post('txtVille') == '') { $ville = null;} else {$ville = $this->input->post('txtVille');} $Sponsor = array ( 'NOSPONSOR' => $this->input->post('nosponsor'), 'NOM' => $this->input->post('txtNom'), 'MAILCONTACT' => $mail, 'TELPORTABLECONTACT' => $telport, 'TELFIXE' => $telfixe, 'ADRESSE' => $adresse, 'CODEPOSTAL' => $cp, 'VILLE' => $ville ); $this->ModeleUtilisateur->UpdateSponsor($Sponsor); $Apporter = $this->ModeleUtilisateur->GetWhereApporter($this->input->post('nosponsor')); if ($this->input->post('nocontributeur')) { if (!(empty($Apporter))) { $this->ModeleUtilisateur->UpdateApporter($arrayName = array('NOCONTRIBUTEUR' => $this->input->post('nocontributeur'),'NOSPONSOR'=>$this->input->post('nosponsor'))); } else { $this->ModeleUtilisateur->AddApporter($arrayName = array('NOCONTRIBUTEUR' => $this->input->post('nocontributeur'),'NOSPONSOR'=>$this->input->post('nosponsor'))); } } redirect('Administrateur_Organisation/Gestion_Sponsor'); } } public function Ajout_Participer_Commission($commission,$contributeur) { $this->ModeleUtilisateur->AddParticiper($Participer = array('ANNEE' => date('Y'),'NOCOMMISSION'=>$commission,'NOCONTRIBUTEUR'=>$contributeur)); redirect('Administrateur_Organisation/Gestion_Benevoles'); } public function Supprimer_Participer_Commission($commission,$contributeur) { $this->ModeleUtilisateur->DeleteParticiper($Participer = array('ANNEE' => date('Y'),'NOCOMMISSION'=>$commission,'NOCONTRIBUTEUR'=>$contributeur)); redirect('Administrateur_Organisation/Gestion_Benevoles'); } public function Mailing_Remerciements() { $this->load->view('Template/EnTete'); $this->load->view('Organisation/DonneeFixe'); $this->load->view('Organisation/Mailing_Remerciements'); if($this->input->post('submit')) { $LesSponsors = $this->ModeleUtilisateur->GetSponsorAnneeEnCours(); //---- Envoye des mails a tout les randonneurs foreach ($LesSponsors as $UnSponsor) { if ($UnSponsor['MAILCONTACT']) { $this->load->library('email'); $this->email->from('<EMAIL>', 'L\'<NAME>'); $this->email->to($UnSponsor['MAILCONTACT']); $this->email->subject($this->input->post('txtObject')); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) { $this->email->print_debugger(); } } } } } public function Mailing_Tout_Les_Sponsors() { $this->load->view('Template/EnTete'); $this->load->view('Organisation/DonneeFixe'); $this->load->view('Organisation/Mailing_Tout_Les_Sponsors'); if($this->input->post('submit')) { $LesSponsors = $this->ModeleUtilisateur->GetSponsors(); //---- Envoye des mails a tout les randonneurs foreach ($LesSponsors as $UnSponsor) { if ($UnSponsor['MAILCONTACT']) { $this->load->library('email'); $this->email->from('<EMAIL>', 'L\'<NAME>'); $this->email->to($UnSponsor['MAILCONTACT']); $this->email->subject($this->input->post('txtObject')); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) { $this->email->print_debugger(); } } } } } } ?><file_sep>/application/controllers/Super_Administrateur.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Super_Administrateur extends CI_Controller { public function __construct() { parent::__construct(); { if (!($this->session->profil == 'super')) // 0 : statut visiteur { redirect('Visiteur'); // pas les droits : redirection vers connexion } } } public function index() { $this->load->view('Template/EnTete'); $this->load->view('super/DonneeFixe'); } public function Gestion_annee() { $this->load->view('Template/EnTete'); $this->load->view('super/DonneeFixe'); $Annee = $this->ModeleUtilisateur->GetAnnee($arrayName = array('annee' => date('Y'))); if (empty($Annee)) { $this->load->view('super/Gestion_annee'); if($this->input->post('submitForm')) { if ($this->input->post('txtCheminPdf') == '') { $CheminPdf = null;} else {$CheminPdf = $this->input->post('txtCheminPdf');} if ($this->input->post('txtCheminAffiche') == '') { $CheminAffiche = null;} else {$CheminAffiche = $this->input->post('txtCheminAffiche');} if ($this->input->post('txtCheminAffichette') == '') { $CheminAffichette = null;} else {$CheminAffichette = $this->input->post('txtCheminAffichette');} $Annee = array ( 'ANNEE' => '2018', 'DATECOURSE' => $this->input->post('DateCourse'), 'LIMITEAGE' => $this->input->post('txtLimiteAge'), 'TARIFINSCRIPTIONADULTE' => $this->input->post('txtInscriA'), 'TARIFINSCRIPTIONENFANT' => $this->input->post('txtInscriE'), 'TARIFREPASENFANT' => $this->input->post('txtRepasA'), 'TARIFREPASADULTE' => $this->input->post('txtRepasE'), 'MAXPARTICIPANTS' => $this->input->post('txtParticipantMax'), 'MAXPAREQUIPE' => $this->input->post('txtMaxParEquipe'), 'DATECLOTUREINSCRIPTION' => $this->input->post('DateCloture'), 'MAILORGANISATION' => $this->input->post('txtMail'), 'CHEMINPDFLIVRET' => $CheminPdf, 'CHEMINIMAGEAFFICHE' => $CheminAffiche, 'CHEMINIMAGEAFFICHETTE' => $CheminAffichette, ); $this->ModeleUtilisateur->AddAnnee($Annee); } } else { $this->load->view('super/Gestion_annee',$Annee); if($this->input->post('submitModif')) { if ($this->input->post('txtCheminPdf') == '') { $CheminPdf = null;} else {$CheminPdf = $this->input->post('txtCheminPdf');} if ($this->input->post('txtCheminAffiche') == '') { $CheminAffiche = null;} else {$CheminAffiche = $this->input->post('txtCheminAffiche');} if ($this->input->post('txtCheminAffichette') == '') { $CheminAffichette = null;} else {$CheminAffichette = $this->input->post('txtCheminAffichette');} $Annee = array ( 'ANNEE' => '2018', 'DATECOURSE' => $this->input->post('DateCourse'), 'LIMITEAGE' => $this->input->post('txtLimiteAge'), 'TARIFINSCRIPTIONADULTE' => $this->input->post('txtInscriA'), 'TARIFINSCRIPTIONENFANT' => $this->input->post('txtInscriE'), 'TARIFREPASENFANT' => $this->input->post('txtRepasA'), 'TARIFREPASADULTE' => $this->input->post('txtRepasE'), 'MAXPARTICIPANTS' => $this->input->post('txtParticipantMax'), 'MAXPAREQUIPE' => $this->input->post('txtMaxParEquipe'), 'DATECLOTUREINSCRIPTION' => $this->input->post('DateCloture'), 'MAILORGANISATION' => $this->input->post('txtMail'), 'CHEMINPDFLIVRET' => $CheminPdf, 'CHEMINIMAGEAFFICHE' => $CheminAffiche, 'CHEMINIMAGEAFFICHETTE' => $CheminAffichette, ); $this->ModeleUtilisateur->UpdateAnnee($Annee); redirect('Super_Administrateur/Gestion_annee'); } } } public function Gestion_Droit() { $this->load->view('Template/EnTete'); $this->load->view('super/DonneeFixe'); $LesBénévoles['LesBénévoles'] = $this->ModeleUtilisateur->GetBenevole(); $this->load->view('super/Recherche_Benevoles',$LesBénévoles); if ($this->input->post('submitRecherche')) { $Administrateur = $this->ModeleUtilisateur->GetAdministrateur($arrayName = array('nocontributeur' =>$this->input->post('nocontributeur'))); $Administrateur['NOCONTRIBUTEUR']=$this->input->post('nocontributeur'); $this->load->view('super/Attribution_Droit',$Administrateur); } if ($this->input->post('submitAjout')) { $Administrateur = $this->ModeleUtilisateur->GetAdministrateur($arrayName = array('nocontributeur' =>$this->input->post('nocontributeur'))); if (!(empty($Administrateur))) { $this->ModeleUtilisateur->UpdateAdministrateur($admin = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'),'PROFIL'=>$this->input->post('Droit') )); } else{ $char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; // génération du mdp $MDP = str_shuffle($char); $MDP = substr($MDP, '0','6'); //mdp généré $this->ModeleUtilisateur->addAdministrateur($admin = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'),'MOTDEPASSE'=>$MDP,'PROFIL'=>$this->input->post('Droit') )); $LeNewAdmin=$this->ModeleUtilisateur->GetWhereContributeur($arrayName = array('NOCONTRIBUTEUR' =>$this->input->post('nocontributeur'))); $this->load->library('email'); $this->email->from('<EMAIL>', '<NAME>'); $this->email->to($LeNewAdmin['EMAIL']); $this->email->subject('Votre mot de passe'); $message = "Vous avez maintenant un compte administrateur ".$this->input->post('Droit')."! Votre mot de passe est : $MDP et votre nom d'utilisateur : ".$LeNewAdmin['EMAIL']." CDL le responsable"; $this->email->message($message); if (!$this->email->send()) { $this->email->print_debugger(); } } } } public function Retrograder($Value) { $this->ModeleUtilisateur->DeleteAdministrateur($Value); redirect('Super_Administrateur/Gestion_Droit'); } public function Mailing() { $this->load->view('Template/EnTete'); $this->load->view('super/DonneeFixe'); $this->load->view('super/Mailing'); if ($this->input->post('submit')) { if ($this->input->post('sponsor')) { if($this->input->post('qui')==1) { $LesSponsors['LesSponsors'] = $this->ModeleUtilisateur->GetEmailSponsor(1); //var_dump($LesSponsors); } else { $LesSponsors['LesSponsors'] = $this->ModeleUtilisateur->GetEmailSponsor(2); //var_dump($LesSponsors); } foreach ($LesSponsors['LesSponsors'] as $UnSponsor) { $this->load->library('email'); $this->email->from('<EMAIL>', 'L\'<NAME>'); $this->email->to($UnSponsor['MAILCONTACT']); $this->email->subject($this->input->post('txtObject')); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) // envoie au sponsor séléctionné { $this->email->print_debugger(); } } } if ($this->input->post('participant')) { if($this->input->post('qui')==1) { $LesSponsors['LesRandonneur'] = $this->ModeleUtilisateur->GetEmailRandonneur(); $LesSponsors['LesResponsable'] = $this->ModeleUtilisateur->GetEmailResponsable(); var_dump($LesSponsors); } else { $LesSponsors['LesRandonneur'] = $this->ModeleUtilisateur->GetEmailRandonneur(1); $LesSponsors['LesResponsable'] = $this->ModeleUtilisateur->GetEmailResponsable(1); var_dump($LesSponsors); } foreach ($LesSponsors['LesRandonneur'] as $UnRandonneur) { $this->load->library('email'); $this->email->from('<EMAIL>', 'L\'<NAME>'); $this->email->to($UnRandonneur['MAIL']); $this->email->subject($this->input->post('txtObject')); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) // envoie au randonneur séléctionné { $this->email->print_debugger(); } } //---------------- foreach ($LesSponsors['LesResponsable'] as $UnResponsable) { $this->load->library('email'); $this->email->from('<EMAIL>', '<NAME>'); $this->email->to($UnResponsable['MAIL']); $this->email->subject($this->input->post('txtObject')); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) // envoie au responsable séléctionné { $this->email->print_debugger(); } } } } } } ?><file_sep>/application/views/Recapitulatif/TableauDeBord.php <div class='container'> <div class='col-sm-12' > <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <ul class="nav nav-tabs nav-justified"> <h1 align='center' class='TextBlanc'><b>Tableau de bord</b></h1><br> <h3 align='center' class='TextBlanc'><b>INSCRIPTION</b></h3><br> <table class="table table-Info table-hover"> <th> </th> <?php $totalEquipe = 0; $totalParticipant = 0; $totalAdultes = 0; $totalEnfant = 0; $totalMaxParcours=0; foreach ($Lesparcours as $key => $UnParcours) { echo '<th>'.$key.'kms</th>'; //-- Calculs des sommes de chaques lignes. $totalEquipe += $UnParcours['NBEquipe']; //-- $somme = $UnParcours[0]+$UnParcours[1]; // [0] = adultes | [1] = enfants. $totalParticipant += $somme; //-- $totalAdultes += $UnParcours[0]; //-- $totalEnfant += $UnParcours[1]; //-- $totalMaxParcours += $UnParcours[2]; } echo '<th> TOTAL </th>'; //--------------------------------------- echo '<tr><td>Nombre d\'équipe inscrite et validée</td>'; foreach ($Lesparcours as $UnParcours) { $Pourcentage = round($UnParcours['NBEquipe'] * 100 / $totalEquipe); echo '<td>'.$UnParcours['NBEquipe'].' ('.$Pourcentage.' %)</td>'; } echo '<td>'.$totalEquipe.' (100%)</td>'; //---------------------------------------- echo '</tr><tr><td>Nombre de participant ADULTES</td>'; foreach ($Lesparcours as $UnParcours) { $Pourcentage = round($UnParcours[0] * 100 / $totalAdultes); echo '<td>'.$UnParcours[0].' ('.$Pourcentage.' %)</td>'; } echo '<td>'.$totalAdultes.' (100%)</td>'; //---------------------------------------- echo '</tr><tr><td>Nombre de participant ENFANTS</td>'; foreach ($Lesparcours as $UnParcours) { $Pourcentage = round($UnParcours[1] * 100 / $totalEnfant); echo '<td>'.$UnParcours[1].' ('.$Pourcentage.' %)</td>'; } echo '<td>'.$totalEnfant.' (100%)</td>'; //---------------------------------------- echo '</tr><tr><td>Nombre de participant TOTAL</td>'; foreach ($Lesparcours as $UnParcours) { $somme = $UnParcours[0]+$UnParcours[1]; // [0] = adultes | [1] = enfants. $Pourcentage = round($somme * 100 / $totalParticipant); echo '<td>'.$somme.' ('.$Pourcentage.' %)</td>'; } echo '<td>'.$totalParticipant.' (100%)</td>'; //---------------------------------------- echo '</tr><tr><td>Nombre maximum de participant</td>'; foreach ($Lesparcours as $UnParcours) { if ($UnParcours[2] == null) { echo '<td>Non définie</td>'; } else { echo '<td>'.$UnParcours[2].'</td>'; } } if ($totalMaxParcours == 0) { echo '<td>Non définie</td>'; } else { echo '<td>'.$totalMaxParcours.'</td>'; } ?> </table> <h3 align='center' class='TextBlanc'><b>REPAS</b></h3><br> <table class="table table-Info table-hover"> <th> </th><th>Nombres de repas</th><th>Nombre d'inscription</th> <tr><td>Adultes</td><td><?php echo $NombreRepasAdultes?></td><td><?php echo $totalAdultes?></td></tr> <tr><td>Enfants</td><td><?php echo $NombreRepasEnfants?></td><td><?php echo $totalEnfant?></td></tr> </table> <br><br> <h4 class='TextBlanc'><b>TOTAL encaissé : <?php echo $TotalEncaisse ?> €</b></h4><br><file_sep>/application/views/Organisation/Ajout_Sponsor.php <?php if (!(isset($LeSponso['NOM']))) {echo '</div>';}?> <div class='col-sm-5' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <script> $( function() { $.widget( "custom.combobox2", { _create: function() { this.wrapper = $( "<span>" ) .addClass( "custom-combobox2" ) .insertAfter( this.element ); this.element.hide(); this._createAutocomplete(); this._createShowAllButton(); }, _createAutocomplete: function() { var selected = this.element.children( ":selected" ), value = selected.val() ? selected.text() : ""; this.input = $( "<input>" ) .appendTo( this.wrapper ) .val( value ) .attr( "title", "" ) .addClass( "custom-combobox2-input ui-widget ui-widget-content ui-state-default ui-corner-left" ) .autocomplete({ delay: 0, minLength: 0, source: $.proxy( this, "_source" ) }) .tooltip({ classes: { "ui-tooltip": "ui-state-highlight" } }); this._on( this.input, { autocompleteselect: function( event, ui ) { ui.item.option.selected = true; this._trigger( "select", event, { item: ui.item.option }); }, autocompletechange: "_removeIfInvalid" }); }, _createShowAllButton: function() { var input = this.input, wasOpen = false; $( "<a>" ) .attr( "tabIndex", -2 ) .attr( "title", "") .tooltip() .appendTo( this.wrapper ) .button({ icons: { primary: "ui-icon-triangle-1-s" }, text: false }) .removeClass( "ui-corner-all" ) .addClass( "custom-combobox2-toggle ui-corner-right" ) .on( "mousedown", function() { wasOpen = input.autocomplete( "widget" ).is( ":visible" ); }) .on( "click", function() { input.trigger( "focus" ); // Close if already visible if ( wasOpen ) { return; } // Pass empty string as value to search for, displaying all results input.autocomplete( "search", "" ); }); }, _source: function( request, response ) { var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); response( this.element.children( "option" ).map(function() { var text = $( this ).text(); if ( this.value && ( !request.term || matcher.test(text) ) ) return { label: text, value: text, option: this }; }) ); }, _removeIfInvalid: function( event, ui ) { // Selected an item, nothing to do if ( ui.item ) { return; } // Search for a match (case-insensitive) var value = this.input.val(), valueLowerCase = value.toLowerCase(), valid = false; this.element.children( "option" ).each(function() { if ( $( this ).text().toLowerCase() === valueLowerCase ) { this.selected = valid = true; return false; } }); // Found a match, nothing to do if ( valid ) { return; } // Remove invalid value this.input .val( "" ) .attr( "title","Aucun contributeur trouvé" ) .tooltip( "open" ); this.element.val( "" ); this._delay(function() { this.input.tooltip( "close" ).attr( "title", "" ); }, 2500 ); this.input.autocomplete( "instance" ).term = ""; }, _destroy: function() { this.wrapper.remove(); this.element.show(); } }); $( "#combobox2" ).combobox(); $( "#toggle" ).on( "click", function() { $( "#combobox2" ).toggle(); }); } ); </script> <?php if (isset($LeSponso['NOM'])) {echo '<h3 align="center"><span class="textBlanc">Modifier un sponsor</span></h3>';} else { echo "<h3 align='center'><span class='textBlanc'>Créer un sponsor</span></h3>"; }?> <p class='textBlanc' align='center'>* = mention obligatoire</p> <?php echo form_open('Administrateur_Organisation/Gestion_Sponsor'); // j'ouvre mon form ?> <br> <p align='center'> <input type="hidden" name="nosponsor" <?php if (isset($LeSponso['NOSPONSOR'])) {echo 'value="'.$LeSponso['NOSPONSOR'].'"';}?>> <label for="txtNom"><span class='textBlanc'>Nom : *</span></label> <input type="text" name='txtNom' class='form-control' required <?php if (isset($LeSponso['NOM'])) {echo 'value="'.$LeSponso['NOM'].'"';}?>> <label for="txtAdresse"><span class='textBlanc'>Adresse : </span></label> <input type="text" name='txtAdresse' class='form-control' <?php if (isset($LeSponso['ADRESSE'])) {echo 'value="'.$LeSponso['ADRESSE'].'"';}?>> <label for="txtCP"><span class='textBlanc'>Code postal : </span></label> <input type="text" name='txtCP' class='form-control' <?php if (isset($LeSponso['CODEPOSTAL'])) {echo 'value="'.$LeSponso['CODEPOSTAL'].'"';}?>> <label for="txtVille"><span class='textBlanc'>Ville : </span></label> <input type="text" name='txtVille' class='form-control' <?php if (isset($LeSponso['VILLE'])) {echo 'value="'.$LeSponso['VILLE'].'"';}?>> <label for="txtTelPortable"><span class='textBlanc'>Numéro de téléphone Portable : </span></label> <input type="text" name='txtTelPortable' class='form-control' <?php if (isset($LeSponso['TELPORTABLE'])) {echo 'value="'.$LeSponso['TELPORTABLE'].'"';}?>> <label for="txtTelFixe"><span class='textBlanc'>Numéro de téléphone fixe: </span></label> <input type="text" name='txtTelFixe' class='form-control' <?php if (isset($LeSponso['TELFIXE'])) {echo 'value="'.$LeSponso['TELFIXE'].'"';}?>> <label for="txtMail"><span class='textBlanc'>Email : </span></label> <input type="text" name='txtMail' class='form-control' pattern='^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$' <?php if (isset($LeSponso['EMAIL'])) {echo 'value="'.$LeSponso['EMAIL'].'"';}?>> <br> <label for="nocontributeur"><span class='textBlanc'>Séléctionner un contributeur : </span></label> <select id="combobox2" name='nocontributeur'> <option value="">Selectionne un...</option> <?php foreach ($LesContributeurs as $UnContributeur) { echo '<option value="'.$UnContributeur['NOCONTRIBUTEUR'].'" '; if ($LeContributeur['NOCONTRIBUTEUR']==$UnContributeur['NOCONTRIBUTEUR']) { echo 'selected'; } echo '>'.$UnContributeur['NOM'].' '.$UnContributeur['PRENOM'].'</option>'; } ?> </select> <br><br> <?php if (isset($LeSponso['NOM'])) {echo "<input type='submit' name='submitModif' value='Envoi' class='btn btn-primary'>";} else {echo "<input type='submit' name='submitForm' value='Envoi' class='btn btn-primary'>";}?> </p> </form> </div></div></section><file_sep>/application/views/BoiteAlerte.php <script type="text/javascript"> alert("<?php echo $Value;?>") </script> <file_sep>/application/views/Inscription/qrcode.php <?php echo '<img src="'.base_url().'test.png" />';?><file_sep>/application/views/Inscription/Relance.php <div class='col-sm-12' > <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h2 align='center' class='TextBlanc'><b>Impayés</b></h2><br> <?php echo form_open('Administrateur_Inscription/Relance'); echo '<p>écriver le contenu du mail ici puis valider :</p>'; $data = array( 'type' => 'textarea', 'name' => "email", 'class' => 'form-control', 'rows' => '5', 'placeholder' => "Ecriver le contenu de votre mail ici", ); echo form_textarea($data); ?> <pre>il manque la somme de : *** €. Attention la date de cloture des inscription est le <?php echo $datefin; ?>. Cordialement, l'équipe RANDOTROLL.</pre> <input type='submit' name='submit' class='btn btn-primary' value ="Envoyer toutes les relances"> <br><br><table class="table table-Info table-hover"> <th>Nom de l'équipe</th> <th>adultes</th><th> repas adultes</th> <th>enfants</th><th> repas enfants</th> <th>Prix total</th> <th>Manque a payer</th> <?php foreach ($LesEquipes as $UneEquipe) { echo '<tr><td>'.$UneEquipe['NomEquipe'].'</td><td>'.$UneEquipe['NBAdultesInscri'].'</td><td>'.$UneEquipe['NBrepasAdulte'].'</td><td>'.$UneEquipe['NBEnfantsInscri'].'</td><td>'.$UneEquipe['NBrepasEnfant'].'</td><td>'.$UneEquipe['PrixTotal'].' €</td><td class=TextBlanc><b>'.$UneEquipe['Manque'].' €</b></td></tr>'; } ?> </table><file_sep>/application/views/Responsable/modifierMDP.php <div class="col-sm-3" style=""> </div> <div class='col-sm-6' style="background-color:#FDBA23;"> <h2 align='center'>Paramètre du compte</h2> <br> <p align='center'>Vous pouvez changer vos informations personnelle ici</p> <script> function confirmMDPasse() { var mdp = document.getElementById("txtMdp").value; var confirmMdp = document.getElementById("txtMdpConfirm").value; if(mdp == confirmMdp) { return true; } else{ alert('Les Champs doivent être identique'); document.getElementById("txtMdp").value = ""; document.getElementById("txtMdpConfirm").value = ""; document.getElementById("txtMdp").focus(); return false; } } </script> <?php //echo form_open('Visiteur/inscription','class="form-horizontal" name="form"'); // j'ouvre mon form echo '<form onsubmit="return confirmMDPasse()" action="'.site_url('Responsable/MonCompte/1').'" method="post">'; ?> <label for="txtMdp"><span class='textBlanc'>Mot de passe :</span></label> <input type="password" name='txtMdp' id='txtMdp' class='form-control' required> <label for="txtMdpConfirm"><span class='textBlanc'>Confirmer le mot de passe : </span></label> <input type="password" name='txtMdpConfirm' id='txtMdpConfirm'class='form-control' required><br> <p align='center'><input type="submit" name='submit' value='Modifier' class='btn btn-primary'></p><file_sep>/application/models/modeleUtilisateur.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class ModeleUtilisateur extends CI_Model { public function __construct() { $this->load->database(); /* chargement database.php (dans config), obligatoirement dans le constructeur */ } public function GetConnexionVisiteur($Value) { $this->db->select('*'); if (isset($Value['mail'])) { $this->db->where('MAIL', $Value['mail']); } if (isset($Value['mdp'])) { $this->db->where('MOTDEPASSE', $Value['mdp']); } if (isset($Value['noparticipant'])) { $this->db->where('participant.NOPARTICIPANT', $Value['noparticipant']); } $this->db->join('participant', 'participant.NOPARTICIPANT = responsable.NOPARTICIPANT'); $this->db->join('equipe', 'equipe.NOPAR_RESPONSABLE = participant.NOPARTICIPANT'); if (!(isset($Value['Inscription']))) //sert uniquement lors de la requete d'inscritption (pour pas écrire la jointure qui suit) { $this->db->join('membrede', 'participant.NOPARTICIPANT = membrede.NOPARTICIPANT'); } $requete = $this->db->get('responsable'); return $requete->row_array(); } public function VerifMailResponsable($Value) { $this->db->select('*'); $this->db->from('responsable'); if (isset($Value['noparticipant'])) { $this->db->where_not_in('NOPARTICIPANT', $Value['noparticipant']); } $this->db->where('MAIL', $Value['mail']); return $this->db->count_all_results(); } public function VerifNomEquipe($Value) { $this->db->select('*'); $this->db->from('equipe'); if (isset($Value['noequipe'])) { $this->db->where_not_in('NOEQUIPE', $Value['noequipe']); } $this->db->where('NOMEQUIPE', $Value['nomequipe']); return $this->db->count_all_results(); } public function getRandonneur($Value) { $requete = $this->db->get_where('randonneur', $Value); return $requete->result_array(); } public function AddParticipant($Value) { $this->db->insert('participant', $Value); return $this->db->insert_id(); } public function AddResponsable($Value) { $this->db->insert('responsable', $Value); } public function getParticipant($Value) { $requete = $this->db->get_where('participant',$Value); return $requete->row_array(); } public function AddEquipe($Value) { $this->db->insert('equipe', $Value); } public function AddMembreDe($Value) { $this->db->insert('membrede', $Value); } public function GetMembreEquipe($Value) { $this->db->select('*'); if (isset($Value['noequipe'])) //si en paramètre il y a noequipe { $this->db->where('membrede.NOEQUIPE', $Value['noequipe']); } if (isset($Value['annee'])) //si en paramètre il y a annee { $this->db->where('ANNEE', $Value['annee']); } if (isset($Value['noparticipant'])) //si en paramètre il y a noparticipant { $this->db->where('participant.NOPARTICIPANT', $Value['noparticipant']); } $this->db->join('randonneur', 'participant.NOPARTICIPANT = randonneur.NOPARTICIPANT','left'); $this->db->join('membrede', 'participant.NOPARTICIPANT = membrede.NOPARTICIPANT'); $requete = $this->db->get('participant'); return $requete->result_array(); } public function AddRandonneur($Value) { $this->db->insert('randonneur', $Value); } public function UpdateRandonneur($Value) { $this->db->where('NOPARTICIPANT', $Value['NOPARTICIPANT']); $this->db->update('randonneur', $Value); } public function UpdateResponsable($Value) { $this->db->where('NOPARTICIPANT', $Value['NOPARTICIPANT']); $this->db->update('responsable', $Value); } public function UpdateParticipant($Value) { $this->db->where('NOPARTICIPANT', $Value['NOPARTICIPANT']); $this->db->update('participant', $Value); } public function UpdateMembreDe($Value) { $this->db->where('NOPARTICIPANT', $Value['NOPARTICIPANT']); $this->db->update('membrede', $Value); } public function UpdateEquipe($Value) { $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); $this->db->update('equipe', $Value); } public function DeleteParticipant($Value) { $tables = array('membrede','randonneur','participant'); $this->db->where('NOPARTICIPANT', $Value); $this->db->delete($tables); } public function GetParcours() { $requete = $this->db->get('parcours'); return $requete->result_array(); } public function GetAnnee($Value) { $this->db->where('ANNEE', $Value['annee']); $requete = $this->db->get('annee'); return $requete->row_array(); } public function AddChoisir($Value) { $this->db->insert('choisir', $Value); } public function GetChoisir($Value) { $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); $this->db->where('ANNEE', $Value['ANNEE']); $requete = $this->db->get('choisir'); return $requete->row_array(); } public function AddSinscrire($Value) { $this->db->insert('sinscrire', $Value); } public function UpdateChoisir($Value) { $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); $this->db->where('ANNEE', $Value['ANNEE']); $this->db->update('choisir', $Value); } public function GetAdulteEquipe($Value) { $this->db->select('*'); $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); $this->db->where('DATEDENAISSANCE <', $Value['DATE']); $requete = $this->db->get('participant'); return $requete->result_array(); } public function GetEnfantEquipe($Value) { $this->db->select('*'); $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); $this->db->where('DATEDENAISSANCE >', $Value['DATE']); $requete = $this->db->get('participant'); return $requete->result_array(); } public function GetAdministrateur($Value) { $this->db->select('*'); if (isset($Value['email'])) { $this->db->where('EMAIL', $Value['email']); $this->db->where('MOTDEPASSE', $Value['mdp']); } if (isset($Value['nocontributeur'])) { $this->db->where('benevole.NOCONTRIBUTEUR', $Value['nocontributeur']); } $this->db->join('benevole', 'benevole.NOCONTRIBUTEUR = contributeur.NOCONTRIBUTEUR'); $this->db->join('administrateur', 'benevole.NOCONTRIBUTEUR = administrateur.NOCONTRIBUTEUR'); $requete = $this->db->get('contributeur'); return $requete->row_array(); } public function GetInscription($Value) { $requete = $this->db->get_where('sinscrire',$Value); return $requete->result_array(); } public function GetWhereEquipe($Value) { $requete = $this->db->get_where('equipe',$Value); return $requete->row_array(); } public function GetEquipeParAnnee($Value) { $this->db->select('*'); $this->db->join('equipe', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); $this->db->join('responsable', 'responsable.NOPARTICIPANT = equipe.NOPAR_RESPONSABLE'); $this->db->join('participant', 'equipe.NOPAR_RESPONSABLE = participant.NOPARTICIPANT'); $this->db->where('ANNEE', $Value['ANNEE']); if (isset($Value['NOEQUIPE'])) { $this->db->where('sinscrire.NOEQUIPE', $Value['NOEQUIPE']); } $requete = $this->db->get('sinscrire'); if (isset($Value['NOEQUIPE'])) { return $requete->row_array(); } return $requete->result_array(); } public function UpdateSinscrire($Value) { $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); $this->db->where('ANNEE', $Value['ANNEE']); $this->db->update('sinscrire', $Value); } public function GetEquipeValide() { $this->db->select('*'); $this->db->where('DATEVALIDATION <>', NULL); $this->db->where('sinscrire.ANNEE', date('Y')); $this->db->join('membrede', 'membrede.NOEQUIPE = sinscrire.NOEQUIPE'); $this->db->join('equipe', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); $this->db->join('participant', 'participant.NOPARTICIPANT = membrede.NOPARTICIPANT'); $this->db->join('choisir', 'choisir.NOEQUIPE = equipe.NOEQUIPE'); $this->db->join('parcours', 'parcours.NOPARCOURS = choisir.NOPARCOURS'); $this->db->order_by('equipe.NOEQUIPE', 'ASC'); $requete = $this->db->get('sinscrire'); return $requete->result_array(); } public function GetNombreParticipantParEquipe($Value) { $this->db->from('membrede'); $this->db->where('NOEQUIPE', $Value['NOEQUIPE']); return $this->db->count_all_results(); } public function GetNombreEquipeInscrite($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->where('parcours.NOPARCOURS', $Value['NOPARCOURS']); $this->db->where('sinscrire.DATEVALIDATION <>', null); $this->db->from('sinscrire'); $this->db->join('choisir', 'choisir.NOEQUIPE = sinscrire.NOEQUIPE'); $this->db->join('parcours', 'choisir.NOPARCOURS = parcours.NOPARCOURS'); return $this->db->count_all_results(); } /*public function GetNombreParticipantInscrit($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->where('parcours.NOPARCOURS', $Value['NOPARCOURS']); $this->db->where('sinscrire.DATEVALIDATION <>', null); $this->db->from('membrede'); $this->db->join('equipe', 'equipe.NOEQUIPE = membrede.NOEQUIPE'); $this->db->join('sinscrire', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); $this->db->join('choisir', 'choisir.NOEQUIPE = sinscrire.NOEQUIPE'); $this->db->join('parcours', 'choisir.NOPARCOURS = parcours.NOPARCOURS'); return $this->db->count_all_results(); }*/ public function GetNombreParticipantAdulteInscrit($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->where('parcours.NOPARCOURS', $Value['NOPARCOURS']); $this->db->where('sinscrire.DATEVALIDATION <>', null); $this->db->where('DATEDENAISSANCE <', $Value['DATE']); $this->db->from('participant'); $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->join('equipe', 'equipe.NOEQUIPE = membrede.NOEQUIPE'); $this->db->join('sinscrire', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); $this->db->join('choisir', 'choisir.NOEQUIPE = sinscrire.NOEQUIPE'); $this->db->join('parcours', 'choisir.NOPARCOURS = parcours.NOPARCOURS'); return $this->db->count_all_results(); } public function GetNombreParticipantEnfantInscrit($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->where('parcours.NOPARCOURS', $Value['NOPARCOURS']); $this->db->where('sinscrire.DATEVALIDATION <>', null); $this->db->where('DATEDENAISSANCE >', $Value['DATE']); $this->db->from('participant'); $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->join('equipe', 'equipe.NOEQUIPE = membrede.NOEQUIPE'); $this->db->join('sinscrire', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); $this->db->join('choisir', 'choisir.NOEQUIPE = sinscrire.NOEQUIPE'); $this->db->join('parcours', 'choisir.NOPARCOURS = parcours.NOPARCOURS'); return $this->db->count_all_results(); } public function getTotalEncaisse($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->select_sum('MONTANTPAYE'); $this->db->select_sum('MONTANTREMBOURSE'); $requete = $this->db->get('sinscrire'); return $requete->row_array(); } public function GetRepasAdultes($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->where('sinscrire.DATEVALIDATION <>', null); $this->db->where('DATEDENAISSANCE <', $Value['DATE']); $this->db->from('participant'); $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->join('equipe', 'equipe.NOEQUIPE = membrede.NOEQUIPE'); $this->db->join('sinscrire', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); return $this->db->count_all_results(); } public function GetRepasEnfants($Value) { $this->db->where('sinscrire.ANNEE', $Value['ANNEE']); $this->db->where('sinscrire.DATEVALIDATION <>', null); $this->db->where('DATEDENAISSANCE >', $Value['DATE']); $this->db->from('participant'); $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->join('equipe', 'equipe.NOEQUIPE = membrede.NOEQUIPE'); $this->db->join('sinscrire', 'sinscrire.NOEQUIPE = equipe.NOEQUIPE'); return $this->db->count_all_results(); } public function GetEmailRandonneur($Value = null) { $this->db->select('distinct (MAIL)'); $this->db->join('randonneur', 'randonneur.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->where('MAIL <>', 'NULL'); if ($Value <> null) { $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->where('ANNEE', date('Y')); } $requete = $this->db->get('participant'); return $requete->result_array(); } public function GetEmailResponsable($value = null) { $this->db->select('distinct (MAIL)'); $this->db->join('responsable', 'responsable.NOPARTICIPANT = participant.NOPARTICIPANT'); if ($Value <> null) { $this->db->join('membrede', 'membrede.NOPARTICIPANT = participant.NOPARTICIPANT'); $this->db->where('ANNEE', date('Y')); } $requete = $this->db->get('participant'); return $requete->result_array(); } public function GetContributeur() { $requete = $this->db->get('contributeur'); return $requete->result_array(); } public function GetWhereContributeur($Value) { $requete = $this->db->get_where('contributeur', $Value); return $requete->row_array(); } public function AddContributeur($Value) { $this->db->insert('contributeur', $Value); return $this->db->insert_id(); } public function AddApporteurDesSponsors($Value) { $this->db->insert('apporteurdesponsors', $Value); } public function AddBenevole($Value) { $this->db->insert('benevole', $Value); } public function UpdateContributeur($Value) { $this->db->where('NOCONTRIBUTEUR', $Value['NOCONTRIBUTEUR']); $this->db->update('contributeur', $Value); } public function GetWhereApporteurDesSponsors($Value) { $requete = $this->db->get_where('apporteurdesponsors', $Value); return $requete->row_array(); } public function GetWhereBenevole($Value) { $requete = $this->db->get_where('benevole', $Value); return $requete->row_array(); } public function GetBenevole() { $this->db->select('*'); $this->db->join('benevole', 'benevole.NOCONTRIBUTEUR = contributeur.NOCONTRIBUTEUR'); $requete = $this->db->get('contributeur'); return $requete->result_array(); } public function GetApporteurDesSponsors() { $this->db->select('*'); $this->db->join('apporteurdesponsors', 'apporteurdesponsors.NOCONTRIBUTEUR = contributeur.NOCONTRIBUTEUR'); $requete = $this->db->get('contributeur'); return $requete->result_array(); } public function AddBenevoleCommission($Value) { $this->db->insert('commission', $Value); } public function GetCommission() { $requete = $this->db->get('commission'); return $requete->result_array(); } public function GetParticiper() { $this->db->select('*'); $this->db->where('ANNEE', date('Y')); $this->db->join('benevole', 'benevole.NOCONTRIBUTEUR = contributeur.NOCONTRIBUTEUR'); $this->db->join('participer', 'participer.NOCONTRIBUTEUR = benevole.NOCONTRIBUTEUR'); $requete = $this->db->get('contributeur'); return $requete->result_array(); } public function AddParticiper($Value) { $this->db->insert('participer', $Value); } public function GetWhereCommission($Value) // A REVOIR {// A REVOIR $requete = "SELECT * from commission where nocommission not in ( SELECT commission.nocommission FROM commission,participer where commission.nocommission = participer.nocommission and nocontributeur = $Value )"; $requete = $this->db->query($requete); // A REVOIR return $requete->result_array(); // A REVOIR }// A REVOIR public function GetWhereBenevoleCommis($Value) { $this->db->where('NOCONTRIBUTEUR', $Value); $this->db->join('participer', 'participer.NOCOMMISSION = commission.NOCOMMISSION'); $requete = $this->db->get('commission'); return $requete->result_array(); } public function DeleteParticiper($Value) { $this->db->delete('participer',$Value); } public function GetSponsorAnneeEnCours() { $this->db->join('contribuer', 'contribuer.NOSPONSOR = sponsor.NOSPONSOR'); $this->db->where('ANNEE', date('Y')); $this->db->order_by('MAILCONTACT', 'ASC'); $requete = $this->db->get('sponsor'); return $requete->result_array(); } public function GetSponsor() { $requete = $this->db->get('sponsor'); return $requete->result_array(); } public function AddSponsor($Value) { $this->db->insert('sponsor', $Value); return $this->db->insert_id(); } public function AddApporter($Value) { $this->db->insert('apporter', $Value); } public function GetWhereSponsor($Value) { $this->db->where('NOSPONSOR', $Value); $requete = $this->db->get('sponsor'); return $requete->row_array(); } public function UpdateSponsor($Value) { $this->db->where('NOSPONSOR', $Value['NOSPONSOR']); $this->db->update('sponsor', $Value); } public function GetWhereApporter($Value) { $this->db->where('NOSPONSOR', $Value); $requete = $this->db->get('apporter'); return $requete->row_array(); } public function UpdateApporter($Value) { $this->db->where('NOSPONSOR', $Value['NOSPONSOR']); $this->db->update('apporter', $Value); } public function GetWhereContribuer($Value) { $this->db->where('NOSPONSOR', $Value); $this->db->where('ANNEE', date('Y')); $requete = $this->db->get('contribuer'); return $requete->row_array(); } public function AddContribuer($Value) { $this->db->insert('contribuer', $Value); } public function UpdateContribuer($Value) { $this->db->where('NOSPONSOR', $Value['NOSPONSOR']); $this->db->where('ANNEE', date('Y')); $this->db->update('contribuer', $Value); } public function AddAnnee($Value) { $this->db->insert('annee', $Value); } public function UpdateAnnee($Value) { $this->db->where('ANNEE', $Value['ANNEE']); $this->db->update('annee', $Value); } public function addAdministrateur($Value) { $this->db->insert('administrateur', $Value); } public function UpdateAdministrateur($Value) { $this->db->where('NOCONTRIBUTEUR', $Value['NOCONTRIBUTEUR']); $this->db->update('administrateur', $Value); } public function DeleteAdministrateur($Value) { $this->db->where('NOCONTRIBUTEUR', $Value); $this->db->delete('administrateur'); } public function GetEmailSponsor($Value) { $this->db->select('DISTINCT (MAILCONTACT)'); if ($Value == 1) { $this->db->join('contribuer', 'contribuer.NOSPONSOR = sponsor.NOSPONSOR'); $this->db->where('ANNEE', date('Y')); } $requete = $this->db->get('sponsor'); return $requete->result_array(); } }<file_sep>/application/views/Inscription/GestionPaiement/AffichageEquipe.php <table class="table table-Info table-hover"> <th>Nom de l'équipe</th><th>Montant payé</th> <th>Montant Remboursé</th> <th>Mode de réglement</th><th></th> <?php echo form_open('Administrateur_Inscription/GestionPaiement'); echo '<tr><td>'.$NOMEQUIPE.'</td><td>'; echo '<input class="form-control" name=txtPaye size=5 value ='; if ($MONTANTPAYE=="") { echo '0€>'; } else { echo $MONTANTPAYE.'€>'; } echo '</td><td>'; //------------------ echo '<input class="form-control" name=txtRembourse size=5 value ='; if ($MONTANTREMBOURSE=="") { echo '0€>'; } else { echo $MONTANTREMBOURSE.'€>'; } echo '</td><td>'; //--------------- echo '<select class="form-control" name=reglement>'; echo '<option value=NULL>Rien de saisie</option>'; echo '<option value="Espèce" '; if ($MODEREGLEMENT == 'Espèce') { echo 'selected>Espèce</option>'; } else { echo '>Espèce</option>'; } //------------ echo '<option value="Chèque" '; if ($MODEREGLEMENT == 'Chèque') { echo 'selected>Chèque</option>'; } else { echo '>Chèque</option>'; } //------------- if ($MODEREGLEMENT == 'Sponsort | Gratuit') { echo '<option value="Sponsort | Gratuit" selected> Sponsort | Gratuit</option>'; } ?> <input type="hidden" name="noequipe" value='<?php echo $NOEQUIPE ?>'> </td> <td><input type="submit" value='Valider' name='submit2'class="btn"></td> </tr> </table> </form> <?php echo form_open('Administrateur_Inscription/GestionPaiement'); ?> <input type="hidden" name="noequipe" value='<?php echo $NOEQUIPE ?>'> <p align='center' ><input type="submit" value="Forcer la validation de l'inscription" name='submit3'class="btn btn-success"></p><file_sep>/application/views/Responsable/InscriptionEquipe.php <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <?php echo form_open('Responsable/inscriptionEquipe','class="form-inline"'); echo '<h4 align=center><b>Inscrire l\'équipe ('.$NombreDInscrit.' membres)</b></h4>'; echo '<p align=center><select name="Parcours" class="form-control" id="Select-parcours" required>'; echo '<option selected value="">Choisissez un parcours</option>'; foreach ($LesParcours as $UnParcours) { echo '<option size="20" value="'.$UnParcours['NOPARCOURS'].'"'; if ($ParcoursChoisis['NOPARCOURS'] == $UnParcours['NOPARCOURS']) { echo 'selected'; } echo '>Parcours '.$UnParcours['KILOMETRAGE'].' kms </option>'; } echo '</select></p>'; if ($ParcoursChoisis) { echo '<p align="center"><input type="submit" class="btn btn-info" value="Changer de parcours"></p>'; } else { echo "<p align='center'><input type='submit' class='btn btn-info' value='Inscrire'></p>"; } ?> <br><br><file_sep>/application/views/Super/Gestion_annee.php <div class='container'> <div class="row"> <div class='col-sm-3' > </div> <div class='col-sm-5' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <?php echo form_open('Super_Administrateur/Gestion_annee'); // j'ouvre mon form ?> <?php if (isset($ANNEE)) {echo '<h3 align="center"><span class="textBlanc">Modifier la course de cette année</span></h3>';} else { echo "<h3 align='center'><span class='textBlanc'>Ajouter la course de cette année</span></h3>"; }?> <br> <p class='TextBlanc'><b>Année de la course : <?php echo date('Y')?></b></p> <p align='center'> <label for="DateCourse"><span class='textBlanc'>Date de course : *</span></label> <input type="date" name='DateCourse' class='form-control' required <?php if (isset($DATECOURSE)) {echo 'value="'.$DATECOURSE.'"';}?>> <label for="DateCloture"><span class='textBlanc'>Date de cloture des inscriptions *</span></label> <input type="date" name='DateCloture' class='form-control' required <?php if (isset($DATECLOTUREINSCRIPTION)) {echo 'value="'.$DATECLOTUREINSCRIPTION.'"';}?>> <label for="txtLimiteAge"><span class='textBlanc'>Limite d'âge : *</span></label> <input type="text" name='txtLimiteAge' class='form-control' required placeholder=' EX : 18' <?php if (isset($LIMITEAGE)) {echo 'value="'.$LIMITEAGE.'"';}?>> <label for="txtInscriA"><span class='textBlanc'>Tarif inscription adulte : *</span></label> <input type="text" name='txtInscriA' class='form-control' required <?php if (isset($TARIFINSCRIPTIONADULTE)) {echo 'value="'.$TARIFINSCRIPTIONADULTE.'"';}?>> <label for="txtInscriE"><span class='textBlanc'>Tarif inscription enfant : *</span></label> <input type="text" name='txtInscriE' class='form-control' required <?php if (isset($TARIFINSCRIPTIONENFANT)) {echo 'value="'.$TARIFINSCRIPTIONENFANT.'"';}?>> <label for="txtRepasA"><span class='textBlanc'>Tarif repas adulte : *</span></label> <input type="text" name='txtRepasA' class='form-control' required <?php if (isset($TARIFREPASENFANT)) {echo 'value="'.$TARIFREPASENFANT.'"';}?>> <label for="txtRepasE"><span class='textBlanc'>Tarif repas enfant : *</span></label> <input type="text" name='txtRepasE' class='form-control' required <?php if (isset($TARIFREPASADULTE)) {echo 'value="'.$TARIFREPASADULTE.'"';}?>> <label for="txtParticipantMax"><span class='textBlanc'>Participant maximum : *</span></label> <input type="text" name='txtParticipantMax' class='form-control' required <?php if (isset($MAXPARTICIPANTS)) {echo 'value="'.$MAXPARTICIPANTS.'"';}?>> <label for="txtMaxParEquipe"><span class='textBlanc'>Maximum par équipe : *</span></label> <input type="text" name='txtMaxParEquipe' class='form-control' required <?php if (isset($MAXPAREQUIPE)) {echo 'value="'.$MAXPAREQUIPE.'"';}?>> <label for="txtMail"><span class='textBlanc'>Mail organisation : *</span></label> <input type="text" name='txtMail' class='form-control' required pattern='^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$' <?php if (isset($MAILORGANISATION)) {echo 'value="'.$MAILORGANISATION.'"';}?>> <label for="txtCheminPdf"><span class='textBlanc'> </span>Chemin pdf livret :</label> <input type="text" name='txtCheminPdf' class='form-control' <?php if (isset($CHEMINPDFLIVRET)) {echo 'value="'.$CHEMINPDFLIVRET.'"';}?>> <label for="txtCheminAffiche"><span class='textBlanc'> </span>Chemin image affiche :</label> <input type="text" name='txtCheminAffiche' class='form-control' <?php if (isset($CHEMINIMAGEAFFICHE)) {echo 'value="'.$CHEMINIMAGEAFFICHE.'"';}?>> <label for="txtCheminAffichette"><span class='textBlanc'> </span>Chemin image affichette :</label> <input type="text" name='txtCheminAffichette' class='form-control' <?php if (isset($CHEMINIMAGEAFFICHETTE)) {echo 'value="'.$CHEMINIMAGEAFFICHETTE.'"';}?>> <br> <?php if (isset($ANNEE)) {echo "<input type='submit' name='submitModif' value='Modifier' class='btn btn-primary'>";} else {echo "<input type='submit' name='submitForm' value='Ajouter' class='btn btn-primary'>";}?> </p> </form><file_sep>/application/views/Inscription/AncienParticipant.php <div class='col-sm-12' > <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h2 align='center' class='TextBlanc'><b>Relance des anciens participant</b></h2><br> <?php echo form_open('Administrateur_Inscription/AncienParticipant'); echo '<p>écriver le contenu du mail ici puis valider :</p>'; $data = array( 'type' => 'textarea', 'name' => "email", 'class' => 'form-control', 'rows' => '5', 'placeholder' => "Ecriver le contenu de votre mail ici", ); echo form_textarea($data); ?> <br> <input type='submit' name='submit' class='btn btn-primary' value ="Envoyer à tout les anciens participant"> </table> <file_sep>/application/controllers/Administrateur_Inscription.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Administrateur_Inscription extends CI_Controller { public function __construct() { parent::__construct(); if (!($this->session->profil == 'super' || $this->session->profil == 'inscription')) // 0 : statut visiteur { redirect('Visiteur'); // pas les droits : redirection vers connexion } } public function index() { $this->load->view('Template/EnTete'); $this->load->view('Inscription/DonneeFixe'); } public function AncienParticipant() { $this->load->view('Template/EnTete'); $this->load->view('Inscription/DonneeFixe'); $this->load->view('Inscription/AncienParticipant'); if($this->input->post('submit')) { $LesRandonneur = $this->ModeleUtilisateur->GetEmailRandonneur(); $LesResponsable = $this->ModeleUtilisateur->GetEmailResponsable(); //---- Envoye des mails a tout les randonneurs foreach ($LesRandonneur as $UnParticipant) { $this->load->library('email'); $this->email->from('<EMAIL>', 'L\'Equipe RandoTroll'); $this->email->to($UnParticipant['MAIL']); $this->email->subject('Rappel de la course RANDOTROLL'); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) { $this->email->print_debugger(); } } //--- Envoye des mails a tout les responsables foreach ($LesResponsable as $UnParticipant) { $this->load->library('email'); $this->email->from('<EMAIL>', 'L\'Equipe RandoTroll'); $this->email->to($UnParticipant['MAIL']); $this->email->subject('Rappel de la course RANDOTROLL'); $message = $this->input->post('email'); $this->email->message($message); if (!$this->email->send()) { $this->email->print_debugger(); } } } } public function EquipePasPayer() { $this->load->view('Template/EnTete'); $this->load->view('Inscription/DonneeFixe'); $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; //je fait les 2 cathégories d'age (date de la course - la limite d'age) $date= $AnneeEnCours['DATECOURSE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $an = $an - $AnneeEnCours['LIMITEAGE']; $LesInscrits = $this->ModeleUtilisateur->GetInscription($date = array( 'annee'=> date('Y'))); foreach ($LesInscrits as $UnInscrit) { //$MembreEquipe = $this->ModeleUtilisateur->GetMembreEquipe($Utilisateur = array('noequipe' => $UnInscrit['NOEQUIPE'], 'annee'=> date('Y'))); //$UneEquipe['nom'] = $UnInscrit['NOM']; $NomEquipe = $this->ModeleUtilisateur->GetWhereEquipe($Utilisateur = array( 'noequipe'=> $UnInscrit['NOEQUIPE'])); $UneEquipe['NomEquipe'] = $NomEquipe['NOMEQUIPE']; $UneEquipe['NoEquipe'] = $NomEquipe['NOEQUIPE']; $Adultes = $this->ModeleUtilisateur->GetAdulteEquipe($Utilisateur = array('NOEQUIPE' => $UnInscrit['NOEQUIPE'], 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UneEquipe['NBAdultesInscri'] = count($Adultes); $NBrepasAdulte = 0; foreach ($Adultes as $UnAdulte) { if ($UnAdulte['REPASSURPLACE']==1) { $NBrepasAdulte++; } } $UneEquipe['NBrepasAdulte'] = $NBrepasAdulte; $Enfant = $this->ModeleUtilisateur->GetEnfantEquipe($Utilisateur = array('NOEQUIPE' => $UnInscrit['NOEQUIPE'], 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UneEquipe['NBEnfantsInscri'] = count($Enfant); $NBrepasEnfant = 0; foreach ($Enfant as $UnEnfant) { if ($UnEnfant['REPASSURPLACE']==1) { $NBrepasEnfant++; } } $UneEquipe['NBrepasEnfant'] = $NBrepasEnfant; $prixTotal = 0; $prixTotal +=$this->session->AnneeEnCours['TARIFINSCRIPTIONADULTE'] * $UneEquipe['NBAdultesInscri']; //on affiche les sous qu'ils devront $prixTotal +=$this->session->AnneeEnCours['TARIFREPASADULTE'] * $NBrepasAdulte; $prixTotal +=$this->session->AnneeEnCours['TARIFINSCRIPTIONENFANT'] * $UneEquipe['NBEnfantsInscri']; $prixTotal +=$this->session->AnneeEnCours['TARIFREPASENFANT'] * $NBrepasEnfant; $UneEquipe['PrixTotal'] = $prixTotal; $UneEquipe['MontantPaye'] = $UnInscrit['MONTANTPAYE']; if ($UnInscrit['MODEREGLEMENT'] <> 'Sponsort | Gratuit') { if (($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']) < $prixTotal) { if ($prixTotal - ($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']) > $prixTotal ) { $UneEquipe['Manque'] = $prixTotal; $LesEquipes[] = $UneEquipe; } else { $UneEquipe['Manque'] = $prixTotal - ($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']); $LesEquipes[] = $UneEquipe; } } } } if (isset($LesEquipes)) { $Equipes['LesEquipes'] = $LesEquipes; $Equipes['datefin'] = $AnneeEnCours['DATECLOTUREINSCRIPTION']; $this->load->view('Inscription/Relance', $Equipes); } else { $Value['Value'] = 'Aucune équipe car toute les équipes ont payé.'; $this->load->view('BoiteAlerte',$Value); } } public function Relance() { $this->load->view('Template/EnTete'); $this->load->view('Inscription/DonneeFixe'); if($this->input->post('submit')) { $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; //je fait les 2 cathégories d'age (date de la course - la limite d'age) $date= $AnneeEnCours['DATECOURSE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $an = $an - $AnneeEnCours['LIMITEAGE']; $LesInscrits = $this->ModeleUtilisateur->GetInscription($date = array( 'annee'=> date('Y'))); foreach ($LesInscrits as $UnInscrit) { $Equipe = $this->ModeleUtilisateur->GetWhereEquipe($Utilisateur = array( 'noequipe'=> $UnInscrit['NOEQUIPE'])); $NomEquipe = $Equipe['NOMEQUIPE']; $NoEquipe = $Equipe['NOEQUIPE']; $NoResponsable = $Equipe['NOPAR_RESPONSABLE']; $Adultes = $this->ModeleUtilisateur->GetAdulteEquipe($Utilisateur = array('NOEQUIPE' => $UnInscrit['NOEQUIPE'], 'DATE'=> $an.'/'.$mois.'/'.$jour)); $NBAdultesInscri = count($Adultes); $NBrepasAdulte = 0; foreach ($Adultes as $UnAdulte) { if ($UnAdulte['REPASSURPLACE']==1) { $NBrepasAdulte++; } } $Enfant = $this->ModeleUtilisateur->GetEnfantEquipe($Utilisateur = array('NOEQUIPE' => $UnInscrit['NOEQUIPE'], 'DATE'=> $an.'/'.$mois.'/'.$jour)); $NBEnfantsInscri = count($Enfant); $NBrepasEnfant = 0; foreach ($Enfant as $UnEnfant) { if ($UnEnfant['REPASSURPLACE']==1) { $NBrepasEnfant++; } } $prixTotal = 0; $prixTotal +=$this->session->AnneeEnCours['TARIFINSCRIPTIONADULTE'] * $NBAdultesInscri; //on affiche les sous qu'ils devront $prixTotal +=$this->session->AnneeEnCours['TARIFREPASADULTE'] * $NBrepasAdulte; $prixTotal +=$this->session->AnneeEnCours['TARIFINSCRIPTIONENFANT'] * $NBEnfantsInscri; $prixTotal +=$this->session->AnneeEnCours['TARIFREPASENFANT'] * $NBrepasEnfant; $MontantPaye = $UnInscrit['MONTANTPAYE']; $Responsable = $this->ModeleUtilisateur->GetConnexionVisiteur($Utilisateur = array('noparticipant' => $Equipe['NOPAR_RESPONSABLE'])); if ($UnInscrit['MODEREGLEMENT'] <> 'Sponsort | Gratuit') { if (($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']) < $prixTotal) { $Manque = $prixTotal - ($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']); $this->load->library('email'); $this->email->from('<EMAIL>', 'Administrateur RandoTroll'); $this->email->to($Responsable['MAIL']); $this->email->subject('Relance payemant RANDOTROLL'); $message = $this->input->post('email'); $message .= "\r\nil manque la somme de : ".$Manque." €.\r\nAttention la date de cloture des inscription est le ".$AnneeEnCours['DATECLOTUREINSCRIPTION']."\r\nCordialement, l'équipe RANDOTROLL"; $this->email->message($message); if (!$this->email->send()) { $this->email->print_debugger(); } } } } } } public function QRcode() { $this->load->view('Template/EnTete'); $this->load->view('Inscription/DonneeFixe'); $this->load->library('ciqrcode'); $params['data'] = 'toto'; $params['level'] = 'H'; $params['size'] = 10; $params['savename'] = FCPATH.'test.png'; $this->ciqrcode->generate($params); $this->load->view('Inscription/qrcode'); } public function GestionPaiement() { $this->load->view('Template/EnTete'); $this->load->view('Inscription/DonneeFixe'); $LesEquipesAnneeCourante['LesEquipes'] = $this->ModeleUtilisateur->GetEquipeParAnnee($Utilisateur = array('ANNEE' =>date('Y'))); $this->load->view('Inscription/GestionPaiement/recherche',$LesEquipesAnneeCourante); if($this->input->post('submit')) { $UneEquipe = $this->ModeleUtilisateur->GetEquipeParAnnee($Utilisateur = array('ANNEE' =>date('Y'),'NOEQUIPE' =>$this->input->post('equipe'))); $this->load->view('Inscription/GestionPaiement/AffichageEquipe', $UneEquipe); } if($this->input->post('submit2')) { $this->ModeleUtilisateur->UpdateSinscrire($Utilisateur = array('ANNEE' =>date('Y'),'NOEQUIPE' =>$this->input->post('noequipe'),'MONTANTPAYE'=>$this->input->post('txtPaye'),'MONTANTREMBOURSE' =>$this->input->post('txtRembourse'), 'MODEREGLEMENT'=>$this->input->post('reglement'))); $UneEquipe = $this->ModeleUtilisateur->GetEquipeParAnnee($Utilisateur = array('ANNEE' =>date('Y'),'NOEQUIPE' =>$this->input->post('noequipe'))); $this->load->view('Inscription/GestionPaiement/AffichageEquipe', $UneEquipe); } if($this->input->post('submit3')) { var_dump($this->input->post('noequipe')); $this->ModeleUtilisateur->UpdateSinscrire($Utilisateur = array('ANNEE' =>date('Y'),'NOEQUIPE' =>$this->input->post('noequipe'),'DATEVALIDATION' => date('Y-m-d'),'MODEREGLEMENT'=> 'Sponsort | Gratuit')); } $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; //je fait les 2 cathégories d'age (date de la course - la limite d'age) $date= $AnneeEnCours['DATECOURSE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $an = $an - $AnneeEnCours['LIMITEAGE']; $LesInscrits = $this->ModeleUtilisateur->GetInscription($date = array( 'annee'=> date('Y'))); foreach ($LesInscrits as $UnInscrit) { //$MembreEquipe = $this->ModeleUtilisateur->GetMembreEquipe($Utilisateur = array('noequipe' => $UnInscrit['NOEQUIPE'], 'annee'=> date('Y'))); //$UneEquipe['nom'] = $UnInscrit['NOM']; $NomEquipe = $this->ModeleUtilisateur->GetWhereEquipe($Utilisateur = array( 'noequipe'=> $UnInscrit['NOEQUIPE'])); $UneEquipe['NomEquipe'] = $NomEquipe['NOMEQUIPE']; $UneEquipe['NoEquipe'] = $NomEquipe['NOEQUIPE']; $Adultes = $this->ModeleUtilisateur->GetAdulteEquipe($Utilisateur = array('NOEQUIPE' => $UnInscrit['NOEQUIPE'], 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UneEquipe['NBAdultesInscri'] = count($Adultes); $NBrepasAdulte = 0; foreach ($Adultes as $UnAdulte) { if ($UnAdulte['REPASSURPLACE']==1) { $NBrepasAdulte++; } } $UneEquipe['NBrepasAdulte'] = $NBrepasAdulte; $Enfant = $this->ModeleUtilisateur->GetEnfantEquipe($Utilisateur = array('NOEQUIPE' => $UnInscrit['NOEQUIPE'], 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UneEquipe['NBEnfantsInscri'] = count($Enfant); $NBrepasEnfant = 0; foreach ($Enfant as $UnEnfant) { if ($UnEnfant['REPASSURPLACE']==1) { $NBrepasEnfant++; } } $UneEquipe['NBrepasEnfant'] = $NBrepasEnfant; $prixTotal = 0; $prixTotal +=$this->session->AnneeEnCours['TARIFINSCRIPTIONADULTE'] * $UneEquipe['NBAdultesInscri']; //on affiche les sous qu'ils devront $prixTotal +=$this->session->AnneeEnCours['TARIFREPASADULTE'] * $NBrepasAdulte; $prixTotal +=$this->session->AnneeEnCours['TARIFINSCRIPTIONENFANT'] * $UneEquipe['NBEnfantsInscri']; $prixTotal +=$this->session->AnneeEnCours['TARIFREPASENFANT'] * $NBrepasEnfant; $UneEquipe['PrixTotal'] = $prixTotal; $UneEquipe['MontantPaye'] = $UnInscrit['MONTANTPAYE']; if ($UnInscrit['MODEREGLEMENT'] <> 'Sponsort | Gratuit') { if (($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']) < $prixTotal) { if ($prixTotal - ($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']) > $prixTotal ) { $UneEquipe['Manque'] = $prixTotal; $LesEquipes[] = $UneEquipe; } else { $UneEquipe['Manque'] = $prixTotal - ($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']); $LesEquipes[] = $UneEquipe; } } if (($UnInscrit['MONTANTPAYE']-$UnInscrit['MONTANTREMBOURSE']) == $prixTotal) { $this->ModeleUtilisateur->UpdateSinscrire($Utilisateur = array('ANNEE' =>date('Y'),'NOEQUIPE' =>$UnInscrit['NOEQUIPE'],'DATEVALIDATION'=> date('Y-m-d'))); } else { $this->ModeleUtilisateur->UpdateSinscrire($Utilisateur = array('ANNEE' =>date('Y'),'NOEQUIPE' =>$UnInscrit['NOEQUIPE'],'DATEVALIDATION'=> NULL)); } } } if (isset($LesEquipes)) { $Equipes['LesEquipes'] = $LesEquipes; $Equipes['datefin'] = $AnneeEnCours['DATECLOTUREINSCRIPTION']; $this->load->view('Inscription/EquipePasPayer', $Equipes); } } public function Ticket() { define('FPDF_FONTPATH',$this->config->item('fonts_path')); $this->load->library('fpdf'); $Données['LesEquipes'] = $this->ModeleUtilisateur->GetEquipeValide(); //var_dump($Données); $this->load->view('Inscription/ticket',$Données); } } <file_sep>/application/views/Organisation/Mailing_Remerciements.php <div class='col-sm-12' > <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h2 align='center' class='textBlanc'> <b> Envoi d'email à tout les sponsors de l'année actuel (remerciements) </b></h2> <?php echo form_open('Administrateur_Organisation/Mailing_Remerciements'); echo '<p>écriver le contenu du mail ici puis valider :</p>'; echo '<label>Objet du mail: <input type="text" name="txtObject" required></label>'; echo '<textarea name="email" rows="5" placeholder="Ecriver le contenu de votre mail ici" required class="form-control"></textarea>'; ?> <br> <input type='submit' name='submit' class='btn btn-primary' value ="Envoyer à tout les sponsors de l'année en cours"> </table> <file_sep>/application/views/Super/Attribution_Droit.php <div class='col-sm-5' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"><?php echo form_open('Super_Administrateur/Gestion_Droit'); // j'ouvre mon form ?> <h2 align='center' class='TextBlanc'><b>Gestion de ses droits</b></h2><br> <p align='center'> <input type="hidden" name="nocontributeur" <?php if(isset($NOCONTRIBUTEUR)){echo "value=$NOCONTRIBUTEUR";}?>> <?php if (!(isset($PROFIL))) { $PROFIL= ""; }?> <select name="Droit" required class="form-control" id=""> <option value="">-- Choisir un droit --</option> <option value="inscription" <?php if($PROFIL == 'inscription'){echo ' selected';}?>>Administrateur inscription</option> <option value="organisation" <?php if($PROFIL == 'organisation'){echo ' selected';}?>>Administrateur organisation</option> <option value="super" <?php if($PROFIL == 'super'){echo ' selected';}?>>Super administrateur</option> </select> <br> <input type='submit' name='submitAjout' <?php if($PROFIL <> ""){echo "value='Modifier'";}else{echo "value='Ajouter'";}?> class='btn btn-warning'> <?php if(isset($PROFIL)){echo "<a href='".site_url('Super_Administrateur/Retrograder/'.$NOCONTRIBUTEUR)."' class='btn btn-danger'>Supprimer les droits</a>";}?> </p> </form> </div></div></div></section><file_sep>/application/views/Responsable/AjouterRandonneur.php </div> <div class='col-sm-3' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <?php if (isset($NOM)) { echo "<h4 align='center'><span class='textBlanc'>Modifier un randonneur</span></h4>"; } else { echo "<h4 align='center'><span class='textBlanc'>Ajouter un randonneur</span></h4>"; }?> <br> </form> <?php if (isset($DATEDENAISSANCE)) { $var = $DATEDENAISSANCE; $date = str_replace('-', '/', $var); $date = date('d-m-Y', strtotime($date)); $date = str_replace('-', '/', $date); } ?> <?php if (isset($NOM)) { echo '<form class="form-inline" action="'.site_url('Responsable/ModifierRandonneur/'.$NOPARTICIPANT).'" method="post">'; } else { echo '<form class="form-inline" action="'.site_url('Responsable/AjouterRandoneur').'" method="post">'; }?> <input type="hidden" name='Valide' value='1'> <div class="form-group"> <label for="txtNom"><span class='textBlanc'>Nom : *</span></label> <input type="text" name='txtNom' class='form-control' size='7' required <?php if (isset($NOM)) {echo 'value = '.$NOM;}?>> </div> <div class="form-group"> <label for="txtNom"><span class='textBlanc'>Prénom : *</span></label> <input type="text" name='txtPrenom' class='form-control' size='7' required <?php if (isset($PRENOM)) {echo 'value = '.$PRENOM;}?>> </div> <div class="form-group"> <label for="txtDate"><span class='textBlanc'>Date de naissance : *</span></label> <input type="text" name='txtDate' id="datepicker" placeholder='16/09/1999' class='form-control' title =" EX : 16/09/1999" required pattern='^([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})$' <?php if (isset($date)) {echo 'value = '.$date;}?>> </div> <br><br> <div class="checkbox"> <label for="sexe"><span class='textBlanc'><b>Sexe : *</b></span></label> <label><input type="radio" name="sexe" required value='H'<?php if (isset($SEXE)) { if($SEXE=='H'){echo 'checked';}}?>><span class='textBlanc'> <b>Homme</b></span></label> <label><input type="radio" name="sexe" required value='F'<?php if (isset($SEXE)) { if($SEXE=='F'){echo 'checked';}}?>><span class='textBlanc'><b>Femme </b></span></label> </div> <br><br> <div class="form-group"> <label for="txtMail"><span class='textBlanc'>Email : </span></label> <input type="text" name='txtMail' class='form-control' pattern='^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$' <?php if (isset($MAIL)) {echo 'value = '.$MAIL;}?>> </div> <div class="form-group"> <label for="txtTel"><span class='textBlanc'>Numéro de téléphone : </span></label> <input type="text" name='txtTel' class='form-control' size='7' <?php if (isset($TELPORTABLE)) {echo 'value = '.$TELPORTABLE;}?>> </div> <br><br> <div class="checkbox"> <label for="repas"><span class='textBlanc'><b>Repas sur place ? : *</b></span></label> <label><input type="radio" name="repas" value='1' required <?php if (isset($REPASSURPLACE)) { if($REPASSURPLACE==1){echo 'checked';}}?>><span class='textBlanc'><b>Oui</b></span> <label><input type="radio" name="repas" value='0' required <?php if (isset($REPASSURPLACE)) { if($REPASSURPLACE==0){echo 'checked';}}?>><span class='textBlanc'><b>Non </b></span> </div> <br><br> <?php if (isset($NOM)) { echo "<p align='center'><button type='submit' class='btn btn-success'>Modifier</button></p>"; } else { echo "<p align='center'><button type='submit' class='btn btn-primary'>Ajouter à l'équipe</button></p>"; } ?> </form> </div> </section><br><file_sep>/application/views/Responsable/Compte.php <div class="col-sm-3" style=""> </div> <div class='col-sm-6' style="background-color:#FDBA23;"> <h2 align='center'>Paramètre du compte</h2> <br> <p align='center'>Vous pouvez changer vos informations personnelle ici <br>Vous voulez modifier votre mot de passe ? cliquez ici <?php echo "<a href='".site_url('Responsable/MonCompte/1')."'><button type='submit' name='ah' class='btn btn-primary btn-xs'>Modifier le mot de passe</button></a>"?></p> <?php echo form_open('Responsable/MonCompte','class="form-horizontal"'); // j'ouvre mon form ?> <label for="txtNom"><span class='textBlanc'>Nom : *</span></label> <input type="text" name='txtNom' class='form-control' required value="<?php echo $NOM?>"> <label for="txtPrenom"><span class='textBlanc'>Prénom : *</span></label> <input type="text" name='txtPrenom' class='form-control' required value="<?php echo $PRENOM?>"> <label for="txtTel"><span class='textBlanc'>Numéro de téléphone : *</span></label> <input type="text" name='txtTel' class='form-control' required value="<?php echo $TELPORTABLE?>"> <label for="txtEquipe"><span class='textBlanc'>Nom de l'équipe : *</span></label> <input type="text" name='txtEquipe' class='form-control' required value="<?php echo $NOMEQUIPE?>"> <label for="txtMail"><span class='textBlanc'>Email : *</span></label> <input type="text" name='txtMail' class='form-control' required pattern='^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$' value="<?php echo $MAIL?>"> <br><br> <p align='center'><input type="submit" name="submit" value='Sauvegarder les informations' class='btn btn-primary'></p> </form><file_sep>/application/views/Organisation/Gestion_Contributeur.php <div class='container'> <div class='col-sm-5' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <?php if (isset($NOM)) {echo '<h3 align="center"><span class="textBlanc">Modifier un contributeur</span></h3>';} else { echo "<h3 align='center'><span class='textBlanc'>Créer un contributeur</span></h3>"; }?> <p class='textBlanc' align='center'>* = mention obligatoire</p> <?php echo form_open('Administrateur_Organisation/Gestion_Contributeur'); // j'ouvre mon form ?> <br> <p align='center'> <input type="hidden" name="nocontributeur" <?php if (isset($NOCONTRIBUTEUR)) {echo 'value="'.$NOCONTRIBUTEUR.'"';}?>> <label for="txtNom"><span class='textBlanc'>Nom : *</span></label> <input type="text" name='txtNom' class='form-control' required <?php if (isset($NOM)) {echo 'value="'.$NOM.'"';}?>> <label for="txtPrenom"><span class='textBlanc'>Prénom : *</span></label> <input type="text" name='txtPrenom' class='form-control' required <?php if (isset($PRENOM)) {echo 'value="'.$PRENOM.'"';}?>> <label for="txtMail"><span class='textBlanc'>Email : *</span></label> <input type="text" name='txtMail' class='form-control' required pattern='^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$' <?php if (isset($EMAIL)) {echo 'value="'.$EMAIL.'"';}?>> <label for="txtTelPortable"><span class='textBlanc'>Numéro de téléphone Portable : </span></label> <input type="text" name='txtTelPortable' class='form-control' <?php if (isset($TELPORTABLE)) {echo 'value="'.$TELPORTABLE.'"';}?>> <label for="txtTelFixe"><span class='textBlanc'>Numéro de téléphone fixe: </span></label> <input type="text" name='txtTelFixe' class='form-control' <?php if (isset($TELFIXE)) {echo 'value="'.$TELFIXE.'"';}?>> <label for="txtAdresse"><span class='textBlanc'>Adresse : </span></label> <input type="text" name='txtAdresse' class='form-control' <?php if (isset($ADRESSE)) {echo 'value="'.$ADRESSE.'"';}?>> <label for="txtCP"><span class='textBlanc'>Code postal : </span></label> <input type="text" name='txtCP' class='form-control' <?php if (isset($CODEPOSTAL)) {echo 'value="'.$CODEPOSTAL.'"';}?>> <label for="txtVille"><span class='textBlanc'>Ville : </span></label> <input type="text" name='txtVille' class='form-control' <?php if (isset($VILLE)) {echo 'value="'.$VILLE.'"';}?>> <br><span class='textBlanc'><b>Type : *</b></span></label> <label><input type="checkbox" name="Bene" value='B'<?php if (isset($bene['NOCONTRIBUTEUR'])) {echo 'disabled checked';}?>><span class='textBlanc'> <b>Bénévole</b></span></label> <label><input type="checkbox" name="Sponso" value='S'<?php if (isset($sponso['NOCONTRIBUTEUR'])) {echo 'disabled checked';}?>><span class='textBlanc'><b>Sponsor </b></span></label> <br><br> <?php if (isset($NOM)) {echo "<input type='submit' name='submitModif' value='Envoi' class='btn btn-primary'>";} else {echo "<input type='submit' name='submitForm' value='Envoi' class='btn btn-primary'>";}?> </p> </form> </div></div></section><file_sep>/application/views/Connexion/Inscription.php <div class="container"><br><br><br> <div class="col-sm-4"></div> <div class="col-sm-4" style="float:left;background-color:#FDBA23"> <h3 align='center'><span class='textBlanc'>Créer un compte équipe</span></h3> <p class='textBlanc' align='center'>* = mention obligatoire</p> <?php echo form_open('Visiteur/inscription'); // j'ouvre mon form ?> <!-- Fonction de Jquery --> <script> $( function() { $( "#datepicker" ).datepicker({ showOn: "button", dateFormat: 'dd/mm/yy', buttonImageOnly: false, buttonText: "Calendrier", changeMonth: true, changeYear: true, monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], monthNamesShort: ['Janv.', 'Févr.', 'Mars', 'Avril', 'Mai', 'Juin', 'Juil.', 'Août', 'Sept.', 'Oct.', 'Nov.', 'Déc.'], dayNamesMin: ['Dim.', 'Lu.', 'Ma.', 'Me.', 'Je.', 'Ve.', 'Sa.'], }); } ); </script> <!-- J'écris ensuite mon formulaire avec les contrôles de saisies --> <br> <p align='center'> <input type="hidden" name='valide' value='1'> <label for="txtNom"><span class='textBlanc'>Nom : *</span></label> <input type="text" name='txtNom' class='form-control' required> <label for="txtPrenom"><span class='textBlanc'>Prénom : *</span></label> <input type="text" name='txtPrenom' class='form-control' required> <label for="txtTel"><span class='textBlanc'>Numéro de téléphone : *</span></label> <input type="text" name='txtTel' class='form-control' required> <label for="txtDate"><span class='textBlanc'>Date de naissance : *</span></label> <input type="text" name='txtDate' id="datepicker" placeholder='16/09/1999' class='form-control' title =" EX : 16/09/1999" required pattern='^([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})$'> <br><br><span class='textBlanc'><b>Sexe : *</b></span></label> <input type="radio" name='sexe' value ='H' required><span class='textBlanc'>Homme</span> | <span class='textBlanc'>Femme</span><input type="radio" name='sexe' value ='F' required><br><br> <label for="txtEquipe"><span class='textBlanc'>Nom de l'équipe : *</span></label> <input type="text" name='txtEquipe' class='form-control' required> <label for="txtMail"><span class='textBlanc'>Email : *</span></label> <input type="text" name='txtMail' class='form-control' required pattern='^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$'> <label for="txtMdp"><span class='textBlanc'>Mot de passe : *</span></label> <input type="password" name='txtMdp' class='form-control' required> <br><br> <input type="submit" name="ok" value='Envoi' class='btn btn-primary'> </p> </form> </div></div><file_sep>/application/views/Connexion/Admin.php <div class="container"><br><br><br> <div class="col-sm-4"></div> <div class="col-sm-4" style="float:left;background-color:#FDBA23"> <h3 align='center'><span class='textBlanc'>Authentification administrateur</span></h3> <?php echo form_open('Visiteur/admin'); ?> <input type="hidden" name='valide' value='1'> <p align='center'><label for="txtLogin"><span class='textBlanc'>Email :</span></label> <input type="text" name='txtLogin' class='form-control' required> <br> <label for="txtLogin"><span class='textBlanc'>Mot de passe :</span></label> <input type="password" name='txtMdp' class='form-control' required> <br> <input type="submit" name="ok" value='Envoi' class='btn btn-primary'></p> </form> </div><file_sep>/application/views/Recapitulatif/AffectationVague.php <div class='container'> <div class='col-sm-12' > <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <table class="table table-Info table-hover"> <?php echo form_open('Recapitulatif/AffectationVague'); ?> <th>Nom</th><th>Parcours</th><th>Nombre de membre</th><th>Numéro de vague</th> <?php $noequipe = 0; foreach ($LesEquipes as $UneEquipe) { if ($UneEquipe['NOEQUIPE'] <> $noequipe) { //------------- VAGUE if ($UneEquipe['VAGUE'] <> null) { $numVague = $UneEquipe['VAGUE']; $vague[$numVague] = 0; } //------------- } } foreach ($LesEquipes as $UneEquipe) { if ($UneEquipe['NOEQUIPE'] <> $noequipe) { $noequipe = $UneEquipe['NOEQUIPE']; //------------- VAGUE $numVague = $UneEquipe['VAGUE']; if ($UneEquipe['VAGUE'] <> null) { $nbMembre = $this->ModeleUtilisateur->GetNombreParticipantParEquipe($arrayName = array('NOEQUIPE' =>$noequipe)); $vague[$numVague] += $nbMembre; } //------------- } } if (isset($vague)) { ksort($vague); echo '<p> Les effectifs par vagues sont : </p> <br>'; foreach ($vague as $key => $value) { if ($key > 0) { echo 'Vague n°'.$key.' : '.$value.'<br>'; } } echo '<br><br>'; } foreach ($LesEquipes as $UneEquipe) { if ($UneEquipe['NOEQUIPE'] <> $noequipe) { $noequipe = $UneEquipe['NOEQUIPE']; $nbMembre = $this->ModeleUtilisateur->GetNombreParticipantParEquipe($arrayName = array('NOEQUIPE' =>$noequipe)); //MAL FACON A NE PAS REPRODUIRE!!! echo '<tr><td>'.$UneEquipe['NOMEQUIPE'].'</td><td>'.$UneEquipe['KILOMETRAGE'].'</td><td>'.$nbMembre.'</td><td><input type="text" id="'.$nbMembre.'" name="'.$UneEquipe['NOEQUIPE']; if ($UneEquipe['VAGUE'] <> null) { echo '" value="'.$UneEquipe['VAGUE'].'"'; } echo '"></tr>'; } } echo '<tr><td><input type="submit" name="submit" class="btn"></td></tr>'; ?> </form> </table><file_sep>/application/controllers/Visiteur.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Visiteur extends CI_Controller { public function __construct() { parent::__construct(); $this->load->view('Template/EnTete'); } public function index() { $this->connexion(); } public function connexion() { $this->load->view('Connexion/Visiteur'); $valide = $this->input->post('valide'); if ($valide == 1) { $Utilisateur = $this->ModeleUtilisateur->GetConnexionVisiteur($Utilisateur = array('Inscription' => '','mail' => $this->input->post('txtLogin'), 'mdp'=> $this->input->post('txtMdp'))); var_dump($Utilisateur); if (!($Utilisateur == null)) { $this->session->profil = 'responsable'; $this->session->nom = $Utilisateur['NOM']; $this->session->prenom = $Utilisateur['PRENOM']; $this->session->mail = $Utilisateur['MAIL']; $this->session->numero = $Utilisateur['NOPARTICIPANT']; $this->session->numeroEquipe = $Utilisateur['NOEQUIPE']; redirect('Responsable'); } } } public function inscription() { $this->load->view('Connexion/inscription'); $valide = $this->input->post('valide'); if ($valide == 1) { $MailExisteResponsable = $this->ModeleUtilisateur->VerifMailResponsable($Utilisateur = array('mail' => $this->input->post('txtMail'))); $MailExisteRandonneur['LesRandonneur'] = $this->ModeleUtilisateur->getRandonneur($Utilisateur = array('MAIL' => $this->input->post('txtMail'))); if ($MailExisteResponsable ==0) { //mail n'existe pas if (!($MailExisteRandonneur == null)) { foreach ($MailExisteRandonneur['LesRandonneur'] as $UnRandonneur) { $this->ModeleUtilisateur->UpdateRandonneur($arrayName = array('NOPARTICIPANT' =>$UnRandonneur['NOPARTICIPANT'], 'MAIL' => null )); } } $var = $this->input->post('txtDate'); $date = str_replace('/', '-', $var); $date = date('Y-m-d', strtotime($date)); $Participant = array( 'NOM' =>$this->input->post('txtNom'), 'PRENOM' =>$this->input->post('txtPrenom'), 'DATEDENAISSANCE' =>$date, 'SEXE' =>$this->input->post('sexe') ); $this->ModeleUtilisateur->AddParticipant($Participant); // ajout du participant(responsable) dans la BDD $UnParticipant = $this->ModeleUtilisateur->getParticipant($Participant); $responsable = array( 'NOPARTICIPANT' => $UnParticipant['NOPARTICIPANT'] , 'MOTDEPASSE' => $this->input->post('txtMdp'), 'MAIL' => $this->input->post('txtMail'), 'TELPORTABLE' => $this->input->post('txtTel') ); $this->ModeleUtilisateur->AddResponsable($responsable); //ajout du responsable dans la BDD $equipe = array( 'NOPAR_RESPONSABLE' => $UnParticipant['NOPARTICIPANT'], 'NOMEQUIPE' => $this->input->post('txtEquipe') ); $this->ModeleUtilisateur->AddEquipe($equipe); // ajout de l'équipe dans la BDD $Utilisateur = $this->ModeleUtilisateur->GetConnexionVisiteur($Utilisateur = array('Inscription' => '','mail' => $this->input->post('txtMail'), 'mdp'=> $this->input->post('txtMdp')));// on récupère les info du responsable var_dump($Utilisateur); $membreDe = array( 'NOPARTICIPANT' => $UnParticipant['NOPARTICIPANT'], 'ANNEE' => date('Y'), 'NOEQUIPE' => $Utilisateur['NOEQUIPE'], 'REPASSURPLACE' => 0 ); $this->ModeleUtilisateur->AddMembreDe($membreDe); // ajout du responsable dans MembreDe dans la BDD redirect('Visiteur'); } else //email déjà utilisé { $Value['Value'] = 'Impossible adresse email déjà utilisée.'; $this->load->view('BoiteAlerte',$Value); } } } public function seDeConnecter() { $this->session->sess_destroy(); redirect('Visiteur'); } public function admin() { $this->load->view('Connexion/Admin'); $valide = $this->input->post('valide'); if ($valide == 1) { $Utilisateur = $this->ModeleUtilisateur->GetAdministrateur($Utilisateur = array('email' => $this->input->post('txtLogin'), 'mdp'=> $this->input->post('txtMdp'))); var_dump($Utilisateur); if (!($Utilisateur == null)) { $this->session->profil = $Utilisateur['PROFIL']; $this->session->nom = $Utilisateur['NOM']; $this->session->prenom = $Utilisateur['PRENOM']; $this->session->mail = $Utilisateur['EMAIL']; $this->session->numero = $Utilisateur['NOCONTRIBUTEUR']; if ($Utilisateur['PROFIL'] == 'inscription') { $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; redirect('Administrateur_Inscription'); } if ($Utilisateur['PROFIL'] == 'organisation') { $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; redirect('Administrateur_Organisation'); } if ($Utilisateur['PROFIL'] == 'super') { $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; redirect('Super_Administrateur'); } } } } } <file_sep>/application/views/Responsable/Accueil.php <script type="text/javascript"> function dernierechance() { valide = confirm("Voulez vous vraiment supprimer ? :"); return valide; } </script> <div class='container'> <div class="row"> <div class='col-sm-9' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h2 align='center'>Les membres de l'équipe</h2> <br> <h4 align='center'><span class='glyphicon glyphicon-flag'></span> Nom de votre équipe : <b><?php echo $Responsable['NOMEQUIPE'] ?></b> <?php echo "<a href='".site_url('Responsable/MonCompte')."'><button type='submit' name='ah' class='btn btn-warning btn-xs'>Modifier le nom d'équipe</button></a>"?></h4> <p align='center'>Après avoir terminé de rentrer les membres de l'équipe oublier pas de l'inscrire, pour l'inscrire <a href="#Select-parcours">CLIQUEZ ICI</a></p> <p align='center'><span class='glyphicon glyphicon-exclamation-sign'></span> <?php echo $this->session->AnneeEnCours['MAXPAREQUIPE']; ?> personne pourrons composer votre équipe. Vous pouvez dépasser le nombre mais si il y a trop de personne l'administrateur risque de ne pas valider l'inscription</p> <br> <input type="hidden" name="num" value="1"> <div class='table-responsive'> <table class="table table-Info table-hover"> <th>Nom et prénom</th><th>Age</th><th>Repas</th><th>Email</th><th>Téléphone</th><th><?php echo "<a href='".site_url('Responsable')."'><button type='submit' name='ah' class='btn btn-primary'>Ajouter un randonneur</button></a>";?><th> <?php $date= $Responsable['DATEDENAISSANCE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $date = $an.$mois.$jour; $aujourd = date('Y-m-d'); $an=substr($aujourd,0,4); $mois=substr($aujourd,5,2); $jour=substr($aujourd,8,2); $aujourd = $an.$mois.$jour; //echo $aujourd.'<br>'; // today //echo $date.'<br>'; // naissance $ageAnnee = $aujourd-$date; if (strlen($ageAnnee) == 8) { // au dela de 1000 ans LOL ;) $age=substr($ageAnnee,0,4); } if (strlen($ageAnnee) == 7) { // au dela de 100 ans $age=substr($ageAnnee,0,3); } if (strlen($ageAnnee) == 6) { // au dela de 10 ans $age=substr($ageAnnee,0,2); } if (strlen($ageAnnee) == 5) { // de 1 a 9 ans $age=substr($ageAnnee,0,1); } if (strlen($ageAnnee) == 4) { // moins de 1 ans $age='0'; } //echo $ageAnnee.'<br>'; // la différance //echo $age;//age total if ($Responsable['REPASSURPLACE']==1) { $repas = "oui"; } else { $repas = 'non'; } echo "<tr><td>".$Responsable['NOM']." ".$Responsable['PRENOM']."</td><td>".$age."</td><td>".$repas."</td><td>".$Responsable['MAIL']."</td><td>".$Responsable['TELPORTABLE']."</td>"; echo "<td><a href='".site_url('Responsable/MonCompte')."'><button type='submit' name='ah' class='btn btn-success'>Modifier</button></a> RESPONSABLE </td></tr>"; ?> <?php foreach ($LesUtilisateur as $UnUtilisateur) { if (!($UnUtilisateur['NOPARTICIPANT'] == $this->session->numero)) { //ON NE PREND PAS LE RESPONSABLE $date= $UnUtilisateur['DATEDENAISSANCE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $date = $an.$mois.$jour; $aujourd = date('Y-m-d'); $an=substr($aujourd,0,4); $mois=substr($aujourd,5,2); $jour=substr($aujourd,8,2); $aujourd = $an.$mois.$jour; //echo $aujourd.'<br>'; // today //echo $date.'<br>'; // naissance $ageAnnee = $aujourd-$date; //echo $ageAnnee.'<br>'; // la différance if (strlen($ageAnnee) == 8) { // au dela de 1000 ans LOL ;) $age=substr($ageAnnee,0,4); } if (strlen($ageAnnee) == 7) { // au dela de 100 ans $age=substr($ageAnnee,0,3); } if (strlen($ageAnnee) == 6) { // au dela de 10 ans $age=substr($ageAnnee,0,2); } if (strlen($ageAnnee) == 5) { // de 1 a 9 ans $age=substr($ageAnnee,0,1); } if (strlen($ageAnnee) == 4) { // moins de 1 ans $age='0'; } //echo $age;//age total if ($UnUtilisateur['REPASSURPLACE']==1) { $repas = "oui"; } else { $repas = 'non'; } echo "<tr><td>".$UnUtilisateur['NOM']." ".$UnUtilisateur['PRENOM']."</td><td>".$age."</td><td>".$repas."</td><td>".$UnUtilisateur['MAIL']."</td><td>".$UnUtilisateur['TELPORTABLE']."</td><td>"; $inscrit = $this->session->inscription; echo "<a href='".site_url('Responsable/modifierRandonneur/'.$UnUtilisateur['NOPARTICIPANT'])."'><button type='submit' name='ah' class='btn btn-success'>Modifier</button></a> <a href=".site_url('Responsable/SupprimerParticipant/'.$UnUtilisateur['NOPARTICIPANT'].'/')."><button type='submit' name='ah' class='btn btn-danger' onclick='return dernierechance()'>Supprimer</button></a></td></tr>"; } } ?> </table> </div> <h4 align='center'>Votre équipe est composée de :</h4> <ul> <?php $prixAdultesInscri = $this->session->AnneeEnCours['TARIFINSCRIPTIONADULTE'] * $NBAdultesInscri //on affiche les sous qu'ils devront?> <?php $prixAdultesRepas = $this->session->AnneeEnCours['TARIFREPASADULTE'] * $NBrepasAdulte?> <?php $PrixEnfantsInscri = $this->session->AnneeEnCours['TARIFINSCRIPTIONENFANT'] * $NBEnfantsInscri?> <?php $prixEnfantsRepas = $this->session->AnneeEnCours['TARIFREPASENFANT'] * $NBrepasEnfant?> <li><?php echo $NBAdultesInscri ?> adulte(s) <b><?php echo $prixAdultesInscri?>€</b> (<?php echo $this->session->AnneeEnCours['TARIFINSCRIPTIONADULTE']?>€/adulte)</li> <li><?php echo $NBrepasAdulte ?> repas adulte(s) <b><?php echo $prixAdultesRepas?>€</b> (<?php echo $this->session->AnneeEnCours['TARIFREPASADULTE']?>€/repas adulte)</li> <li><?php echo $NBEnfantsInscri ?> enfant(s) <b><?php echo $PrixEnfantsInscri?>€</b> (<?php echo $this->session->AnneeEnCours['TARIFINSCRIPTIONENFANT']?>€/enfant)</li> <li><?php echo $NBrepasEnfant ?> repas enfant(s) <b><?php echo $prixEnfantsRepas?>€</b> (<?php echo $this->session->AnneeEnCours['TARIFREPASENFANT']?>€/repas enfant)</li> </ul> <p>Pour un total de <b><?php echo $prixAdultesInscri + $prixAdultesRepas + $PrixEnfantsInscri + $prixEnfantsRepas?>€</b></p> </div> </section><br> <file_sep>/application/views/Super/Mailing.php <div class='col-sm-12' > <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h2 align='center' class='textBlanc'> <b> Envoi d'email</b></h2> <?php echo form_open('Super_Administrateur/Mailing'); echo '<p>écriver le contenu du mail ici puis valider :</p>'; echo '<label>Objet du mail: <input type="text" name="txtObject" required></label>'; echo '<textarea name="email" rows="5" placeholder="Ecriver le contenu de votre mail ici" required class="form-control"></textarea>'; ?> <br> <label><input type="checkbox" name="sponsor"checked>Envoyer aux sponsors</label><br> <label><input type="checkbox" name="participant" checked>Envoyer aux participant </label><br> <label><input type="radio" name="qui" value='2' required ><span class='textBlanc'><b>Tous de toutes les années confondu</b></span><br> <label><input type="radio" name="qui" value='1' required ><span class='textBlanc'><b>Tous de l'année en cours </b></span><br><br> <input type='submit' name='submit' class='btn btn-primary' value ="Envoyer"> </table> <file_sep>/application/views/Organisation/Selection_Commission.php <div class='col-sm-4' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h3 align='center' class='textBlanc'>Bénévole SELECTIONNÉ : <b><?php echo $personne['PRENOM'].' '.$personne['NOM'];?></b> </h3> <table class="table table-Info table-hover"> <h3 align='center' class='textBlanc'><u>Commission :</u></h3> <?php if (empty($LesCommissionsPasInscrit)) { echo '<p align="center">Aucune autre commission à attribuer</p>'; } foreach ($LesCommissionsPasInscrit as $UneCommission) { echo '<tr><td>'.$UneCommission['LIBELLE'].'</td>'; echo "<td><a href='".site_url('Administrateur_Organisation/Ajout_Participer_Commission/'.$UneCommission['NOCOMMISSION'].'/'.$personne['NOCONTRIBUTEUR'])."'> <button class='btn btn-success'>ATTRIBUER</button></a> </td></tr>"; } foreach ($LesCommissionsInscrit as $UneCommission) { echo '<tr><td>'.$UneCommission['LIBELLE'].'</td>'; echo "<td><a href='".site_url('Administrateur_Organisation/Supprimer_Participer_Commission/'.$UneCommission['NOCOMMISSION'].'/'.$personne['NOCONTRIBUTEUR'])."'> <button class='btn btn-danger'>RETIRER</button></a> </td></tr>"; } ?> </table> </div></div></section><file_sep>/application/views/Organisation/Benevoles_Commis.php <br><div class="row"> <div class='col-sm-6' > <section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"> <h3 align='center' class='textBlanc'>Bénévoles COMMIS :</h3> <table class="table table-Info table-hover"> <h3 align='center' class='textBlanc'><u>Commis :</u></h3> <?php foreach ($LesCommissions as $UneCommission) { echo '<tr><td>'.$UneCommission['LIBELLE'].' :</td><td>'; foreach ($Participer as $UnParticipant) { if ($UnParticipant['NOCOMMISSION'] == $UneCommission['NOCOMMISSION']) { echo $UnParticipant['PRENOM'].' '.$UnParticipant['NOM']."<br>"; } } echo '</td><tr>'; } ?> </table> </div></div></section><file_sep>/application/views/Responsable/DonneeFixe.php <style> .selectioné { color: #C40000; } </style> <div class="container"> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" <?php echo "href='".site_url('Responsable')."'" ?>>RandoTroll</a> </div> <ul class="nav navbar-nav"> <li><a href="#">Contact admin</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a <?php echo "href='".site_url('Responsable/MonCompte')."'" ?>><span class="glyphicon glyphicon-user"></span> Mon compte</a></li> <li><a <?php echo "href='".site_url('Visiteur/seDeConnecter')."'" ?>><span class="glyphicon glyphicon-log-in"></span> Se déconnecter</a></li> </ul> </div> </nav> <file_sep>/application/views/Inscription/EquipePasPayer.php <br><h2 align='center' class='TextBlanc'><b>Récapitulatif</b></h2> <br><br><table class="table table-Info table-hover"> <th>Nom de l'équipe</th> <th>adultes</th><th> repas adultes</th> <th>enfants</th><th> repas enfants</th> <th>Prix total</th> <th>Manque a payer</th> <?php foreach ($LesEquipes as $UneEquipe) { echo '<tr><td>'.$UneEquipe['NomEquipe'].'</td><td>'.$UneEquipe['NBAdultesInscri'].'</td><td>'.$UneEquipe['NBrepasAdulte'].'</td><td>'.$UneEquipe['NBEnfantsInscri'].'</td><td>'.$UneEquipe['NBrepasEnfant'].'</td><td>'.$UneEquipe['PrixTotal'].' €</td><td class=TextBlanc><b>'.$UneEquipe['Manque'].' €</b></td></tr>'; } ?> </table><file_sep>/application/controllers/Responsable.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Responsable extends CI_Controller { public function __construct() { parent::__construct(); if (!($this->session->profil == 'responsable')) { redirect('Visiteur'); } $this->load->view('Template/EnTete'); $this->load->view('Responsable/DonneeFixe'); } public function index() { $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; //je fait les 2 cathégories d'age (date de la course - la limite d'age) $date= $AnneeEnCours['DATECOURSE']; //$date = date_create($date); //$date = date_format($date,"d/m/Y") $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $an = $an - $AnneeEnCours['LIMITEAGE']; $Adultes = $this->ModeleUtilisateur->GetAdulteEquipe($Utilisateur = array('NOEQUIPE' => $this->session->numeroEquipe, 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UnUtilisateur['NBAdultesInscri'] = count($Adultes); $NBrepasAdulte = 0; foreach ($Adultes as $UnAdulte) { if ($UnAdulte['REPASSURPLACE']==1) { $NBrepasAdulte++; } } $UnUtilisateur['NBrepasAdulte'] = $NBrepasAdulte; $Enfant = $this->ModeleUtilisateur->GetEnfantEquipe($Utilisateur = array('NOEQUIPE' => $this->session->numeroEquipe, 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UnUtilisateur['NBEnfantsInscri'] = count($Enfant); $NBrepasEnfant = 0; foreach ($Enfant as $UnEnfant) { if ($UnEnfant['REPASSURPLACE']==1) { $NBrepasEnfant++; } } $UnUtilisateur['NBrepasEnfant'] = $NBrepasEnfant; $UnUtilisateur['LesUtilisateur'] = $this->ModeleUtilisateur->GetMembreEquipe($Utilisateur = array('noequipe' => $this->session->numeroEquipe, 'annee'=> date('Y'))); $NombreDInscrit = count($UnUtilisateur['LesUtilisateur']); $UnUtilisateur['Responsable'] = $this->ModeleUtilisateur->GetConnexionVisiteur($Participant = array('noparticipant' => $this->session->numero)); $UnUtilisateur['LesParcours'] = $this->ModeleUtilisateur->GetParcours(); $UnUtilisateur['ParcoursChoisis'] = $this->ModeleUtilisateur->GetChoisir($arrayName = array('NOEQUIPE' =>$this->session->numeroEquipe,'ANNEE' => date('Y'))); $UnUtilisateur['NombreDInscrit'] = $NombreDInscrit; $this->load->view('Responsable/Accueil',$UnUtilisateur); $this->load->view('Responsable/AjouterRandonneur'); $this->load->view('Responsable/InscriptionEquipe',$UnUtilisateur); } public function modifierRandonneur($numero = null) { if (!($numero == null)) { $AnneeEnCours = $this->ModeleUtilisateur->GetAnnee($Utilisateur = array( 'annee'=> date('Y'))); $this->session->AnneeEnCours = $AnneeEnCours; //je fait les 2 cathégories d'age (date de la course - la limite d'age) $date= $AnneeEnCours['DATECOURSE']; $an=substr($date,0,4); $mois=substr($date,5,2); $jour=substr($date,8,2); $an = $an - $AnneeEnCours['LIMITEAGE']; $Adultes = $this->ModeleUtilisateur->GetAdulteEquipe($Utilisateur = array('NOEQUIPE' => $this->session->numeroEquipe, 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UnUtilisateur['NBAdultesInscri'] = count($Adultes); $NBrepasAdulte = 0; foreach ($Adultes as $UnAdulte) { if ($UnAdulte['REPASSURPLACE']==1) { $NBrepasAdulte++; } } $UnUtilisateur['NBrepasAdulte'] = $NBrepasAdulte; $Enfant = $this->ModeleUtilisateur->GetEnfantEquipe($Utilisateur = array('NOEQUIPE' => $this->session->numeroEquipe, 'DATE'=> $an.'/'.$mois.'/'.$jour)); $UnUtilisateur['NBEnfantsInscri'] = count($Enfant); $NBrepasEnfant = 0; foreach ($Enfant as $UnEnfant) { if ($UnEnfant['REPASSURPLACE']==1) { $NBrepasEnfant++; } } $UnUtilisateur['NBrepasEnfant'] = $NBrepasEnfant; $arrayName = array('NOPARTICIPANT' => $this->session->numero, ); $LesMembresEquipes = $this->ModeleUtilisateur->GetMembreEquipe($arrayName); $UnUtilisateur['Responsable'] = $this->ModeleUtilisateur->GetConnexionVisiteur($Participant = array('noparticipant' => $this->session->numero)); $UnUtilisateur['LesUtilisateur'] = $this->ModeleUtilisateur->GetMembreEquipe($Utilisateur = array('noequipe' => $this->session->numeroEquipe, 'annee'=> date('Y'))); $NombreDInscrit = count($UnUtilisateur['LesUtilisateur']); $UnUtilisateur['NombreDInscrit'] = $NombreDInscrit; $UnUtilisateur['LesParcours'] = $this->ModeleUtilisateur->GetParcours(); $UnUtilisateur['ParcoursChoisis'] = $this->ModeleUtilisateur->GetChoisir($arrayName = array('NOEQUIPE' =>$this->session->numeroEquipe,'ANNEE' => date('Y'))); $this->load->view('Responsable/Accueil',$UnUtilisateur); foreach ($LesMembresEquipes as $UnMembreEquipe) { if ($UnMembreEquipe['NOPARTICIPANT'] == $numero) //si le membre que l'on veux supprimer fait bien parti de l'équipe sur la session actuel { if (!($UnMembreEquipe['NOPARTICIPANT'] == $this->session->numero)) // si le membre n'est pas le responsable { $UnParticipant = $this->ModeleUtilisateur->getParticipant($Participant = array('NOPARTICIPANT' => $numero)); $LeParticipantAModif = $this->ModeleUtilisateur->GetMembreEquipe($Utilisateur = array('noparticipant' => $UnParticipant['NOPARTICIPANT'])); if ((!$LeParticipantAModif == null)) { $this->load->view('Responsable/AjouterRandonneur',$LeParticipantAModif[0]); $this->load->view('Responsable/InscriptionEquipe',$UnUtilisateur); } } else { redirect('Responsable','refresh'); //force si l'utilisateur change dans l'URL le numéro } } } } else { redirect('Responsable','refresh'); //force si l'utilisateur change dans l'URL le numéro } $valide = $this->input->post('Valide'); if ($valide ==1) { // alors j'update toute les tables if ($this->input->post('txtMail') == '') { $mail = null;} else {$mail = $this->input->post('txtMail');} if($this->ModeleUtilisateur->VerifMailResponsable($arrayName = array('mail' => $mail))) // si le mail du randonneur est identique a celui d'un responsable { $Value['Value'] = 'Impossible adresse email déjà utilisée par un responsable.'; $this->load->view('BoiteAlerte',$Value); $mail = null; } else // si le mail n'est pas utilisé { $var = $this->input->post('txtDate'); $date = str_replace('/', '-', $var); $date = date('Y-m-d', strtotime($date)); $Participant = array( 'NOPARTICIPANT' =>$numero, 'NOM' =>$this->input->post('txtNom'), 'PRENOM' =>$this->input->post('txtPrenom'), 'DATEDENAISSANCE' =>$date, 'SEXE' =>$this->input->post('sexe') ); $this->ModeleUtilisateur->UpdateParticipant($Participant); // Update dans la table Participant if ($this->input->post('txtTel') == '') { $tel = null;} else {$tel = $this->input->post('txtTel');} $randonneur = array( 'NOPARTICIPANT' => $numero , 'MAIL' => $mail, 'TELPORTABLE' => $tel ); $this->ModeleUtilisateur->UpdateRandonneur($randonneur); // Update dans la table Randonneur $membreDe = array( 'NOPARTICIPANT' => $numero, 'REPASSURPLACE' => $this->input->post('repas') ); $this->ModeleUtilisateur->UpdateMembreDe($membreDe); // Update dans la table MembreDe redirect('Responsable/modifierRandonneur/'.$numero); } } } public function AjouterRandoneur() { $var = $this->input->post('txtDate'); $date = str_replace('/', '-', $var); $date = date('Y-m-d', strtotime($date)); $Participant = array( 'NOM' =>$this->input->post('txtNom'), 'PRENOM' =>$this->input->post('txtPrenom'), 'DATEDENAISSANCE' =>$date, 'SEXE' =>$this->input->post('sexe') ); $numParticipant = $this->ModeleUtilisateur->AddParticipant($Participant); // ajout du participant dans la BDD $UnParticipant = $this->ModeleUtilisateur->getParticipant($arrayName = array('NOPARTICIPANT' => $numParticipant)); //récupère le numero du nouveau participant if ($this->input->post('txtMail') == '') { $mail = null;} else {$mail = $this->input->post('txtMail');} if ($this->input->post('txtTel') == '') { $tel = null;} else {$tel = $this->input->post('txtTel');} $randonneur = array( 'NOPARTICIPANT' => $UnParticipant['NOPARTICIPANT'] , 'MAIL' => $mail, 'TELPORTABLE' => $tel ); $this->ModeleUtilisateur->AddRandonneur($randonneur); // ajout du randonneur dans la BDD $membreDe = array( 'NOPARTICIPANT' => $UnParticipant['NOPARTICIPANT'], 'ANNEE' => date('Y'), 'NOEQUIPE' => $this->session->numeroEquipe, 'REPASSURPLACE' => $this->input->post('repas') ); $this->ModeleUtilisateur->AddMembreDe($membreDe); // ajout du responsable dans MembreDe dans la BDD redirect('Responsable','refresh'); } public function SupprimerParticipant($numero) { $arrayName = array('NOPARTICIPANT' => $this->session->numero, ); $LesMembresEquipes = $this->ModeleUtilisateur->GetMembreEquipe($arrayName); foreach ($LesMembresEquipes as $UnMembreEquipe) { if ($UnMembreEquipe['NOPARTICIPANT'] == $numero) //si le membre que l'on veux supprimer fait bien parti de l'équipe sur la session actuel { if (!($UnMembreEquipe['NOPARTICIPANT'] == $this->session->numero)) // si le membre n'est pas le responsable { $this->ModeleUtilisateur->DeleteParticipant($numero); // alors ont supprime redirect('Responsable'); } } } var_dump($LesMembresEquipes); } public function MonCompte($switch=null) { switch ($switch) { case '1': #modifier mot de passe $this->load->view('Responsable/modifierMDP'); if($this->input->post('submit')) { $this->ModeleUtilisateur->UpdateResponsable($arrayName = array('NOPARTICIPANT' =>$this->session->numero,'MOTDEPASSE' =>$this->input->post('txtMdp'))); redirect('Responsable/MonCompte'); } break; default: #modifier les infos du compte $Utilisateur = $this->ModeleUtilisateur->GetConnexionVisiteur($Utilisateur = array('noparticipant' => $this->session->numero)); $this->load->view('Responsable/Compte',$Utilisateur); if($this->input->post('submit')) { $MailExisteResponsable = $this->ModeleUtilisateur->VerifMailResponsable($Utilisateur = array('mail' => $this->input->post('txtMail'),'noparticipant'=>$this->session->numero)); $MailExisteRandonneur['LesRandonneur'] = $this->ModeleUtilisateur->getRandonneur($Utilisateur = array('MAIL' => $this->input->post('txtMail'))); $NomEquipeExiste = $this->ModeleUtilisateur->VerifNomEquipe($Equipe = array('nomequipe' => $this->input->post('txtEquipe'),'noequipe'=>$this->session->numeroEquipe)); if ($MailExisteResponsable ==0) { //mail n'existe pas if ($NomEquipeExiste==0) { if (!($MailExisteRandonneur == null)) { foreach ($MailExisteRandonneur['LesRandonneur'] as $UnRandonneur) { $this->ModeleUtilisateur->UpdateRandonneur($arrayName = array('NOPARTICIPANT' =>$UnRandonneur['NOPARTICIPANT'], 'MAIL' => null )); } } $this->ModeleUtilisateur->UpdateResponsable($arrayName = array('NOPARTICIPANT' =>$this->session->numero,'MAIL' =>$this->input->post('txtMail'),'TELPORTABLE' =>$this->input->post('txtTel'))); $this->ModeleUtilisateur->UpdateParticipant($arrayName = array('NOPARTICIPANT' =>$this->session->numero,'NOM' =>$this->input->post('txtNom'),'PRENOM' =>$this->input->post('txtPrenom'))); $this->ModeleUtilisateur->UpdateEquipe($arrayName = array('NOEQUIPE' =>$this->session->numeroEquipe,'NOMEQUIPE' =>$this->input->post('txtEquipe'))); redirect('Responsable/MonCompte'); } else { $Value['Value'] = 'Le nom d\'équipe est déjà utilisé cette année.'; $this->load->view('BoiteAlerte',$Value); } } else { $Value['Value'] = 'Impossible adresse email déjà utilisée par un autre responsable.'; $this->load->view('BoiteAlerte',$Value); } } break; } } public function inscriptionEquipe() { $Choisir = array( 'NOEQUIPE' =>$this->session->numeroEquipe, 'ANNEE' => date('Y'), 'NOPARCOURS' => $this->input->post('Parcours') ); $ResultChoisir = $this->ModeleUtilisateur->GetChoisir($arrayName = array('NOEQUIPE' =>$this->session->numeroEquipe,'ANNEE' => date('Y'))); if (!(isset($ResultChoisir))) { $this->ModeleUtilisateur->AddChoisir($Choisir); $Sinscrire = array( 'NOEQUIPE' => $this->session->numeroEquipe, 'ANNEE'=> date('Y'), 'DATEINSCRIPTION'=> date('Y-m-d')); var_dump($Sinscrire); $this->ModeleUtilisateur->AddSinscrire($Sinscrire); } else { $this->ModeleUtilisateur->UpdateChoisir($Choisir); } redirect('Responsable'); } } <file_sep>/application/views/Template/EnTete.php <html> <head> <title>Randotroll</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <?php echo '<link href='.css_url('feuilleStyle').' rel="stylesheet">'?> </head> <body> <hr> <br> <h1 align='center' class='textBlanc'>Randotroll</h1> <hr><file_sep>/application/views/Organisation/DonneeFixe.php <style> .selectioné { color: #C40000; } </style> <div class="container"> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <?php if ($this->session->profil == 'super') { echo '<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Changer d\'administrateur <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="'.site_url('Super_Administrateur').'">Super Administrateur</a></li> <li><a href="'.site_url('Administrateur_Organisation').'">Administrateur Organisation</a></li> <li><a href="'.site_url('Administrateur_Inscription').'">Administrateur Inscription</a></li> </ul> </li>'; } ?> <a class="navbar-brand" <?php echo "href='".site_url('Administrateur_Organisation')."'" ?>>Administrateur Orga</a> </div> <ul class="nav navbar-nav"> <li><a <?php echo "href='".site_url('Administrateur_Organisation/Gestion_Contributeur')."'" ?>>Gestion des contributeur</a></li> <li><a <?php echo "href='".site_url('Administrateur_Organisation/Gestion_Sponsor')."'" ?>>Gestion des sponsor</a></li> <li><a <?php echo "href='".site_url('Administrateur_Organisation/Gestion_Benevoles')."'" ?>>Gestion des bénévoles</a></li> <li><a <?php echo "href='".site_url('Administrateur_Organisation/Mailing_Remerciements')."'" ?>>mailing remerciement sponsor</a></li> <li><a <?php echo "href='".site_url('Administrateur_Organisation/Mailing_Tout_Les_Sponsors')."'" ?>>mailing relance sponsor</a></li> <li><a <?php echo "href='".site_url('Recapitulatif/TableauDeBord')."'" ?>>Tableau de bord</a></li> <li><a <?php echo "href='".site_url('Recapitulatif/AffectationVague')."'" ?>>Affecter les équipes à des vagues de départ</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a <?php echo "href='".site_url('Visiteur/seDeConnecter')."'" ?>><span class="glyphicon glyphicon-log-in"></span> Se déconnecter</a></li> </ul> </div> </nav> <file_sep>/application/views/Organisation/Contribution_Sponsor.php <br><section> <div class="section-inner" style="background-color:#FDBA23;padding:20px;"><?php echo form_open('Administrateur_Organisation/Gestion_Sponsor'); // j'ouvre mon form ?> <h2 align='center' class='TextBlanc'><b>Montant apporté</b></h2><br> <p align='center'> <input type="hidden" name="nosponsor" <?php if (isset($LeSponso['NOSPONSOR'])) {echo 'value="'.$LeSponso['NOSPONSOR'].'"';}?>> <label for="txtCommission"><span class='textBlanc'>Montant de cette année:</span></label> <input type="text" name='txtMontant' class='form-control' required <?php if (isset($Contribution['MONTANT'])) {echo 'value="'.$Contribution['MONTANT'].' €"';}?>><br> <input type='submit' name='SubmitContribution' value='Enregistrer' class='btn btn-warning'> </p> </form> </div></div></section>
b11edbcd96c1b3d1aac35afd6081a1ada6eaa8b0
[ "PHP" ]
36
PHP
KalaxWar/RandoTroll
6a425ddca209a3d86d74fa24f170c3da1c74b17e
a5acf5cbed2afe3d1be7f666da7927e92c019c24
refs/heads/master
<file_sep>package main import ( "flag" "fmt" "github.com/rzetterberg/elmobd" ) func main() { serialPath := flag.String( "serial", "/dev/ttyUSB0", "Path to the serial device to use", ) flag.Parse() dev, err := elmobd.NewDevice(*serialPath, false) if err != nil { fmt.Println("Failed to create new device", err) return } version, err := dev.GetVersion() if err != nil { fmt.Println("Failed to get version", err) return } fmt.Println("Device has version", version) } <file_sep>package main import ( "flag" "fmt" "github.com/rzetterberg/elmobd" ) func main() { serialPath := flag.String( "serial", "/dev/ttyUSB0", "Path to the serial device to use", ) flag.Parse() dev, err := elmobd.NewDevice(*serialPath, false) if err != nil { fmt.Println("Failed to create new device", err) return } rpm, err := dev.RunOBDCommand(elmobd.NewEngineRPM()) if err != nil { fmt.Println("Failed to get rpm", err) return } fmt.Printf("Engine spins at %s RPMs\n", rpm.ValueAsLit()) } <file_sep>package main import ( "flag" "fmt" "github.com/rzetterberg/elmobd" ) func main() { serialPath := flag.String( "serial", "/dev/ttyUSB0", "Path to the serial device to use", ) flag.Parse() dev, err := elmobd.NewDevice(*serialPath, false) if err != nil { fmt.Println("Failed to create new device", err) return } supported, err := dev.CheckSupportedCommands() if err != nil { fmt.Println("Failed to check supported commands", err) return } rpm := elmobd.NewEngineRPM() if supported.IsSupported(rpm) { fmt.Println("The car supports checking RPM") } else { fmt.Println("The car does NOT supports checking RPM") } } <file_sep>package elmobd import ( "fmt" "strconv" "strings" ) /*============================================================================== * External */ // Result represents the results from running a command on the ELM327 device, // encoded as a byte array. When you run a command on the ELM327 device the // response is a space-separated string of hex bytes, which looks something // like this: // // 41 0C 1A F8 // // The first 2 bytes are control bytes, while the rest of the bytes represent // the actual result. So this data type contains an array of those bytes in // binary. // // This data type is only used internally to produce the processed value of // the run OBDCommand, so the end user will never use this data type. type Result struct { value []byte } // NewResult constructrs a Result by taking care of parsing the hex bytes into // binary representation. func NewResult(rawLine string) (*Result, error) { literals := strings.Split(rawLine, " ") if len(literals) < 3 { return nil, fmt.Errorf( "Expected at least 3 OBD literals: %s", rawLine, ) } result := Result{make([]byte, 0)} for i := range literals { curr, err := strconv.ParseUint( literals[i], 16, 8, ) if err != nil { return nil, err } result.value = append(result.value, uint8(curr)) } return &result, nil } // Validate checks that the result is for the given OBDCommand by checking the // length of the data, comparing the mode ID and the parameter ID. func (res *Result) Validate(cmd OBDCommand) error { valueLen := len(res.value) expLen := int(cmd.DataWidth() + 2) if valueLen != expLen { return fmt.Errorf( "Expected %d bytes, found %d", expLen, valueLen, ) } modeResp := cmd.ModeID() + 0x40 if res.value[0] != modeResp { return fmt.Errorf( "Expected mode echo %02X, got %02X", modeResp, res.value[0], ) } if OBDParameterID(res.value[1]) != cmd.ParameterID() { return fmt.Errorf( "Expected parameter echo %02X got %02X", cmd.ParameterID(), res.value[1], ) } return nil } // payloadAsUInt casts the Result as a unisgned 64-bit integer and making sure // it has the expected amount of bytes. // // This function is used by other more specific utility functions that cast the // result to a specific unsigned integer typer. // // By verifying the amount of bytes in the result using this function we can // safely cast the resulting uint64 into types with less bits. func (res *Result) payloadAsUInt(expAmount int) (uint64, error) { var result uint64 payload := res.value[2:] amount := len(payload) if amount != expAmount { return 0, fmt.Errorf( "Expected %d bytes of payload, got %d", expAmount, amount, ) } for i := range payload { curr := payload[amount-(i+1)] result |= uint64(curr) << uint(i*8) } return result, nil } // PayloadAsUInt64 is a helper for getting payload as uint64. func (res *Result) PayloadAsUInt64() (uint64, error) { result, err := res.payloadAsUInt(8) if err != nil { return 0, err } return uint64(result), nil } // PayloadAsUInt32 is a helper for getting payload as uint32. func (res *Result) PayloadAsUInt32() (uint32, error) { result, err := res.payloadAsUInt(4) if err != nil { return 0, err } return uint32(result), nil } // PayloadAsUInt16 is a helper for getting payload as uint16. func (res *Result) PayloadAsUInt16() (uint16, error) { result, err := res.payloadAsUInt(2) if err != nil { return 0, err } return uint16(result), nil } // PayloadAsByte is a helper for getting payload as byte. func (res *Result) PayloadAsByte() (byte, error) { result, err := res.payloadAsUInt(1) if err != nil { return 0, err } return uint8(result), nil } // Device represents the connection to a ELM327 device. This is the data type // you use to run commands on the connected ELM327 device, see NewDevice for // creating a Device and RunOBDCommand for running commands. type Device struct { rawDevice *RawDevice outputDebug bool } // NewDevice constructs a Device by initilizing the serial connection and // setting the protocol to talk with the car to "automatic". func NewDevice(devicePath string, debug bool) (*Device, error) { rawDev, err := NewRawDevice(devicePath) if err != nil { return nil, err } dev := Device{ rawDev, debug, } err = dev.SetAutomaticProtocol() if err != nil { return nil, err } return &dev, nil } // SetAutomaticProtocol tells the ELM327 device to automatically discover what // protocol to talk to the car with. How the protocol is chhosen is something // that the ELM327 does internally. If you're interested in how this works you // can look in the data sheet linked in the beginning of the package description. func (dev *Device) SetAutomaticProtocol() error { res := dev.rawDevice.RunCommand("ATSP0") if res.Error != nil { return res.Error } if dev.outputDebug { fmt.Println(res.FormatOverview()) } if res.Outputs[0] != "OK" { return fmt.Errorf( "Expected OK response, got: %q", res.Outputs[0], ) } return nil } // GetVersion gets the version of the connected ELM327 device. The latest // version being v2.2. func (dev *Device) GetVersion() (string, error) { res := dev.rawDevice.RunCommand("AT@1") if res.Error != nil { return "", res.Error } if dev.outputDebug { fmt.Println(res.FormatOverview()) } version := res.Outputs[0][:] return strings.Trim(version, " "), nil } // CheckSupportedCommands check which commands are supported (PID 1 to PID 160) // by the car connected to the ELM327 device. // // Since a single command can only contain 32-bits of information 5 commands // are run in series by this function to get the whole 160-bits of information. func (dev *Device) CheckSupportedCommands() (*SupportedCommands, error) { part1, err := dev.CheckSupportedPart(NewPart1Supported()) if err != nil { return nil, err } part2, err := dev.CheckSupportedPart(NewPart2Supported()) if err != nil { return nil, err } part3, err := dev.CheckSupportedPart(NewPart3Supported()) if err != nil { return nil, err } part4, err := dev.CheckSupportedPart(NewPart4Supported()) if err != nil { return nil, err } part5, err := dev.CheckSupportedPart(NewPart5Supported()) if err != nil { return nil, err } result := SupportedCommands{ uint32(part1.(*Part1Supported).Value), uint32(part2.(*Part2Supported).Value), uint32(part3.(*Part3Supported).Value), uint32(part4.(*Part4Supported).Value), uint32(part5.(*Part5Supported).Value), } return &result, nil } // CheckSupportedPart checks the availability of a range of 32 commands. func (dev *Device) CheckSupportedPart(cmd OBDCommand) (OBDCommand, error) { rawResult := dev.rawDevice.RunCommand(cmd.ToCommand()) if rawResult.Error != nil { return cmd, rawResult.Error } if dev.outputDebug { fmt.Println(rawResult.FormatOverview()) } result, err := parseSupportedResponse(cmd, rawResult.Outputs) if err != nil { return cmd, err } err = result.Validate(cmd) if err != nil { return cmd, err } err = cmd.SetValue(result) return cmd, err } // RunOBDCommand runs the given OBDCommand on the connected ELM327 device and // populates the OBDCommand with the parsed output from the device. func (dev *Device) RunOBDCommand(cmd OBDCommand) (OBDCommand, error) { rawResult := dev.rawDevice.RunCommand(cmd.ToCommand()) if rawResult.Error != nil { return cmd, rawResult.Error } if dev.outputDebug { fmt.Println(rawResult.FormatOverview()) } result, err := parseOBDResponse(cmd, rawResult.Outputs) if err != nil { return cmd, err } err = result.Validate(cmd) if err != nil { return cmd, err } err = cmd.SetValue(result) return cmd, err } // RunManyOBDCommands is a helper function to run multiple commands in series. func (dev *Device) RunManyOBDCommands(commands []OBDCommand) ([]OBDCommand, error) { var result []OBDCommand for _, cmd := range commands { res, err := dev.RunOBDCommand(cmd) if err != nil { return []OBDCommand{}, err } result = append(result, res) } return result, nil } // SupportedCommands represents the lookup table for which commands // (PID 1 to PID 160) that are supported by the car connected to the ELM327 // device. type SupportedCommands struct { part1 uint32 part2 uint32 part3 uint32 part4 uint32 part5 uint32 } // IsSupported checks if the given OBDCommand is supported. // // It does this by comparing the PID of the OBDCommand against the lookup table. func (sc *SupportedCommands) IsSupported(cmd OBDCommand) bool { if cmd.ParameterID() == 0 { return true } pid := cmd.ParameterID() inPart1 := (sc.part1 >> uint32(32-pid)) & 1 inPart2 := (sc.part2 >> uint32(32-pid)) & 1 inPart3 := (sc.part3 >> uint32(32-pid)) & 1 inPart4 := (sc.part4 >> uint32(32-pid)) & 1 inPart5 := (sc.part5 >> uint32(32-pid)) & 1 return (inPart1 == 1) || (inPart2 == 1) || (inPart3 == 1) || (inPart4 == 1) || (inPart5 == 1) } // FilterSupported filters out the OBDCommands that are supported. func (sc *SupportedCommands) FilterSupported(commands []OBDCommand) []OBDCommand { var result []OBDCommand for _, cmd := range commands { if sc.IsSupported(cmd) { result = append(result, cmd) } } return result } /*============================================================================== * Internal */ // parseSupportedResponse parses the raw output produced from running the given // OBDCommand. Is specific to OBDCommands that check the availability of a // command range. // // The output from these commands have a special structure that needs to be // handled before the generic parseOBDResponse function can be run on the result. func parseSupportedResponse(cmd OBDCommand, outputs []string) (*Result, error) { if len(outputs) < 2 { return nil, fmt.Errorf( "Expected more than one output, got: %q", outputs, ) } if outputs[1] == "UNABLE TO CONNECT" { return nil, fmt.Errorf( "Unable to connect to car, is the ignition on?", ) } return parseOBDResponse(cmd, outputs[1:]) } // parseOBDResponse parses the raw output produced from running the given // OBDCommand on the connected ELM327 device. // // The output is checked so that it doesn't represent a failed command run // before return a new Result. func parseOBDResponse(cmd OBDCommand, outputs []string) (*Result, error) { if len(outputs) < 1 { return nil, fmt.Errorf( "Expected atleast one output, got: %q", outputs, ) } payload := outputs[0] if payload == "UNABLE TO CONNECT" { return nil, fmt.Errorf( "Unable to connect to car, is the ignition on?", ) } if payload == "NO DATA" { return nil, fmt.Errorf( "No data from car, time out from elm device?", ) } return NewResult(payload) } <file_sep>package elmobd import ( "fmt" ) /*============================================================================== * Generic types */ // OBDParameterID is an alias to give meaning to this particular byte. type OBDParameterID byte // OBDCommand is an interface that all OBD commands needs to implement to be // able to be used with the Device. type OBDCommand interface { ModeID() byte ParameterID() OBDParameterID DataWidth() byte Key() string SetValue(*Result) error ValueAsLit() string ToCommand() string } // BaseCommand is a simple struct with the 3 members that all OBDCommands // will have in common. type BaseCommand struct { parameterID byte dataWidth byte key string } // ModeID retrieves the mode ID of the command. func (cmd *BaseCommand) ModeID() byte { return 0x01 } // ParameterID retrieves the Parameter ID (also called PID) of the command. func (cmd *BaseCommand) ParameterID() OBDParameterID { return OBDParameterID(cmd.parameterID) } // DataWidth retrieves the amount of bytes the command expects from the ELM327 // devices. func (cmd *BaseCommand) DataWidth() byte { return cmd.dataWidth } // Key retrieves the unique literal key of the command, used when exporting // commands. func (cmd *BaseCommand) Key() string { return cmd.key } // ToCommand retrieves the raw command that can be sent to the ELM327 device. func (cmd *BaseCommand) ToCommand() string { return fmt.Sprintf("%02X%02X", cmd.ModeID(), cmd.ParameterID()) } // FloatCommand is just a shortcut for commands that retrieve floating point // values from the ELM327 device. type FloatCommand struct { Value float32 } // ValueAsLit retrieves the value as a literal representation. func (cmd *FloatCommand) ValueAsLit() string { return fmt.Sprintf("%f", cmd.Value) } // IntCommand is just a shortcut for commands that retrieve integer // values from the ELM327 device. type IntCommand struct { Value int } // ValueAsLit retrieves the value as a literal representation. func (cmd *IntCommand) ValueAsLit() string { return fmt.Sprintf("%d", cmd.Value) } // UIntCommand is just a shortcut for commands that retrieve unsigned // integer values from the ELM327 device. type UIntCommand struct { Value uint32 } // ValueAsLit retrieves the value as a literal representation. func (cmd *UIntCommand) ValueAsLit() string { return fmt.Sprintf("%d", cmd.Value) } /*============================================================================== * Specific types */ // Part1Supported represents a command that checks the supported PIDs 0 to 20 type Part1Supported struct { BaseCommand UIntCommand } // NewPart1Supported creates a new Part1Supported. func NewPart1Supported() *Part1Supported { return &Part1Supported{ BaseCommand{0, 4, "supported_commands_part1"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned // integer value. func (cmd *Part1Supported) SetValue(result *Result) error { payload, err := result.PayloadAsUInt32() if err != nil { return err } cmd.Value = uint32(payload) return nil } // EngineLoad represents a command that checks the engine load in percent // // Min: 0.0 // Max: 1.0 type EngineLoad struct { BaseCommand FloatCommand } // NewEngineLoad creates a new EngineLoad with the correct parameters. func NewEngineLoad() *EngineLoad { return &EngineLoad{ BaseCommand{4, 1, "engine_load"}, FloatCommand{}, } } // SetValue processes the byte array value into the right float value. func (cmd *EngineLoad) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = float32(payload) / 255 return nil } // CoolantTemperature represents a command that checks the engine coolant // temperature in Celsius. // // Min: -40 // Max: 215 type CoolantTemperature struct { BaseCommand IntCommand } // NewCoolantTemperature creates a new CoolantTemperature with the right // parameters. func NewCoolantTemperature() *CoolantTemperature { return &CoolantTemperature{ BaseCommand{5, 1, "coolant_temperature"}, IntCommand{}, } } // SetValue processes the byte array value into the right integer value. func (cmd *CoolantTemperature) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = int(payload) - 40 return nil } // fuelTrim is an abstract type for fuel trim, both for short term and long term. // Min: -100 (too rich) // Max: 99.2 (too lean) type fuelTrim struct { BaseCommand FloatCommand } // SetValue processes the byte array value into the right float value. func (cmd *fuelTrim) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = (float32(payload) / 1.28) - 100 return nil } // ShortFuelTrim1 represents a command that checks the short term fuel trim for // bank 1. type ShortFuelTrim1 struct { fuelTrim } // NewShortFuelTrim1 creates a new ShortFuelTrim1 with the right parameters. func NewShortFuelTrim1() *ShortFuelTrim1 { return &ShortFuelTrim1{ fuelTrim{ BaseCommand{6, 1, "short_term_fuel_trim_bank1"}, FloatCommand{}, }, } } // LongFuelTrim1 represents a command that checks the long term fuel trim for // bank 1. type LongFuelTrim1 struct { fuelTrim } // NewLongFuelTrim1 creates a new LongFuelTrim1 with the right parameters. func NewLongFuelTrim1() *LongFuelTrim1 { return &LongFuelTrim1{ fuelTrim{ BaseCommand{7, 1, "long_term_fuel_trim_bank1"}, FloatCommand{}, }, } } // ShortFuelTrim2 represents a command that checks the short term fuel trim for // bank 2. type ShortFuelTrim2 struct { fuelTrim } // NewShortFuelTrim2 creates a new ShortFuelTrim2 with the right parameters. func NewShortFuelTrim2() *ShortFuelTrim2 { return &ShortFuelTrim2{ fuelTrim{ BaseCommand{8, 1, "short_term_fuel_trim_bank2"}, FloatCommand{}, }, } } // LongFuelTrim2 represents a command that checks the long term fuel trim for // bank 2. type LongFuelTrim2 struct { fuelTrim } // NewLongFuelTrim2 creates a new LongFuelTrim2 with the right parameters. func NewLongFuelTrim2() *LongFuelTrim2 { return &LongFuelTrim2{ fuelTrim{ BaseCommand{9, 1, "long_term_fuel_trim_bank2"}, FloatCommand{}, }, } } // FuelPressure represents a command that checks the fuel pressure in kPa. // // Min: 0 // Max: 765 type FuelPressure struct { BaseCommand UIntCommand } // NewFuelPressure creates a new FuelPressure with the right parameters. func NewFuelPressure() *FuelPressure { return &FuelPressure{ BaseCommand{10, 1, "fuel_pressure"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer value. func (cmd *FuelPressure) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = uint32(payload) * 3 return nil } // IntakeManifoldPressure represents a command that checks the intake manifold // pressure in kPa. // // Min: 0 // Max: 255 type IntakeManifoldPressure struct { BaseCommand UIntCommand } // NewIntakeManifoldPressure creates a new IntakeManifoldPressure with the // right parameters. func NewIntakeManifoldPressure() *IntakeManifoldPressure { return &IntakeManifoldPressure{ BaseCommand{11, 1, "intake_manifold_pressure"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer value. func (cmd *IntakeManifoldPressure) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = uint32(payload) return nil } // EngineRPM represents a command that checks eEngine revolutions per minute. // // Min: 0.0 // Max: 16383.75 type EngineRPM struct { BaseCommand FloatCommand } // NewEngineRPM creates a new EngineRPM with the right parameters. func NewEngineRPM() *EngineRPM { return &EngineRPM{ BaseCommand{12, 2, "engine_rpm"}, FloatCommand{}, } } // SetValue processes the byte array value into the right float value. func (cmd *EngineRPM) SetValue(result *Result) error { payload, err := result.PayloadAsUInt16() if err != nil { return err } cmd.Value = float32(payload) / 4 return nil } // VehicleSpeed represents a command that checks the vehicle speed in km/h. // // Min: 0 // Max: 255 type VehicleSpeed struct { BaseCommand UIntCommand } // NewVehicleSpeed creates a new VehicleSpeed with the right parameters func NewVehicleSpeed() *VehicleSpeed { return &VehicleSpeed{ BaseCommand{13, 1, "vehicle_speed"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer value. func (cmd *VehicleSpeed) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = uint32(payload) return nil } // TimingAdvance represents a command that checks the timing advance in degrees // before TDC. // // Min: -64 // Max: 63.5 // // For more info about TDC: // https://en.wikipedia.org/wiki/Dead_centre_(engineering) type TimingAdvance struct { BaseCommand FloatCommand } // NewTimingAdvance creates a new TimingAdvance with the right parameters. func NewTimingAdvance() *TimingAdvance { return &TimingAdvance{ BaseCommand{14, 1, "timing_advance"}, FloatCommand{}, } } // SetValue processes the byte array value into the right float value. func (cmd *TimingAdvance) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = float32(payload/2) - 64 return nil } // IntakeAirTemperature represents a command that checks the intake air // temperature in Celsius. // // Min: -40 // Max: 215 type IntakeAirTemperature struct { BaseCommand IntCommand } // NewIntakeAirTemperature creates a new IntakeAirTemperature with the right parameters. func NewIntakeAirTemperature() *IntakeAirTemperature { return &IntakeAirTemperature{ BaseCommand{15, 1, "intake_air_temperature"}, IntCommand{}, } } // SetValue processes the byte array value into the right integer value. func (cmd *IntakeAirTemperature) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = int(payload) - 40 return nil } // MafAirFlowRate represents a command that checks the mass Air Flow sensor // flow rate grams/second. // // Min: 0 // Max: 655.35 // // More information about MAF: // https://en.wikipedia.org/wiki/Mass_flow_sensor type MafAirFlowRate struct { BaseCommand FloatCommand } // NewMafAirFlowRate creates a new MafAirFlowRate with the right parameters. func NewMafAirFlowRate() *MafAirFlowRate { return &MafAirFlowRate{ BaseCommand{16, 2, "maf_air_flow_rate"}, FloatCommand{}, } } // SetValue processes the byte array value into the right float value. func (cmd *MafAirFlowRate) SetValue(result *Result) error { payload, err := result.PayloadAsUInt16() if err != nil { return err } cmd.Value = float32(payload) / 100 return nil } // ThrottlePosition represents a command that checks the throttle position in // percentage. // // Min: 0.0 // Max: 100.0 type ThrottlePosition struct { BaseCommand FloatCommand } // NewThrottlePosition creates a new ThrottlePosition with the right parameters. func NewThrottlePosition() *ThrottlePosition { return &ThrottlePosition{ BaseCommand{17, 1, "throttle_position"}, FloatCommand{}, } } // SetValue processes the byte array value into the right float value. func (cmd *ThrottlePosition) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = float32(payload) / 255 return nil } // OBDStandards represents a command that checks the OBD standards this vehicle // conforms to as a single decimal value: // // - 1 OBD-II as defined by the CARB // - 2 OBD as defined by the EPA // - 3 OBD and OBD-II // - 4 OBD-I // - 5 Not OBD compliant // - 6 EOBD (Europe) // - 7 EOBD and OBD-II // - 8 EOBD and OBD // - 9 EOBD, OBD and OBD II // - 10 JOBD (Japan) // - 11 JOBD and OBD II // - 12 JOBD and EOBD // - 13 JOBD, EOBD, and OBD II // - 14 Reserved // - 15 Reserved // - 16 Reserved // - 17 Engine Manufacturer Diagnostics (EMD) // - 18 Engine Manufacturer Diagnostics Enhanced (EMD+) // - 19 Heavy Duty On-Board Diagnostics (Child/Partial) (HD OBD-C) // - 20 Heavy Duty On-Board Diagnostics (HD OBD) // - 21 World Wide Harmonized OBD (WWH OBD) // - 22 Reserved // - 23 Heavy Duty Euro OBD Stage I without NOx control (HD EOBD-I) // - 24 Heavy Duty Euro OBD Stage I with NOx control (HD EOBD-I N) // - 25 Heavy Duty Euro OBD Stage II without NOx control (HD EOBD-II) // - 26 Heavy Duty Euro OBD Stage II with NOx control (HD EOBD-II N) // - 27 Reserved // - 28 Brazil OBD Phase 1 (OBDBr-1) // - 29 Brazil OBD Phase 2 (OBDBr-2) // - 30 Korean OBD (KOBD) // - 31 India OBD I (IOBD I) // - 32 India OBD II (IOBD II) // - 33 Heavy Duty Euro OBD Stage VI (HD EOBD-IV) // - 34-250 Reserved // - 251-255 Not available for assignment (SAE J1939 special meaning) type OBDStandards struct { BaseCommand UIntCommand } // NewOBDStandards creates a new OBDStandards with the right parameters. func NewOBDStandards() *OBDStandards { return &OBDStandards{ BaseCommand{28, 1, "obd_standards"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer // value. func (cmd *OBDStandards) SetValue(result *Result) error { payload, err := result.PayloadAsByte() if err != nil { return err } cmd.Value = uint32(payload) return nil } // RuntimeSinceStart represents a command that checks the run time since engine // start. // // Min: 0 // Max: 65535 type RuntimeSinceStart struct { BaseCommand UIntCommand } // NewRuntimeSinceStart creates a new RuntimeSinceStart with the right // parameters. func NewRuntimeSinceStart() *RuntimeSinceStart { return &RuntimeSinceStart{ BaseCommand{31, 1, "runtime_since_engine_start"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer // value. func (cmd *RuntimeSinceStart) SetValue(result *Result) error { payload, err := result.PayloadAsUInt16() if err != nil { return err } cmd.Value = uint32(payload) return nil } // Part2Supported represents a command that checks the supported PIDs 21 to 40. type Part2Supported struct { BaseCommand UIntCommand } // NewPart2Supported creates a new Part2Supported with the right parameters. func NewPart2Supported() *Part2Supported { return &Part2Supported{ BaseCommand{32, 4, "supported_commands_part2"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer // value. func (cmd *Part2Supported) SetValue(result *Result) error { payload, err := result.PayloadAsUInt32() if err != nil { return err } cmd.Value = uint32(payload) return nil } // Part3Supported represents a command that checks the supported PIDs 41 to 60. type Part3Supported struct { BaseCommand UIntCommand } // NewPart3Supported creates a new Part3Supported with the right parameters. func NewPart3Supported() *Part3Supported { return &Part3Supported{ BaseCommand{64, 4, "supported_commands_part3"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer // value. func (cmd *Part3Supported) SetValue(result *Result) error { payload, err := result.PayloadAsUInt32() if err != nil { return err } cmd.Value = uint32(payload) return nil } // Part4Supported represents a command that checks the supported PIDs 61 to 80. type Part4Supported struct { BaseCommand UIntCommand } // NewPart4Supported creates a new Part4Supported with the right parameters. func NewPart4Supported() *Part4Supported { return &Part4Supported{ BaseCommand{96, 4, "supported_commands_part4"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer // value. func (cmd *Part4Supported) SetValue(result *Result) error { payload, err := result.PayloadAsUInt32() if err != nil { return err } cmd.Value = uint32(payload) return nil } // Part5Supported represents a command that checks the supported PIDs 81 to A0. type Part5Supported struct { BaseCommand UIntCommand } // NewPart5Supported creates a new Part5Supported with the right parameters.. func NewPart5Supported() *Part5Supported { return &Part5Supported{ BaseCommand{128, 4, "supported_commands_part5"}, UIntCommand{}, } } // SetValue processes the byte array value into the right unsigned integer // value. func (cmd *Part5Supported) SetValue(result *Result) error { payload, err := result.PayloadAsUInt32() if err != nil { return err } cmd.Value = uint32(payload) return nil } /*============================================================================== * Utilities */ var sensorCommands = []OBDCommand{ NewEngineLoad(), NewCoolantTemperature(), NewShortFuelTrim1(), NewLongFuelTrim1(), NewShortFuelTrim2(), NewLongFuelTrim2(), NewFuelPressure(), NewIntakeManifoldPressure(), NewEngineRPM(), NewVehicleSpeed(), NewTimingAdvance(), NewMafAirFlowRate(), NewThrottlePosition(), NewOBDStandards(), NewRuntimeSinceStart(), } // GetSensorCommands returns all the defined commands that are not commands // that check command availability on the connected car. func GetSensorCommands() []OBDCommand { return sensorCommands } <file_sep>package elmobd import ( "fmt" "testing" ) /*============================================================================== * Benchmarks */ var resultParseOBDResponse *Result func benchParseOBDResponse(cmd OBDCommand, input []string, b *testing.B) { var r *Result for n := 0; n < b.N; n++ { r, _ = parseOBDResponse(cmd, input) } resultParseOBDResponse = r } func BenchmarkParseOBDResponse4(b *testing.B) { benchParseOBDResponse( NewPart1Supported(), []string{"41 00 02 03 04 05"}, b, ) } func BenchmarkParseOBDResponse2(b *testing.B) { benchParseOBDResponse( NewEngineLoad(), []string{"41 04 03"}, b, ) } /*============================================================================== * Tests */ func assertEqual(t *testing.T, a interface{}, b interface{}) { if a == b { return } t.Fatal(fmt.Sprintf("%v != %v", a, b)) } func TestToCommand(t *testing.T) { assertEqual(t, NewPart1Supported().ToCommand(), "0100") assertEqual(t, NewEngineLoad().ToCommand(), "0104") assertEqual(t, NewVehicleSpeed().ToCommand(), "010D") } func TestIsSupported(t *testing.T) { sc := SupportedCommands{0x0, 0x0, 0x0, 0x0, 0x0} cmd1 := NewPart1Supported() if !sc.IsSupported(cmd1) { t.Error("Expected supported sensors to always be supported") } cmd2 := NewEngineLoad() sc.part1 = 0x10000000 if !sc.IsSupported(cmd2) { t.Errorf("Expected command %v to be supported", cmd2) } } func TestParseSupportedResponse(t *testing.T) { // ---- it accepts valid response res, err := parseSupportedResponse( NewPart1Supported(), []string{ "SEARCHING...", "41 00 01 02 03 04", }, ) if err != nil { t.Error("Failed parsing", err) } val, err := res.PayloadAsUInt32() if err != nil { t.Error("Invalid payload", err) } exp := uint32(0x01020304) if val != exp { t.Errorf("Expected 0x%02X, got 0x%02X", exp, val) } } func TestParseOBDResponse(t *testing.T) { type scenario struct { command OBDCommand outputs []string } scenarios := []scenario{ { NewPart1Supported(), []string{"41 00 02 03 04 05"}, }, { NewEngineLoad(), []string{"41 04 02"}, }, { NewCoolantTemperature(), []string{"41 05 FF"}, }, { NewShortFuelTrim1(), []string{"41 06 F2"}, }, { NewLongFuelTrim1(), []string{"41 07 2F"}, }, { NewShortFuelTrim2(), []string{"41 08 20"}, }, { NewLongFuelTrim2(), []string{"41 09 01"}, }, { NewFuelPressure(), []string{"41 0A BC"}, }, { NewIntakeManifoldPressure(), []string{"41 0B C2"}, }, { NewEngineRPM(), []string{"41 0C FF B2"}, }, { NewVehicleSpeed(), []string{"41 0D A9"}, }, { NewTimingAdvance(), []string{"41 0E 4F"}, }, { NewIntakeAirTemperature(), []string{"41 0F EB"}, }, { NewMafAirFlowRate(), []string{"41 10 C2 8B"}, }, { NewThrottlePosition(), []string{"41 11 FF"}, }, } for _, curr := range scenarios { _, err := parseOBDResponse( curr.command, curr.outputs, ) if err != nil { t.Error("Failed parsing", err) } } }
5c804ec7986400346de65c567b18c6392582e70f
[ "Go" ]
6
Go
AramisHM/elmobd
56ef3ed440ee98238f00b8c25ae46b0261f4c4a1
135ea3edc70ef02aef81c6d82d3e049428558e97
refs/heads/master
<repo_name>Hendrik-Jacobs/CodeSnippetMaker<file_sep>/CodeSnippetMaker/General/Export.cs using CodeSnippetMaker.Models; using EControls; using System.IO; using System.Linq; using System.Reflection; using System.Windows; namespace CodeSnippetMaker.General { public static class Export { public static void Run(ViewModel view) { if (SomeFieldIsEmpty(view)) { return; } if (CheckExportFolder(view)) { return; } if (CheckExportPath(view)) { return; } if (ShortCutExists(view)) { return; } WriteSnippet(view); } private static bool SomeFieldIsEmpty(ViewModel view) { foreach (PropertyInfo? prop in typeof(ViewModel).GetProperties()) { if (string.IsNullOrEmpty(prop.GetValue(view).ToString())) { if (prop.Name == "Description") { EMessageBox em = new($"Field {prop.Name} is empty.\nLeave it empty?", MessageBoxButton.OKCancel); em.ShowDialog(); if (em.Result == MessageBoxResult.Cancel) { return true; } continue; } EMessageBox eb = new($"Error: Field {prop.Name} is empty."); eb.ShowDialog(); return true; } } return false; } private static bool ShortCutExists(ViewModel view) { if (IsDefaultShortcut(view)) { return true; } if (IsCustomShortcut(view)) { return true; } return false; } private static bool IsDefaultShortcut(ViewModel view) { if (Helper.DefaultShortcuts.Contains(view.ShortCut)) { EMessageBox eb = new($"Error: Shortcut '{view.ShortCut}' is a default shortcut."); eb.ShowDialog(); return true; } return false; } private static bool IsCustomShortcut(ViewModel view) { string[] files = Directory.GetFiles(view.ExportFolder); foreach (string file in files) { string text = File.ReadAllText(file); int end = text.IndexOf("</Shortcut>"); int start = text[..end].LastIndexOf(">") + 1; string shortcut = text[start..end]; if (shortcut == view.ShortCut) { EMessageBox eb = new($"Error: Shortcut '{view.ShortCut}' already exists as custom shortcut."); eb.ShowDialog(); return true; } } return false; } private static bool CheckExportFolder(ViewModel view) { return !Directory.Exists(view.ExportFolder); } private static bool CheckExportPath(ViewModel view) { return Directory.Exists($@"{view.ExportFolder}\{view.FileName}.snippet"); } private static void WriteSnippet(ViewModel view) { string literals = GetLiterals(view); string text = "<?xml version=\"1.0\" encoding=\"utf - 8\"?>\n" + "<CodeSnippets xmlns=\"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet\">\n" + " <CodeSnippet Format=\"1.0.0\">\n" + " <Header>\n" + $" <Title>{view.Title}</Title>\n" + $" <Author>{view.Author}</Author>\n" + $" <Description>{view.Description}</Description>\n" + $" <Shortcut>{view.ShortCut}</Shortcut>\n" + " </Header>\n" + " <Snippet>\n" + " <Code Language=\"CSharp\">\n" + $" <![CDATA[{view.Code}]]>\n" + " </Code>\n" + $"{literals}" + " </Snippet>\n" + " </CodeSnippet>\n" + "</CodeSnippets>"; File.WriteAllText($@"{view.ExportFolder}\{view.FileName}.snippet", text); } private static string GetLiterals(ViewModel view) { if (view.Literals == null) { return ""; } if (view.Literals.Count == 0) { return ""; } string literals = " <Declarations>\n"; foreach (LiteralModel literal in view.Literals) { if (string.IsNullOrEmpty(literal.ID) || string.IsNullOrEmpty(literal.Default)) { continue; } literals += " <Literal>\n" + $" <ID>{literal.ID}</ID>\n" + $" <Default>{literal.Default}</Default>\n" + " </Literal>\n"; } if (literals.IndexOf('\n') == literals.Length - 1) { return ""; } literals += " </Declarations>\n"; return literals; } } }<file_sep>/CodeSnippetMaker/General/Picker.cs using System.Windows.Forms; namespace CodeSnippetMaker.General; public static class Picker { public static string FolderPicker() { FolderBrowserDialog openFileDlg = new FolderBrowserDialog(); string result = openFileDlg.ShowDialog().ToString(); if (result.ToLower() == "ok") { return openFileDlg.SelectedPath; } return ""; } public static string OpenPicker(string path) { OpenFileDialog dlg = new(); if (string.IsNullOrEmpty(path) == false) { dlg.InitialDirectory = path; } dlg.Filter = "Code Snippet (.snippet)|*.snippet"; if (dlg.ShowDialog() == DialogResult.OK) { return dlg.FileName; } return ""; } }<file_sep>/CodeSnippetMaker/General/Import.cs using CodeSnippetMaker.Models; using System.IO; namespace CodeSnippetMaker.General { public static class Import { public static ViewModel Run(ViewModel model) { ViewModel view = new ViewModel(model); string path = Picker.OpenPicker(model.ExportFolder); if (string.IsNullOrEmpty(path)) { return null; } string text = File.ReadAllText(path); view.Title = GetValue(text, "<Title>", "</Title>"); view.Author = GetValue(text, "<Author>", "</Author>"); view.Description = GetValue(text, "<Description>", "</Description>"); view.ShortCut = GetValue(text, "<Shortcut>", "</Shortcut>"); view.Code = GetCode(text); view.Language = GetLanguage(text); view.FileName = GetFileName(path); int index = text.IndexOf("<Literal>"); if (index == -1) { return view; } text = text[index..]; while (true) { string id = GetValue(text, "<ID>", "</ID>"); string def = GetValue(text, "<Default>", "</Default>"); if (string.IsNullOrEmpty(id) == false) { view.Literals.Add(new LiteralModel(id, def)); } text = text[1..]; text = text[text.IndexOf("</Default>")..]; if (text.IndexOf("<Default>") == -1) { break; } } return view; } private static string GetValue(string text, string startTag, string endTag) { int index = text.IndexOf(startTag); if (index == -1) { return ""; } text = text[index..].Replace(startTag, ""); index = text.IndexOf(endTag); text = text[..index]; return text; } private static string GetLanguage(string text) { int index = text.IndexOf("<Code Language="); if (index == -1) { return ""; } text = text[index..]; index = text.IndexOf('"'); if (index == -1) { return ""; } index++; text = text[index..]; index = text.IndexOf('"'); if (index == -1) { return ""; } text = text[..index]; return text; } private static string GetCode(string text) { int start = text.IndexOf("<![CDATA["); if (start == -1) { return ""; } start += 9; int end = text.IndexOf("</Code>"); if (end == -1) { return ""; } text = text[start..end].Trim(); text = text[..^3]; return text; } private static string GetFileName(string text) { string[] parts = text.Split('\\'); return parts[^1].Replace(".snippet", ""); } } }<file_sep>/CodeSnippetMaker/General/Texts.cs using CodeSnippetMaker.Models; using System.Collections.Generic; using System.Linq; using System.Text; namespace CodeSnippetMaker.General { public static class Texts { public static Dictionary<string, string> SplitColors(ViewModel view) { StringBuilder white = new(); StringBuilder violet = new(); int i = -1; int end = -1; foreach (char c in view.Code) { i++; if (end == -1) { if (c == '$') { int next = view.Code.IndexOf('$', i + 1); if (next == -1) { white.Append(c); violet.Append(' '); continue; } int start = i + 1; string name = view.Code[start..next]; int result = view.Literals.Where(x => x.ID == name).ToList().Count; if (result == 1) { end = next; } } } if (end == -1) { if (c == '\n' || c == '\t' || c == '\r') { white.Append(c); violet.Append(c); continue; } white.Append(c); violet.Append(' '); } else { white.Append(' '); violet.Append(c); if (end == i) { end = -1; } } } Dictionary<string, string> texts = new(); texts.Add("White", white.ToString()); texts.Add("Violet", violet.ToString()); return texts; } } }<file_sep>/CodeSnippetMaker/Views/MainWindow.xaml.cs using CodeSnippetMaker.General; using CodeSnippetMaker.Models; using System; using System.ComponentModel; using System.Windows; namespace CodeSnippetMaker { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); _view = new(); DataContext = _view; } private ViewModel _view; private void OnWinClose(object sender, CancelEventArgs e) => Settings.Save(_view); private void ClickOpen(object sender, EventArgs e) { ViewModel view = Import.Run(_view); if (view != null) { _view = view; DataContext = _view; } } private void ClickExport(object sender, EventArgs e) => Export.Run(_view); private void ColumnLostFocus(object sender, RoutedEventArgs e) => _view.UpdateTexts(); private void ClickFolder(object sender, EventArgs e) { string folder = Picker.FolderPicker(); if (string.IsNullOrEmpty(folder)) { return; } _view.ExportFolder = folder; } } }<file_sep>/CodeSnippetMaker/Models/LiteralModel.cs namespace CodeSnippetMaker.Models { public class LiteralModel { public LiteralModel(string id, string def) { ID = id; Default = def; } public string ID { get; set; } public string Default { get; set; } } }<file_sep>/CodeSnippetMaker/Models/ViewModel.cs using CodeSnippetMaker.General; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.IO; namespace CodeSnippetMaker.Models { public class ViewModel : INotifyPropertyChanged { #region Constructors public ViewModel() { Literals = new(); if (File.Exists(Helper.JsonPath)) { string[] settings = Settings.Load(); Author = settings[0]; Language = settings[1]; ExportFolder = settings[2]; } Literals.CollectionChanged += new NotifyCollectionChangedEventHandler(LiteralsChanged); } public ViewModel(ViewModel other) { Literals = new(); Author = other.Author; Language = other.Language; ExportFolder = other.ExportFolder; Literals.CollectionChanged += new NotifyCollectionChangedEventHandler(LiteralsChanged); } #endregion Constructors #region Fields private string _author; private string _language; private string _exportPath; private string _fileName; private string _code; private string _codeWhite; private string _codeViolet; private string _title; private string _description; private string _shortCut; #endregion Fields #region Properties# public ObservableCollection<LiteralModel> Literals { get; set; } public string Author { get { if (string.IsNullOrEmpty(_author)) { return ""; } return _author; } set { if (_author != value) { _author = value; OnPropertyChanged("Author"); } } } public string Language { get { if (string.IsNullOrEmpty(_language)) { return ""; } return _language; } set { if (_language != value) { _language = value; OnPropertyChanged("Language"); } } } public string ExportFolder { get { if (string.IsNullOrEmpty(_exportPath)) { return ""; } return _exportPath; } set { if (_exportPath != value) { _exportPath = value; OnPropertyChanged("ExportFolder"); } } } public string Code { get { if (string.IsNullOrEmpty(_code)) { return ""; } return _code; } set { if (_code != value) { _code = value; UpdateTexts(); OnPropertyChanged("Code"); } } } public string CodeWhite { get { if (string.IsNullOrEmpty(_codeWhite)) { return ""; } return _codeWhite; } set { if (_codeWhite != value) { _codeWhite = value; OnPropertyChanged("CodeWhite"); } } } public string CodeViolet { get { if (string.IsNullOrEmpty(_codeViolet)) { return ""; } return _codeViolet; } set { if (_codeViolet != value) { _codeViolet = value; OnPropertyChanged("CodeViolet"); } } } public string Title { get { if (string.IsNullOrEmpty(_title)) { return ""; } return _title; } set { if (_title != value) { _title = value; OnPropertyChanged("Title"); } } } public string Description { get { if (string.IsNullOrEmpty(_description)) { return ""; } return _description; } set { if (_description != value) { _description = value; OnPropertyChanged("Description"); } } } public string ShortCut { get { if (string.IsNullOrEmpty(_shortCut)) { return ""; } return _shortCut; } set { if (_shortCut != value) { _shortCut = value; OnPropertyChanged("ShortCut"); } } } public string FileName { get { if (string.IsNullOrEmpty(_fileName)) { return ""; } return _fileName; } set { if (_fileName != value) { _fileName = value; OnPropertyChanged("FileName"); } } } #endregion Properties private void LiteralsChanged(object sender, NotifyCollectionChangedEventArgs e) { UpdateTexts(); } public void UpdateTexts() { Dictionary<string, string> texts = Texts.SplitColors(this); CodeWhite = texts["White"]; CodeViolet = texts["Violet"]; } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } #endregion INotifyPropertyChanged Members}} } }<file_sep>/CodeSnippetMaker/General/Helper.cs namespace CodeSnippetMaker.General { public static class Helper { public const string JsonPath = @"json\settings.json"; public const string JsonFolder = @"json"; public static string[] DefaultShortcuts = { "#if", "#region", "~", "Attribute", "checked", "class", "ctor", "cw", "do", "else", "enum", "equals", "exception", "for", "foreach", "forr", "if", "Indexer", "interface", "invoke", "Iterator", "iterindex", "lock", "mbox", "namespace", "prop", "propfull", "propg", "sim", "struct", "svm", "switch", "try", "tryf", "unchecked", "unsafe", "using", "while" }; } }<file_sep>/CodeSnippetMaker/General/Settings.cs using CodeSnippetMaker.Models; using Newtonsoft.Json; using System.IO; namespace CodeSnippetMaker.General { public static class Settings { public static void Save(ViewModel view) { if (Directory.Exists(Helper.JsonFolder) == false) { Directory.CreateDirectory(Helper.JsonFolder); } string[] values = { view.Author, view.Language, view.ExportFolder }; string json = JsonConvert.SerializeObject(values); File.WriteAllText(Helper.JsonPath, json); } public static string[] Load() { string json = File.ReadAllText(Helper.JsonPath); string[] values = JsonConvert.DeserializeObject<string[]>(json); return values; } } }
5bc985dbcc8d6411398ced1117cde561b05c2f84
[ "C#" ]
9
C#
Hendrik-Jacobs/CodeSnippetMaker
c6aafd025b982071e04ddcdb60f676ac19418e1e
c304ee2dfcb1f1a3f2eb27b305bb6ac58337629b
refs/heads/master
<repo_name>RedBomb1811/cwp-07<file_sep>/readAll.js let articles = require('./articles.json'); const log = require('./log'); function readAll(req, res, payload, cb) { log.log('/api/articles/readAll', payload); if(payload.sortField === undefined) payload.sortField = 'date'; if(payload.sortOrder === undefined) payload.sortOrder = 'desc'; if(payload.page === undefined) payload.page = 1; if(payload.limit === undefined) payload.limit = 10; if(payload.includeDeps === undefined) payload.includeDeps = 'false'; articles.articles.sort((a, b)=>{ if((a[payload.sortField] > b[payload.sortField]) ^ (payload.sortOrder === 'asc')) return -1; if((a[payload.sortField] < b[payload.sortField]) ^ (payload.sortOrder === 'asc')) return 1; else return 0; }); let begin = (payload.page - 1)*payload.limit; let end = begin + payload.limit; let reqArr = { items : articles.articles.slice(begin, end), page : payload.page, pages : Math.ceil(articles.articles.length / payload.limit), count : articles.articles.length, limit : payload.limit }; if(payload.includeDeps === 'false') reqArr.items.forEach((elem)=>{ elem.comments = []; }); cb(null, reqArr); } exports.readAll = readAll;<file_sep>/updateArticle.js let articles = require('./articles.json'); const log = require('./log'); const fs = require("fs"); function updateArticle(req, res, payload, cb) { let article = payload; const index = articles.articles.findIndex(article => article.id === payload.id); if (index !== -1) { articles.articles.splice(index, 1, article); log.log('/api/articles/update', payload); fs.writeFile('./articles.json', JSON.stringify(articles), (err)=>{ if(err) throw Error(err); cb(null, article); }); } else { cb('error'); } } exports.updateArticle = updateArticle;<file_sep>/read.js let articles = require('./articles.json'); const log = require('./log'); function read(req, res, payload, cb) { let article = articles.articles.find(article => article.id === payload.id); if (article) { log.log('/api/articles/read', payload); cb(null, article); } else { cb('error'); } } exports.read = read;<file_sep>/deleteComment.js let articles = require('./articles.json'); const log = require('./log'); const fs = require("fs"); function deleteComment(req, res, payload, cb) { try { let commentD = payload; let index; const article = articles.find(article => (index = article.comments.findIndex(comment => comment.id == commentD.articleId)) !== -1); if (article) { article.comments.splice(index, 1); log.log('/api/comments/delete', payload); fs.writeFile('./articles.json', JSON.stringify(articles), (err)=>{ if(err) throw Error(err); cb(null, null); }); } else { cb('error'); } } catch (exception) { console.log(exception.message); } } exports.deleteComment = deleteComment;<file_sep>/createComment.js let articles = require('./articles.json'); const log = require('./log'); const fs = require("fs"); function createComment(req, res, payload, cb) { let comment = payload; const article = articles.articles.find(article => article.id === payload.articleId); comment.id = article.comments.length; comment.date = Date.now(); if (article) { article.comments.push(comment); log.log('/api/comments/create', payload); fs.writeFile('./articles.json', JSON.stringify(articles), (err)=>{ if(err) throw Error(err); cb(null, article); }); } else { cb('error'); } } exports.createComment = createComment;<file_sep>/createArticle.js let articles = require('./articles.json'); const log = require('./log'); const fs = require('fs'); function createArticle(req, res, payload, cb) { let article = payload; article.id = articles.articles.length; article.date = Date.now(); articles.articles.push(article); if (article) { log.log('/api/articles/create', payload); fs.writeFile('./articles.json', JSON.stringify(articles), (err)=>{ if(err) throw Error(err); cb(null, article); }); } else { cb('error'); } } exports.createArticle = createArticle;
21334d24f7b78e0c093d042345027a944ac4ceba
[ "JavaScript" ]
6
JavaScript
RedBomb1811/cwp-07
8adef6d4f331096120606d8bc119377401d9515b
a74aec92bd2e737a9be0752323d192b22e161286
refs/heads/master
<repo_name>hk0792/UsefulClass<file_sep>/EBookDroid/src/org/ebookdroid/core/views/PageViewZoomControls.java package org.ebookdroid.core.views; import org.ebookdroid.core.models.ZoomModel; import android.content.Context; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.widget.LinearLayout; public class PageViewZoomControls extends LinearLayout { public PageViewZoomControls(final Context context, final ZoomModel zoomModel) { super(context); setVisibility(View.GONE); setOrientation(LinearLayout.HORIZONTAL); setGravity(Gravity.BOTTOM); addView(new ZoomRoll(context, zoomModel)); zoomModel.addListener(this); } @Override public boolean onTouchEvent(final MotionEvent event) { return false; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/views/SpotlightDrawable.java /* * Copyright (C) 2008 <NAME> * * 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. */ package org.ebookdroid.core.views; import org.ebookdroid.R; import org.ebookdroid.core.bitmaps.BitmapManager; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.PixelFormat; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; public class SpotlightDrawable extends Drawable { private final Bitmap mBitmap; private final Paint mPaint; private final ViewGroup mView; private boolean mOffsetDisabled; private boolean mBlockSetBounds; private Drawable mParent; public SpotlightDrawable(Context context, ViewGroup view) { this(context, view, R.drawable.spotlight); } public SpotlightDrawable(Context context, ViewGroup view, int resource) { mView = view; mBitmap = BitmapManager.getResource(resource); mPaint = new Paint(); mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SCREEN)); } public void draw(Canvas canvas) { if (mView.hasWindowFocus()) { final Rect bounds = getBounds(); canvas.save(); canvas.drawBitmap(mBitmap, bounds.left, bounds.top, mPaint); } } @Override public void setBounds(int left, int top, int right, int bottom) { if (mBlockSetBounds) return; if (!mOffsetDisabled) { final int width = getIntrinsicWidth(); final View view = mView.getChildAt(0); if (view != null) left -= (width - view.getWidth()) / 2.0f; right = left + width; bottom = top + getIntrinsicHeight(); } else { right = left + getIntrinsicWidth(); bottom = top + getIntrinsicHeight(); } super.setBounds(left, top, right, bottom); if (mParent != null) { mBlockSetBounds = true; mParent.setBounds(left, top, right, bottom); mBlockSetBounds = false; } } public void setParent(Drawable drawable) { mParent = drawable; } @Override protected boolean onStateChange(int[] state) { invalidateSelf(); return super.onStateChange(state); } public void setAlpha(int alpha) { mPaint.setAlpha(alpha); } public void setColorFilter(ColorFilter cf) { mPaint.setColorFilter(cf); } public int getOpacity() { return PixelFormat.TRANSLUCENT; } @Override public int getIntrinsicWidth() { return mBitmap.getWidth(); } @Override public int getIntrinsicHeight() { return mBitmap.getHeight(); } public void disableOffset() { mOffsetDisabled = true; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/utils/SystemUtils.java package org.ebookdroid.core.utils; import org.ebookdroid.EBookDroidApp; import android.app.ActivityManager; import android.app.ActivityManager.RunningServiceInfo; import android.content.ComponentName; import android.content.Context; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.StringWriter; import java.util.List; public class SystemUtils { private static final ComponentName SYSTEM_UI = new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService"); private static final String SU_PATH1 = "/system/bin/su"; private static final String SU_PATH2 = "/system/xbin/su"; private SystemUtils() { } private static String getSuPath() { File file = new File(SU_PATH1); if (file.exists() && file.isFile() && file.canExecute()) { return SU_PATH1; } else { File file1 = new File(SU_PATH2); if (file1.exists() && file1.isFile() && file1.canExecute()) return SU_PATH2; } return null; } public static final boolean isSystemUIRunning() { ActivityManager actvityManager = (ActivityManager) EBookDroidApp.context .getSystemService(Context.ACTIVITY_SERVICE); List<RunningServiceInfo> rsiList = actvityManager.getRunningServices(1000); for (RunningServiceInfo rsi : rsiList) { if (SYSTEM_UI.equals(rsi.service)) { return true; } } return false; } public static void startSystemUI() { if (isSystemUIRunning()) { return; } exec(new String[] { "/system/bin/am", "startservice", "-n", "com.android.systemui/.SystemUIService" }); } public static boolean stopSystemUI() { if (!isSystemUIRunning()) { return true; } final String su = getSuPath(); if (su == null) { return false; } else { exec(new String[] { su, "-c", "service call activity 79 s16 com.android.systemui" }); } return true; } public static void toggleSystemUI() { if (isSystemUIRunning()) { stopSystemUI(); } else { startSystemUI(); } } public static void exec(final String... as) { (new Thread(new Runnable() { public void run() { execImpl(as); } })).start(); } private static String execImpl(String... as) { try { Process process = Runtime.getRuntime().exec(as); InputStreamReader r = new InputStreamReader(process.getInputStream()); StringWriter w = new StringWriter(); char ac[] = new char[8192]; int i = 0; do { i = r.read(ac, 0, 8192); w.write(ac, 0, i); } while (i != -1); r.close(); process.waitFor(); return w.toString(); } catch (IOException e) { throw new IllegalStateException(e); } catch (InterruptedException e) { throw new IllegalStateException(e); } } } <file_sep>/EBookDroid/src/org/ebookdroid/fb2droid/codec/FB2MarkupEndPage.java package org.ebookdroid.fb2droid.codec; public class FB2MarkupEndPage implements FB2MarkupElement { @Override public void publishToDocument(final FB2Document doc) { doc.commitPage(); } } <file_sep>/MenuCode/src/com/keensoft/websitebook/ui/MainActivity.java package com.keensoft.websitebook.ui; import java.util.List; import android.content.Intent; import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import com.keensoft.websitebook.R; import com.keensoft.websitebook.adapter.CommonAdapter; import com.keensoft.websitebook.adapter.ViewHolder; import com.keensoft.websitebook.beans.FolderItem; import com.keensoft.websitebook.db.FaiCodeDatabase; import com.keensoft.websitebook.fragment.MainListFragment; import com.keensoft.websitebook.fragment.MainListFragment.OnSelectedListener; import com.umeng.analytics.MobclickAgent; import com.umeng.update.UmengUpdateAgent; public class MainActivity extends ActionBarActivity implements OnSelectedListener { private DrawerLayout mDrawerLayout; private ActionBarDrawerToggle mDrawerToggle; private ListView mDrawerList; private View left; private String[] mNaviItemText; private CharSequence mTitle; private CharSequence mDrawerTitle; private CommonAdapter<FolderItem> mAdapter; private List<FolderItem> data; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initDrawerLayout(); selectNaviItem(0); UmengUpdateAgent.update(this); } public void onResume() { super.onResume(); MobclickAgent.onResume(this); } public void onPause() { super.onPause(); MobclickAgent.onPause(this); } @Override public void onSelect(String url) { // TODO Auto-generated method stub Uri uri = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } private void initDrawerLayout() { mNaviItemText = getResources().getStringArray(R.array.navi_items); mDrawerTitle = getResources().getString(R.string.app_name); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); left = findViewById(R.id.id_left_menu); mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); mDrawerList = (ListView) findViewById(R.id.left_drawer); data = FaiCodeDatabase.getInstance(this).getFolderItemList(); mAdapter = new CommonAdapter<FolderItem>(this, data, R.layout.view_navi_drawer_item) { @Override public void convert(ViewHolder helper, FolderItem file) { helper.setText(R.id.tv_navi_item_text, file.getName()); } }; mDrawerList.setAdapter(mAdapter); mDrawerList .setOnItemClickListener(new NaviDrawerListItemOnClickListner()); initialDrawerListener(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); } private void initialDrawerListener() { mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) { @Override public void onDrawerOpened(View drawerView) { // getSupportActionBar().setTitle(mDrawerTitle); } @Override public void onDrawerClosed(View drawerView) { // getSupportActionBar().setTitle(mTitle); } }; mDrawerLayout.setDrawerListener(mDrawerToggle); } private class NaviDrawerListItemOnClickListner implements OnItemClickListener { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { selectNaviItem(position); } } private void selectNaviItem(int position) { Fragment topLevelFrgmt = null; topLevelFrgmt = new MainListFragment(); Bundle bundle = new Bundle(); bundle.putInt("folderid", mAdapter.getItem(position).getId()); topLevelFrgmt.setArguments(bundle); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.main_content, topLevelFrgmt); ft.commit(); mDrawerList.setItemChecked(position, true); setTitle(mNaviItemText[position]); mDrawerLayout.closeDrawer(left); } @Override public void setTitle(CharSequence title) { mTitle = title; getSupportActionBar().setTitle(mTitle); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); mDrawerToggle.syncState(); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { if (mDrawerToggle.onOptionsItemSelected(item)) { return true; } // return super.onOptionsItemSelected(item); } } <file_sep>/EBookDroid/jni/ebookdroid/Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := ebookdroid ifneq ($(TARGET_ARCH_ABI),x86) LOCAL_ARM_MODE := arm endif # TARGET_ARCH_ABI != x86 LOCAL_CFLAGS := LOCAL_SRC_FILES := \ ebookdroidjni.c \ pdfdroidbridge.c \ xpsdroidbridge.c \ DjvuDroidBridge.cpp \ cbdroidbridge.c \ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../mupdf/mupdf/fitz \ $(LOCAL_PATH)/../mupdf/mupdf/pdf \ $(LOCAL_PATH)/../mupdf/mupdf/xps \ $(LOCAL_PATH)/../djvu \ $(LOCAL_PATH)/../hqx LOCAL_CXX_INCLUDES := \ $(LOCAL_PATH)/../libdjvu LOCAL_STATIC_LIBRARIES := mupdf djvu jpeg hqx # uses Android log and z library (Android-3 Native API) LOCAL_LDLIBS := -llog -lz include $(BUILD_SHARED_LIBRARY) <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/RecentAdapter.java package org.ebookdroid.core.presentation; import org.ebookdroid.R; import org.ebookdroid.core.IBrowserActivity; import org.ebookdroid.core.settings.books.BookSettings; import org.ebookdroid.core.utils.FileExtensionFilter; import org.ebookdroid.utils.FileUtils; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class RecentAdapter extends BaseAdapter { final IBrowserActivity base; private List<BookSettings> books = Collections.emptyList(); public RecentAdapter(IBrowserActivity base) { this.base = base; } @Override public int getCount() { return books.size(); } @Override public BookSettings getItem(final int i) { return books.get(i); } @Override public long getItemId(final int i) { return i; } @Override public View getView(final int i, final View view, final ViewGroup parent) { final ViewHolder holder = BaseViewHolder.getOrCreateViewHolder(ViewHolder.class, R.layout.recentitem, view, parent); final BookSettings bs = books.get(i); final File file = new File(bs.fileName); holder.name.setText(file.getName()); // holder.imageView.setScaleType(ImageView.ScaleType.FIT_XY); base.loadThumbnail(file.getPath(), holder.imageView, R.drawable.book); holder.info.setText(FileUtils.getFileDate(file.lastModified())); holder.fileSize.setText(FileUtils.getFileSize(file.length())); return holder.getView(); } public void clearBooks() { this.books = Collections.emptyList(); notifyDataSetInvalidated(); } public void setBooks(final Collection<BookSettings> books, final FileExtensionFilter filter) { if (filter != null) { this.books = new ArrayList<BookSettings>(books.size()); for (final BookSettings bs : books) { if (filter.accept(bs.fileName)) { this.books.add(bs); } } } else { this.books = new ArrayList<BookSettings>(books); } notifyDataSetInvalidated(); } static class ViewHolder extends BaseViewHolder { TextView name; ImageView imageView; TextView info; TextView fileSize; @Override public void init(final View convertView) { super.init(convertView); name = (TextView) convertView.findViewById(R.id.recentItemName); imageView = (ImageView) convertView.findViewById(R.id.recentItemIcon); info = (TextView) convertView.findViewById(R.id.recentItemInfo); fileSize = (TextView) convertView.findViewById(R.id.recentItemfileSize); } } } <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/OutlineAdapter.java package org.ebookdroid.core.presentation; import org.ebookdroid.R; import org.ebookdroid.core.OutlineLink; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.RelativeLayout; import android.widget.RelativeLayout.LayoutParams; import android.widget.TextView; import java.util.List; public class OutlineAdapter extends ArrayAdapter<OutlineLink> { private int margin; public OutlineAdapter(Context context, List<OutlineLink> objects) { super(context, android.R.layout.simple_list_item_1, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { View container = null; TextView view = null; boolean firstTime = false; if (convertView == null) { container = LayoutInflater.from(getContext()).inflate(R.layout.outline_item, parent, false); firstTime = true; } else { container = convertView; } view = (TextView) container.findViewById(R.id.outline_title); OutlineLink item = getItem(position); view.setText(item.title.trim()); RelativeLayout.LayoutParams l = (LayoutParams) view.getLayoutParams(); if (firstTime) { margin = l.leftMargin; } l.leftMargin = Math.min(5, item.level + 1) * margin; return container; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/utils/archives/zip/ZipArchiveEntry.java package org.ebookdroid.core.utils.archives.zip; import org.ebookdroid.core.utils.archives.ArchiveEntry; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; public class ZipArchiveEntry implements ArchiveEntry { final ZipArchive archive; final ZipEntry entry; ZipArchiveEntry(final ZipArchive archive, final ZipEntry entry) { this.archive = archive; this.entry = entry; } /** * {@inheritDoc} * * @see org.ebookdroid.core.utils.archives.ArchiveEntry#getName() */ @Override public String getName() { return entry.getName(); } /** * {@inheritDoc} * * @see org.ebookdroid.core.utils.archives.ArchiveEntry#isDirectory() */ @Override public boolean isDirectory() { return entry.isDirectory(); } @Override public InputStream open() throws IOException { return archive.open(this); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/BookNode.java package org.ebookdroid.core.presentation; import org.ebookdroid.utils.StringUtils; import java.io.File; public class BookNode implements Comparable<BookNode> { public final String name; public final String path; BookNode(final File f) { this.name = f.getName(); this.path = f.getAbsolutePath(); } @Override public String toString() { return this.name; } @Override public int compareTo(BookNode that) { if (this == that) { return 0; } return StringUtils.compareNatural(this.path, that.path); } } <file_sep>/EBookDroid/src/org/ebookdroid/cbdroid/CbrViewerActivity.java package org.ebookdroid.cbdroid; import org.ebookdroid.cbdroid.codec.CbxArchiveFactory; import org.ebookdroid.cbdroid.codec.CbxContext; import org.ebookdroid.core.BaseViewerActivity; import org.ebookdroid.core.DecodeService; import org.ebookdroid.core.DecodeServiceBase; import org.ebookdroid.core.utils.archives.ArchiveFile; import org.ebookdroid.core.utils.archives.rar.RarArchive; import org.ebookdroid.core.utils.archives.rar.RarArchiveEntry; import java.io.File; import java.io.IOException; public class CbrViewerActivity extends BaseViewerActivity implements CbxArchiveFactory<RarArchiveEntry> { /** * {@inheritDoc} * * @see org.ebookdroid.core.BaseViewerActivity#createDecodeService() */ @Override protected DecodeService createDecodeService() { return new DecodeServiceBase(new CbxContext<RarArchiveEntry>(this)); } /** * {@inheritDoc} * * @see org.ebookdroid.cbdroid.codec.CbxArchiveFactory#create(java.io.File, java.lang.String) */ @Override public ArchiveFile<RarArchiveEntry> create(final File file, final String password) throws IOException { return new RarArchive(file); } } <file_sep>/EBookDroid/src/org/ebookdroid/xpsdroid/codec/XpsContext.java package org.ebookdroid.xpsdroid.codec; import org.ebookdroid.core.EBookDroidLibraryLoader; import org.ebookdroid.core.codec.AbstractCodecContext; import org.ebookdroid.core.codec.CodecDocument; import android.graphics.Bitmap; public class XpsContext extends AbstractCodecContext { public static final boolean useNativeGraphics; public static final Bitmap.Config BITMAP_CFG = Bitmap.Config.RGB_565; public static final Bitmap.Config NATIVE_BITMAP_CFG = Bitmap.Config.ARGB_8888; static { EBookDroidLibraryLoader.load(); useNativeGraphics = isNativeGraphicsAvailable(); } @Override public Bitmap.Config getBitmapConfig() { return useNativeGraphics ? NATIVE_BITMAP_CFG : BITMAP_CFG; } @Override public CodecDocument openDocument(final String fileName, final String password) { return new XpsDocument(this, fileName); } private static native boolean isNativeGraphicsAvailable(); } <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/BrowserAdapter.java package org.ebookdroid.core.presentation; import org.ebookdroid.R; import org.ebookdroid.core.settings.SettingsManager; import org.ebookdroid.utils.FileUtils; import org.ebookdroid.utils.LengthUtils; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import java.io.File; import java.io.FileFilter; import java.util.Arrays; import java.util.Comparator; public class BrowserAdapter extends BaseAdapter implements Comparator<File> { private final FileFilter filter; private File currentDirectory; private File[] files = null; public BrowserAdapter(final FileFilter filter) { this.filter = filter; } @Override public int getCount() { if (LengthUtils.isNotEmpty(files)) { return files.length; } return 0; } @Override public File getItem(final int i) { if (LengthUtils.isNotEmpty(files)) { return files[i]; } return null; } @Override public long getItemId(final int i) { return i; } @Override public View getView(final int i, final View view, final ViewGroup parent) { final ViewHolder holder = BaseViewHolder.getOrCreateViewHolder(ViewHolder.class, R.layout.browseritem, view, parent); final File file = getItem(i); holder.textView.setText(file.getName()); if (file.isDirectory()) { final boolean watched = SettingsManager.getAppSettings().getAutoScanDirs().contains(file.getPath()); holder.imageView.setImageResource(watched ? R.drawable.folderwatched : R.drawable.folderopen); holder.info.setText(""); holder.fileSize.setText(""); } else { holder.imageView.setImageResource(R.drawable.book); holder.info.setText(FileUtils.getFileDate(file.lastModified())); holder.fileSize.setText(FileUtils.getFileSize(file.length())); } return holder.getView(); } public void setCurrentDirectory(final File currentDirectory) { if (currentDirectory.getAbsolutePath().startsWith("/sys")) { return; } this.currentDirectory = currentDirectory; final File[] files = currentDirectory.listFiles(filter); if (LengthUtils.isNotEmpty(files)) { Arrays.sort(files, this); } setFiles(files); } private void setFiles(final File[] files) { this.files = files; notifyDataSetInvalidated(); } public File getCurrentDirectory() { return currentDirectory; } @Override public int compare(final File f1, final File f2) { if (f1.isDirectory() && f2.isFile()) { return -1; } if (f1.isFile() && f2.isDirectory()) { return 1; } return f1.getName().compareTo(f2.getName()); } static class ViewHolder extends BaseViewHolder { TextView textView; ImageView imageView; TextView info; TextView fileSize; @Override public void init(final View convertView) { super.init(convertView); textView = (TextView) convertView.findViewById(R.id.browserItemText); imageView = (ImageView) convertView.findViewById(R.id.browserItemIcon); info = (TextView) convertView.findViewById(R.id.browserItemInfo); fileSize = (TextView) convertView.findViewById(R.id.browserItemfileSize); } } } <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/BooksAdapter.java package org.ebookdroid.core.presentation; import org.ebookdroid.R; import org.ebookdroid.core.IBrowserActivity; import org.ebookdroid.core.settings.SettingsManager; import org.ebookdroid.core.settings.books.BookSettings; import org.ebookdroid.core.views.BookshelfView; import org.ebookdroid.utils.LengthUtils; import _android.util.SparseArrayEx; import android.database.DataSetObserver; import android.os.Parcelable; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; public class BooksAdapter extends PagerAdapter implements FileSystemScanner.Listener, Iterable<BookShelfAdapter> { final IBrowserActivity base; final AtomicBoolean inScan = new AtomicBoolean(); final SparseArrayEx<BookShelfAdapter> data = new SparseArrayEx<BookShelfAdapter>(); final TreeMap<String, BookShelfAdapter> folders = new TreeMap<String, BookShelfAdapter>(); private final static AtomicInteger SEQ = new AtomicInteger(1); private final RecentUpdater updater = new RecentUpdater(); private final RecentAdapter recent; private final FileSystemScanner scanner; private final List<DataSetObserver> _dsoList = new ArrayList<DataSetObserver>(); public BooksAdapter(final IBrowserActivity base, final RecentAdapter adapter) { this.base = base; this.recent = adapter; this.recent.registerDataSetObserver(updater); this.scanner = new FileSystemScanner(base); this.scanner.listeners.addListener(this); } @Override public void destroyItem(final View collection, final int position, final Object view) { ((ViewPager) collection).removeView((View) view); ((View) view).destroyDrawingCache(); } @Override public void finishUpdate(final View arg0) { // TODO Auto-generated method stub } @Override public Iterator<BookShelfAdapter> iterator() { return data.iterator(); } @Override public int getCount() { return getListCount(); } @Override public Object instantiateItem(final View arg0, final int arg1) { final BookshelfView view = new BookshelfView(base, arg0, getList(arg1)); ((ViewPager) arg0).addView(view, 0); return view; } @Override public boolean isViewFromObject(final View arg0, final Object arg1) { return arg0.equals(arg1); } @Override public void restoreState(final Parcelable arg0, final ClassLoader arg1) { // TODO Auto-generated method stub } @Override public Parcelable saveState() { return null; } @Override public void startUpdate(final View arg0) { // TODO Auto-generated method stub } public synchronized BookShelfAdapter getList(final int index) { return data.valueAt(index); } public synchronized int getListCount() { return data.size(); } public String getListName(final int currentList) { createRecent(); final BookShelfAdapter list = getList(currentList); return list != null ? LengthUtils.safeString(list.name) : ""; } public String getListPath(final int currentList) { createRecent(); final BookShelfAdapter list = getList(currentList); return list != null ? LengthUtils.safeString(list.path) : ""; } public synchronized List<String> getListNames() { createRecent(); final int size = data.size(); if (size == 0) { return null; } final List<String> result = new ArrayList<String>(data.size()); for (int index = 0; index < size; index++) { final BookShelfAdapter a = data.valueAt(index); result.add(a.name); } return result; } public synchronized List<String> getListPaths() { createRecent(); final int size = data.size(); if (size == 0) { return null; } final List<String> result = new ArrayList<String>(data.size()); for (int index = 0; index < size; index++) { final BookShelfAdapter a = data.valueAt(index); result.add(a.path); } return result; } public BookNode getItem(final int currentList, final int position) { createRecent(); if (0 <= currentList && currentList < data.size()) { return getList(currentList).nodes.get(position); } throw new RuntimeException("Wrong list id: " + currentList + "/" + data.size()); } public long getItemId(final int position) { return position; } public synchronized void clearData() { final BookShelfAdapter oldRecent = data.get(0); data.clear(); folders.clear(); SEQ.set(1); if (oldRecent != null) { data.append(0, oldRecent); } else { createRecent(); } notifyDataSetChanged(); } private synchronized BookShelfAdapter createRecent() { BookShelfAdapter a = data.get(0); if (a == null) { a = new BookShelfAdapter(base, 0, base.getContext().getString(R.string.recent_title), ""); data.append(0, a); } return a; } public void startScan() { clearData(); scanner.startScan(SettingsManager.getAppSettings().getAutoScanDirs()); } public void stopScan() { scanner.stopScan(); } @Override public synchronized void onFileScan(final File parent, final File[] files) { final String dir = parent.getAbsolutePath(); BookShelfAdapter a = folders.get(dir); if (LengthUtils.isEmpty(files)) { if (a != null) { onDirDeleted(parent.getParentFile(), parent); } } else { if (a == null) { a = new BookShelfAdapter(base, SEQ.getAndIncrement(), parent.getName(), dir); data.append(a.id, a); folders.put(dir, a); for (final File f : files) { a.nodes.add(new BookNode(f)); } notifyDataSetChanged(); } else { for (final File f : files) { a.nodes.add(new BookNode(f)); } a.notifyDataSetChanged(); } } } @Override public synchronized void onFileAdded(final File parent, final File f) { if (f != null) { final String dir = parent.getAbsolutePath(); BookShelfAdapter a = folders.get(dir); if (a == null) { a = new BookShelfAdapter(base, SEQ.getAndIncrement(), parent.getName(), dir); data.append(a.id, a); folders.put(dir, a); a.nodes.add(new BookNode(f)); Collections.sort(a.nodes); notifyDataSetChanged(); } else { a.nodes.add(new BookNode(f)); Collections.sort(a.nodes); a.notifyDataSetChanged(); } } } @Override public synchronized void onFileDeleted(final File parent, final File f) { final String dir = parent.getAbsolutePath(); final BookShelfAdapter a = folders.get(dir); if (a != null) { final String path = f.getAbsolutePath(); for (final Iterator<BookNode> i = a.nodes.iterator(); i.hasNext();) { final BookNode node = i.next(); if (path.equals(node.path)) { i.remove(); if (a.nodes.isEmpty()) { data.remove(a.id); folders.remove(a.path); this.notifyDataSetChanged(); } else { a.notifyDataSetChanged(); } return; } } } } @Override public void onDirAdded(final File parent, final File f) { scanner.startScan(f.getAbsolutePath()); } @Override public synchronized void onDirDeleted(final File parent, final File f) { final String dir = f.getAbsolutePath(); final BookShelfAdapter a = folders.get(dir); if (a != null) { data.remove(a.id); folders.remove(a.path); this.notifyDataSetChanged(); } } static class ViewHolder extends BaseViewHolder { ImageView imageView; TextView textView; @Override public void init(final View convertView) { super.init(convertView); this.imageView = (ImageView) convertView.findViewById(R.id.thumbnailImage); this.textView = (TextView) convertView.findViewById(R.id.thumbnailText); } } public void registerDataSetObserver(final DataSetObserver dataSetObserver) { _dsoList.add(dataSetObserver); } private void notifyDataSetInvalidated() { for (final DataSetObserver dso : _dsoList) { dso.onInvalidated(); } } @Override public void notifyDataSetChanged() { super.notifyDataSetChanged(); for (final DataSetObserver dso : _dsoList) { dso.onChanged(); } } private final class RecentUpdater extends DataSetObserver { @Override public void onChanged() { updateRecentBooks(); } @Override public void onInvalidated() { updateRecentBooks(); } private void updateRecentBooks() { final BookShelfAdapter ra = createRecent(); ra.nodes.clear(); final int count = recent.getCount(); for (int i = 0; i < count; i++) { final BookSettings item = recent.getItem(i); final File file = new File(item.fileName); final BookNode book = new BookNode(file); ra.nodes.add(book); final BookShelfAdapter a = folders.get(new File(book.path).getParent()); if (a != null) { a.notifyDataSetInvalidated(); } } ra.notifyDataSetChanged(); BooksAdapter.this.notifyDataSetInvalidated(); } } } <file_sep>/EBookDroid/jni/ebookdroid/pdfdroidbridge.c #include <jni.h> #include <android/log.h> #include <nativebitmap.h> #include <errno.h> #include <fitz.h> #include <mupdf.h> /* Debugging helper */ #define DEBUG(args...) \ __android_log_print(ANDROID_LOG_DEBUG, "EBookDroid.PDF", args) #define ERROR(args...) \ __android_log_print(ANDROID_LOG_ERROR, "EBookDroid.PDF", args) #define INFO(args...) \ __android_log_print(ANDROID_LOG_INFO, "EBookDroid.PDF", args) typedef struct renderdocument_s renderdocument_t; struct renderdocument_s { fz_context *ctx; pdf_document *xref; fz_outline *outline; }; typedef struct renderpage_s renderpage_t; struct renderpage_s { pdf_page *page; fz_display_list* pageList; }; #define RUNTIME_EXCEPTION "java/lang/RuntimeException" void throw_exception(JNIEnv *env, char *message) { jthrowable new_exception = (*env)->FindClass(env, RUNTIME_EXCEPTION); if (new_exception == NULL) { return; } else { DEBUG("Exception '%s', Message: '%s'", RUNTIME_EXCEPTION, message); } (*env)->ThrowNew(env, new_exception, message); } static void pdf_free_document(renderdocument_t* doc) { if (doc) { if (doc->outline) fz_free_outline(doc->ctx,doc->outline); doc->outline = NULL; if (doc->xref) pdf_close_document(doc->xref); doc->xref = NULL; fz_flush_warnings(doc->ctx); fz_free_context(doc->ctx); doc->ctx = NULL; free(doc); doc = NULL; } } JNIEXPORT jlong JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfDocument_open(JNIEnv *env, jclass clazz, jint storememory, jstring fname, jstring pwd) { fz_obj *obj; renderdocument_t *doc; jboolean iscopy; jclass cls; jfieldID fid; char *filename; char *password; filename = (char*) (*env)->GetStringUTFChars(env, fname, &iscopy); password = (char*) (*env)->GetStringUTFChars(env, pwd, &iscopy); doc = malloc(sizeof(renderdocument_t)); if (!doc) { throw_exception(env, "Out of Memory"); goto cleanup; } DEBUG("PdfDocument.nativeOpen(): storememory = %d", storememory); // doc->ctx = fz_new_context(&fz_alloc_default, 256<<20); // doc->ctx = fz_new_context(&fz_alloc_default, storememory); doc->ctx = fz_new_context(NULL, storememory); if (!doc->ctx) { free(doc); throw_exception(env, "Out of Memory"); goto cleanup; } doc->xref = NULL; doc->outline = NULL; // fz_set_aa_level(fz_catch(ctx), alphabits); /* * Open PDF and load xref table */ fz_try(doc->ctx) { doc->xref = pdf_open_document(doc->ctx, filename); } fz_catch(doc->ctx) { throw_exception(env, (char*)fz_caught(doc->ctx)); pdf_free_document(doc); // throw_exception(env, "PDF file not found or corrupted"); goto cleanup; } /* * Handle encrypted PDF files */ if (pdf_needs_password(doc->xref)) { if (strlen(password)) { int ok = pdf_authenticate_password(doc->xref, password); if (!ok) { pdf_free_document(doc); throw_exception(env, "Wrong password given"); goto cleanup; } } else { pdf_free_document(doc); throw_exception(env, "PDF needs a password!"); goto cleanup; } } cleanup: (*env)->ReleaseStringUTFChars(env, fname, filename); (*env)->ReleaseStringUTFChars(env, pwd, password); // DEBUG("PdfDocument.nativeOpen(): return handle = %p", doc); return (jlong) (long) doc; } JNIEXPORT void JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfDocument_free(JNIEnv *env, jclass clazz, jlong handle) { renderdocument_t *doc = (renderdocument_t*) (long) handle; pdf_free_document(doc); } JNIEXPORT jint JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfDocument_getPageInfo(JNIEnv *env, jclass cls, jlong handle, jint pageNumber, jobject cpi) { renderdocument_t *doc = (renderdocument_t*) (long) handle; jclass clazz; jfieldID fid; fz_obj *pageobj = NULL; fz_obj *rotateobj = NULL; fz_obj *obj; fz_bbox bbox; fz_rect mediabox; int rotate = 0; pageobj = doc->xref->page_objs[pageNumber - 1]; obj = fz_dict_gets(pageobj, "MediaBox"); bbox = fz_round_rect(pdf_to_rect(doc->ctx, obj)); if (fz_is_empty_rect(pdf_to_rect(doc->ctx, obj))) { fz_warn(doc->ctx, "cannot find page size for page %d", pageNumber + 1); bbox.x0 = 0; bbox.y0 = 0; bbox.x1 = 612; bbox.y1 = 792; } obj = fz_dict_gets(pageobj, "CropBox"); if (fz_is_array(obj)) { fz_bbox cropbox = fz_round_rect(pdf_to_rect(doc->ctx, obj)); bbox = fz_intersect_bbox(bbox, cropbox); } mediabox.x0 = MIN(bbox.x0, bbox.x1); mediabox.y0 = MIN(bbox.y0, bbox.y1); mediabox.x1 = MAX(bbox.x0, bbox.x1); mediabox.y1 = MAX(bbox.y0, bbox.y1); if (mediabox.x1 - mediabox.x0 < 1 || mediabox.y1 - mediabox.y0 < 1) { fz_warn(doc->ctx, "invalid page size in page %d", pageNumber + 1); mediabox = fz_unit_rect; } // DEBUG( "Mediabox: %f %f %f %f", mediabox.x0, mediabox.y0, mediabox.x1, mediabox.y1); rotateobj = fz_dict_gets(pageobj, "Rotate"); if (fz_is_int(rotateobj)) { rotate = fz_to_int(rotateobj); } clazz = (*env)->GetObjectClass(env, cpi); if (0 == clazz) { return (-1); } fz_rect bounds = fz_transform_rect(fz_rotate(rotate), mediabox); int width = bounds.x1 - bounds.x0; int height = bounds.y1 - bounds.y0; fid = (*env)->GetFieldID(env, clazz, "width", "I"); (*env)->SetIntField(env, cpi, fid, width); fid = (*env)->GetFieldID(env, clazz, "height", "I"); (*env)->SetIntField(env, cpi, fid, height); fid = (*env)->GetFieldID(env, clazz, "dpi", "I"); (*env)->SetIntField(env, cpi, fid, 0); fid = (*env)->GetFieldID(env, clazz, "rotation", "I"); (*env)->SetIntField(env, cpi, fid, rotate); fid = (*env)->GetFieldID(env, clazz, "version", "I"); (*env)->SetIntField(env, cpi, fid, 0); return 0; } JNIEXPORT jobject JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfDocument_getPageLinks(JNIEnv *env, jclass clazz, jlong handle, jint pageno) { renderdocument_t *doc = (renderdocument_t*) (long) handle; // DEBUG("PdfDocument.getLinks = %p", doc); fz_link *link; jobject arrayList = NULL; pdf_page *page = NULL; fz_try(doc->ctx) { page = pdf_load_page(doc->xref, pageno - 1); } fz_catch(doc->ctx) { //fz_throw(doc->ctx, "cannot open document: %s", filename); return arrayList; } if (page && page->links) { jclass arrayListClass = (*env)->FindClass(env, "java/util/ArrayList"); if (!arrayListClass) return arrayList; jmethodID alInitMethodId = (*env)->GetMethodID(env, arrayListClass, "<init>", "()V"); if (!alInitMethodId) return arrayList; jmethodID alAddMethodId = (*env)->GetMethodID(env, arrayListClass, "add", "(Ljava/lang/Object;)Z"); if (!alAddMethodId) return arrayList; arrayList = (*env)->NewObject(env, arrayListClass, alInitMethodId); if (!arrayList) return arrayList; for (link = page->links; link; link = link->next) { jclass pagelinkClass = (*env)->FindClass(env, "org/ebookdroid/core/PageLink"); if (!pagelinkClass) return arrayList; jmethodID plInitMethodId = (*env)->GetMethodID(env, pagelinkClass, "<init>", "(Ljava/lang/String;I[I)V"); if (!plInitMethodId) return arrayList; jint data[4]; data[0] = link->rect.x0; data[1] = link->rect.y0; data[2] = link->rect.x1; data[3] = link->rect.y1; jintArray points = (*env)->NewIntArray(env, 4); (*env)->SetIntArrayRegion(env, points, 0, 4, data); char linkbuf[128]; int number; if (link->dest.kind == FZ_LINK_URI) { snprintf(linkbuf, 128, "%s", link->dest.ld.uri.uri); } else if (link->dest.kind == FZ_LINK_GOTO) { snprintf(linkbuf, 127, "#%d", link->dest.ld.gotor.page); } jstring jstr = (*env)->NewStringUTF(env, linkbuf); jobject hl = (*env)->NewObject(env, pagelinkClass, plInitMethodId, jstr, (jint) 1, points); (*env)->DeleteLocalRef(env, jstr); (*env)->DeleteLocalRef(env, points); if (hl) (*env)->CallBooleanMethod(env, arrayList, alAddMethodId, hl); //jenv->DeleteLocalRef(hl); } pdf_free_page(doc->ctx, page); } return arrayList; } JNIEXPORT jint JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfDocument_getPageCount(JNIEnv *env, jclass clazz, jlong handle) { renderdocument_t *doc = (renderdocument_t*) (long) handle; return (pdf_count_pages(doc->xref)); } JNIEXPORT jlong JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfPage_open(JNIEnv *env, jclass clazz, jlong dochandle, jint pageno) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page; fz_obj *obj; fz_device *dev; jclass cls; jfieldID fid; page = malloc(sizeof(renderpage_t)); if (!page) { throw_exception(env, "Out of Memory"); return (jlong) (long) NULL; } page->page = NULL; page->pageList = NULL; fz_try(doc->ctx) { page->page = pdf_load_page(doc->xref, pageno - 1); } fz_catch(doc->ctx) { //fz_throw(ctx, "cannot load page tree: %s", filename); free(page); page = NULL; throw_exception(env, "error loading page"); goto cleanup; } fz_try(doc->ctx) { page->pageList = fz_new_display_list(doc->ctx); dev = fz_new_list_device(doc->ctx, page->pageList); pdf_run_page(doc->xref, page->page, dev, fz_identity, NULL); } fz_catch(doc->ctx) { fz_free_device(dev); fz_free_display_list(doc->ctx, page->pageList); pdf_free_page(doc->ctx, page->page); // fz_throw(ctx, "cannot draw page %d",pageno); free(page); page = NULL; throw_exception(env, "error loading page"); goto cleanup; } fz_free_device(dev); cleanup: /* nothing yet */ // DEBUG("PdfPage.nativeOpenPage(): return handle = %p", page); return (jlong) (long) page; } JNIEXPORT void JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfPage_free(JNIEnv *env, jclass clazz, jlong dochandle, jlong handle) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) handle; // DEBUG("PdfPage_free(%p)", page); if (page) { if (page->page) pdf_free_page(doc->ctx, page->page); if (page->pageList) fz_free_display_list(doc->ctx, page->pageList); free(page); } } JNIEXPORT void JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfPage_getBounds(JNIEnv *env, jclass clazz, jlong dochandle, jlong handle, jfloatArray bounds) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) handle; jfloat *bbox = (*env)->GetPrimitiveArrayCritical(env, bounds, 0); if (!bbox) return; fz_rect page_bounds = pdf_bound_page(doc->xref, page->page); // DEBUG("Bounds: %f %f %f %f", page_bounds.x0, page_bounds.y0, page_bounds.x1, page_bounds.y1); bbox[0] = page_bounds.x0; bbox[1] = page_bounds.y0; bbox[2] = page_bounds.x1; bbox[3] = page_bounds.y1; (*env)->ReleasePrimitiveArrayCritical(env, bounds, bbox, 0); } JNIEXPORT void JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfPage_renderPage(JNIEnv *env, jobject this, jlong dochandle, jlong pagehandle, jintArray viewboxarray, jfloatArray matrixarray, jintArray bufferarray) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) pagehandle; // DEBUG("PdfView(%p).renderPage(%p, %p)", this, doc, page); fz_matrix ctm; fz_bbox viewbox; fz_pixmap *pixmap; jfloat *matrix; jint *viewboxarr; jint *dimen; jint *buffer; int length, val; fz_device *dev = NULL; /* initialize parameter arrays for MuPDF */ ctm = fz_identity; matrix = (*env)->GetPrimitiveArrayCritical(env, matrixarray, 0); ctm.a = matrix[0]; ctm.b = matrix[1]; ctm.c = matrix[2]; ctm.d = matrix[3]; ctm.e = matrix[4]; ctm.f = matrix[5]; (*env)->ReleasePrimitiveArrayCritical(env, matrixarray, matrix, 0); // DEBUG( "Matrix: %f %f %f %f %f %f", ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f); viewboxarr = (*env)->GetPrimitiveArrayCritical(env, viewboxarray, 0); viewbox.x0 = viewboxarr[0]; viewbox.y0 = viewboxarr[1]; viewbox.x1 = viewboxarr[2]; viewbox.y1 = viewboxarr[3]; (*env)->ReleasePrimitiveArrayCritical(env, viewboxarray, viewboxarr, 0); // DEBUG( "Viewbox: %d %d %d %d", viewbox.x0, viewbox.y0, viewbox.x1, viewbox.y1); /* do the rendering */ buffer = (*env)->GetPrimitiveArrayCritical(env, bufferarray, 0); pixmap = fz_new_pixmap_with_data(doc->ctx, fz_device_bgr, viewbox.x1 - viewbox.x0, viewbox.y1 - viewbox.y0, (unsigned char*) buffer); // DEBUG("doing the rendering..."); fz_clear_pixmap_with_color(pixmap, 0xff); dev = fz_new_draw_device(doc->ctx, pixmap); fz_execute_display_list(page->pageList, dev, ctm, viewbox, NULL); fz_free_device(dev); (*env)->ReleasePrimitiveArrayCritical(env, bufferarray, buffer, 0); fz_drop_pixmap(doc->ctx, pixmap); // DEBUG("PdfView.renderPage() done"); } /*JNI BITMAP API*/ JNIEXPORT jboolean JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfContext_isNativeGraphicsAvailable(JNIEnv *env, jobject this) { return NativePresent(); } JNIEXPORT jboolean JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfPage_renderPageBitmap(JNIEnv *env, jobject this, jlong dochandle, jlong pagehandle, jintArray viewboxarray, jfloatArray matrixarray, jobject bitmap) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) pagehandle; // DEBUG("PdfView(%p).renderPageBitmap(%p, %p)", this, doc, page); fz_matrix ctm; fz_bbox viewbox; fz_pixmap *pixmap; jfloat *matrix; jint *viewboxarr; jint *dimen; int length, val; fz_device *dev = NULL; AndroidBitmapInfo info; void *pixels; int ret; if ((ret = NativeBitmap_getInfo(env, bitmap, &info)) < 0) { ERROR("AndroidBitmap_getInfo() failed ! error=%d", ret); return 0; } // DEBUG("Checking format\n"); if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888) { ERROR("Bitmap format is not RGBA_8888 !"); return 0; } // DEBUG("locking pixels\n"); if ((ret = NativeBitmap_lockPixels(env, bitmap, &pixels)) < 0) { ERROR("AndroidBitmap_lockPixels() failed ! error=%d", ret); return 0; } ctm = fz_identity; matrix = (*env)->GetPrimitiveArrayCritical(env, matrixarray, 0); ctm.a = matrix[0]; ctm.b = matrix[1]; ctm.c = matrix[2]; ctm.d = matrix[3]; ctm.e = matrix[4]; ctm.f = matrix[5]; (*env)->ReleasePrimitiveArrayCritical(env, matrixarray, matrix, 0); // DEBUG( "Matrix: %f %f %f %f %f %f", ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f); viewboxarr = (*env)->GetPrimitiveArrayCritical(env, viewboxarray, 0); viewbox.x0 = viewboxarr[0]; viewbox.y0 = viewboxarr[1]; viewbox.x1 = viewboxarr[2]; viewbox.y1 = viewboxarr[3]; (*env)->ReleasePrimitiveArrayCritical(env, viewboxarray, viewboxarr, 0); // DEBUG( "Viewbox: %d %d %d %d", viewbox.x0, viewbox.y0, viewbox.x1, viewbox.y1); pixmap = fz_new_pixmap_with_data(doc->ctx, fz_device_rgb, viewbox.x1 - viewbox.x0, viewbox.y1 - viewbox.y0, pixels); // DEBUG("doing the rendering..."); fz_clear_pixmap_with_color(pixmap, 0xff); dev = fz_new_draw_device(doc->ctx, pixmap); fz_execute_display_list(page->pageList, dev, ctm, viewbox, NULL); fz_free_device(dev); fz_drop_pixmap(doc->ctx, pixmap); // DEBUG("PdfView.renderPage() done"); NativeBitmap_unlockPixels(env, bitmap); return 1; } //Outline JNIEXPORT jlong JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfOutline_open(JNIEnv *env, jclass clazz, jlong dochandle) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; if (!doc->outline) doc->outline = pdf_load_outline(doc->xref); // DEBUG("PdfOutline.open(): return handle = %p", doc->outline); return (jlong) (long) doc->outline; } JNIEXPORT void JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfOutline_free(JNIEnv *env, jclass clazz, jlong dochandle) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; // DEBUG("PdfOutline_free(%p)", doc); if (doc) { if (doc->outline) fz_free_outline(doc->ctx, doc->outline); doc->outline = NULL; } } JNIEXPORT jstring JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfOutline_getTitle(JNIEnv *env, jclass clazz, jlong outlinehandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; // DEBUG("PdfOutline_getTitle(%p)",outline); if (outline) return (*env)->NewStringUTF(env, outline->title); return NULL; } JNIEXPORT jstring JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfOutline_getLink(JNIEnv *env, jclass clazz, jlong outlinehandle, jlong dochandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; renderdocument_t *doc = (renderdocument_t*) (long) dochandle; // DEBUG("PdfOutline_getLink(%p)",outline); if (!outline) return NULL; char linkbuf[128]; if (outline->dest.kind == FZ_LINK_URI) { snprintf(linkbuf, 128, "%s", outline->dest.ld.uri.uri); // DEBUG("PdfOutline_getLink uri = %s",linkbuf); } else if (outline->dest.kind == FZ_LINK_GOTO) { snprintf(linkbuf, 127, "#%d", outline->dest.ld.gotor.page + 1); // DEBUG("PdfOutline_getLink goto = %s",linkbuf); } else { return NULL; } return (*env)->NewStringUTF(env, linkbuf); } JNIEXPORT jlong JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfOutline_getNext(JNIEnv *env, jclass clazz, jlong outlinehandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; // DEBUG("PdfOutline_getNext(%p)",outline); if (!outline) return 0; return (jlong) (long) outline->next; } JNIEXPORT jlong JNICALL Java_org_ebookdroid_pdfdroid_codec_PdfOutline_getChild(JNIEnv *env, jclass clazz, jlong outlinehandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; // DEBUG("PdfOutline_getChild(%p)",outline); if (!outline) return 0; return (jlong) (long) outline->down; } <file_sep>/EBookDroid/src/org/ebookdroid/fb2droid/codec/FB2MarkupNote.java package org.ebookdroid.fb2droid.codec; public class FB2MarkupNote implements FB2MarkupElement { private final String ref; public FB2MarkupNote(final String ref) { this.ref = ref; } @Override public void publishToDocument(final FB2Document doc) { doc.publishNote(ref); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/settings/ui/fragments/UIFragment.java package org.ebookdroid.core.settings.ui.fragments; import org.ebookdroid.R; public class UIFragment extends BasePreferenceFragment { public UIFragment() { super(R.xml.fragment_ui); } @Override public void decorate() { decorator.decorateUISettings(); } } <file_sep>/EBookDroid/src/org/ebookdroid/fb2droid/codec/StopParsingException.java package org.ebookdroid.fb2droid.codec; import org.xml.sax.SAXException; public class StopParsingException extends SAXException { private static final long serialVersionUID = 3145741090251025545L; } <file_sep>/EBookDroid/src/org/ebookdroid/core/log/EmergencyHandler.java package org.ebookdroid.core.log; import org.ebookdroid.EBookDroidApp; import android.content.Context; import android.content.pm.PackageManager; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; import java.lang.Thread.UncaughtExceptionHandler; import java.text.SimpleDateFormat; import java.util.Date; public class EmergencyHandler implements UncaughtExceptionHandler { private static final EmergencyHandler instance = new EmergencyHandler(); private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyyMMdd.HHmmss"); private static String FILES_PATH; private static UncaughtExceptionHandler system; private EmergencyHandler() { } @Override public void uncaughtException(final Thread thread, final Throwable ex) { processException(ex); system.uncaughtException(thread, ex); } private void processException(final Throwable th) { try { final String timestamp = SDF.format(new Date()); final Writer result = new StringWriter(); final PrintWriter printWriter = new PrintWriter(result); th.printStackTrace(printWriter); final String stacktrace = result.toString(); printWriter.close(); final String filename = FILES_PATH + "/" + EBookDroidApp.APP_PACKAGE + "." + EBookDroidApp.APP_VERSION + "." + timestamp + ".stacktrace"; writeToFile(stacktrace, filename); } catch (final Exception e) { e.printStackTrace(); } } private void writeToFile(final String stacktrace, final String filename) { try { final BufferedWriter bos = new BufferedWriter(new FileWriter(filename)); bos.write(stacktrace); bos.flush(); bos.close(); System.out.println("Stacktrace is written: " + filename); } catch (final Exception e) { e.printStackTrace(); } } public static void init(final Context context) { if (system == null) { final PackageManager pm = context.getPackageManager(); File dir = EBookDroidApp.EXT_STORAGE; if (dir != null) { File appDir = new File(dir, "." + EBookDroidApp.APP_PACKAGE); if (appDir.isDirectory() || appDir.mkdir()) { dir = appDir; } } else { dir = context.getFilesDir(); } FILES_PATH = dir.getAbsolutePath(); system = Thread.getDefaultUncaughtExceptionHandler(); Thread.setDefaultUncaughtExceptionHandler(instance); } } public static void onUnexpectedError(final Throwable th) { instance.processException(th); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/utils/archives/ArchiveFile.java package org.ebookdroid.core.utils.archives; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; public interface ArchiveFile<ArchiveEntryType extends ArchiveEntry> extends Closeable { boolean randomAccessAllowed(); Enumeration<ArchiveEntryType> entries(); InputStream open(ArchiveEntryType entry) throws IOException; } <file_sep>/README.md # UsefulClass good code for duplicate // lets go! <file_sep>/EBookDroid/src/org/ebookdroid/fb2droid/codec/FB2MarkupNoSpace.java package org.ebookdroid.fb2droid.codec; public class FB2MarkupNoSpace implements FB2MarkupElement { private FB2MarkupNoSpace() { } public static final FB2MarkupNoSpace _instance = new FB2MarkupNoSpace(); @Override public void publishToDocument(final FB2Document doc) { doc.insertSpace = false; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/Page.java package org.ebookdroid.core; import org.ebookdroid.R; import org.ebookdroid.core.bitmaps.Bitmaps; import org.ebookdroid.core.codec.CodecPageInfo; import org.ebookdroid.core.log.LogContext; import org.ebookdroid.utils.MathUtils; import android.graphics.Canvas; import android.graphics.RectF; import android.text.TextPaint; import java.util.List; public class Page { static final LogContext LCTX = LogContext.ROOT.lctx("Page", true); public final PageIndex index; public final PageType type; final IViewerActivity base; final PageTree nodes; RectF bounds; float aspectRatio; boolean recycled; float storedZoom; RectF zoomedBounds; int zoomLevel = 1; public Page(final IViewerActivity base, final PageIndex index, final PageType pt, final CodecPageInfo cpi) { this.base = base; this.index = index; this.type = pt != null ? pt : PageType.FULL_PAGE; this.bounds = new RectF(0, 0, cpi.width / type.getWidthScale(), cpi.height); setAspectRatio(cpi); nodes = new PageTree(this); } public void recycle(List<Bitmaps> bitmapsToRecycle) { recycled = true; nodes.recycleAll(bitmapsToRecycle, true); } public boolean draw(final Canvas canvas, final ViewState viewState) { return draw(canvas, viewState, false); } public boolean draw(final Canvas canvas, final ViewState viewState, final boolean drawInvisible) { if (drawInvisible || viewState.isPageVisible(this)) { final PagePaint paint = viewState.nightMode ? PagePaint.NIGHT : PagePaint.DAY; final RectF bounds = viewState.getBounds(this); if (!nodes.root.hasBitmap()) { canvas.drawRect(bounds, paint.fillPaint); final TextPaint textPaint = paint.textPaint; textPaint.setTextSize(24 * base.getZoomModel().getZoom()); canvas.drawText(base.getContext().getString(R.string.text_page) + " " + (index.viewIndex + 1), bounds.centerX(), bounds.centerY(), textPaint); } nodes.root.draw(canvas, viewState, bounds, paint); return true; } return false; } public float getAspectRatio() { return aspectRatio; } private boolean setAspectRatio(final float aspectRatio) { if (this.aspectRatio != aspectRatio) { this.aspectRatio = aspectRatio; return true; } return false; } public boolean setAspectRatio(final CodecPageInfo page) { if (page != null) { return this.setAspectRatio(page.width / type.getWidthScale(), page.height); } return false; } public boolean setAspectRatio(final float width, final float height) { return setAspectRatio(width / height); } public void setBounds(final RectF pageBounds) { storedZoom = 0.0f; zoomedBounds = null; bounds = pageBounds; } public boolean onZoomChanged(final float oldZoom, final ViewState viewState, boolean committed, final List<PageTreeNode> nodesToDecode, List<Bitmaps> bitmapsToRecycle) { if (!recycled) { if (viewState.isPageKeptInMemory(this) || viewState.isPageVisible(this)) { return nodes.root.onZoomChanged(oldZoom, viewState, committed, viewState.getBounds(this), nodesToDecode, bitmapsToRecycle); } else { int oldSize = bitmapsToRecycle.size(); if (nodes.recycleAll(bitmapsToRecycle, true)) { if (LCTX.isDebugEnabled()) { if (LCTX.isDebugEnabled()) { LCTX.d("onZoomChanged: recycle page " + index + " " + viewState.firstCached + ":" + viewState.lastCached + " = " + (bitmapsToRecycle.size() - oldSize)); } } } } } return false; } public boolean onPositionChanged(final ViewState viewState, final List<PageTreeNode> nodesToDecode, List<Bitmaps> bitmapsToRecycle) { if (!recycled) { if (viewState.isPageKeptInMemory(this) || viewState.isPageVisible(this)) { return nodes.root.onPositionChanged(viewState, viewState.getBounds(this), nodesToDecode, bitmapsToRecycle); } else { int oldSize = bitmapsToRecycle.size(); if (nodes.recycleAll(bitmapsToRecycle, true)) { if (LCTX.isDebugEnabled()) { LCTX.d("onPositionChanged: recycle page " + index + " " + viewState.firstCached + ":" + viewState.lastCached + " = " + (bitmapsToRecycle.size() - oldSize)); } } } } return false; } public RectF getBounds(final float zoom) { if (zoom != storedZoom) { storedZoom = zoom; zoomedBounds = MathUtils.zoom(bounds, zoom); } return zoomedBounds; } @Override public String toString() { final StringBuilder buf = new StringBuilder("Page"); buf.append("["); buf.append("index").append("=").append(index); buf.append(", "); buf.append("bounds").append("=").append(bounds); buf.append(", "); buf.append("aspectRatio").append("=").append(aspectRatio); buf.append(", "); buf.append("type").append("=").append(type.name()); buf.append("]"); return buf.toString(); } public float getTargetRectScale() { return type.getWidthScale(); } public float getTargetTranslate() { return type.getLeftPos(); } public RectF getCroppedRegion() { return nodes.root.croppedBounds; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/settings/AppSettings.java package org.ebookdroid.core.settings; import org.ebookdroid.core.Activities; import org.ebookdroid.core.DecodeMode; import org.ebookdroid.core.DocumentViewMode; import org.ebookdroid.core.PageAlign; import org.ebookdroid.core.RotationType; import org.ebookdroid.core.curl.PageAnimationType; import org.ebookdroid.core.settings.books.BookSettings; import org.ebookdroid.core.utils.AndroidVersion; import org.ebookdroid.core.utils.FileExtensionFilter; import org.ebookdroid.utils.LengthUtils; import org.ebookdroid.utils.StringUtils; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.preference.PreferenceManager; import java.io.File; import java.util.HashSet; import java.util.Set; public class AppSettings { private final SharedPreferences prefs; private Boolean tapScroll; private Integer tapSize; private DocumentViewMode viewMode; private Integer pagesInMemory; private Boolean showAnimIcon; private Boolean nightMode; private PageAlign pageAlign; private Boolean fullScreen; private RotationType rotation; private Boolean showTitle; private Integer scrollHeight; private PageAnimationType animationType; private Boolean splitPages; private Boolean pageInTitle; private Integer brightness; private Boolean brightnessnightmodeonly; private Boolean keepscreenon; private Set<String> autoScanDirs; private Boolean loadRecent; private Integer maxImageSize; private Boolean zoomByDoubleTap; private DecodeMode decodeMode; private Boolean useBookcase; private Integer djvuRenderingMode; private Boolean cropPages; private String touchProfiles; AppSettings(final Context context) { this.prefs = PreferenceManager.getDefaultSharedPreferences(context); } public String getTouchProfiles() { if (touchProfiles == null) { touchProfiles = prefs.getString("touchprofiles", ""); } return touchProfiles; } public void updateTouchProfiles(String profiles) { touchProfiles = profiles; final Editor edit = prefs.edit(); edit.putString("touchprofiles", touchProfiles); edit.commit(); } public boolean isLoadRecentBook() { if (loadRecent == null) { loadRecent = prefs.getBoolean("loadrecent", false); } return loadRecent; } public Set<String> getAutoScanDirs() { if (autoScanDirs == null) { autoScanDirs = StringUtils.split(File.pathSeparator, prefs.getString("brautoscandir", "/sdcard")); } return autoScanDirs; } public void setAutoScanDirs(final Set<String> dirs) { autoScanDirs = dirs; final Editor edit = prefs.edit(); edit.putString("brautoscandir", StringUtils.merge(File.pathSeparator, autoScanDirs)); edit.commit(); } public void changeAutoScanDirs(final String dir, final boolean add) { final Set<String> dirs = getAutoScanDirs(); if (add && dirs.add(dir) || dirs.remove(dir)) { setAutoScanDirs(dirs); } } public FileExtensionFilter getAllowedFileTypes() { return getAllowedFileTypes(Activities.getAllExtensions()); } public FileExtensionFilter getAllowedFileTypes(final Set<String> fileTypes) { final Set<String> res = new HashSet<String>(); for (final String ext : fileTypes) { if (isFileTypeAllowed(ext)) { res.add(ext); } } return new FileExtensionFilter(res); } public boolean isFileTypeAllowed(final String ext) { return prefs.getBoolean("brfiletype" + ext, true); } public int getBrightness() { if (isBrightnessInNightModeOnly() && !getNightMode()) { return 100; } if (brightness == null) { brightness = getIntValue("brightness", 100); } return brightness; } public boolean getShowAnimIcon() { if (showAnimIcon == null) { showAnimIcon = prefs.getBoolean("showanimicon", true); } return showAnimIcon; } public boolean getNightMode() { if (nightMode == null) { nightMode = prefs.getBoolean("nightmode", false); } return nightMode; } public boolean isKeepScreenOn() { if (keepscreenon == null) { keepscreenon = prefs.getBoolean("keepscreenon", true); } return keepscreenon; } public boolean isBrightnessInNightModeOnly() { if (brightnessnightmodeonly == null) { brightnessnightmodeonly = prefs.getBoolean("brightnessnightmodeonly", false); } return brightnessnightmodeonly; } public void switchNightMode() { nightMode = !nightMode; final Editor edit = prefs.edit(); edit.putBoolean("nightmode", nightMode); edit.commit(); } public RotationType getRotation() { if (rotation == null) { final String rotationStr = prefs.getString("rotation", RotationType.AUTOMATIC.getResValue()); rotation = RotationType.getByResValue(rotationStr); if (rotation == null) { rotation = RotationType.AUTOMATIC; } } return rotation; } public boolean getFullScreen() { if (fullScreen == null) { fullScreen = prefs.getBoolean("fullscreen", false); } return fullScreen; } public boolean getShowTitle() { if (showTitle == null) { showTitle = prefs.getBoolean("title", true); } return showTitle; } public boolean getPageInTitle() { if (pageInTitle == null) { pageInTitle = prefs.getBoolean("pageintitle", true); } return pageInTitle; } public boolean getTapScroll() { if (tapScroll == null) { tapScroll = prefs.getBoolean("tapscroll", false); } return tapScroll; } public int getTapSize() { if (tapSize == null) { tapSize = getIntValue("tapsize", 10); } return tapSize.intValue(); } public int getScrollHeight() { if (scrollHeight == null) { scrollHeight = getIntValue("scrollheight", 50); } return scrollHeight.intValue(); } public int getPagesInMemory() { if (pagesInMemory == null) { pagesInMemory = getIntValue("pagesinmemory", 2); } return pagesInMemory.intValue(); } public DecodeMode getDecodeMode() { if (decodeMode == null) { String val = prefs.getString("decodemode", null); if (LengthUtils.isEmpty(val)) { if (prefs.getBoolean("nativeresolution", false)) { decodeMode = DecodeMode.NATIVE_RESOLUTION; } else if (prefs.getBoolean("slicelimit", false)) { decodeMode = DecodeMode.LOW_MEMORY; } else { decodeMode = DecodeMode.NORMAL; } } else { decodeMode = DecodeMode.getByResValue(val); } } return decodeMode; } public int getMaxImageSize() { if (maxImageSize == null) { int value = Math.max(64, getIntValue("maximagesize", 256)); maxImageSize = value * 1024; } return maxImageSize; } public boolean getZoomByDoubleTap() { if (zoomByDoubleTap == null) { zoomByDoubleTap = prefs.getBoolean("zoomdoubletap", false); } return zoomByDoubleTap; } public boolean getUseBookcase() { if (useBookcase == null) { useBookcase = prefs.getBoolean("usebookcase", true); } return !AndroidVersion.is1x && useBookcase; } boolean getSplitPages() { if (splitPages == null) { splitPages = prefs.getBoolean("splitpages", false); } return splitPages; } public DocumentViewMode getViewMode() { if (viewMode == null) { viewMode = DocumentViewMode.getByResValue(prefs.getString("viewmode", null)); if (viewMode == null) { boolean singlePage = prefs.getBoolean("singlepage", false); viewMode = singlePage ? DocumentViewMode.SINGLE_PAGE : DocumentViewMode.VERTICALL_SCROLL; } } return viewMode; } PageAlign getPageAlign() { if (pageAlign == null) { final String align = prefs.getString("align", PageAlign.AUTO.getResValue()); pageAlign = PageAlign.getByResValue(align); if (pageAlign == null) { pageAlign = PageAlign.AUTO; } } return pageAlign; } PageAnimationType getAnimationType() { if (animationType == null) { animationType = PageAnimationType.get(prefs.getString("animationType", null)); } return animationType; } public int getDjvuRenderingMode() { if (djvuRenderingMode == null) { djvuRenderingMode = getIntValue("djvu_rendering_mode", 0); } return djvuRenderingMode; } boolean getCropPages() { if (cropPages == null) { cropPages = prefs.getBoolean("croppages", false); } return cropPages; } void clearPseudoBookSettings() { final Editor editor = prefs.edit(); editor.remove("book"); editor.remove("book_splitpages"); editor.remove("book_singlepage"); editor.remove("book_align"); editor.remove("book_animationType"); editor.remove("book_croppages"); editor.commit(); } void updatePseudoBookSettings(final BookSettings bs) { final Editor editor = prefs.edit(); editor.putString("book", bs.fileName); editor.putBoolean("book_splitpages", bs.splitPages); editor.putString("book_viewmode", bs.viewMode.getResValue()); editor.putString("book_align", bs.pageAlign.getResValue()); editor.putString("book_animationType", bs.animationType.getResValue()); editor.putBoolean("book_croppages", bs.cropPages); editor.commit(); } void fillBookSettings(final BookSettings bs) { bs.splitPages = prefs.getBoolean("book_splitpages", getSplitPages()); bs.viewMode = DocumentViewMode.getByResValue(prefs.getString("book_viewmode", getViewMode().getResValue())); if (bs.viewMode == null) { bs.viewMode = DocumentViewMode.VERTICALL_SCROLL; } bs.pageAlign = PageAlign.getByResValue(prefs.getString("book_align", getPageAlign().getResValue())); if (bs.pageAlign == null) { bs.pageAlign = PageAlign.AUTO; } bs.animationType = PageAnimationType.get(prefs .getString("book_animationType", getAnimationType().getResValue())); if (bs.animationType == null) { bs.animationType = PageAnimationType.NONE; } bs.cropPages = prefs.getBoolean("book_croppages", getCropPages()); } private int getIntValue(final String key, final int defaultValue) { final String str = prefs.getString(key, "" + defaultValue); int value = defaultValue; try { value = Integer.parseInt(str); } catch (final NumberFormatException e) { } return value; } public static class Diff { private static final int D_NightMode = 0x0001 << 0; private static final int D_Rotation = 0x0001 << 1; private static final int D_FullScreen = 0x0001 << 2; private static final int D_ShowTitle = 0x0001 << 3; private static final int D_PageInTitle = 0x0001 << 4; private static final int D_TapScroll = 0x0001 << 5; private static final int D_TapSize = 0x0001 << 6; private static final int D_ScrollHeight = 0x0001 << 7; private static final int D_PagesInMemory = 0x0001 << 8; private static final int D_DecodeMode = 0x0001 << 9; private static final int D_Brightness = 0x0001 << 10; private static final int D_BrightnessInNightMode = 0x0001 << 11; private static final int D_KeepScreenOn = 0x0001 << 12; private static final int D_LoadRecent = 0x0001 << 13; private static final int D_MaxImageSize = 0x0001 << 14; private static final int D_UseBookcase = 0x0001 << 15; private static final int D_DjvuRenderingMode = 0x0001 << 16; private static final int D_AutoScanDirs = 0x0001 << 17; private static final int D_AllowedFileTypes = 0x0001 << 18; private int mask; private final boolean firstTime; public Diff(final AppSettings olds, final AppSettings news) { firstTime = olds == null; if (news != null) { if (firstTime || olds.getNightMode() != news.getNightMode()) { mask |= D_NightMode; } if (firstTime || olds.getRotation() != news.getRotation()) { mask |= D_Rotation; } if (firstTime || olds.getFullScreen() != news.getFullScreen()) { mask |= D_FullScreen; } if (firstTime || olds.getShowTitle() != news.getShowTitle()) { mask |= D_ShowTitle; } if (firstTime || olds.getPageInTitle() != news.getPageInTitle()) { mask |= D_PageInTitle; } if (firstTime || olds.getTapScroll() != news.getTapScroll()) { mask |= D_TapScroll; } if (firstTime || olds.getTapSize() != news.getTapSize()) { mask |= D_TapSize; } if (firstTime || olds.getScrollHeight() != news.getScrollHeight()) { mask |= D_ScrollHeight; } if (firstTime || olds.getPagesInMemory() != news.getPagesInMemory()) { mask |= D_PagesInMemory; } if (firstTime || olds.getDecodeMode() != news.getDecodeMode()) { mask |= D_DecodeMode; } if (firstTime || olds.getBrightness() != news.getBrightness()) { mask |= D_Brightness; } if (firstTime || olds.isBrightnessInNightModeOnly() != news.isBrightnessInNightModeOnly()) { mask |= D_BrightnessInNightMode; } if (firstTime || olds.isKeepScreenOn() != news.isKeepScreenOn()) { mask |= D_KeepScreenOn; } if (firstTime || olds.isLoadRecentBook() != news.isLoadRecentBook()) { mask |= D_LoadRecent; } if (firstTime || olds.getMaxImageSize() != news.getMaxImageSize()) { mask |= D_MaxImageSize; } if (firstTime || olds.getUseBookcase() != news.getUseBookcase()) { mask |= D_UseBookcase; } if (firstTime || olds.getDjvuRenderingMode() != news.getDjvuRenderingMode()) { mask |= D_DjvuRenderingMode; } if (firstTime || olds.getAutoScanDirs().equals(news.getAutoScanDirs())) { mask |= D_AutoScanDirs; } if (firstTime || olds.getAllowedFileTypes().equals(news.getAllowedFileTypes())) { mask |= D_AllowedFileTypes; } } } public boolean isFirstTime() { return firstTime; } public boolean isNightModeChanged() { return 0 != (mask & D_NightMode); } public boolean isRotationChanged() { return 0 != (mask & D_Rotation); } public boolean isFullScreenChanged() { return 0 != (mask & D_FullScreen); } public boolean isShowTitleChanged() { return 0 != (mask & D_ShowTitle); } public boolean isPageInTitleChanged() { return 0 != (mask & D_PageInTitle); } public boolean isTapScrollChanged() { return 0 != (mask & D_TapScroll); } public boolean isTapSizeChanged() { return 0 != (mask & D_TapSize); } public boolean isScrollHeightChanged() { return 0 != (mask & D_ScrollHeight); } public boolean isPagesInMemoryChanged() { return 0 != (mask & D_PagesInMemory); } public boolean isDecodeModeChanged() { return 0 != (mask & D_DecodeMode); } public boolean isBrightnessChanged() { return 0 != (mask & D_Brightness); } public boolean isBrightnessInNightModeChanged() { return 0 != (mask & D_BrightnessInNightMode); } public boolean isKeepScreenOnChanged() { return 0 != (mask & D_KeepScreenOn); } public boolean isLoadRecentChanged() { return 0 != (mask & D_LoadRecent); } public boolean isMaxImageSizeChanged() { return 0 != (mask & D_MaxImageSize); } public boolean isUseBookcaseChanged() { return 0 != (mask & D_UseBookcase); } public boolean isDjvuRenderingModeChanged() { return 0 != (mask & D_DjvuRenderingMode); } public boolean isAutoScanDirsChanged() { return 0 != (mask & D_AutoScanDirs); } public boolean isAllowedFileTypesChanged() { return 0 != (mask & D_AllowedFileTypes); } } } <file_sep>/EBookDroid/src/org/ebookdroid/core/views/LibraryView.java package org.ebookdroid.core.views; import org.ebookdroid.core.IBrowserActivity; import org.ebookdroid.core.presentation.BookNode; import org.ebookdroid.core.presentation.FileListAdapter; import android.net.Uri; import android.view.View; import android.widget.ExpandableListView; import java.io.File; public class LibraryView extends ExpandableListView implements ExpandableListView.OnChildClickListener { private IBrowserActivity base; private FileListAdapter adapter; public LibraryView(IBrowserActivity base, FileListAdapter adapter) { super(base.getContext()); this.base = base; this.adapter = adapter; setAdapter(adapter); setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); setOnChildClickListener(this); } @Override public boolean onChildClick(final ExpandableListView parent, final View v, final int groupPosition, final int childPosition, final long id) { final BookNode book = adapter.getChild(groupPosition, childPosition); final File file = new File(book.path); if (!file.isDirectory()) { base.showDocument(Uri.fromFile(file)); } return false; } } <file_sep>/FaiReport/src/com/fai/beans/Report.java package com.fai.beans; public class Report { private int rigNum; private int payNmu; public int getRigNum() { return rigNum; } public void setRigNum(int rigNum) { this.rigNum = rigNum; } public int getPayNmu() { return payNmu; } public void setPayNmu(int payNmu) { this.payNmu = payNmu; } } <file_sep>/EBookDroid/src/org/ebookdroid/cbdroid/CbzViewerActivity.java package org.ebookdroid.cbdroid; import org.ebookdroid.cbdroid.codec.CbxArchiveFactory; import org.ebookdroid.cbdroid.codec.CbxContext; import org.ebookdroid.core.BaseViewerActivity; import org.ebookdroid.core.DecodeService; import org.ebookdroid.core.DecodeServiceBase; import org.ebookdroid.core.utils.archives.ArchiveFile; import org.ebookdroid.core.utils.archives.zip.ZipArchive; import org.ebookdroid.core.utils.archives.zip.ZipArchiveEntry; import java.io.File; import java.io.IOException; public class CbzViewerActivity extends BaseViewerActivity implements CbxArchiveFactory<ZipArchiveEntry> { /** * {@inheritDoc} * * @see org.ebookdroid.core.BaseViewerActivity#createDecodeService() */ @Override protected DecodeService createDecodeService() { return new DecodeServiceBase(new CbxContext<ZipArchiveEntry>(this)); } /** * {@inheritDoc} * * @see org.ebookdroid.cbdroid.codec.CbxArchiveFactory#create(java.io.File, java.lang.String) */ @Override public ArchiveFile<ZipArchiveEntry> create(final File file, final String password) throws IOException { return new ZipArchive(file); } } <file_sep>/EBookDroid/src/org/ebookdroid/xpsdroid/codec/XpsOutline.java package org.ebookdroid.xpsdroid.codec; import org.ebookdroid.core.OutlineLink; import java.util.ArrayList; import java.util.List; public class XpsOutline { private long docHandle; public List<OutlineLink> getOutline(final long dochandle) { final List<OutlineLink> ls = new ArrayList<OutlineLink>(); docHandle = dochandle; final long outline = open(dochandle); ttOutline(ls, outline, 0); // WARN: Possible memory leak here. // free(dochandle); return ls; } private void ttOutline(final List<OutlineLink> ls, long outline, int level) { while (outline > 0) { final String title = getTitle(outline); final String link = getLink(outline, docHandle); if (title != null) { ls.add(new OutlineLink(title, link, level)); } final long child = getChild(outline); ttOutline(ls, child, level + 1); outline = getNext(outline); } } private static native String getTitle(long outlinehandle); private static native String getLink(long outlinehandle, long dochandle); private static native long getNext(long outlinehandle); private static native long getChild(long outlinehandle); private static native long open(long dochandle); private static native void free(long dochandle); } <file_sep>/EBookDroid/jni/hqx/hqx.c /* * Copyright (C) 2010 <NAME> ( <EMAIL>) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <unistd.h> #include <stdint.h> #include <stdlib.h> #include <hqx.h> #include <IL/il.h> static inline uint32_t swapByteOrder(uint32_t ui) { return (ui >> 24) | ((ui << 8) & 0x00FF0000) | ((ui >> 8) & 0x0000FF00) | (ui << 24); } int main(int argc, char *argv[]) { int opt; int scaleBy = 4; while ((opt = getopt(argc, argv, "s:")) != -1) { switch (opt) { case 's': scaleBy = atoi(optarg); if (scaleBy != 2 && scaleBy != 3 && scaleBy != 4) { fprintf(stderr, "Only scale factors of 2, 3, and 4 are supported."); return 1; } break; default: goto error_usage; } } if (optind + 2 > argc) { error_usage: fprintf(stderr, "Usage: %s [-s scaleBy] input output\n", argv[0]); return 1; } ILuint handle, width, height; char *szFilenameIn = argv[optind]; char *szFilenameOut = argv[optind + 1]; ilInit(); ilEnable(IL_ORIGIN_SET); ilGenImages(1, &handle); ilBindImage(handle); // Load image ILboolean loaded = ilLoadImage(szFilenameIn); if (loaded == IL_FALSE) { fprintf(stderr, "ERROR: can't load '%s'\n", szFilenameIn); return 1; } width = ilGetInteger(IL_IMAGE_WIDTH); height = ilGetInteger(IL_IMAGE_HEIGHT); // Allocate memory for image data size_t srcSize = width * height * sizeof(uint32_t); uint8_t *srcData = (uint8_t *) malloc(srcSize); size_t destSize = width * scaleBy * height * scaleBy * sizeof(uint32_t); uint8_t *destData = (uint8_t *) malloc(destSize); // Init srcData from loaded image // We want the pixels in BGRA format so that when converting to uint32_t // we get a RGB value due to little-endianness. ilCopyPixels(0, 0, 0, width, height, 1, IL_BGRA, IL_UNSIGNED_BYTE, srcData); // Discard the alpha byte since the RGBtoYUV conversion // expects the most significant byte to be empty size_t i; for (i = 3; i < srcSize; i += 4) { srcData[i] = 0; } uint32_t *sp = (uint32_t *) srcData; uint32_t *dp = (uint32_t *) destData; // If big endian we have to swap the byte order to get RGB values #ifdef WORDS_BIGENDIAN uint32_t *spTemp = sp; for (i = 0; i < srcSize >> 2; i++) { spTemp[i] = swapByteOrder(spTemp[i]); } #endif hqxInit(); switch (scaleBy) { case 2: hq2x_32(sp, dp, width, height); break; case 3: hq3x_32(sp, dp, width, height); break; case 4: default: hq4x_32(sp, dp, width, height); break; } // If big endian we have to swap byte order of destData to get BGRA format #ifdef WORDS_BIGENDIAN uint32_t *dpTemp = dp; for (i = 0; i < destSize >> 2; i++) { dpTemp[i] = swapByteOrder(dpTemp[i]); } #endif // Copy destData into image ilTexImage(width * scaleBy, height * scaleBy, 0, 4, IL_BGRA, IL_UNSIGNED_BYTE, destData); // Free image data free(srcData); free(destData); // Save image ilConvertImage(IL_BGR, IL_UNSIGNED_BYTE); // No alpha channel ilHint(IL_COMPRESSION_HINT, IL_USE_COMPRESSION); ilEnable(IL_FILE_OVERWRITE); ILboolean saved = ilSaveImage(szFilenameOut); ilDeleteImages(1, &handle); if (saved == IL_FALSE) { fprintf(stderr, "ERROR: can't save '%s'\n", szFilenameOut); return 1; } return 0; } <file_sep>/EBookDroid/src/org/ebookdroid/fb2droid/codec/FB2MarkupTitle.java package org.ebookdroid.fb2droid.codec; public class FB2MarkupTitle implements FB2MarkupElement { final String title; final int level; public FB2MarkupTitle(final String string, int level) { this.title = string; this.level = level; } @Override public void publishToDocument(final FB2Document doc) { doc.addTitle(this); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/settings/ui/BookSettingsActivity.java package org.ebookdroid.core.settings.ui; import org.ebookdroid.R; import org.ebookdroid.core.settings.SettingsManager; import org.ebookdroid.core.settings.SettingsManager.BookSettingsEditor; import org.ebookdroid.core.settings.books.BookSettings; import org.ebookdroid.core.utils.PathFromUri; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; public class BookSettingsActivity extends BaseSettingsActivity { private BookSettingsEditor edit; @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Uri uri = getIntent().getData(); final String fileName = PathFromUri.retrieve(getContentResolver(), uri); final BookSettings bs = SettingsManager.getBookSettings(fileName); if (bs == null) { finish(); } edit = SettingsManager.edit(bs); try { addPreferencesFromResource(R.xml.books_prefs); } catch (final ClassCastException e) { LCTX.e("Book preferences are corrupt! Resetting to default values."); final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences.Editor editor = preferences.edit(); editor.clear(); editor.commit(); PreferenceManager.setDefaultValues(this, R.xml.books_prefs, true); addPreferencesFromResource(R.xml.books_prefs); } decorator.decorateBooksSettings(); } @Override protected void onPause() { if (edit != null) { edit.commit(); } super.onPause(); } } <file_sep>/FaiReport/src/com/fai/servlet/ReportServlet.java package com.fai.servlet; import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.fai.service.Service; public class ReportServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub super.doGet(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Service service = new Service(); List list = service.getReport(); req.getSession().setAttribute("report", list); resp.sendRedirect("index.jsp"); } } <file_sep>/EBookDroid/jni/Application.mk #APP_ABI := armeabi armeabi-v7a x86 #APP_ABI := x86 #APP_CFLAGS := -DHAVE_CONFIG_H -DTHREADMODEL=NOTHREADS -DDEBUGLVL=0 -Os -D__ANDROID__ APP_CFLAGS := -DHAVE_CONFIG_H -DTHREADMODEL=NOTHREADS -DDEBUGLVL=0 -O3 -D__ANDROID__ APP_MODULES := jpeg libdjvu mupdf ebookdroid hqx<file_sep>/EBookDroid/src/org/ebookdroid/core/views/FileBrowserView.java package org.ebookdroid.core.views; import org.ebookdroid.R; import org.ebookdroid.core.IBrowserActivity; import org.ebookdroid.core.presentation.BrowserAdapter; import org.ebookdroid.core.settings.SettingsManager; import android.app.AlertDialog; import android.content.DialogInterface; import android.net.Uri; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.FrameLayout; import android.widget.ListView; import android.widget.Toast; import java.io.File; import java.util.Set; public class FileBrowserView extends ListView implements AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, DialogInterface.OnClickListener { private final IBrowserActivity base; private final BrowserAdapter adapter; private File selected; private boolean scannedDir; public FileBrowserView(final IBrowserActivity base, final BrowserAdapter adapter) { super(base.getContext()); this.base = base; this.adapter = adapter; this.setAdapter(adapter); this.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); this.setOnItemClickListener(this); this.setOnItemLongClickListener(this); this.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); } @Override public void onItemClick(final AdapterView<?> adapterView, final View view, final int i, final long l) { selected = adapter.getItem(i); if (selected.isDirectory()) { base.setCurrentDir(selected); } else { base.showDocument(Uri.fromFile(selected)); } } @Override public boolean onItemLongClick(final AdapterView<?> adapterView, final View view, final int i, final long l) { selected = adapter.getItem(i); if (selected.isDirectory()) { final Set<String> dirs = SettingsManager.getAppSettings().getAutoScanDirs(); scannedDir = dirs.contains(selected.getPath()); final AlertDialog.Builder builder = new AlertDialog.Builder(base.getActivity()); builder.setTitle(selected.getName()); builder.setItems((scannedDir) ? R.array.list_filebrowser_del : R.array.list_filebrowser_add, this); final AlertDialog alert = builder.create(); alert.show(); } else { showDialog("Path: " + selected.getParent() + "\nFile: " + selected.getName()); } return false; } @Override public void onClick(final DialogInterface dialog, final int item) { switch (item) { case 0: base.setCurrentDir(selected); break; case 1: SettingsManager.getAppSettings().changeAutoScanDirs(selected.getPath(), !scannedDir); adapter.notifyDataSetInvalidated(); Toast.makeText(base.getActivity().getApplicationContext(), "Done.", Toast.LENGTH_SHORT).show(); break; } } private void showDialog(final String msg) { final AlertDialog alertDialog = new AlertDialog.Builder(base.getContext()).create(); alertDialog.setTitle("Info"); alertDialog.setMessage(msg); alertDialog.setButton("OK", (DialogInterface.OnClickListener) null); alertDialog.setIcon(R.drawable.icon); alertDialog.show(); } } <file_sep>/EBookDroid/src/org/ebookdroid/fb2droid/FB2ViewerActivity.java package org.ebookdroid.fb2droid; import org.ebookdroid.core.BaseViewerActivity; import org.ebookdroid.core.DecodeService; import org.ebookdroid.core.DecodeServiceBase; import org.ebookdroid.fb2droid.codec.FB2Context; public class FB2ViewerActivity extends BaseViewerActivity { /** * {@inheritDoc} * * @see org.ebookdroid.core.BaseViewerActivity#createDecodeService() */ @Override protected DecodeService createDecodeService() { return new DecodeServiceBase(new FB2Context()); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/settings/ui/fragments/ScrollFragment.java package org.ebookdroid.core.settings.ui.fragments; import org.ebookdroid.R; public class ScrollFragment extends BasePreferenceFragment { public ScrollFragment() { super(R.xml.fragment_scroll); } @Override public void decorate() { decorator.decorateScrollSettings(); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/IDocumentViewController.java package org.ebookdroid.core; import org.ebookdroid.core.IViewerActivity.IBookLoadTask; import org.ebookdroid.core.events.ZoomListener; import android.graphics.Canvas; import android.graphics.Rect; import android.view.KeyEvent; import android.view.MotionEvent; public interface IDocumentViewController extends ZoomListener { void init(IBookLoadTask bookLoadTask); void show(); /* Page related methods */ void goToPage(int page); void invalidatePageSizes(InvalidateSizeReason reason, Page changedPage); int getFirstVisiblePage(); int calculateCurrentPage(ViewState viewState); int getLastVisiblePage(); void verticalConfigScroll(int i); void redrawView(); void redrawView(ViewState viewState); void setAlign(PageAlign byResValue); /* Infrastructure methods */ IViewerActivity getBase(); IDocumentView getView(); void updateAnimationType(); void updateMemorySettings(); public static enum InvalidateSizeReason { INIT, LAYOUT, PAGE_ALIGN, ZOOM, PAGE_LOADED; } void drawView(Canvas canvas, ViewState viewState); boolean onLayoutChanged(boolean layoutChanged, boolean layoutLocked, Rect oldLaout, Rect newLayout); Rect getScrollLimits(); boolean onTouchEvent(MotionEvent ev); void onScrollChanged(final int newPage, final int direction); boolean dispatchKeyEvent(final KeyEvent event); ViewState updatePageVisibility(final int newPage, final int direction, final float zoom); void pageUpdated(int viewIndex); void toggleNightMode(boolean nightMode); } <file_sep>/EBookDroid/src/org/ebookdroid/core/settings/ui/fragments/BookFragment.java package org.ebookdroid.core.settings.ui.fragments; import org.ebookdroid.R; public class BookFragment extends BasePreferenceFragment { public BookFragment() { super(R.xml.fragment_book); } @Override public void decorate() { decorator.decorateBooksSettings(); } } <file_sep>/BaseCode/src/com/keensoft/basecode/BaseFragment.java package com.keensoft.basecode; import android.support.v4.app.Fragment; import com.umeng.analytics.MobclickAgent; public class BaseFragment extends Fragment { public void onResume() { super.onResume(); MobclickAgent.onPageStart("SplashScreen"); // 统计页面(仅有Activity的应用中SDK自动调用,不需要单独写) // MobclickAgent.onResume(this.getActivity()); // 统计时长 } public void onPause() { super.onPause(); MobclickAgent.onPageEnd("SplashScreen"); // (仅有Activity的应用中SDK自动调用,不需要单独写)保证 // MobclickAgent.onPause(this.getActivity()); } } <file_sep>/EBookDroid/jni/ebookdroid/cbdroidbridge.c #include <string.h> #include <jni.h> #include <stdint.h> #include "hqxcommon.h" #include "hqx.h" JNIEXPORT void JNICALL Java_org_ebookdroid_core_bitmaps_RawBitmap_nativeHq4x(JNIEnv* env, jclass classObject, jintArray srcArray, jintArray dstArray, jint width, jint height) { jint* src; jint* dst; src = (*env)->GetIntArrayElements(env, srcArray, 0); dst = (*env)->GetIntArrayElements(env, dstArray, 0); hq4x_32(src, dst, width, height); (*env)->ReleaseIntArrayElements(env, srcArray, src, 0); (*env)->ReleaseIntArrayElements(env, dstArray, dst, 0); } JNIEXPORT void JNICALL Java_org_ebookdroid_core_bitmaps_RawBitmap_nativeHq3x(JNIEnv* env, jclass classObject, jintArray srcArray, jintArray dstArray, jint width, jint height) { jint* src; jint* dst; src = (*env)->GetIntArrayElements(env, srcArray, 0); dst = (*env)->GetIntArrayElements(env, dstArray, 0); hq3x_32(src, dst, width, height); (*env)->ReleaseIntArrayElements(env, srcArray, src, 0); (*env)->ReleaseIntArrayElements(env, dstArray, dst, 0); } JNIEXPORT void JNICALL Java_org_ebookdroid_core_bitmaps_RawBitmap_nativeHq2x(JNIEnv* env, jclass classObject, jintArray srcArray, jintArray dstArray, jint width, jint height) { jint* src; jint* dst; src = (*env)->GetIntArrayElements(env, srcArray, 0); dst = (*env)->GetIntArrayElements(env, dstArray, 0); hq2x_32(src, dst, width, height); (*env)->ReleaseIntArrayElements(env, srcArray, src, 0); (*env)->ReleaseIntArrayElements(env, dstArray, dst, 0); } JNIEXPORT void JNICALL Java_org_ebookdroid_core_bitmaps_RawBitmap_nativeInvert(JNIEnv* env, jclass classObject, jintArray srcArray, jint width, jint height) { jint* src; int i; src = (*env)->GetIntArrayElements(env, srcArray, 0); for (i = 0; i < width * height; i++) { src[i] ^= 0x00FFFFFF; } (*env)->ReleaseIntArrayElements(env, srcArray, src, 0); }<file_sep>/EBookDroid/src/org/ebookdroid/djvudroid/DjvuViewerActivity.java package org.ebookdroid.djvudroid; import org.ebookdroid.core.BaseViewerActivity; import org.ebookdroid.core.DecodeService; import org.ebookdroid.core.DecodeServiceBase; import org.ebookdroid.djvudroid.codec.DjvuContext; public class DjvuViewerActivity extends BaseViewerActivity { @Override protected DecodeService createDecodeService() { return new DecodeServiceBase(new DjvuContext()); } } <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/BookShelfAdapter.java package org.ebookdroid.core.presentation; import org.ebookdroid.R; import org.ebookdroid.core.IBrowserActivity; import org.ebookdroid.core.presentation.BooksAdapter.ViewHolder; import org.ebookdroid.utils.StringUtils; import android.database.DataSetObserver; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import java.util.ArrayList; import java.util.IdentityHashMap; import java.util.List; public class BookShelfAdapter extends BaseAdapter { private final IBrowserActivity base; private final IdentityHashMap<DataSetObserver, DataSetObserver> observers = new IdentityHashMap<DataSetObserver, DataSetObserver>(); final int id; final String name; final String path; final List<BookNode> nodes = new ArrayList<BookNode>(); public BookShelfAdapter(final IBrowserActivity base, final int index, final String name, final String path) { this.base = base; this.id = index; this.name = name; this.path = path; } @Override public int getCount() { return nodes.size(); } @Override public Object getItem(final int position) { return nodes.get(position); } @Override public long getItemId(final int position) { return position; } @Override public View getView(final int position, final View view, final ViewGroup parent) { final ViewHolder holder = BaseViewHolder.getOrCreateViewHolder(ViewHolder.class, R.layout.thumbnail, view, parent); final BookNode node = nodes.get(position); holder.textView.setText(StringUtils.cleanupTitle(node.name)); base.loadThumbnail(node.path, holder.imageView, R.drawable.book); return holder.getView(); } public String getPath() { return path; } @Override public void registerDataSetObserver(final DataSetObserver observer) { if (!observers.containsKey(observer)) { super.registerDataSetObserver(observer); observers.put(observer, observer); } } @Override public void unregisterDataSetObserver(final DataSetObserver observer) { if (null != observers.remove(observer)) { super.unregisterDataSetObserver(observer); } } } <file_sep>/EBookDroid/build.xml <project name="EBookDroid" basedir="." default="EBookDroid-dev"> <property file="build.${user.name}.properties" /> <property file="build.properties" /> <property file="project.properties" /> <tstamp> <format property="debug.version" pattern="yyyyMMdd.HHmmss" /> </tstamp> <path id="svnant.classpath"> <fileset dir="${svnant.dir}/lib"> <include name="**/*.jar" /> </fileset> </path> <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" /> <path id="android.antlibs"> <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> </path> <taskdef name="xpath" classname="com.android.ant.XPathTask" classpathref="android.antlibs" /> <property name="aapt" value="${sdk.dir}/platform-tools/aapt" /> <property name="dx" value="${sdk.dir}/platform-tools/dx" /> <property name="android.jar" value="${sdk.dir}/platforms/${target}/android.jar" /> <property name="out.dir" value="target" /> <property name="out.absolute.dir" location="${out.dir}" /> <xpath input="AndroidManifest.xml" expression="/manifest/@android:versionName" output="manifest.version" /> <property name="out.debug.file" location="${out.absolute.dir}/${ant.project.name}-${debug.version}.apk" /> <property name="out.release.file" location="${out.absolute.dir}/${ant.project.name}-release.apk" /> <property name="arm.mk" location="jni/Application.mk" /> <property name="cortex.a8.mk" location="jni/Application.arm7.a8.mk" /> <property name="cortex.a9.mk" location="jni/Application.arm7.a9.mk" /> <property name="cortex.a8.neon.mk" location="jni/Application.arm7.a8.neon.mk" /> <property name="cortex.a9.neon.mk" location="jni/Application.arm7.a9.neon.mk" /> <property name="wexler.mk" location="jni/Application.wexler.t7007.mk" /> <property name="arm.apk" location="apk/${package.name}-${manifest.version}.apk" /> <property name="arm.svn.apk" location="apk/${package.name}-${manifest.version}.apk" /> <property name="cortex.a8.apk" value="apk/${package.name}-arm7-cortex-a8-${manifest.version}.apk" /> <property name="cortex.a9.apk" value="apk/${package.name}-arm7-cortex-a9-${manifest.version}.apk" /> <property name="cortex.a8.neon.apk" value="apk/${package.name}-arm7-cortex-a8-neon-${manifest.version}.apk" /> <property name="cortex.a9.neon.apk" value="apk/${package.name}-arm7-cortex-a9-neon-${manifest.version}.apk" /> <property name="wexler.apk" value="apk/${package.name}-wexler.t7007-${manifest.version}.apk" /> <path id="project.libraries"> <pathelement path="thirdparty/junrar" /> <pathelement path="thirdparty/android" /> </path> <path id="project.libraries.jars" /> <path id="project.libraries.libs" /> <path id="android.target.classpath"> <fileset dir="${sdk.dir}/platforms/${target}/"> <include name="android.jar" /> </fileset> </path> <import file="${sdk.dir}/tools/ant/build.xml" /> <mkdir dir="apk" /> <target name="--make-release"> <delete dir="${out.absolute.dir}" /> <mkdir dir="${out.absolute.dir}" /> <delete dir="obj" /> <mkdir dir="obj" /> <delete dir="libs/armeabi" /> <delete dir="libs/armeabi-v7a" /> <echo>${mk}</echo> <exec command="${ndk.dir}/ndk-build NDK_DEBUG=0 NDK_APPLICATION_MK=${mk} -j32" /> <antcall target="release" /> <echo>${apk}</echo> <rename src="${out.release.file}" dest="${apk}" /> </target> <target name="EBookDroid-release"> <svn javahl="false"> <export srcurl="http://ebookdroid.googlecode.com/svn/wiki/ChangeLog.wiki" destpath="assets/about_changelog.wiki"/> </svn> <antcall target="--make-release" inheritall="true"> <param name="mk" value="${arm.mk}" /> <param name="apk" value="${arm.apk}" /> </antcall> <antcall target="--make-release" inheritall="true"> <param name="mk" value="${cortex.a8.mk}" /> <param name="apk" value="${cortex.a8.apk}" /> </antcall> <antcall target="--make-release" inheritall="true"> <param name="mk" value="${cortex.a8.neon.mk}" /> <param name="apk" value="${cortex.a8.neon.apk}" /> </antcall> <antcall target="--make-release"> <param name="mk" value="${cortex.a9.mk}" /> <param name="apk" value="${cortex.a9.apk}" /> </antcall> <antcall target="--make-release"> <param name="mk" value="${cortex.a9.neon.mk}" /> <param name="apk" value="${cortex.a9.neon.apk}" /> </antcall> <antcall target="--make-release"> <param name="mk" value="${wexler.mk}" /> <param name="apk" value="${wexler.apk}" /> </antcall> </target> <target name="EBookDroid-Wexler-release"> <svn javahl="false"> <export srcurl="http://ebookdroid.googlecode.com/svn/wiki/ChangeLog.wiki" destpath="assets/about_changelog.wiki"/> </svn> <antcall target="--make-release"> <param name="mk" value="${wexler.mk}" /> <param name="apk" value="${wexler.apk}" /> </antcall> </target> <target name="EBookDroid-dev"> <svn javahl="false"> <info target="." /> </svn> <echo>Revision: ${svn.info.rev}</echo> <property name="target.apk" location="apk/${package.name}-${manifest.version}-r${svn.info.rev}.apk" /> <echo>Target: ${target.apk}</echo> <svn javahl="false"> <export srcurl="http://ebookdroid.googlecode.com/svn/wiki/ChangeLog.wiki" destpath="assets/about_changelog.wiki"/> </svn> <antcall target="--make-release"> <param name="mk" value="${arm.mk}" /> <param name="apk" value="${target.apk}" /> </antcall> </target> <target name="EBookDroid-Wexler-dev"> <svn javahl="false"> <info target="." /> </svn> <echo>Revision: ${svn.info.rev}</echo> <property name="target.apk" location="apk/${package.name}-wexler.t7007-${manifest.version}-r${svn.info.rev}.apk" /> <echo>Target: ${target.apk}</echo> <svn javahl="false"> <export srcurl="http://ebookdroid.googlecode.com/svn/wiki/ChangeLog.wiki" destpath="assets/about_changelog.wiki"/> </svn> <antcall target="--make-release"> <param name="mk" value="${wexler.mk}" /> <param name="apk" value="${target.apk}" /> </antcall> </target> </project><file_sep>/EBookDroid/src/org/ebookdroid/pdfdroid/codec/FzGeometry.java package org.ebookdroid.pdfdroid.codec; import android.util.FloatMath; public class FzGeometry { public static class fz_matrix { float a, b, c, d, e, f; public fz_matrix() { } public fz_matrix(float a, float b, float c, float d, float e, float f) { this.a = a; this.b = b; this.c = c; this.d = d; this.e = e; this.f = f; } }; public static final fz_matrix fz_identity = new fz_matrix(1, 0, 0, 1, 0, 0); public static fz_matrix fz_concat(fz_matrix one, fz_matrix two) { fz_matrix dst = new fz_matrix(); dst.a = one.a * two.a + one.b * two.c; dst.b = one.a * two.b + one.b * two.d; dst.c = one.c * two.a + one.d * two.c; dst.d = one.c * two.b + one.d * two.d; dst.e = one.e * two.a + one.f * two.c + two.e; dst.f = one.e * two.b + one.f * two.d + two.f; return dst; } public static fz_matrix fz_scale(float sx, float sy) { fz_matrix m = new fz_matrix(); m.a = sx; m.b = 0; m.c = 0; m.d = sy; m.e = 0; m.f = 0; return m; } public static fz_matrix fz_shear(float h, float v) { fz_matrix m = new fz_matrix(); m.a = 1; m.b = v; m.c = h; m.d = 1; m.e = 0; m.f = 0; return m; } public static fz_matrix fz_rotate(float theta) { fz_matrix m = new fz_matrix(); float s; float c; while (theta < 0) { theta += 360; } while (theta >= 360) { theta -= 360; } if (Math.abs(0 - theta) < 0.1) { s = 0; c = 1; } else if (Math.abs(90.0f - theta) < 0.1) { s = 1; c = 0; } else if (Math.abs(180.0f - theta) < 0.1) { s = 0; c = -1; } else if (Math.abs(270.0f - theta) < 0.1) { s = -1; c = 0; } else { s = FloatMath.sin(theta * (float) Math.PI / 180); c = FloatMath.cos(theta * (float) Math.PI / 180); } m.a = c; m.b = s; m.c = -s; m.d = c; m.e = 0; m.f = 0; return m; } public static fz_matrix fz_translate(float tx, float ty) { fz_matrix m = new fz_matrix(); m.a = 1; m.b = 0; m.c = 0; m.d = 1; m.e = tx; m.f = ty; return m; } public static fz_matrix fz_invert_matrix(fz_matrix src) { fz_matrix dst = new fz_matrix(); float rdet = 1 / (src.a * src.d - src.b * src.c); dst.a = src.d * rdet; dst.b = -src.b * rdet; dst.c = -src.c * rdet; dst.d = src.a * rdet; dst.e = -src.e * dst.a - src.f * dst.c; dst.f = -src.e * dst.b - src.f * dst.d; return dst; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/touch/MultiTouchZoomImpl.java package org.ebookdroid.core.touch; import android.graphics.PointF; import android.util.FloatMath; import android.util.Pair; import android.view.MotionEvent; public class MultiTouchZoomImpl implements IMultiTouchZoom { private final IMultiTouchListener listener; private float twoFingerDistance; private boolean twoFingerPress = false; private boolean multiEventCatched; private PointF multiCenter; public MultiTouchZoomImpl(final IMultiTouchListener listener) { this.listener = listener; } @Override public boolean onTouchEvent(final MotionEvent ev) { if ((ev.getAction() & MotionEvent.ACTION_POINTER_DOWN) == MotionEvent.ACTION_POINTER_DOWN) { switch (ev.getPointerCount()) { case 2: twoFingerDistance = getZoomDistance(ev); twoFingerPress = true; break; default: twoFingerPress = false; } multiCenter = calculateCenter(ev); multiEventCatched = true; return true; } if ((ev.getAction() & MotionEvent.ACTION_POINTER_UP) == MotionEvent.ACTION_POINTER_UP) { if (ev.getPointerCount() < 2) { if (twoFingerDistance > 0) { twoFingerDistance = 0; listener.onTwoFingerPinchEnd(); } if (twoFingerPress) { listener.onTwoFingerTap(); } twoFingerPress = false; } multiEventCatched = true; return true; } if (ev.getAction() == MotionEvent.ACTION_MOVE) { if (twoFingerDistance != 0 && ev.getPointerCount() == 2) { PointF newCenter = calculateCenter(ev); if (distance(newCenter, multiCenter) > 10.0f || !twoFingerPress) { twoFingerPress = false; // We moved it is not a tap anymore! final float zoomDistance = getZoomDistance(ev); listener.onTwoFingerPinch(twoFingerDistance, zoomDistance); twoFingerDistance = zoomDistance; } multiEventCatched = true; } return multiEventCatched; } if (ev.getAction() == MotionEvent.ACTION_UP && multiEventCatched) { multiEventCatched = false; return true; } return false; } private float distance(PointF p0, PointF p1) { return FloatMath.sqrt(((p0.x - p1.x) * (p0.x - p1.x) + (p0.y - p1.y) * (p0.y - p1.y))); } private PointF calculateCenter(MotionEvent ev) { float x = 0, y = 0; for (int i = 0; i < ev.getPointerCount(); i++) { x += ev.getX(i); y += ev.getY(i); } return new PointF(x / ev.getPointerCount(), y / ev.getPointerCount()); } private float getZoomDistance(final MotionEvent ev) { if (ev.getPointerCount() == 2) { float x0 = ev.getX(0); float x1 = ev.getX(1); float y0 = ev.getY(0); float y1 = ev.getY(1); return FloatMath.sqrt(((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1))); } return twoFingerDistance; } @Override public boolean enabled() { return true; } } <file_sep>/EBookDroid/src/org/ebookdroid/core/settings/SettingsManager.java package org.ebookdroid.core.settings; import org.ebookdroid.core.PageIndex; import org.ebookdroid.core.events.ListenerProxy; import org.ebookdroid.core.settings.books.BookSettings; import org.ebookdroid.core.settings.books.DBSettingsManager; import android.content.Context; import java.util.HashMap; import java.util.Map; import java.util.concurrent.locks.ReentrantReadWriteLock; public class SettingsManager { private static Context ctx; private static DBSettingsManager db; private static final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); private static AppSettings appSettings; private static final Map<String, BookSettings> bookSettings = new HashMap<String, BookSettings>(); private static BookSettings current; private static ListenerProxy listeners = new ListenerProxy(ISettingsChangeListener.class); public static void init(final Context context) { if (ctx == null) { ctx = context; db = new DBSettingsManager(context); appSettings = new AppSettings(context); } } public static BookSettings init(final String fileName) { lock.writeLock().lock(); try { getAppSettings().clearPseudoBookSettings(); current = getBookSettingsImpl(fileName, true); getAppSettings().updatePseudoBookSettings(current); return current; } finally { lock.writeLock().unlock(); } } public static BookSettings getBookSettings(final String fileName) { lock.writeLock().lock(); try { BookSettings bs = bookSettings.get(fileName); if (bs == null) { bs = db.getBookSettings(fileName); } if (current == null) { current = bs; } return bs; } finally { lock.writeLock().unlock(); } } private static BookSettings getBookSettingsImpl(final String fileName, final boolean createOnDemand) { BookSettings bs = bookSettings.get(fileName); if (bs == null) { bs = db.getBookSettings(fileName); if (bs == null) { bs = new BookSettings(fileName); getAppSettings().fillBookSettings(bs); db.storeBookSettings(bs); } bookSettings.put(fileName, bs); } return bs; } private static void replaceCurrentBookSettings(final BookSettings newBS) { if (current != null) { bookSettings.remove(current.fileName); } current = newBS; if (current != null) { bookSettings.put(current.fileName, current); } } public static BookSettingsEditor edit(final BookSettings bs) { return new BookSettingsEditor(bs); } public static void clearCurrentBookSettings() { lock.writeLock().lock(); try { getAppSettings().clearPseudoBookSettings(); storeBookSettings(); replaceCurrentBookSettings(null); } finally { lock.writeLock().unlock(); } } public static void removeCurrentBookSettings() { lock.writeLock().lock(); try { getAppSettings().clearPseudoBookSettings(); if (current != null) { bookSettings.remove(current.fileName); db.delete(current); } current = null; } finally { lock.writeLock().unlock(); } } public static void clearAllRecentBookSettings() { lock.writeLock().lock(); try { db.clearRecent(); bookSettings.clear(); final AppSettings apps = getAppSettings(); if (current != null) { apps.clearPseudoBookSettings(); apps.updatePseudoBookSettings(current); } else { apps.clearPseudoBookSettings(); } } finally { lock.writeLock().unlock(); } } public static void deleteAllBookSettings() { lock.writeLock().lock(); try { db.deleteAll(); bookSettings.clear(); final AppSettings apps = getAppSettings(); if (current != null) { apps.clearPseudoBookSettings(); apps.updatePseudoBookSettings(current); } else { apps.clearPseudoBookSettings(); } } finally { lock.writeLock().unlock(); } } public static void deleteAllBookmarks() { lock.writeLock().lock(); try { db.deleteAllBookmarks(); bookSettings.clear(); if (current != null) { current.bookmarks.clear(); } } finally { lock.writeLock().unlock(); } } public static AppSettings getAppSettings() { lock.readLock().lock(); try { return appSettings; } finally { lock.readLock().unlock(); } } public static BookSettings getBookSettings() { lock.readLock().lock(); try { return current; } finally { lock.readLock().unlock(); } } public static BookSettings getRecentBook() { lock.readLock().lock(); try { if (current != null) { return current; } final Map<String, BookSettings> books = db.getBookSettings(false); final BookSettings bs = books.isEmpty() ? null : books.values().iterator().next(); if (bs != null) { bookSettings.put(bs.fileName, bs); } return bs; } finally { lock.readLock().unlock(); } } public static Map<String, BookSettings> getAllBooksSettings() { lock.writeLock().lock(); try { final String fileName = current != null ? current.fileName : null; final Map<String, BookSettings> books = db.getBookSettings(true); bookSettings.clear(); books.putAll(books); replaceCurrentBookSettings(books.get(fileName)); return books; } finally { lock.writeLock().unlock(); } } public static void currentPageChanged(final PageIndex oldIndex, final PageIndex newIndex) { lock.readLock().lock(); try { if (current != null) { current.currentPageChanged(oldIndex, newIndex); db.storeBookSettings(current); } } finally { lock.readLock().unlock(); } } public static void zoomChanged(final float zoom, boolean committed) { lock.readLock().lock(); try { if (current != null) { current.setZoom(zoom); if (committed) { db.storeBookSettings(current); } } } finally { lock.readLock().unlock(); } } public static void positionChanged(final float offsetX, final float offsetY) { lock.readLock().lock(); try { if (current != null) { current.offsetX = offsetX; current.offsetY = offsetY; } } finally { lock.readLock().unlock(); } } public static void onSettingsChanged() { lock.writeLock().lock(); try { final AppSettings oldSettings = appSettings; appSettings = new AppSettings(ctx); final AppSettings.Diff appDiff = applyAppSettingsChanges(oldSettings, appSettings); onBookSettingsChanged(current, appDiff); } finally { lock.writeLock().unlock(); } } static void onBookSettingsChanged(final BookSettings bs, final AppSettings.Diff appDiff) { lock.writeLock().lock(); try { if (current != null) { if (current == bs) { final BookSettings oldBS = new BookSettings(current); appSettings.fillBookSettings(current); db.storeBookSettings(current); db.updateBookmarks(current); applyBookSettingsChanges(oldBS, current, appDiff); } else { appSettings.fillBookSettings(current); db.storeBookSettings(current); db.updateBookmarks(current); } } } finally { lock.writeLock().unlock(); } } public static void storeBookSettings() { lock.readLock().lock(); try { if (current != null) { db.storeBookSettings(current); db.updateBookmarks(current); } } finally { lock.readLock().unlock(); } } public static AppSettings.Diff applyAppSettingsChanges(final AppSettings oldSettings, final AppSettings newSettings) { final AppSettings.Diff diff = new AppSettings.Diff(oldSettings, newSettings); final ISettingsChangeListener l = listeners.getListener(); l.onAppSettingsChanged(oldSettings, newSettings, diff); return diff; } public static void applyBookSettingsChanges(final BookSettings oldSettings, final BookSettings newSettings, final AppSettings.Diff appDiff) { if (newSettings == null) { return; } final BookSettings.Diff diff = new BookSettings.Diff(oldSettings, newSettings); final ISettingsChangeListener l = listeners.getListener(); l.onBookSettingsChanged(oldSettings, newSettings, diff, appDiff); } public static void addListener(final ISettingsChangeListener l) { listeners.addListener(l); } public static void removeListener(final ISettingsChangeListener l) { listeners.removeListener(l); } public static class BookSettingsEditor { final BookSettings bookSettings; BookSettingsEditor(final BookSettings bs) { this.bookSettings = bs; if (bookSettings != null) { getAppSettings().updatePseudoBookSettings(bookSettings); } } public void commit() { if (bookSettings != null) { onBookSettingsChanged(bookSettings, null); } } public void rollback() { getAppSettings().clearPseudoBookSettings(); } } } <file_sep>/EBookDroid/src/org/ebookdroid/core/touch/IMultiTouchListener.java package org.ebookdroid.core.touch; public interface IMultiTouchListener { void onTwoFingerPinchEnd(); void onTwoFingerPinch(float oldDistance, float newDistance); void onTwoFingerTap(); } <file_sep>/EBookDroid/src/org/ebookdroid/core/bitmaps/BitmapManager.java package org.ebookdroid.core.bitmaps; import org.ebookdroid.EBookDroidApp; import org.ebookdroid.core.log.LogContext; import org.ebookdroid.utils.LengthUtils; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.Rect; import android.os.Debug; import android.util.SparseArray; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; public class BitmapManager { static final LogContext LCTX = LogContext.ROOT.lctx("BitmapManager", false); private final static long BITMAP_MEMORY_LIMIT = Runtime.getRuntime().maxMemory() / 2; private static Map<Integer, BitmapRef> used = new HashMap<Integer, BitmapRef>(); private static LinkedList<BitmapRef> pool = new LinkedList<BitmapRef>(); private static SparseArray<Bitmap> resources = new SparseArray<Bitmap>(); private static ConcurrentLinkedQueue<Object> releasing = new ConcurrentLinkedQueue<Object>(); private static long created; private static long reused; private static long memoryUsed; private static long memoryPooled; private static long generation; public static synchronized void increateGeneration() { generation++; } public static synchronized Bitmap getResource(final int resourceId) { Bitmap bitmap = resources.get(resourceId); if (bitmap == null || bitmap.isRecycled()) { final Resources resources = EBookDroidApp.context.getResources(); bitmap = BitmapFactory.decodeResource(resources, resourceId); } return bitmap; } public static synchronized BitmapRef getBitmap(final String name, final int width, final int height, final Bitmap.Config config) { if (used.size() == 0 && pool.size() == 0) { if (LCTX.isDebugEnabled()) { LCTX.d("!!! Bitmap pool size: " + (BITMAP_MEMORY_LIMIT / 1024) + "KB"); } } else { removeOldRefs(); removeEmptyRefs(); } final Iterator<BitmapRef> it = pool.iterator(); while (it.hasNext()) { final BitmapRef ref = it.next(); final Bitmap bmp = ref.bitmap; if (bmp != null && bmp.getConfig() == config && bmp.getWidth() == width && bmp.getHeight() >= height) { it.remove(); ref.gen = generation; used.put(ref.id, ref); reused++; memoryPooled -= ref.size; memoryUsed += ref.size; if (LCTX.isDebugEnabled()) { LCTX.d("Reuse bitmap: [" + ref.id + ", " + ref.name + " => " + name + ", " + width + ", " + height + "], created=" + created + ", reused=" + reused + ", memoryUsed=" + used.size() + "/" + (memoryUsed / 1024) + "KB" + ", memoryInPool=" + pool.size() + "/" + (memoryPooled / 1024) + "KB"); } bmp.eraseColor(Color.CYAN); ref.name = name; return ref; } } final BitmapRef ref = new BitmapRef(Bitmap.createBitmap(width, height, config), generation); used.put(ref.id, ref); created++; memoryUsed += ref.size; if (LCTX.isDebugEnabled()) { LCTX.d("Create bitmap: [" + ref.id + ", " + name + ", " + width + ", " + height + "], created=" + created + ", reused=" + reused + ", memoryUsed=" + used.size() + "/" + (memoryUsed / 1024) + "KB" + ", memoryInPool=" + pool.size() + "/" + (memoryPooled / 1024) + "KB"); } shrinkPool(BITMAP_MEMORY_LIMIT); ref.name = name; return ref; } public static synchronized void clear(final String msg) { generation += 10; removeOldRefs(); removeEmptyRefs(); release(); shrinkPool(0); print(msg, true); } private static void print(final String msg, final boolean showRefs) { long sum = 0; for (final BitmapRef ref : pool) { if (!ref.clearEmptyRef()) { if (showRefs) { LCTX.e("Pool: " + ref); } sum += ref.size; } } for (final BitmapRef ref : used.values()) { if (!ref.clearEmptyRef()) { if (showRefs) { LCTX.e("Used: " + ref); } sum += ref.size; } } LCTX.e(msg + "Bitmaps&NativeHeap : " + sum + "(" + (pool.size() + used.size()) + " instances)/" + Debug.getNativeHeapAllocatedSize() + "/" + Debug.getNativeHeapSize()); } @SuppressWarnings("unchecked") public static synchronized void release() { increateGeneration(); removeOldRefs(); removeEmptyRefs(); int count = 0; final int queueBefore = releasing.size(); while (!releasing.isEmpty()) { final Object ref = releasing.poll(); if (ref instanceof BitmapRef) { releaseImpl((BitmapRef) ref); count++; } else if (ref instanceof List) { final List<Bitmaps> list = (List<Bitmaps>) ref; for (final Bitmaps bmp : list) { BitmapRef[] bitmaps = bmp.bitmaps; bmp.bitmaps = null; if (bitmaps != null) { for (final BitmapRef bitmap : bitmaps) { if (bitmap != null) { releaseImpl(bitmap); count++; } } } } } else { LCTX.e("Unknown object in release queue: " + ref); } } shrinkPool(BITMAP_MEMORY_LIMIT); if (LCTX.isDebugEnabled()) { LCTX.d("Return " + count + " bitmap(s) to pool: " + "memoryUsed=" + used.size() + "/" + (memoryUsed / 1024) + "KB" + ", memoryInPool=" + pool.size() + "/" + (memoryPooled / 1024) + "KB" + ", releasing queue size " + queueBefore + " => 0"); } print("After release: ", false); } public static void release(final BitmapRef ref) { if (ref != null) { if (LCTX.isDebugEnabled()) { LCTX.d("Adding 1 ref to release queue"); } releasing.add(ref); } } public static void release(final List<Bitmaps> bitmapsToRecycle) { if (LengthUtils.isNotEmpty(bitmapsToRecycle)) { if (LCTX.isDebugEnabled()) { LCTX.d("Adding list of " + bitmapsToRecycle.size() + " bitmaps to release queue"); } releasing.add(new ArrayList<Bitmaps>(bitmapsToRecycle)); } } static void releaseImpl(final BitmapRef ref) { assert ref != null; if (null != used.remove(ref.id)) { memoryUsed -= ref.size; } else { LCTX.e("The bitmap " + ref + " not found in used ones"); } if (!ref.clearEmptyRef()) { pool.add(ref); memoryPooled += ref.size; } } private static void removeOldRefs() { int recycled = 0; int invalid = 0; final Iterator<BitmapRef> it = pool.iterator(); while (it.hasNext()) { final BitmapRef ref = it.next(); if (ref.clearEmptyRef()) { it.remove(); invalid++; memoryPooled -= ref.size; } else if (generation - ref.gen > 5) { it.remove(); ref.recycle(); recycled++; memoryPooled -= ref.size; } } if (recycled + invalid > 0) { if (LCTX.isDebugEnabled()) { LCTX.d("Recycled " + invalid + "/" + recycled + " pooled bitmap(s): " + "memoryUsed=" + used.size() + "/" + (memoryUsed / 1024) + "KB" + ", memoryInPool=" + pool.size() + "/" + (memoryPooled / 1024) + "KB"); } } } private static void removeEmptyRefs() { int recycled = 0; final Iterator<BitmapRef> it = used.values().iterator(); while (it.hasNext()) { final BitmapRef ref = it.next(); if (ref.clearEmptyRef()) { it.remove(); recycled++; memoryUsed -= ref.size; } } if (recycled > 0) { if (LCTX.isDebugEnabled()) { LCTX.d("Removed " + recycled + " autorecycled bitmap(s): " + "memoryUsed=" + used.size() + "/" + (memoryUsed / 1024) + "KB" + ", memoryInPool=" + pool.size() + "/" + (memoryPooled / 1024) + "KB"); } } } private static void shrinkPool(final long limit) { int recycled = 0; while (memoryPooled + memoryUsed > limit && !pool.isEmpty()) { final BitmapRef ref = pool.removeFirst(); ref.recycle(); memoryPooled -= ref.size; recycled++; } if (recycled > 0) { if (LCTX.isDebugEnabled()) { LCTX.d("Recycled " + recycled + " pooled bitmap(s): " + "memoryUsed=" + used.size() + "/" + (memoryUsed / 1024) + "KB" + ", memoryInPool=" + pool.size() + "/" + (memoryPooled / 1024) + "KB"); } } } public static int getBitmapBufferSize(final int width, final int height, final Bitmap.Config config) { return getPixelSizeInBytes(config) * width * height; } public static int getBitmapBufferSize(final Bitmap parentBitmap, final Rect childSize) { int bytes = 4; if (parentBitmap != null) { bytes = BitmapManager.getPixelSizeInBytes(parentBitmap.getConfig()); } return bytes * childSize.width() * childSize.height(); } public static int getPixelSizeInBytes(final Bitmap.Config config) { switch (config) { case ALPHA_8: return 1; case ARGB_4444: case RGB_565: return 2; case ARGB_8888: default: return 4; } } } <file_sep>/EBookDroid/jni/ebookdroid/xpsdroidbridge.c #include <jni.h> #include <android/log.h> #include <nativebitmap.h> #include <errno.h> #include <fitz.h> #include <muxps.h> /* Debugging helper */ #define DEBUG(args...) \ __android_log_print(ANDROID_LOG_DEBUG, "EBookDroid.XPS", args) #define ERROR(args...) \ __android_log_print(ANDROID_LOG_ERROR, "EBookDroid.XPS", args) #define INFO(args...) \ __android_log_print(ANDROID_LOG_INFO, "EBookDroid.XPS", args) typedef struct renderdocument_s renderdocument_t; struct renderdocument_s { fz_context* ctx; xps_document* xpsdoc; fz_outline* outline; }; typedef struct renderpage_s renderpage_t; struct renderpage_s { xps_page* page; fz_display_list* pageList; }; #define RUNTIME_EXCEPTION "java/lang/RuntimeException" void xps_throw_exception(JNIEnv *env, char *message) { jthrowable new_exception = (*env)->FindClass(env, RUNTIME_EXCEPTION); if (new_exception == NULL) { return; } else { DEBUG("Exception '%s', Message: '%s'", RUNTIME_EXCEPTION, message); } (*env)->ThrowNew(env, new_exception, message); } static void xps_free_document(renderdocument_t* doc) { if (doc) { if (doc->outline) fz_free_outline(doc->ctx, doc->outline); doc->outline = NULL; if(doc->xpsdoc) xps_close_document(doc->xpsdoc); doc->xpsdoc = NULL; fz_flush_warnings(doc->ctx); fz_free_context(doc->ctx); doc->ctx = NULL; free(doc); doc = NULL; } } JNIEXPORT jlong JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsDocument_open(JNIEnv *env, jclass clazz, jint storememory, jstring fname) { fz_obj *obj; renderdocument_t *doc; jboolean iscopy; jclass cls; jfieldID fid; char *filename; filename = (char*) (*env)->GetStringUTFChars(env, fname, &iscopy); doc = malloc(sizeof(renderdocument_t)); if (!doc) { xps_throw_exception(env, "Out of Memory"); goto cleanup; } DEBUG("XpsDocument.nativeOpen(): storememory = %d", storememory); // doc->ctx = fz_new_context(&fz_alloc_default, 256<<20); // doc->ctx = fz_new_context(&fz_alloc_default, storememory); doc->ctx = fz_new_context(NULL, storememory); if (!doc->ctx) { free(doc); xps_throw_exception(env, "Out of Memory"); goto cleanup; } doc->xpsdoc = NULL; doc->outline = NULL; fz_try(doc->ctx) { doc->xpsdoc = xps_open_document(doc->ctx, filename); } fz_catch(doc->ctx) { xps_free_document(doc); xps_throw_exception(env, "XPS file not found or corrupted"); goto cleanup; } cleanup: (*env)->ReleaseStringUTFChars(env, fname, filename); DEBUG("XpsDocument.nativeOpen(): return handle = %p", doc); return (jlong) (long) doc; } JNIEXPORT void JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsDocument_free(JNIEnv *env, jclass clazz, jlong handle) { renderdocument_t *doc = (renderdocument_t*) (long) handle; xps_free_document(doc); } JNIEXPORT jint JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsDocument_getPageInfo(JNIEnv *env, jclass cls, jlong handle, jint pageNumber, jobject cpi) { renderdocument_t *doc = (renderdocument_t*) (long) handle; // DEBUG("XpsDocument.getPageInfo = %p", doc); xps_page *page = NULL; jclass clazz; jfieldID fid; fz_try(doc->ctx) { page = xps_load_page(doc->xpsdoc, pageNumber - 1); } fz_catch(doc->ctx) { return (-1); } if (page) { clazz = (*env)->GetObjectClass(env, cpi); if (0 == clazz) { return (-1); } fid = (*env)->GetFieldID(env, clazz, "width", "I"); (*env)->SetIntField(env, cpi, fid, page->width); fid = (*env)->GetFieldID(env, clazz, "height", "I"); (*env)->SetIntField(env, cpi, fid, page->height); fid = (*env)->GetFieldID(env, clazz, "dpi", "I"); (*env)->SetIntField(env, cpi, fid, 0); fid = (*env)->GetFieldID(env, clazz, "rotation", "I"); (*env)->SetIntField(env, cpi, fid, 0); fid = (*env)->GetFieldID(env, clazz, "version", "I"); (*env)->SetIntField(env, cpi, fid, 0); xps_free_page(doc->xpsdoc, page); return 0; } return (-1); } JNIEXPORT jint JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsDocument_getPageCount(JNIEnv *env, jclass clazz, jlong handle) { renderdocument_t *doc = (renderdocument_t*) (long) handle; return (xps_count_pages(doc->xpsdoc)); } JNIEXPORT jlong JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsPage_open(JNIEnv *env, jclass clazz, jlong dochandle, jint pageno) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page; fz_obj *obj; jclass cls; jfieldID fid; page = malloc(sizeof(renderpage_t)); if (!page) { xps_throw_exception(env, "Out of Memory"); return (jlong) (long) NULL; } fz_try(doc->ctx) { page->page = xps_load_page(doc->xpsdoc, pageno - 1); } fz_catch(doc->ctx) { free(page); xps_throw_exception(env, "error loading page"); goto cleanup; } //New draw page page->pageList = fz_new_display_list(doc->ctx); fz_device *dev = fz_new_list_device(doc->ctx, page->pageList); xps_run_page(doc->xpsdoc, page->page, dev, fz_identity, NULL); fz_free_device(dev); // cleanup: /* nothing yet */ DEBUG("XpsPage.nativeOpenPage(): return handle = %p", page); return (jlong) (long) page; } JNIEXPORT void JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsPage_free(JNIEnv *env, jclass clazz, jlong docHandle, jlong handle) { renderdocument_t *doc = (renderdocument_t*) (long) docHandle; renderpage_t *page = (renderpage_t*) (long) handle; DEBUG("XpsPage_free(%p)", page); if (page) { if (page->page) xps_free_page(doc->xpsdoc, page->page); if (page->pageList) fz_free_display_list(doc->ctx, page->pageList); free(page); } } JNIEXPORT void JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsPage_getBounds(JNIEnv *env, jclass clazz, jlong dochandle, jlong handle, jfloatArray bounds) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) handle; jfloat *bbox = (*env)->GetPrimitiveArrayCritical(env, bounds, 0); if (!bbox) return; fz_rect page_bounds = xps_bound_page(doc->xpsdoc, page->page); DEBUG("Bounds: %f %f %f %f", page_bounds.x0, page_bounds.y0, page_bounds.x1, page_bounds.y1); bbox[0] = page_bounds.x0; bbox[1] = page_bounds.y0; bbox[2] = page_bounds.x1; bbox[3] = page_bounds.y1; (*env)->ReleasePrimitiveArrayCritical(env, bounds, bbox, 0); } JNIEXPORT void JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsPage_renderPage(JNIEnv *env, jobject this, jlong dochandle, jlong pagehandle, jintArray viewboxarray, jfloatArray matrixarray, jintArray bufferarray) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) pagehandle; DEBUG("XpsView(%p).renderPage(%p, %p)", this, doc, page); fz_matrix ctm; fz_bbox viewbox; fz_pixmap *pixmap; jfloat *matrix; jint *viewboxarr; jint *dimen; jint *buffer; int length, val; fz_device *dev = NULL; /* initialize parameter arrays for MuPDF */ ctm = fz_identity; matrix = (*env)->GetPrimitiveArrayCritical(env, matrixarray, 0); ctm.a = matrix[0]; ctm.b = matrix[1]; ctm.c = matrix[2]; ctm.d = matrix[3]; ctm.e = matrix[4]; ctm.f = matrix[5]; (*env)->ReleasePrimitiveArrayCritical(env, matrixarray, matrix, 0); DEBUG("Matrix: %f %f %f %f %f %f", ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f); viewboxarr = (*env)->GetPrimitiveArrayCritical(env, viewboxarray, 0); viewbox.x0 = viewboxarr[0]; viewbox.y0 = viewboxarr[1]; viewbox.x1 = viewboxarr[2]; viewbox.y1 = viewboxarr[3]; (*env)->ReleasePrimitiveArrayCritical(env, viewboxarray, viewboxarr, 0); DEBUG("Viewbox: %d %d %d %d", viewbox.x0, viewbox.y0, viewbox.x1, viewbox.y1); /* do the rendering */ buffer = (*env)->GetPrimitiveArrayCritical(env, bufferarray, 0); // pixmap = fz_new_pixmap_with_data(fz_device_bgr, viewbox.x0, viewbox.y0, viewbox.x1 - viewbox.x0, viewbox.y1 - viewbox.y0, (unsigned char*)buffer); pixmap = fz_new_pixmap_with_data(doc->ctx, fz_device_bgr, viewbox.x1 - viewbox.x0, viewbox.y1 - viewbox.y0, (unsigned char*) buffer); DEBUG("doing the rendering..."); fz_clear_pixmap_with_color(pixmap, 0xff); dev = fz_new_draw_device(doc->ctx, pixmap); fz_execute_display_list(page->pageList, dev, ctm, viewbox, NULL); fz_free_device(dev); (*env)->ReleasePrimitiveArrayCritical(env, bufferarray, buffer, 0); fz_drop_pixmap(doc->ctx, pixmap); DEBUG("XpsView.renderPage() done"); } /*JNI BITMAP API*/ JNIEXPORT jboolean JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsContext_isNativeGraphicsAvailable(JNIEnv *env, jobject this) { return NativePresent(); } JNIEXPORT jboolean JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsPage_renderPageBitmap(JNIEnv *env, jobject this, jlong dochandle, jlong pagehandle, jintArray viewboxarray, jfloatArray matrixarray, jobject bitmap) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; renderpage_t *page = (renderpage_t*) (long) pagehandle; DEBUG("XpsView(%p).renderPageBitmap(%p, %p)", this, doc, page); fz_matrix ctm; fz_bbox viewbox; fz_pixmap *pixmap; jfloat *matrix; jint *viewboxarr; jint *dimen; jint *buffer; int length, val; fz_device *dev = NULL; AndroidBitmapInfo info; void *pixels; int ret; if ((ret = NativeBitmap_getInfo(env, bitmap, &info)) < 0) { ERROR("AndroidBitmap_getInfo() failed ! error=%d", ret); return 0; } DEBUG("Checking format\n"); if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888) { ERROR("Bitmap format is not RGBA_8888 !"); return 0; } DEBUG("locking pixels\n"); if ((ret = NativeBitmap_lockPixels(env, bitmap, &pixels)) < 0) { ERROR("AndroidBitmap_lockPixels() failed ! error=%d", ret); return 0; } ctm = fz_identity; matrix = (*env)->GetPrimitiveArrayCritical(env, matrixarray, 0); ctm.a = matrix[0]; ctm.b = matrix[1]; ctm.c = matrix[2]; ctm.d = matrix[3]; ctm.e = matrix[4]; ctm.f = matrix[5]; (*env)->ReleasePrimitiveArrayCritical(env, matrixarray, matrix, 0); DEBUG("Matrix: %f %f %f %f %f %f", ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f); viewboxarr = (*env)->GetPrimitiveArrayCritical(env, viewboxarray, 0); viewbox.x0 = viewboxarr[0]; viewbox.y0 = viewboxarr[1]; viewbox.x1 = viewboxarr[2]; viewbox.y1 = viewboxarr[3]; (*env)->ReleasePrimitiveArrayCritical(env, viewboxarray, viewboxarr, 0); DEBUG("Viewbox: %d %d %d %d", viewbox.x0, viewbox.y0, viewbox.x1, viewbox.y1); /* do the rendering */ pixmap = fz_new_pixmap_with_data(doc->ctx, fz_device_rgb, viewbox.x1 - viewbox.x0, viewbox.y1 - viewbox.y0, pixels); DEBUG("doing the rendering..."); fz_clear_pixmap_with_color(pixmap, 0xff); DEBUG("doing the rendering...0"); dev = fz_new_draw_device(doc->ctx, pixmap); DEBUG("doing the rendering...1"); fz_execute_display_list(page->pageList, dev, ctm, viewbox, NULL); DEBUG("doing the rendering...2"); fz_free_device(dev); DEBUG("doing the rendering...3"); fz_drop_pixmap(doc->ctx, pixmap); DEBUG("XPSView.renderPageBitmap() done"); NativeBitmap_unlockPixels(env, bitmap); return 1; } //Outline JNIEXPORT jlong JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsOutline_open(JNIEnv *env, jclass clazz, jlong dochandle) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; if (!doc->outline) doc->outline = xps_load_outline(doc->xpsdoc); DEBUG("XpsOutline.open(): return handle = %p", doc->outline); return (jlong) (long) doc->outline; } JNIEXPORT void JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsOutline_free(JNIEnv *env, jclass clazz, jlong dochandle) { renderdocument_t *doc = (renderdocument_t*) (long) dochandle; // DEBUG("XpsOutline_free(%p)", doc); if (doc) { if (doc->outline) fz_free_outline(doc->ctx, doc->outline); doc->outline = NULL; } // DEBUG("XpsOutline_free(%p)", doc); } JNIEXPORT jstring JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsOutline_getTitle(JNIEnv *env, jclass clazz, jlong outlinehandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; // DEBUG("XpsOutline_getTitle(%p)",outline); if (outline) return (*env)->NewStringUTF(env, outline->title); return NULL; } JNIEXPORT jstring JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsOutline_getLink(JNIEnv *env, jclass clazz, jlong outlinehandle, jlong dochandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; renderdocument_t *doc = (renderdocument_t*) (long) dochandle; // DEBUG("XpsOutline_getLink(%p)",outline); if (!outline) return NULL; char linkbuf[128]; if (outline->dest.kind == FZ_LINK_URI) { snprintf(linkbuf, 128, "%s", outline->dest.ld.uri.uri); // DEBUG("XpsOutline_getLink uri = %s",linkbuf); } else if (outline->dest.kind == FZ_LINK_GOTO) { snprintf(linkbuf, 127, "#%d", outline->dest.ld.gotor.page + 1); // DEBUG("XpsOutline_getLink goto = %s",linkbuf); } else { return NULL; } return (*env)->NewStringUTF(env, linkbuf); } JNIEXPORT jlong JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsOutline_getNext(JNIEnv *env, jclass clazz, jlong outlinehandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; // DEBUG("XpsOutline_getNext(%p)",outline); if (!outline) return 0; return (jlong) (long) outline->next; } JNIEXPORT jlong JNICALL Java_org_ebookdroid_xpsdroid_codec_XpsOutline_getChild(JNIEnv *env, jclass clazz, jlong outlinehandle) { fz_outline *outline = (fz_outline*) (long) outlinehandle; // DEBUG("XpsOutline_getChild(%p)",outline); if (!outline) return 0; return (jlong) (long) outline->down; } <file_sep>/EBookDroid/src/org/ebookdroid/core/presentation/FileListAdapter.java package org.ebookdroid.core.presentation; import org.ebookdroid.R; import org.ebookdroid.core.settings.SettingsManager; import org.ebookdroid.utils.FileUtils; import android.database.DataSetObserver; import android.view.View; import android.view.ViewGroup; import android.widget.BaseExpandableListAdapter; import android.widget.ImageView; import android.widget.TextView; import java.io.File; public class FileListAdapter extends BaseExpandableListAdapter { final BooksAdapter adapter; final FolderObserver observer = new FolderObserver(); public FileListAdapter(final BooksAdapter adapter) { this.adapter = adapter; adapter.registerDataSetObserver(new DataSetObserver() { @Override public void onChanged() { for (BookShelfAdapter a : adapter) { if (a != null && a.id > 0) { a.registerDataSetObserver(observer); } } notifyDataSetChanged(); } @Override public void onInvalidated() { notifyDataSetChanged(); } }); } @Override public BookNode getChild(final int groupPosition, final int childPosition) { return adapter.getItem(groupPosition + 1, childPosition); } @Override public long getChildId(final int groupPosition, final int childPosition) { return childPosition; } @Override public int getChildrenCount(final int groupPosition) { return adapter.getList(groupPosition + 1).getCount(); } @Override public View getChildView(final int groupPosition, final int childPosition, final boolean isLastChild, final View convertView, final ViewGroup parent) { final ViewHolder holder = BaseViewHolder.getOrCreateViewHolder(ViewHolder.class, R.layout.browseritem, convertView, parent); final BookNode book = getChild(groupPosition, childPosition); final File file = new File(book.path); final boolean wasRead = SettingsManager.getBookSettings(file.getAbsolutePath()) != null; holder.name.setText(book.name); holder.image.setImageResource(wasRead ? R.drawable.bookwatched : R.drawable.book); holder.info.setText(FileUtils.getFileDate(file.lastModified())); holder.fileSize.setText(FileUtils.getFileSize(file.length())); return holder.getView(); } @Override public View getGroupView(final int groupPosition, final boolean isExpanded, final View convertView, final ViewGroup parent) { final ViewHolder holder = BaseViewHolder.getOrCreateViewHolder(ViewHolder.class, R.layout.browseritem, convertView, parent); final BookShelfAdapter curr = getGroup(groupPosition); holder.name.setText(curr.name); holder.image.setImageResource(R.drawable.folderopen); holder.info.setText("Books: " + curr.getCount()); holder.fileSize.setText(""); return holder.getView(); } @Override public BookShelfAdapter getGroup(final int groupPosition) { return adapter.getList(groupPosition + 1); } @Override public int getGroupCount() { return adapter.getListCount() - 1; } @Override public long getGroupId(final int groupPosition) { return groupPosition; } @Override public boolean isChildSelectable(final int groupPosition, final int childPosition) { return true; } @Override public boolean hasStableIds() { return false; } public void clearData() { adapter.clearData(); notifyDataSetInvalidated(); } public void startScan() { adapter.startScan(); } public void stopScan() { adapter.stopScan(); } static class ViewHolder extends BaseViewHolder { TextView name; ImageView image; TextView info; TextView fileSize; @Override public void init(final View convertView) { super.init(convertView); this.name = (TextView) convertView.findViewById(R.id.browserItemText); this.image = (ImageView) convertView.findViewById(R.id.browserItemIcon); this.info = (TextView) convertView.findViewById(R.id.browserItemInfo); this.fileSize = (TextView) convertView.findViewById(R.id.browserItemfileSize); } } class FolderObserver extends DataSetObserver { @Override public void onChanged() { notifyDataSetChanged(); } @Override public void onInvalidated() { notifyDataSetChanged(); } } } <file_sep>/EBookDroid/src/org/ebookdroid/core/views/LayerDrawable.java /* * Copyright (C) 2008 The Android Open Source Project, <NAME> * * 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. */ package org.ebookdroid.core.views; import android.graphics.*; import android.graphics.drawable.Drawable; class LayerDrawable extends Drawable implements Drawable.Callback { LayerState mLayerState; private int[] mPaddingL; private int[] mPaddingT; private int[] mPaddingR; private int[] mPaddingB; private final Rect mTmpRect = new Rect(); private Drawable mParent; private boolean mBlockSetBounds; LayerDrawable(Drawable... layers) { this(null, layers); } LayerDrawable(LayerState state, Drawable... layers) { this(state); int length = layers.length; Rec[] r = new Rec[length]; final LayerState layerState = mLayerState; for (int i = 0; i < length; i++) { r[i] = new Rec(); r[i].mDrawable = layers[i]; layers[i].setCallback(this); layerState.mChildrenChangingConfigurations |= layers[i].getChangingConfigurations(); } layerState.mNum = length; layerState.mArray = r; ensurePadding(); } LayerDrawable(LayerState state) { LayerState as = createConstantState(state); mLayerState = as; if (as.mNum > 0) { ensurePadding(); } } LayerState createConstantState(LayerState state) { return new LayerState(state, this); } public void invalidateDrawable(Drawable who) { invalidateSelf(); } public void scheduleDrawable(Drawable who, Runnable what, long when) { scheduleSelf(what, when); } public void unscheduleDrawable(Drawable who, Runnable what) { unscheduleSelf(what); } @Override public void draw(Canvas canvas) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { array[i].mDrawable.draw(canvas); } } @Override public int getChangingConfigurations() { return super.getChangingConfigurations() | mLayerState.mChangingConfigurations | mLayerState.mChildrenChangingConfigurations; } @Override public boolean getPadding(Rect padding) { padding.left = 0; padding.top = 0; padding.right = 0; padding.bottom = 0; final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { reapplyPadding(i, array[i]); padding.left = Math.max(padding.left, mPaddingL[i]); padding.top = Math.max(padding.top, mPaddingT[i]); padding.right = Math.max(padding.right, mPaddingR[i]); padding.bottom = Math.max(padding.bottom, mPaddingB[i]); } return true; } @Override public boolean setVisible(boolean visible, boolean restart) { boolean changed = super.setVisible(visible, restart); final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { array[i].mDrawable.setVisible(visible, restart); } return changed; } @Override public void setDither(boolean dither) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { array[i].mDrawable.setDither(dither); } } @Override public void setAlpha(int alpha) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { array[i].mDrawable.setAlpha(alpha); } } @Override public void setColorFilter(ColorFilter cf) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { array[i].mDrawable.setColorFilter(cf); } } @Override public int getOpacity() { return mLayerState.getOpacity(); } @Override public boolean isStateful() { return mLayerState.isStateful(); } @Override protected boolean onStateChange(int[] state) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; boolean paddingChanged = false; boolean changed = false; for (int i = 0; i < N; i++) { final Rec r = array[i]; if (r.mDrawable.setState(state)) { changed = true; } if (reapplyPadding(i, r)) { paddingChanged = true; } } if (paddingChanged) { onBoundsChange(getBounds()); } return changed; } @Override protected boolean onLevelChange(int level) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; boolean paddingChanged = false; boolean changed = false; for (int i = 0; i < N; i++) { final Rec r = array[i]; if (r.mDrawable.setLevel(level)) { changed = true; } if (reapplyPadding(i, r)) { paddingChanged = true; } } if (paddingChanged) { onBoundsChange(getBounds()); } return changed; } @Override public void setBounds(int left, int top, int right, int bottom) { if (mBlockSetBounds) return; final int width = mLayerState.mArray[0].mDrawable.getIntrinsicWidth(); left -= (width - (right - left)) / 2.0f; right = left + width; bottom = top + getIntrinsicHeight(); super.setBounds(left, top, right, bottom); if (mParent != null) { mBlockSetBounds = true; mParent.setBounds(left, top, right, bottom); mBlockSetBounds = false; } } public void setParent(Drawable drawable) { mParent = drawable; } @Override protected void onBoundsChange(Rect bounds) { final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; int padL = 0, padT = 0, padR = 0, padB = 0; for (int i = 0; i < N; i++) { final Rec r = array[i]; r.mDrawable.setBounds(bounds.left + r.mInsetL + padL, bounds.top + r.mInsetT + padT, bounds.right - r.mInsetR - padR, bounds.bottom - r.mInsetB - padB); padL += mPaddingL[i]; padR += mPaddingR[i]; padT += mPaddingT[i]; padB += mPaddingB[i]; } } @Override public int getIntrinsicWidth() { int width = -1; final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; int padL = 0, padR = 0; for (int i = 0; i < N; i++) { final Rec r = array[i]; int w = r.mDrawable.getIntrinsicWidth() + r.mInsetL + r.mInsetR + padL + padR; if (w > width) { width = w; } padL += mPaddingL[i]; padR += mPaddingR[i]; } return width; } @Override public int getIntrinsicHeight() { int height = -1; final Rec[] array = mLayerState.mArray; final int N = mLayerState.mNum; int padT = 0, padB = 0; for (int i = 0; i < N; i++) { final Rec r = array[i]; int h = r.mDrawable.getIntrinsicHeight() + r.mInsetT + r.mInsetB + +padT + padB; if (h > height) { height = h; } padT += mPaddingT[i]; padB += mPaddingB[i]; } return height; } private boolean reapplyPadding(int i, Rec r) { final Rect rect = mTmpRect; r.mDrawable.getPadding(rect); if (rect.left != mPaddingL[i] || rect.top != mPaddingT[i] || rect.right != mPaddingR[i] || rect.bottom != mPaddingB[i]) { mPaddingL[i] = rect.left; mPaddingT[i] = rect.top; mPaddingR[i] = rect.right; mPaddingB[i] = rect.bottom; return true; } return false; } private void ensurePadding() { final int N = mLayerState.mNum; if (mPaddingL != null && mPaddingL.length >= N) { return; } mPaddingL = new int[N]; mPaddingT = new int[N]; mPaddingR = new int[N]; mPaddingB = new int[N]; } @Override public ConstantState getConstantState() { if (mLayerState.canConstantState()) { mLayerState.mChangingConfigurations = super.getChangingConfigurations(); return mLayerState; } return null; } static class Rec { public Drawable mDrawable; public int mInsetL, mInsetT, mInsetR, mInsetB; public int mId; } static class LayerState extends ConstantState { int mNum; Rec[] mArray; int mChangingConfigurations; int mChildrenChangingConfigurations; private boolean mHaveOpacity = false; private int mOpacity; private boolean mHaveStateful = false; private boolean mStateful; private boolean mCheckedConstantState; private boolean mCanConstantState; LayerState(LayerState orig, LayerDrawable owner) { if (orig != null) { final Rec[] origRec = orig.mArray; final int N = orig.mNum; mNum = N; mArray = new Rec[N]; mChangingConfigurations = orig.mChangingConfigurations; mChildrenChangingConfigurations = orig.mChildrenChangingConfigurations; for (int i = 0; i < N; i++) { final Rec r = mArray[i] = new Rec(); final Rec or = origRec[i]; r.mDrawable = or.mDrawable.getConstantState().newDrawable(); r.mDrawable.setCallback(owner); r.mInsetL = or.mInsetL; r.mInsetT = or.mInsetT; r.mInsetR = or.mInsetR; r.mInsetB = or.mInsetB; r.mId = or.mId; } mHaveOpacity = orig.mHaveOpacity; mOpacity = orig.mOpacity; mHaveStateful = orig.mHaveStateful; mStateful = orig.mStateful; mCheckedConstantState = mCanConstantState = true; } else { mNum = 0; mArray = null; } } @Override public Drawable newDrawable() { return new LayerDrawable(this); } @Override public int getChangingConfigurations() { return mChangingConfigurations; } public final int getOpacity() { if (mHaveOpacity) { return mOpacity; } final int N = mNum; final Rec[] array = mArray; int op = N > 0 ? array[0].mDrawable.getOpacity() : PixelFormat.TRANSPARENT; for (int i = 1; i < N; i++) { op = Drawable.resolveOpacity(op, array[i].mDrawable.getOpacity()); } mOpacity = op; mHaveOpacity = true; return op; } public final boolean isStateful() { if (mHaveStateful) { return mStateful; } boolean stateful = false; final int N = mNum; final Rec[] array = mArray; for (int i = 0; i < N; i++) { if (array[i].mDrawable.isStateful()) { stateful = true; break; } } mStateful = stateful; mHaveStateful = true; return stateful; } public synchronized boolean canConstantState() { final Rec[] array = mArray; if (!mCheckedConstantState && array != null) { mCanConstantState = true; final int N = mNum; for (int i = 0; i < N; i++) { if (array[i].mDrawable.getConstantState() == null) { mCanConstantState = false; break; } } mCheckedConstantState = true; } return mCanConstantState; } } }
76dc7dcfaddcf352749847d42363c10d7d93ff87
[ "Markdown", "Makefile", "Java", "Ant Build System", "C" ]
51
Java
hk0792/UsefulClass
d840880d67e16de257d1e22060d71bb79091ce94
efd55e05fd5b1d504472177f8418008c3c2f30c3
refs/heads/master
<file_sep>extern crate rust_webvr_api; #[cfg(all(feature = "googlevr", target_os= "android"))] extern crate gvr_sys; #[cfg(all(target_os="windows", feature = "openvr"))] extern crate libloading; #[macro_use] extern crate log; #[cfg(all(feature = "oculusvr", target_os= "android"))] extern crate ovr_mobile_sys; #[cfg(any(feature = "googlevr", feature= "oculusvr"))] mod gl { include!(concat!(env!("OUT_DIR"), "/gles_bindings.rs")); } pub mod api; mod vr_manager; pub use rust_webvr_api::*; pub use vr_manager::VRServiceManager;
3c4726bfb87c2b18b395e4a96ef618b2ece4eab9
[ "Rust" ]
1
Rust
shadowkun/rust-webvr
9e4e64510dfdb1f762a6f9dbe289337250e63516
f962ce339a800afedd9c49c2ed46a4007ae382d2
refs/heads/main
<file_sep>import { writable } from 'svelte/store'; export const templateStore = writable({ pretitle:'', title:'', templateLayout:'admin-layout-vertical', themeColor: 'light' });<file_sep>## Açıklama [tabler](https://preview.tabler.io/) yönetici panel temasını [svelte](https://svelte.dev/) teması haline getirilmektedir. Not: Çeviri işlemi daha devam etmektedir. ## Kurulum Bağımlılıkları kurmak... ```bash npm install ``` ...Başlatma [Rollup](https://rollupjs.org): ```bash npm run dev ``` [localhost:5000](http://localhost:5000) adresine gidin or ```bash npm run dev -- --open ```
dc5aa4cdd2355194cb425a9daeeb7e05287cd4b0
[ "JavaScript", "Markdown" ]
2
JavaScript
etuncay/tabler-svelte
6680168fa742826b15910e5ba11ed0c32e1de284
54236683c8767cea747aa8fc746f0e7827d0d82d
refs/heads/master
<repo_name>XVs32/youtube_downloader_public_ver<file_sep>/Dockerfile FROM ubuntu:18.04 RUN apt update -y && \ apt upgrade -y && \ apt install -y python3-pip && \ apt install -y python-pip && \ yes | pip3 install django==2.2.5 && \ yes | pip3 install django-crispy-forms==1.7.2 && \ yes | pip3 install pysqlite3 && \ yes | pip3 install django-extensions && \ yes | pip3 install django-werkzeug-debugger-runserver && \ yes | pip3 install pyOpenSSL && \ yes | pip3 install youtube-dl && \ apt install -y ffmpeg && \ apt-get install locales && \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \ locale-gen && \ dpkg-reconfigure --frontend=noninteractive locales ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 RUN mkdir youtube_downloader COPY ./youtube_downloader /youtube_downloader CMD python3 /youtube_downloader/manage.py runserver_plus --cert server.crt 0:8000 <file_sep>/youtube_downloader/youtube_downloader/views.py # -*- coding: utf-8 -*- from django.http import HttpResponse,HttpResponseRedirect from django.shortcuts import render_to_response from django import template from django.conf import settings from django.conf import urls from django.contrib import auth from django.contrib.auth.models import User import youtube_dl import subprocess import threading import os import re def is_password(pw): pattern = re.compile(r'^[0-9A-Za-z_]+$') result = pattern.match(pw) if result: return True else: return False def home(request): if not request.user.is_authenticated: return HttpResponseRedirect('/login') return render_to_response('home.html',locals()) def logout(request): auth.logout(request) return HttpResponseRedirect('/login') def login(request): if request.user.is_authenticated: return HttpResponseRedirect('/') return render_to_response('login.html',locals()) def try_login(request): username = request.POST.get('username', '') password = request.POST.get('password', '') user = auth.authenticate(username=username, password=<PASSWORD>) if user is not None and user.is_active: auth.login(request, user) return HttpResponseRedirect('/') else: messages = "wrong pw or id" print(messages) return render_to_response('login.html',locals()) def register(request): return render_to_response('register.html',locals()) def add_user(request): user_name = request.POST.get('username', '') password = request.POST.get('password', '') password_c = request.POST.get('password_c', '') invite_code = request.POST.get('invite_code', '') userid_ex = User.objects.filter(username=user_name) if userid_ex.exists(): messages = "This user is registered already" return render_to_response('register.html',locals()) elif password != password_c: messages = "Two passwords are not the same" return render_to_response('register.html',locals()) elif is_password(password) == False: messages = "Password can only contain letter/number/underscore" return render_to_response('register.html',locals()) elif invite_code != "welcome": messages = "Invalid invite code, who are you?" return render_to_response('register.html',locals()) else: User.objects.create_user(username=user_name,password=<PASSWORD>) return render_to_response('login.html',locals()) def music_download(request): if 'youtube_url' in request.POST: url = request.POST.get('youtube_url', '') yt_id_index = url.find("?v=") if yt_id_index != -1: yt_id = url[yt_id_index:yt_id_index+14] yt_id = yt_id[3:] ydl_opts = { 'format': 'bestaudio/best', } info = youtube_dl.YoutubeDL(ydl_opts).extract_info(yt_id, download=False) info['title'] = info['title'].replace(' ','') info['title'] = info['title'].replace('*','') info['title'] = info['title'].replace('%','') info['title'] = info['title'].replace('?','') info['title'] = info['title'].replace('+','') info['title'] = info['title'].replace('-','') info['title'] = info['title'].replace('.','') music_download = threading.Thread(target=yt_download, args=(yt_id,info['title'],request.user.username,)) music_download.start() return HttpResponseRedirect('/') def yt_download(yt_id, file_name, username): ydl_opts = { 'format': 'bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'aac', 'preferredquality': '192', }], 'outtmpl': os.path.join(settings.BASE_DIR,'static/music_tem/')+file_name+'.%(ext)s', } youtube_dl.YoutubeDL(ydl_opts).download([yt_id]) gdrive_path = os.path.join(settings.BASE_DIR,'static/gdrive/gdrive') gdrive_token = os.path.join(settings.BASE_DIR,'static/gdrive/.gdrive') #gdrive_token folder gdrive_folder = " --parent 0B00oV1eaTRbuZmNaWVM5VkF0c28 " #google drive folder id cmd = gdrive_path + " --config " + gdrive_token\ + " upload " + gdrive_folder\ + os.path.join(settings.BASE_DIR,'static/music_tem/')+file_name+".aac" os.system(cmd) return HttpResponseRedirect('/') <file_sep>/README.md # youtube downloader ReadMe --- ###### tags: `python3`, `django` --- ## Revision record |version| comment | author | |-------|------------------|--------| |v0.1.0 |eng document built|<NAME>| --- ## Outline [TOC] * Revision record * Outline * Introduction * Dependency * Setup * Build docker * How does it looks like * SignUp page * Home page --- ## Introduction This is a youtube downloader with web interface, which download youtube video, convert it into ```.aac``` file, and then upload it to specific google drive. ![](https://i.imgur.com/M3ZbHoS.png) --- ## Dependency [gdrive](https://github.com/gdrive-org/gdrive): A command line utility for interacting with Google Drive. [Django](https://www.djangoproject.com/): A high-level Python Web framework. [youtube-dl](https://github.com/ytdl-org/youtube-dl): Download videos from youtube or other video platforms. [ffmpeg](https://ffmpeg.org/): Convert video and audio. --- ## Setup Although this project is packed by docker, there are some arguments need to set by user manually. * ***Django ```SECRET_KEY```***: Please make sure you did ***change the SECRET_KEY*** before using, or you would put the system at risk. It sits under [setting.py](https://github.com/XVs32/youtube_downloader_public_ver/blob/master/youtube_downloader/youtube_downloader/settings.py) (near line 24).<br/> The ```SECRET_KEY``` is used for en/decryption etc, so it is important that you change it. You could find yourself a SECRET_KEY generator [here](https://djecrety.ir/). * ***gdrive token***: You would need to put the token folder ```.gdrive``` under the [gdirve](https://github.com/XVs32/youtube_downloader_public_ver/tree/master/youtube_downloader/static/gdrive) folder.<br/> This token allow ```gdrive``` to interacting with Google Drive. You could get your token by authenticating with google using ```gdrive about```. A complete guide is available in [gdrive](https://github.com/gdrive-org/gdrive) github. Please be aware that ***anyone*** who have access to this token file could access your google drive. * ***google drive folder id***: This is the google drive folder id which you could easily find in the url, when you open your google drive page. Please replace this id with the id in [view.py](https://github.com/XVs32/youtube_downloader_public_ver/blob/master/youtube_downloader/youtube_downloader/views.py), which sits after ```gdrive_folder = " --parent```. <br/> This [guide](https://ploi.io/documentation/mysql/where-do-i-get-google-drive-folder-id) tells you how to get your own folder id. * ***HTTPS***: This project does use HTTPS, so you would need to get your own HTTPS certificate. And replace it with ```.crt``` and ```.key``` under [youtube_downloader](https://github.com/XVs32/youtube_downloader_public_ver/tree/master/youtube_downloader). * ***invite code***: The sign up process is block by a invite code, which sits in [view.py](https://github.com/XVs32/youtube_downloader_public_ver/blob/master/youtube_downloader/youtube_downloader/views.py) (near line 83), the default is ```welcome``` and I do recommend changing it to something else. ### Build docker As I said before, this project is packed by docker, so it should be rather simple to build a docker image by just using: ```docker build -t youtube_downloader .``` Then you could run the image with: ```docker run --name=youtube_downloader -p YOUR_PORT:8000 youtube_downloader``` Replace ```YOUR_PORT``` with the port you want to use. --- ## How does it looks like ### SignUp page ![](https://i.imgur.com/SeY7RhC.png) ### Home page ![](https://i.imgur.com/THBYLFq.png)
698574d8d17419b163317ac4bb08b6917f5dfbe9
[ "Markdown", "Python", "Dockerfile" ]
3
Dockerfile
XVs32/youtube_downloader_public_ver
7e0ac485b232af79628d5a7d414deda50fafa75f
84557ea0ad09b9902b90e5cde4ac21285cb2b027
refs/heads/master
<repo_name>hexufeng/study<file_sep>/closures/test4.js var Toaster = (function () { var setting = 0; var temperature; var low = 100; var med = 200; var high = 300; // public var turnOn = function () { return heatSetting(); }; var adjustSetting = function (setting) { if (setting <= 3) { temperature = low; } if (setting > 3 && setting <= 6) { temperature = med; } if (setting > 6 && setting <= 10) { temperature = high; } return temperature; }; // private var heatSetting = function (adjustSetting) { var thermostat = adjustSetting; return thermostat; }; return { turnOn: turnOn, adjustSetting: adjustSetting }; })(); var result1 = Toaster.adjustSetting(5); var result2 = Toaster.adjustSetting(8); console.log('result1', result1); console.log('result2', result2);<file_sep>/closures/main.js String.prototype.replaceAll = function(search, replacement) { var target = this; return target.replace(new RegExp(search, 'g'), replacement); }; window.onload = function(e) { readTextFile('./test.js', text => { text = text.replaceAll('\r\n', '<br/>'); text = text.replaceAll('\n', '<br/>'); text = text.replaceAll(' ', '&nbsp;'); document.getElementById('test1js').innerHTML = text; }); readTextFile('./test2.js', text => { text = text.replaceAll('\r\n', '<br/>'); text = text.replaceAll('\n', '<br/>'); text = text.replaceAll(' ', '&nbsp;'); document.getElementById('test2js').innerHTML = text; }); readTextFile('./test3.js', text => { text = text.replaceAll('\r\n', '<br/>'); text = text.replaceAll('\n', '<br/>'); text = text.replaceAll(' ', '&nbsp;'); document.getElementById('test3js').innerHTML = text; }); readTextFile('./test4.js', text => { text = text.replaceAll('\r\n', '<br/>'); text = text.replaceAll('\n', '<br/>'); text = text.replaceAll(' ', '&nbsp;'); document.getElementById('test4js').innerHTML = text; }); readTextFile('./test5.js', text => { text = text.replaceAll('\r\n', '<br/>'); text = text.replaceAll('\n', '<br/>'); text = text.replaceAll(' ', '&nbsp;'); document.getElementById('test5js').innerHTML = text; }); }<file_sep>/closures/test.js var num1 = 1; function fun() { var num2 = 2; return num1 + num2; } console.log('result', fun());<file_sep>/closures/test5.js function firstName(first){ function fullName(last){ console.log(first + " " + last); } return fullName; } var name = firstName("Mister"); name("Smith"); name("Jones");
e09cfc4b4ea4d9223ee56bb6c83d36960003819c
[ "JavaScript" ]
4
JavaScript
hexufeng/study
6d85c42d09d09ad58143299b478cb6f6f28cdc88
39d86e4496f7ae4505472e8e096185cca8e1f0d8
refs/heads/master
<repo_name>asinggih/coding-challenges<file_sep>/README.md # Coding-Challenges This repo contains coding challenges that I've managed to finish. <file_sep>/final_discount.py #!/usr/bin/env python3 """ Given an array of prices, for each prices, determine if it will be discounted or not. discount is determined by the closest lower price on its right. e.g., L = [4,1,6,2] L[0] will have a final price of 4-1 L[1] will have a final price of 1-0 (no discount) since nothing is lower than L[1] on its right .... L[3] will have a final price of 2-0 output should be in 2 lines - total final price after discount - index of non discounted item separated by space .e.g, 1 3 constraints: n is prices array size 1 <= n <= 10**5 1 <= price <= 10**5 """ def final_discount(prices): stack = [] result = [] for i in range(len(prices)-1, -1, -1): while stack != [] and stack[len(stack)-1] > prices[i]: stack.pop() if stack != []: result.append(stack[len(stack)-1]) stack.append(prices[i]) print(sum(result)) # def final_discount(prices): # no_discount = [] # final_price = 0 # for i in range(len(prices)): # for j in range(i+1, len(prices)): # if prices[j] <= prices[i]: # final_price += prices[i] - prices[j] # break # if j == len(prices)-1: # final_price += prices[i] # no_discount.append(str(i)) # break # final_price += prices[len(prices)-1] # no_discount.append(str(len(prices)-1)) # print(final_price) # print(" ".join(no_discount)) if __name__ == "__main__": # prices = [5, 1, 3, 4, 6, 2] prices = [5, 4, 5, 1, 3, 3, 8, 2] final_discount(prices) <file_sep>/highest_count.py #!/usr/bin/env python2.7 # # Code was written by asinggih (<NAME>) # # # Note: Problemset belongs to the owner. Not me """ Given a spaced-separated string of numbers, return the number that occurs the most. If 2 or more numbers have the same occurences, return the largest number. If all numbers have same occurences, return the largest number """ def find_most_freq(string): array = userinput.split(" ") array = [int(i) for i in array] distinct = set(array) lookup = dict() largest_num = array[0] for i in array: if i > largest_num: largest_num = i if i in lookup: lookup[i] += 1 else: lookup[i] = 1 output = None largest_count = 0 for num in distinct: if lookup[num] >= largest_count: largest_count = lookup[num] output = num if output is None: return largest_num return output if __name__ == "__main__": # userinput = "1 5 1 4 9 0 4" # userinput = "1 5 1 9 0 4" userinput = "1 5 10 4 9 0" print(find_most_freq(userinput)) <file_sep>/product_of_all.py #!/usr/bin/env python3 # # Written by asinggih 10/01/19 ''' --------------------------------------- Problem set --------------------------------------- Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6]. Follow-up: what if you can't use division? ''' # ----------------------------------------------------------------- # First Solution # ----------------------------------------------------------------- def sol_1(num_array): final_out = [] total = 1 # -------------------------------------------- # codeblock to handle zeroes in the array # -------------------------------------------- zero_count = 0 idx_of_zero = None for item in num_array: if item == 0: zero_count += 1 # memorise the index of the zero idx_of_zero = num_array.index(item) else: total *= item # return all zeros if there's more than 1 zeros in the input array if zero_count > 1: return [0 for x in range(len(num_array))] # Final output will be all zeros except at the idx_of_zero # from the original array, which will be the product of all numbers # of the original array if zero_count: final_out = [0 for x in range(len(num_array))] final_out[idx_of_zero] = total # ------------------- end -------------------- else: for item in num_array: final_out.append(total//item) return final_out # ----------------------------------------------------------------- # Second Solution (no division operator) # ----------------------------------------------------------------- # Algorithm summary (see example): # # Basically what we do here is to doing the multipication from # both ends of the array, and let them complement each other # # 1. loop the array from left to right: # - build the multplication while carrying the previous num # - store each of the multiplication in a temp array x # # 2. do the same thing, but from the right to left (store in array y) # # 3. multiply each x[i] with y.reverse()[i] and store them # in the final array that will be returned # Example: # original input array = [3, 5, 2, 4] # # x = [ 1 3 3*5 3*5*2 ] # y = [ 4*2*5 4*2 4 1 ] ------> this is in reversed form # # out = [ x[0]*y[0] , x[1]*y[1] , x[2]*y[2] , x[3]*y[3] ] def sol_2(num_array): # Step 1 array_a = [] total_a = 1 for item in num_array: array_a.append(total_a) total_a *= item # Step 2 array_b = [] total_b = 1 for item in num_array[::-1]: array_b.append(total_b) total_b *= item # Step 3 out = [] for item in array_a: # need to use pop on array_b because we want to # start from the end of array_b array (see example) out.append(item*array_b.pop()) return out if __name__ == "__main__": x = [5, 4, 3, 2, 1] print("Solution 1") print(sol_1(x)) print() print("Solution 2 - no div") print(sol_2(x)) <file_sep>/ip_classifier.py #!/usr/bin/env python3 import re """ https://www.hackerrank.com/challenges/ip-address-validation/problem Determine whether input is IPv4, IPv6, or Neither IPv4 was the first publicly used Internet Protocol which used 4 byte addresses which permitted for 232 addresses. The typical format of an IPv4 address is A.B.C.D where A, B, C and D are Integers lying between 0 and 255 (both inclusive). IPv6, with 128 bits was developed to permit the expansion of the address space. To quote from the linked article: The 128 bits of an IPv6 address are represented in 8 groups of 16 bits each. Each group is written as 4 hexadecimal digits and the groups are separated by colons (:). The address 2001:0db8:0000:0000:0000:ff00:0042:8329 is an example of this representation. Consecutive sections of zeros will be left as they are. An IPv6 value such as "...:0:..." or "...:5:..." is address-wise identical to "...:0000:..." or "...:0005:....". Leading zeros may be omitted in writing the address. Sample input: 3 This line has junk text. 121.18.19.20 2001:0db8:0000:0000:0000:ff00:0042:8329 Sample output: Neither IPv4 IPv6 """ def classify_ip(ip): # This is a proper regex to grep IPv4 Address # ^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$ ipv4_patt = re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$') ipv4 = ipv4_patt.match(ip) ipv6_patt = re.compile(r'^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$') ipv6 = ipv6_patt.match(ip) if ipv4: temp = ipv4.group().split(".") for item in temp: x = int(item) if x > 255: return "Neither" return "IPv4" elif ipv6: return "IPv6" else: return "Neither" if __name__ == "__main__": input_count = int(input()) out = [] for i in range(input_count): ip = input() out.append(classify_ip(ip)) for i in out: print(i) <file_sep>/fuck_the_anagram.py #!/usr/bin/env python3 # # Code was written by asinggih (<NAME>) """ Given an array of strings, remove each string that is an anagram of an earlier string, then return the remaining array in sorted order e.g., ["code", "ecod", "framer", "doce", "frame"] 'doce' and 'ecod' are both anagrams of 'code' so they are removed. 'frame' and 'framer' are not anagrams due to the extra 'r' in 'framer'. The final list of strings in alphabetical order is ['code', 'frame', 'framer'] Note: Problem set belongs to the owner (not me) """ def anagram(arr): for i in range(len(arr)): try: word = arr[i] lookup = set() # charset for current word for char in word: lookup.add(char) # loop from the back so we can remove stuff for j in range(len(arr)-1, i, -1): # only check the compared word if length is the same as # current word if len(arr[i]) == len(arr[j]): same = True # initially we assume that theyre the same for char in arr[j]: # check if the compared word contains the same chars # as current word if char not in lookup: same = False # flip the flag break if same: # remove it from the arr if it's an anagram of # current word arr.remove(arr[j]) except: # out of range exception, cos we removed some stuff(s) earlier print("here") return arr return arr if __name__ == "__main__": # array = ["code", "aaagmnrs", "anagrams", "doce"] # array = ["aaa", "bbb", "ccc"] array = ["code", "ecod", "framer", "doce", "frame"] output = anagram(array) output.sort(key=len) print(output) <file_sep>/romanizer.py #!/usr/bin/env python3 """ Given an integer between 1 and 1000 (1 and 1000 inclusive), convert the integer into a roman numeral """ from collections import OrderedDict def loop_dict(dictionary, number): for key in dictionary: if number - key >= 0: number -= key return dictionary[key], number def romanizer(number): thousands = OrderedDict({1000: "M"}) hunds = OrderedDict({ 900: "CM", 500: "D", 400: "CD", 100: "C", }) tens = OrderedDict({ 90: "XC", 50: "L", 40: "XL", 10: "X", }) ones = OrderedDict({ 9: "IX", 5: "V", 4: "IV", 1: "I", }) output = [] current = number while current > 0: if current == 1000: output.append(thousands[1000]) break if current >= 100: roman, current = loop_dict(hunds, current) output.append(roman) elif current >= 10: roman, current = loop_dict(tens, current) output.append(roman) else: roman, current = loop_dict(ones, current) output.append(roman) return "".join(output) if __name__ == "__main__": input_count = int(input()) roman_numerals = [] for i in range(input_count): decimal = int(input()) roman_numerals.append(romanizer(decimal)) for i in roman_numerals: print(i) <file_sep>/balanced_brackets.py #!/usr/bin/env python3 # # Written by asinggih 07/02/19 """ --------------------------------------- Problem set --------------------------------------- Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed). For example, given the string "([])[]({})", you should return true. Given the string "([)]" or "((()", you should return false. """ def balanced_brackets(list_of_brackets): """ A function to check if the given list of brackets are well formed """ if list_of_brackets.strip() == "": # check for empty strings return False stack = [] bracket_pair = { "(": ")", "[": "]", "{": "}" } for bracket in list_of_brackets: if bracket in bracket_pair: stack.append(bracket) else: # if bracket is a closing bracket try: popped = stack.pop() if bracket != bracket_pair[popped]: return False except: return False if stack: # if there's still item in the stack return False return True if __name__ == "__main__": a = "([])[]({})" b = "([)]" c = "((()" d = "" e = "[{(())}]{({})}" print(balanced_brackets(a)) print(balanced_brackets(b)) print(balanced_brackets(c)) print(balanced_brackets(d)) print(balanced_brackets(e)) <file_sep>/longest_streak_index.py #!/usr/bin/env python3 # # Code was written by asinggih (<NAME>)) # # Note: Problem set belongs to the owner (not me) """ From a given array, find the longest streak, and return the index of the first number in that longest streak. If there's no increasing sequence, return -1 """ def start_index(arr): lookup = dict() longest_streak = 0 for i in range(len(arr)-1): if arr[i+1] > arr[i]: longest_streak += 1 elif arr[i+1] <= arr[i]: lookup[i] = longest_streak longest_streak = 0 lookup[len(arr)-1] = longest_streak start_idx = None largest = 0 for idx in lookup: if lookup[idx] >= largest: start_idx = idx largest = lookup[idx] if largest == 0: return -1 return start_idx - largest if __name__ == "__main__": # L = [5, 6, 7, 1, 2, -1, 10, 12, 13, 14] # L = [10, 9, 8, 7, 5, 1] # L = [5, 6, 7, -1, 2, 3, 0, 13, 14] L = [1, 1, 1, 1, 1, 1, 1, 1, 1, 2] print(start_index(L)) <file_sep>/bt_serialisation.py #!/usr/bin/env python3 ''' Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree. For example, given the following Node class class Node: def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right The following test should pass: node = Node('root', Node('left', Node('left.left')), Node('right', Node('right.left'), Node('right.right'))) assert deserialize(serialize(node)).left.left.val == 'left.left' The tree looks like [root] / \ / \ / \ / \ / \ / \ left right / / \ / / \ left.left right.left right.right ''' class Node: def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right def serialize(root): container = [] def encode(node): if node is None: # condition when parent node has no children # use "x" as a flag to show None --> useful when deserealising back to tree container.append(Node('x')) return None container.append(node) encode(node.left) encode(node.right) encode(root) return ' '.join(str(node.val) for node in container) def deserialize(serialised): def decode(arr_iterable): node_value = next(arr_iterable) # get the next item from the array if node_value == "x": # reading the None flag return None node = Node(node_value) node.left = decode(arr_iterable) node.right = decode(arr_iterable) return node # creating a generator to get each of the node value def node_val_generator(array): for node_value in array: yield node_value arr_iterable = node_val_generator(serialised.split(' ')) return decode(arr_iterable) if __name__ == "__main__": node = Node('root', Node('left', Node('left.left')), Node('right', Node('right.left'), Node('right.right'))) print(serialize(node)) print(deserialize(serialize(node)).left.left.val == 'left.left') <file_sep>/find_sum.py #!/usr/bin/env python3 # # Written by asinggih 09/01/19 ''' --------------------------------------- Problem set --------------------------------------- Given a list of numbers and a number k, return whether any two numbers from the list add up to k. For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. Bonus: Can you do this in one pass? ''' def find_sum(k, num_array): seen = set() # keep track of numbers that have been seen for i in num_array: complement = k-i # the number needed to get to k if complement in seen: return True seen.add(i) return False if __name__ == "__main__": nums = [10, 15, 3, 7] k = 17 print(find_sum(k, nums)) <file_sep>/missing_integer.py #!/usr/bin/env python3 # # Code was written by asinggih (<NAME>) # # Note: Problemset belongs to the owner. Not me """ Write a function: function solution(A); that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. Given A = [1, 2, 3], the function should return 4. Given A = [−1, −3], the function should return 1. Assume that: N is an integer within the range [1..100,000] Each element of array A is an integer within the range [−1,000,000..1,000,000] """ def solution(A): seen = set() for item in A: if item > 0: seen.add(item) if not seen: return 1 for number in range(1, len(A)+2): if number not in seen: return number if __name__ == "__main__": A = [1, 3, 6, 4, 1, 2] B = [1, 2, 3, 4, 5] C = [-1, -3] print(solution(B)) <file_sep>/max_diff.py #!/usr/bin/env python3 # # Code was written by asinggih (<NAME>) # # # Note: Problemset belongs to the owner. Not me """ Given an array of numbers, find the largest difference within the array. The difference can only be obtained by subtracting the current value. with the value that has a lower index. If the values in the array are constantly decreasing, return -1 e.g., L = [10, 1, 4, 5, 3] given that array, the function should return 4, which was taken from 5-1 another case L = [6, 5, 3, 1] return -1, because there will be no values with a lower index that will be smaller than the current index """ def max_diff(arr): smallest = arr[0] largest_diff = -1 for num in arr[1::]: if num-smallest > largest_diff: largest_diff = num-smallest if num < smallest: smallest = num return largest_diff if __name__ == "__main__": # L = [7, 1, 2, 5] L = [6, 5, 4, 3, 2, 1] # L = [2, 3, 10, 2, 4, 8, 1] print(max_diff(L))
658b2a26c6871fb09a97969bb618ae38b1d8dad3
[ "Markdown", "Python" ]
13
Markdown
asinggih/coding-challenges
0756e3dd596b9fb656dd3000a5c00b56ed27a533
dae371b8cbdaa98ac9234764b585c3b3180c0de8
refs/heads/master
<file_sep># unknown Author # This is an AMAZING MAKEFILE # The name of your project (used to name the compiled .hex file) TARGET = main INCLUDES = \ -I. \ -I./FreeRTOS/include \ -I./FreeRTOS/portable/GCC/ARM_CM3 \ -I./Minimal/include \ # compiler options for C only CFLAGS = -W -Wall -Os --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb CFLAGS += -ffunction-sections -fdata-sections $(INCLUDES) # linker options LDFLAGS = -Os -Wl,--gc-sections $(INCLUDES) -mcpu=cortex-m3 -mthumb -TLPC17xx.ld -Xlinker -Map=demp.map # additional libraries to link LIBS = -lm # names for the compiler programs CC = arm-none-eabi-gcc CXX = arm-none-eabi-g++ OBJCOPY = arm-none-eabi-objcopy SIZE = arm-none-eabi-size # automatically create lists of the sources and objects # TODO: this does not handle Arduino libraries yet... C_FILES := $(wildcard ./*.c) \ $(wildcard ./FreeRTOS/*.c) \ $(wildcard ./FreeRTOS/portable/GCC/ARM_CM3/*.c) \ $(wildcard ./FreeRTOS/portable/MemMang/*.c) \ $(wildcard ./Minimal/*.c) OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o) # the actual makefile rules (all .o files built by GNU make's default implicit rules) all: $(TARGET).hex $(TARGET).bin # SOME IMPLICIT THING, INSANE $(TARGET).elf: $(OBJS) LPC17xx.ld $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) %.hex: %.elf $(SIZE) $< $(OBJCOPY) -O ihex -R .eeprom $< $@ %.bin: %.elf $(OBJCOPY) $(CPFLAGS) -O binary $< $*.bin # compiler generated dependency info -include $(OBJS:.o=.d) isp: $(TARGET).bin mdel -i /dev/sdc ::/firmware.bin mcopy -i /dev/sdc $(TARGET).bin ::/ clean: find . -type f -name '*.o' -or -name '*.d' -or -name $(TARGET).elf -or -name $(TARGET).hex -delete <file_sep>All the licenses have been preserved. This port has been built with the help of many examples of many people Makefile is provided, maming things independent of IDE Bare project arm-none-eabi- required <file_sep># LPC-1768-FREE-RTOS- Free RTOS v 9.0 port for LPC 1768 bare minimum. Linux Only. Without IDE All licenses have been preserved. It was built with the help of many people's work Bare minimum Free RTOS port. <file_sep> #include "LPC17xx.h" #include "FreeRTOS.h" #include "task.h" #include "timers.h" #define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define UARTLog_Task_Priority ( tskIDLE_PRIORITY + 2 ) static xTimerHandle xLEDTimer = NULL; #define mainLED_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS ) #define mainDONT_BLOCK (0) /* Declare a variable that will be incremented by the hook function. */ unsigned long ulIdleCycleCount = 0UL; /* Idle hook functions MUST be called vApplicationIdleHook(), take no parameters, and return void. */ void vApplicationIdleHook( void ) { /* This hook function does nothing but increment a counter. */ ulIdleCycleCount++; } void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) { /* This function will get called if a task overflows its stack. */ ( void ) pxTask; ( void ) pcTaskName; for( ;; ); } static void prvTask2(void *pvParameters) { while(1) { LPC_GPIO2->FIOSET = 0xffffffff; // Make all the Port pins as high vTaskDelay( 2000 / portTICK_RATE_MS ); } } static void prvTask1(void *pvParameters) { xTaskCreate( prvTask2, "Task2", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL ); while(1) { /* Turn Off all the leds */ LPC_GPIO2->FIOCLR = 0xffffffff; vTaskDelay( 3000 / portTICK_RATE_MS ); } } /* // UNCOMMENT THIS FOR TIMER TASK static void prvLEDTimerCallback( xTimerHandle xTimer ) { static int toggle = 0; if(toggle == 0) { LPC_GPIO2->FIOSET = 0xffffffff; // Make all the Port pins as high toggle = 1; } else { LPC_GPIO2->FIOCLR = 0xffffffff; toggle = 0; } } */ int main(void) { SystemInit(); //Clock and PLL configuration LPC_PINCON->PINSEL4 = 0x000000; //Configure the Pins for GPIO; LPC_GPIO2->FIODIR = 0xffffffff; //Configure the PORT pins as OUTPUT; xTaskCreate( prvTask1, "Task1", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL ); //xTaskCreate( UARTLogTask, "ULog", configMINIMAL_STACK_SIZE, NULL, UARTLog_Task_Priority, NULL ); //xLEDTimer = xTimerCreate( "LEDTimer", /* A text name, purely to help debugging. */ // ( mainLED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */ // pdTRUE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */ // ( void * ) 0, /* The ID is not used, so can be set to anything. */ // prvLEDTimerCallback /* The callback function that switches the LED off. */ // ); //xTimerStart( xLEDTimer, mainDONT_BLOCK ); vTaskStartScheduler(); return 0; }
1463970a15dec8ce48aa93f2b8daf56e3e7b14f9
[ "Text", "C", "Makefile", "Markdown" ]
4
Makefile
Prakhar06/LPC-1768-FREE-RTOS-
8e6b7cafbf28bfdcd666fa5625e98475d59a9694
a0c0087881aa91f87378db823788aa3ba68701cf
refs/heads/master
<file_sep>package sk.upjs.ics.jot; import android.database.ContentObserver; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; public interface Constants { public static final String[] NO_PROJECTION = null; public static final String[] ALL_COLUMNS = null; public static final String NO_SELECTION = null; public static final String[] NO_SELECTION_ARGS = null; public static final String NO_SORT_ORDER = null; public static final String NO_GROUP_BY = null; public static final String NO_HAVING = null; public static final String AUTOGENERATED_ID = null; public static final SQLiteDatabase.CursorFactory DEFAULT_CURSOR_FACTORY = null; public static final String NO_NULL_COLUMN_HACK = null; public static final Cursor NO_CURSOR = null; public static final ContentObserver NO_CONTENT_OBSERVER = null; public static final Object NO_COOKIE = null; public static final int NO_FLAGS = 0; public static final int DEFAULT_LOADER_ID = 0; }<file_sep>package sk.upjs.ics.jot.provider; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import static sk.upjs.ics.jot.Constants.ALL_COLUMNS; import static sk.upjs.ics.jot.Constants.NO_CONTENT_OBSERVER; import static sk.upjs.ics.jot.Constants.NO_GROUP_BY; import static sk.upjs.ics.jot.Constants.NO_HAVING; import static sk.upjs.ics.jot.Constants.NO_NULL_COLUMN_HACK; import static sk.upjs.ics.jot.Constants.NO_SELECTION; import static sk.upjs.ics.jot.Constants.NO_SELECTION_ARGS; import static sk.upjs.ics.jot.Constants.NO_SORT_ORDER; public class JotContentProvider extends ContentProvider { private DatabaseOpenHelper databaseOpenHelper; @Override public boolean onCreate() { databaseOpenHelper = new DatabaseOpenHelper(getContext()); return true; } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { SQLiteDatabase db = databaseOpenHelper.getReadableDatabase(); Cursor cursor = db.query(JotContract.Note.TABLE_NAME, ALL_COLUMNS, NO_SELECTION, NO_SELECTION_ARGS, NO_GROUP_BY, NO_HAVING, NO_SORT_ORDER); cursor.setNotificationUri(getContext().getContentResolver(), JotContract.Note.CONTENT_URI); return cursor; } @Override public Uri insert(Uri uri, ContentValues values) { SQLiteDatabase db = databaseOpenHelper.getWritableDatabase(); long id = db.insert(JotContract.Note.TABLE_NAME, NO_NULL_COLUMN_HACK, values); getContext().getContentResolver().notifyChange(JotContract.Note.CONTENT_URI, NO_CONTENT_OBSERVER); return Uri.withAppendedPath(JotContract.Note.CONTENT_URI, String.valueOf(id)); } @Override public int delete(Uri uri, String selection, String[] selectionArgs) { String id = uri.getLastPathSegment(); SQLiteDatabase db = databaseOpenHelper.getWritableDatabase(); String[] whereArgs = { id }; int affectedRows = db.delete(JotContract.Note.TABLE_NAME, JotContract.Note._ID + "=?", whereArgs); getContext().getContentResolver().notifyChange(JotContract.Note.CONTENT_URI, NO_CONTENT_OBSERVER); return affectedRows; } @Override public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { throw new UnsupportedOperationException("Not yet implemented"); } @Override public String getType(Uri uri) { return null; } } <file_sep>package sk.upjs.ics.jot; import android.app.LoaderManager; import android.content.AsyncQueryHandler; import android.content.ContentValues; import android.content.CursorLoader; import android.content.Loader; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.GridView; import android.widget.SimpleCursorAdapter; import android.widget.Toast; import sk.upjs.ics.jot.provider.JotContentProvider; import sk.upjs.ics.jot.provider.JotContract; import static sk.upjs.ics.jot.Constants.DEFAULT_LOADER_ID; import static sk.upjs.ics.jot.Constants.NO_COOKIE; import static sk.upjs.ics.jot.Constants.NO_CURSOR; import static sk.upjs.ics.jot.Constants.NO_FLAGS; import static sk.upjs.ics.jot.Constants.NO_SELECTION; import static sk.upjs.ics.jot.Constants.NO_SELECTION_ARGS; public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor>, AdapterView.OnItemLongClickListener { private GridView notesGridView; private SimpleCursorAdapter notesGridViewAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); notesGridView = (GridView) findViewById(R.id.notesGridView); String[] from = { JotContract.Note.DESCRIPTION }; int[] to = { R.id.cardText }; notesGridViewAdapter = new SimpleCursorAdapter(this, R.layout.note, NO_CURSOR, from, to, NO_FLAGS); notesGridView.setAdapter(notesGridViewAdapter); notesGridView.setOnItemLongClickListener(this); getLoaderManager().initLoader(DEFAULT_LOADER_ID, Bundle.EMPTY, this); } @Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { if(id != DEFAULT_LOADER_ID) { throw new IllegalStateException("Invalid loader ID " + id); } CursorLoader cursorLoader = new CursorLoader(this); cursorLoader.setUri(JotContract.Note.CONTENT_URI); return cursorLoader; } @Override public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) { cursor.setNotificationUri(getContentResolver(), JotContract.Note.CONTENT_URI); notesGridViewAdapter.swapCursor(cursor); } @Override public void onLoaderReset(Loader<Cursor> loader) { notesGridViewAdapter.swapCursor(NO_CURSOR); } public void onFabClick(View view) { ContentValues contentValues = new ContentValues(); contentValues.put(JotContract.Note.DESCRIPTION, "Test this"); AsyncQueryHandler queryHandler = new AsyncQueryHandler(getContentResolver()) { @Override protected void onInsertComplete(int token, Object cookie, Uri uri) { Toast.makeText(MainActivity.this, "Note was saved", Toast.LENGTH_LONG).show(); } }; queryHandler.startInsert(0, NO_COOKIE, JotContract.Note.CONTENT_URI, contentValues); } @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { AsyncQueryHandler queryHandler = new AsyncQueryHandler(getContentResolver()) { // no specific behavior is required after DELETE is completed }; queryHandler.startDelete(0, null, Uri.withAppendedPath(JotContract.Note.CONTENT_URI, String.valueOf(id)), NO_SELECTION, NO_SELECTION_ARGS); return true; } }
ab50f64b66cdb7fe795374b7c920a14376fe7ea6
[ "Java" ]
3
Java
novotnyr/android-jot-2017
5fca1d88851456f94d2781420dd1bf94e8dda4d4
6953d8d2f23bd795a00f9d72b57b36eea3fed07a
refs/heads/master
<file_sep>using Domain; using Microsoft.AspNet.Identity; using Service.EspacePatient; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; namespace WebUI.Controllers { public class APIController : ApiController { ServiceAppointment sp = new ServiceAppointment(); [Route("API/AppointmentsList")] [HttpGet] public IHttpActionResult Index() { var ap = sp.GetMany(); return Ok(ap); } [Route("api/appointmentDetails/{id}")] [HttpGet] public IHttpActionResult Details(String id) { Appointment ap = sp.GetById(id); return Ok(ap); } [Route("api/appointmentAdd")] [HttpGet] public IHttpActionResult Add(Appointment ap) { sp.Add(ap); return Ok(); } [Route("api/appointmentDelete/{id}")] [HttpPost] public IHttpActionResult Delete(String id, Appointment a) { var req = sp.GetMany().Where(b => b.AppointmentId.Equals(id)).FirstOrDefault(); sp.Delete(req); sp.Commit(); return Ok(); } } } <file_sep>using Domain; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; using System.Web.Mvc; namespace WebUI.Models.EspacePatient { public class AppointmentModel { [DataType(DataType.Date)] public DateTime Date { get; set; } public string Location { get; set; } [Column(TypeName = "nvarchar(24)")] public SpecialityEnum Specialities { get; set; } //[Column(TypeName = "nvarchar(24)")] //public State AppointmentState { get; set; } public virtual Patient Patient { get; set; } [ForeignKey("Patient")] public string PatientId { get; set; } public virtual Doctor Doctor { get; set; } public int? DoctorId { get; set; } public IEnumerable<SelectListItem> Doctors { get; set; } } }<file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using Domain; using System.Threading.Tasks; using Data; using Service.Analytics; namespace GUI { class Program { static void Main(string[] args) { ServiceDashboard2 sd = new ServiceDashboard2(); foreach (var item in sd.getAllPatientsNotTreatedByDoctor("83521291-6853-4672-ad39-2f58ae07244a")) { Console.WriteLine(item.FirstName); } Console.ReadKey(); } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using WebUI.Models; namespace WebUI.Controllers.Doctolib { public class RssController : Controller { // GET: Rss public ActionResult Index() { return View(); } //public ActionResult RssReader() //{ // return View(WebUI.Models.Doctolib.RssReader.GetRssFeed()); //} } }<file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.Analytics { public interface IServiceDashboard3 : IService<Appointment> { IEnumerable<Appointment> getAllAppointments(); IEnumerable<Appointment> getAllAppointmentsByDoctor(string doctorId); } } <file_sep>using Domain; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace WebUI.Models { public class AccountViewModels { public class RegisterViewModel { [Required] [Display(Name = "Username")] public string UserName { get; set; } public String FirstName { get; set; } public String LastName { get; set; } [DataType(DataType.Date)] public DateTime BirthDate { get; set; } public String Address { get; set; } public Gender Gender { get; set; } public String ImageName { get; set; } [Required] [EmailAddress] [Display(Name = "Email")] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } public string PhoneNumber { get; set; } [Required] [Display(Name = "Account Type")] public EAccountType AccountType { get; set; } [Display(Name = "Speciality")] public SpecialityEnum Speciality { get; set; } } public class RegisterViewModell { [Required] [Display(Name = "Username")] public string UserName { get; set; } public String FirstName { get; set; } public String LastName { get; set; } [DataType(DataType.Date)] public DateTime BirthDate { get; set; } public String Address { get; set; } public Gender Gender { get; set; } public String ImageName { get; set; } [Required] [EmailAddress] [Display(Name = "Email")] public string Email { get; set; } //[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [Required] [DataType(DataType.Password)] [Display(Name = "PasswordHash")] public string PasswordHash { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } public string PhoneNumber { get; set; } [Required] [Display(Name = "Account Type")] public EAccountType AccountType { get; set; } [Display(Name = "Speciality")] public SpecialityEnum Speciality { get; set; } [Display(Name = "AccessFailedCount")] public int AccessFailedCount { get; set; } } public class LoginViewModel { [Required] [Display(Name = "UserName")] public string Username { get; set; } [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } public class LoginViewModell { [Required] [Display(Name = "UserName")] public string Username { get; set; } [DataType(DataType.Password)] [Display(Name = "PasswordHash")] public string PasswordHash { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Data.Infrastructure; using Infrastructure; namespace Service.EspaceMedecin { public class ServiceMedecin : Service<Doctor>, IServiceMedecin { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork uow = new UnitOfWork(dbf); public ServiceMedecin() : base(uow) { } public IEnumerable<Doctor> getDoctorById(string id) { var req = from Doctor in GetMany() where Doctor.Id == id select Doctor; return req; } public IEnumerable<Doctor> getDoctorByUserName(string username) { var req = from Doctor in GetMany() where Doctor.UserName == username select Doctor; return req; } } } <file_sep>using System; using System.Globalization; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin.Security; using WebUI.Models; using ServicePattern; using Domain; using Service.Identity; using static WebUI.Models.AccountViewModels; using System.IO; namespace WebUI.Controllers { [Authorize] public class AccountController : Controller { //===========================// //--------- MANAGERS ---------- //===========================// private ApplicationSignInManager _signInManager; private ApplicationUserManager _userManager; private readonly ServiceUser _userService = new ServiceUser(); public ApplicationSignInManager SignInManager { get { return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>(); } private set { _signInManager = value; } } public ApplicationUserManager UserManager { get { return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>(); } private set { _userManager = value; } } private IAuthenticationManager AuthenticationManager { get { return HttpContext.GetOwinContext().Authentication; } } //===========================// //--------- LOGIN ---------- //===========================// // GET: /Account/Login [AllowAnonymous] public ActionResult Login(string returnUrl) { ViewBag.ReturnUrl = returnUrl; return View(); } public static String UserCoUserName; // // POST: /Account/Login [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) { if (!ModelState.IsValid) { return View(model); } // This doesn't count login failures towards account lockout // To enable password failures to trigger account lockout, change to shouldLockout: true var result = await SignInManager.PasswordSignInAsync(model.Username, model.Password, model.RememberMe, shouldLockout: false); switch (result) { case SignInStatus.Success: { // ModelState.AddModelError("", "Connected."); //return RedirectToLocal(returnUrl); //return View(model); UserCoUserName = model.Username; return RedirectToAction("Index", "Home"); } case SignInStatus.LockedOut: return View("Lockout"); case SignInStatus.RequiresVerification: return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); default: ModelState.AddModelError("", "Invalid login attempt."); return View(model); } } //===========================// //--------- LOG OUT --------- //===========================// // // POST: /Account/LogOff [HttpPost] [ValidateAntiForgeryToken] public ActionResult LogOff() { UserCoUserName = null; AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie); return RedirectToAction("Index", "Home"); } //===========================// //--------- REGISTER -------- //===========================// // // GET: /Account/Register [AllowAnonymous] public ActionResult Register() { return View(); //ViewBag.Roles = new SelectList(db.Roles.Where(a => !a.Name.Contains("Admins")).ToList(), "Name", "Name"); //return View(); } // // POST: /Account/Register [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Register(AccountViewModels.RegisterViewModel model, HttpPostedFileBase Image) { if (ModelState.IsValid) { IdentityResult result; model.ImageName = Image.FileName; // Switch on Selected Account type switch (model.AccountType) { // Volunteer Account type selected: case EAccountType.Patient: { // create new volunteer and map form values to the instance Patient v = new Patient { UserName = (model.UserName), Email = model.Email, Address = model.Address, FirstName = model.FirstName, LastName = model.LastName, BirthDate = model.BirthDate, ImageName = model.ImageName, PhoneNumber = model.PhoneNumber, Gender = model.Gender, }; //v.Roles.Add(); if (v.ImageName == null) { v.ImageName = "default-user-image.png"; } var path = Path.Combine(Server.MapPath("~/Content/Upload/"), Image.FileName); Image.SaveAs(path); result = await UserManager.CreateAsync(v, model.Password); // Add volunteer role to the new User if (result.Succeeded) { // UserManager.AddToRole(v.Id, EAccountType.Patient.ToString()); await SignInManager.SignInAsync(v, isPersistent: false, rememberBrowser: false); // Email confirmation here UserCoUserName = null; return RedirectToAction("Index", "Home"); } AddErrors(result); } break; // Ngo Account type selected: case EAccountType.Doctor: { // create new Ngo and map form values to the instance Doctor ngo = new Doctor { UserName = model.UserName, Email = model.Email, Address = model.Address, FirstName = model.FirstName, LastName = model.LastName, BirthDate = model.BirthDate, ImageName = model.ImageName, PhoneNumber = model.PhoneNumber, Gender = model.Gender, Speciality = model.Speciality }; if (ngo.ImageName == null) { ngo.ImageName = "default-user-image.png"; } var path = Path.Combine(Server.MapPath("~/Content/Upload/"), Image.FileName); Image.SaveAs(path); result = await UserManager.CreateAsync(ngo, model.Password); // Add Ngo role to the new User if (result.Succeeded) { // UserManager.AddToRole(ngo.Id, EAccountType.Doctor.ToString()); await SignInManager.SignInAsync(ngo, isPersistent: false, rememberBrowser: false); UserCoUserName = ngo.UserName; return RedirectToAction("Index", "Home"); } // AddErrors(result); } break; } } // If we got this far, something failed, redisplay form return View(model); } private void AddErrors(IdentityResult result) { foreach (var error in result.Errors) { ModelState.AddModelError("", error); } } //===========================// //--------- HELPERS --------- //===========================// private ActionResult RedirectToLocal(string returnUrl) { if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } return RedirectToAction("Index", "Home"); } // FOR REFERENCE // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771 // Send an email with this link // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>"); // GET: /Account/ConfirmEmail [AllowAnonymous] public async Task<ActionResult> ConfirmEmail(string userId, string code) { if (userId == null || code == null) { return View("Error"); } var result = await UserManager.ConfirmEmailAsync(userId, code); return View(result.Succeeded ? "ConfirmEmail" : "Error"); } // // GET: /Account/ForgotPassword [AllowAnonymous] public ActionResult ForgotPassword() { return View(); } // //// POST: /Account/ForgotPassword //[HttpPost] //[AllowAnonymous] //[ValidateAntiForgeryToken] //public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model) //{ // if (ModelState.IsValid) // { // var user = await UserManager.FindByNameAsync(model.Email); // if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id))) // { // // Don't reveal that the user does not exist or is not confirmed // return View("ForgotPasswordConfirmation"); // } // // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771 // // Send an email with this link // // string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id); // // var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); // // await UserManager.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking <a href=\"" + callbackUrl + "\">here</a>"); // // return RedirectToAction("ForgotPasswordConfirmation", "Account"); // } // // If we got this far, something failed, redisplay form // return View(model); } } <file_sep>using DHTMLX.Scheduler.Data; using DHTMLX.Common; using DHTMLX.Scheduler; using Domain; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; using System.Web.Mvc; using Data; using Service.EspaceMedecin; using DHTMLX.Scheduler.Controls; using System.Collections; using System.Web.UI; namespace WebUI.Controllers.EspaceMedecin { public class CalenderController : Controller { ServiceMedecin sm = new ServiceMedecin(); // GET: Calender ServiceDisponibility sd = new ServiceDisponibility(); public ActionResult Index() { var scheduler = new DHXScheduler(this); scheduler.Lightbox.Name = "Disponibility"; //scheduler.Lightbox.Add(check); scheduler.TimeSpans.Add(new DHXMarkTime() { Day = DayOfWeek.Sunday, CssClass = "green_section", SpanType = DHXTimeSpan.Type.BlockEvents }); scheduler.TimeSpans.Add(new DHXMarkTime() { FullWeek = false, Day = DayOfWeek.Saturday, CssClass = "red_section",// apply this css class to the section HTML = "LockTime", // inner html of the section Zones = new List<Zone>() { new Zone { Start = 15 * 60, End = 20 * 60 } }, SpanType = DHXTimeSpan.Type.BlockEvents//if specified - user can't create event in this area }); scheduler.Skin = DHXScheduler.Skins.Flat; scheduler.Config.first_hour = 8; scheduler.Config.last_hour = 20; scheduler.Config.time_step = 15; scheduler.EnableDynamicLoading(SchedulerDataLoader.DynamicalLoadingMode.Month); scheduler.LoadData = true; scheduler.EnableDataprocessor = true; //scheduler.filter_timeline = function(id, event){ return false; } return View(scheduler); } PiContext db = new PiContext(); public ContentResult Data(DateTime from, DateTime to) { var apps = db.Disponibilities.Where(e => e.StartDate < to && e.EndDate >= from).ToList(); return new SchedulerAjaxData(apps); } public ActionResult Save(int? id, FormCollection actionValues) { var action = new DataAction(actionValues); var medecin = sm.getDoctorByUserName(AccountController.UserCoUserName); try { var changedEvent = DHXEventsHelper.Bind<Disponibility>(actionValues); changedEvent.DoctorId = medecin.Single().Id; switch (action.Type) { case DataActionTypes.Insert: { if (changedEvent.StartDate >= DateTime.Now.Date) { changedEvent.Description = "Disponible"; db.Disponibilities.Add(changedEvent); } else { Response.Write("alert('You can t add disponibility in the past')"); } } break; case DataActionTypes.Delete: if (changedEvent.DoctorId == ((sm.getDoctorByUserName(AccountController.UserCoUserName)).Single()).Id) { db.Entry(changedEvent).State = EntityState.Deleted; } else { Response.Write("alert('You can t delete disponibility of another doctor')"); } break; default:// "update" { if (changedEvent.StartDate >= DateTime.Now.Date) {if (changedEvent.DoctorId == ((sm.getDoctorByUserName(AccountController.UserCoUserName)).Single()).Id) { db.Entry(changedEvent).State = EntityState.Modified; } else { Response.Write("alert('You can t update disponibility of another doctor')"); } } else { Response.Write("alert('You can t update disponibility in the past')"); } } break; } db.SaveChanges(); action.TargetId = changedEvent.Id; } catch (Exception a) { action.Type = DataActionTypes.Error; } return (new AjaxSaveResponse(action)); } protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); } } }<file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.EspacePatient { public interface IServiceAppointment:IService<Appointment> { } } <file_sep>using Domain; using Microsoft.Owin; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using Service.Identity; using Data; namespace Service { public class AppService { /* public void TestContext() { IOwinContext c = new OwinContext(); User v = new User { Email = "<EMAIL>", Password = "<PASSWORD>", adress = "1 rue de sfax", UserName = "emel", gender = Gender.female, lastName = "Garouachi", birthDate = DateTime.Now }; var cox = HttpContext.Current.GetOwinContext().Get<PiContext>(); c.Get<PiContext>().Users.Add(v); }*/ } } <file_sep>using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class Question { [Key] public int IdQuestion { get; set; } public String LaQuestion { get; set; } public Patient Patient { get; set; } public virtual ICollection<Commentaire> Commentaires { get; set; } } } <file_sep>using Data; using Domain; using Newtonsoft.Json.Linq; using Service.EspaceMedecin; using Service.EspacePatient; using System; using System.Collections.Generic; using System.Data.Entity; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; namespace WebUI.Controllers.EspaceMedecin { public class MedecinController : Controller { ServiceAppointment sa = new ServiceAppointment(); ServiceMedecin sm = new ServiceMedecin(); // GET: Medecin public ActionResult Index() { //var medecin= new IEnumerable<Doctor>(); int a=0; var medecin2 = sm.GetMany().ToList(); return View(medecin2); } [HttpPost] public ActionResult Index(string SearchString) { //var medecin= new IEnumerable<Doctor>(); var medecin2 = sm.GetMany(p=>p.Address.Contains(SearchString)); return View(medecin2); } // GET: Medecin/Details/5 public ActionResult Details(string id) { var medecin = sm.GetById(id); return View(medecin); } ServiceDisponibility sd = new ServiceDisponibility(); public ActionResult ViewDispo(String id) { var dispo = sd.geDispoByDoctorId(id); return View(dispo); } // GET: Medecin/Create //public ActionResult Create() //{ // return View(); //} //// POST: Medecin/Create //[HttpPost] //public ActionResult Create(FormCollection collection) //{ // try // { // // TODO: Add insert logic here // return RedirectToAction("Index"); // } // catch // { // return View(); // } //} // GET: Medecin/Edit/5 PiContext pi = new PiContext(); // POST: Medecin/Edit/5 // GET: Medecin/Delete/5 } } <file_sep>using System; using System.Collections.Generic; using System.Data.Entity.ModelConfiguration.Conventions; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Data.CustomConventions { public class DateTimeConvention : Convention { public DateTimeConvention() { Properties<DateTime>().Configure(dt => dt.HasColumnType("DateTime2")); } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.Analytics { public interface IServiceDashboard : IService<Doctor> { Doctor getDoctorByName(string name); } } <file_sep>using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class Chat { public int ChatId { get; set; } public string Content { get; set; } public DateTime CreationDate { get; set; } public virtual Doctor Doctor { get; set; } [ForeignKey("Doctor")] public string DoctorId { get; set; } public virtual Patient Patient { get; set; } [ForeignKey("Patient")] public string PatientId { get; set; } } } <file_sep>using Data.Infrastructure; using Domain; using Infrastructure; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.Analytics { public class ServiceDashboard : Service<Doctor>, IServiceDashboard { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork uow = new UnitOfWork(dbf); public ServiceDashboard() : base(uow) { } public Doctor getDoctorByName(string name) { return Get(a => a.UserName == name); } } } <file_sep>using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class Course { // [Key] // [ForeignKey("Patient")] public int CourseId { get; set; } //public ICollection<Appointment> Visits { get; set; } // public virtual Patient patient { get; set; } // public virtual Patient Patient { get; set; } // [Key] // [ForeignKey("Patient")] //public virtual Patient patient { get; set; } } } <file_sep>using Data; using Domain; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Service.EspaceMedecin; using System; using System.Collections.Generic; using System.Data.Entity; using System.IO; using System.Linq; using System.Web; using System.Web.Helpers; using System.Web.Http; using System.Web.Mvc; namespace WebUI.Controllers.EspaceMedecin { public class APIDoctorController : Controller { // GET: APIDoctor ServiceMedecin ds = new ServiceMedecin(); PiContext db = new PiContext(); public ActionResult GetDoctors() { IList<Doctor> lcm = new List<Doctor>(); foreach (var item in ds.GetMany()) { Doctor cm = new Doctor(); cm.Id = item.Id; cm.LastName = item.LastName; cm.FirstName = item.FirstName; cm.UserName = item.UserName; cm.Email = item.Email; cm.PhoneNumber = item.PhoneNumber; cm.UserName = item.UserName; cm.BirthDate = item.BirthDate; cm.Gender = item.Gender; cm.Address = item.Address; cm.ImageName = item.ImageName; cm.Speciality = item.Speciality; lcm.Add(cm); } return Json(lcm, JsonRequestBehavior.AllowGet); } public ActionResult DoctorDetails(String id) { Doctor sk = ds.GetById(id); IList<Doctor> lcm = new List<Doctor>(); lcm.Add(sk); // var sk = ds.GetById(id); return Json(lcm, JsonRequestBehavior.AllowGet); } public ActionResult DoctorSearch(string SearchString) { IList<Doctor> lcm = new List<Doctor>(); foreach (var item in ds.GetMany(p => p.Address.Contains(SearchString))) { Doctor cm = new Doctor(); cm.Id = item.Id; cm.LastName = item.LastName; cm.FirstName = item.FirstName; cm.UserName = item.UserName; cm.Email = item.Email; cm.PhoneNumber = item.PhoneNumber; cm.UserName = item.UserName; cm.Gender = item.Gender; cm.Address = item.Address; cm.ImageName = item.ImageName; lcm.Add(cm); } return Json(lcm); } ServiceDisponibility sd = new ServiceDisponibility(); public ActionResult ViewDispo(String id) { IList<Disponibility> lcm = new List<Disponibility>(); foreach (var item in sd.geDispoByDoctorId(id)) { Disponibility cm = new Disponibility(); cm.Description = item.Description; cm.StartDate = item.StartDate; cm.EndDate = item.EndDate; cm.Doctor = item.Doctor; lcm.Add(cm); } return Json(lcm); } //[Route("api/doctorsList")] // [HttpGet] // public IHttpActionResult Index() // { // //var sk = ds.GetMany(); // IList<Doctor> lcm = new List<Doctor>(); // foreach (var item in ds.GetMany()) // { // Doctor cm = new Doctor(); // cm.Id = item.Id; // cm.FirstName = item.FirstName; // cm.Email = item.Email; // cm.PhoneNumber = item.PhoneNumber; // cm.UserName = item.UserName; // cm.BirthDate = item.BirthDate; // cm.Gender = item.Gender; // cm.Address = item.Address; // cm.ImageName = item.ImageName; // lcm.Add(cm); // } // return Ok(lcm); // // return Json(sk); //} // [Route("api/docteurDetails/{id}")] // [HttpGet] // public IHttpActionResult Details(String id) // { // Doctor sk = ds.GetById(id); // // var sk = ds.GetById(id); // return Ok(sk); // } // [Route("api/doctorDel/{id}")] // [HttpPost] // public IHttpActionResult Delete(String id, Doctor d) // { // var req = ds.GetMany().Where(a => a.Id.Equals(id)).FirstOrDefault(); // ds.Delete(req); // ds.Commit(); // return Ok(); // } // [Route("api/doctorSearch/{SearchString}")] // [HttpPost] // public IHttpActionResult Index(string SearchString) // { // var medecin2 = ds.GetMany(p => p.Address.Contains(SearchString)); // return Ok(medecin2); // } //ServiceDisponibility sd = new ServiceDisponibility(); //[Route("api/dispoByDoctor/{id}")] //[HttpPost] //public IHttpActionResult ViewDispo(String id) //{ // var dispo = sd.geDispoByDoctorId(id); // return Ok(dispo); //} //[Route("api/docteurDash")] //[HttpGet] //public IHttpActionResult DashboardMedecin() //{ // var medecin = ds.getDoctorByUserName(AccountController.UserCoUserName); // return Ok(medecin); //} //PiContext pi = new PiContext(); //[Route("api/docteurDash")] //[HttpPost] //public IHttpActionResult Edit([System.Web.Mvc.Bind(Include = "Id,Email,SecurityStamp,PhoneNumber, LockoutEndDateUtc,AccessFailedCount,UserName, FirstName,LastName,birthDate,Address,ImageName,Gender,Speciality")] Doctor d, HttpPostedFileBase Image) //{ // //Doctor do= new Doctor(); // // TODO: Add update logic here // if (ModelState.IsValid) // { // String fileName = Path.GetFileName(Image.FileName); // d.ImageName = fileName; // var doctor = ds.GetMany().Single(em => em.Id == d.Id); // d.PasswordHash = <PASSWORD>; // d.SecurityStamp = doctor.SecurityStamp; // pi.Entry(d).State = EntityState.Modified; // pi.SaveChanges(); // return Ok(); // } // // return RedirectToAction("Index"); // return Ok(d); //} } } <file_sep>using Service.EspacePatient; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ServicePattern; using WebUI.Models.EspacePatient; using Data; using System.Data.Entity; using Domain; using Microsoft.AspNet.Identity; namespace WebUI.Controllers.EspacePatient { //[Authorize] public class AppointmentController : Controller { ServiceAppointment SA = new ServiceAppointment(); public ActionResult IndexWS() { return View(SA.GetAll()); } // GET: Appointment public ActionResult Index() { var Appointments = SA.GetMany(); return View(Appointments); } [HttpPost] public ActionResult Index(DateTime SearchDate) { var AppointmentsSearched = SA.GetMany(a => a.Date == SearchDate); return View(AppointmentsSearched); } // GET: Appointment/Details/5 public ActionResult Details(int id) { return View(); } // GET: Appointment/Create public ActionResult Create() { AppointmentModel ap = new AppointmentModel(); ap.Doctors = SA.GetMany(). Select(c => new SelectListItem { Text = c.Doctor.UserName, Value = c.DoctorId }); return View(ap); } // POST: Appointment/Create [HttpPost] public ActionResult Create(AppointmentModel am) { String currentUserId = User.Identity.GetUserId(); List<User> GetUsers = SA.GetUsers(); var user = GetUsers.FirstOrDefault(u => u.Id == currentUserId); try { Appointment a = new Appointment() { Specialities = am.Specialities, Date = am.Date, Location = am.Location, DoctorId = am.Doctor.Id, PatientId = currentUserId}; SA.AddAppointment(a); SA.Commit(); return RedirectToAction("Index"); } catch { return View(); } } // GET: Appointment/Edit/5 public ActionResult Edit(int id) { var appointment = SA.GetById(id); return View(appointment); } PiContext pi = new PiContext(); // POST: Appointment/Edit/5 [HttpPost] public ActionResult Edit([Bind(Include = "AppointmentId,Date,Location,AppointmentState, Doctor,DoctorId,Patient, PatientId")] Appointment ap) { if (ModelState.IsValid) { var appointment = SA.GetMany().Single(a => a.AppointmentId == ap.AppointmentId); ap.AppointmentState = appointment.AppointmentState; ap.Date = appointment.Date; ap.Location = ap.Location; ap.Doctor = ap.Doctor; pi.Entry(ap).State = EntityState.Modified; pi.SaveChanges(); return RedirectToAction("Index"); } return View(ap); } // GET: Appointment/Delete/5 public ActionResult Delete(int id) { return View(); } // POST: Appointment/Delete/5 [HttpPost] public ActionResult Delete(int id, Appointment ap) { try { var req = SA.GetMany().Where(a => a.AppointmentId.Equals(id)).FirstOrDefault(); SA.Delete(req); SA.Commit(); return RedirectToAction("Index"); } catch { return View(); } } } } <file_sep>//using Data; //using Domain; //using Microsoft.AspNet.Identity; //using Service; //using System; //using System.Collections.Generic; //using System.Linq; //using System.Net; //using System.Net.Http; //using System.Web.Http; //using System.Web.Mvc; //using WebUI.Models.Analytics; //namespace WebUI.Controllers //{ // public class UtilisateurController : Controller // { // Service.IServiceUser us = new Service.ServiceUser(); // public ActionResult GetUsers() // { // IList<UserModel> lcm = new List<UserModel>(); // foreach (var item in us.getAll()) // { // UserModel cm = new UserModel(); // cm.Id = item.Id; // cm.FirstName = item.FirstName; // cm.Email = item.Email; // cm.PhoneNumber = item.PhoneNumber; // cm.UserName = item.UserName; // cm.BirthDate = item.BirthDate; // cm.Gender = item.Gender.Value.ToString(); // cm.Address = item.Address; // cm.ImageName = item.ImageName; // lcm.Add(cm); // } // return Json(lcm, JsonRequestBehavior.AllowGet); // } // //public UtilisateurController() { } // //IServicesUser us = new ServicesUser(); // //UserManager<User, string> _userManager = new UserManager<User, string>(new ApplicationUserStore(new PiContext())); // //[Route("api/useradd")] // //[HttpPost] // //public IHttpActionResult Create(UserModel clt) // //{ // // User c = new User(); // // c.FirstName = clt.FirstName; // // c.PhoneNumber = clt.PhoneNumber; // // //c.StreetName = clt.StreetName; // // //c.City = clt.City; // // //c.Country = clt.Country; // // //c.Type = clt.Type; // // //c.Categorie = clt.Categorie; // // //c.Logo = "Client.jpg"; // // //c.role = "Client"; // // //var mp = RandomStringGenerator(); // // //c.password = mp; // // //c.PasswordHash = _userManager.PasswordHasher.HashPassword(mp); // // //c.LockoutEnabled = true; // // //c.SecurityStamp = Guid.NewGuid().ToString(); // // ///****Mail****/ // // //try // // //{ // // // MailMessage message = new MailMessage("<EMAIL>", clt.Email, "Hello", "Compte créé votre mail est : " + clt.Email + ", Votre mp est: " + mp); // // // message.IsBodyHtml = true; // // // SmtpClient client = new SmtpClient("smtp.gmail.com", 587); // // // client.EnableSsl = true; // // // client.Credentials = new System.Net.NetworkCredential("<EMAIL>", "0720MB2326"); // // // client.Send(message); // // //} // // //catch (Exception ex) // // //{ // // // Console.WriteLine(ex.StackTrace); // // //} // // /****Mail****/ // // us.Add(c); // // us.Commit(); // // return Ok(); // //} // //[Route("api/utilisateur")] // //[HttpGet] // //public IHttpActionResult getAllUsers() // //{ // // IList<UserModel> lcm = new List<UserModel>(); // // foreach (var item in us.getAll()) // // { // // UserModel cm = new UserModel(); // // cm.Id = item.Id; // // cm.FirstName = item.FirstName; // // cm.Email = item.Email; // // cm.PhoneNumber = item.PhoneNumber; // // cm.UserName = item.UserName; // // cm.BirthDate = item.BirthDate; // // cm.Gender = item.Gender.Value.ToString(); // // cm.Address = item.Address; // // cm.ImageName = item.ImageName; // // lcm.Add(cm); // // } // // if (lcm.Count == 0) // // { // // return NotFound(); // // } // // return Ok(lcm); // //} // } //} <file_sep>using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class MedicalPath { [Key] [ForeignKey("Patient")] public string PathId { get; set; } public string RecommendedSpeciality { get; set; } public int ValidatedSteps { get; set; } public string Justification { get; set; } public virtual Patient Patient { get; set; } public virtual ICollection<Doctor> Doctors { get; set; } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.EspaceMedecin { public interface IServiceDisponibility:IService<Disponibility> { IEnumerable<Disponibility> geDispoByDoctorId(string id); } } <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class Repport { public int RepportId { get; set; } public string RepportName { get; set; } public DateTime RepportDate { get; set; } public string PatientName { get; set; } public string DiseaseDeclared { get; set; } public string Symptoms { get; set; } public string Abnormalities { get; set; } public string ImageDisease { get; set; } public string RepportContent { get; set; } public string Diagnostic { get; set; } public string ReferentDoctor { get; set; } public Doctor Doctor { get; set; } //public virtual Course course { get; set; } } } <file_sep>using Domain; using System; using System.Collections.Generic; using System.Data.Entity.ModelConfiguration; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Data.Configurations { public class DoctorConfiguration : EntityTypeConfiguration<Doctor> { public DoctorConfiguration() { HasMany(d => d.MedicalPaths).WithMany(mp => mp.Doctors).Map(m => { m.ToTable("Paths_Doctors"); m.MapLeftKey("DoctorId"); m.MapRightKey("PathId"); }); HasMany(d => d.Appointments).WithRequired(a => a.Doctor).HasForeignKey(a => a.DoctorId).WillCascadeOnDelete(false); HasMany(d => d.Conversations).WithRequired(c => c.Doctor).HasForeignKey(c => c.DoctorId).WillCascadeOnDelete(false); } } } <file_sep>using Domain; using Microsoft.AspNet.Identity.EntityFramework; using System.Data.Entity; using Data.CustomConventions; namespace Data { // [DbConfigurationType(typeof(MySqlEFConfiguration))] public class PiContext : IdentityDbContext<User> { public PiContext() : base("pidb") { Database.SetInitializer(new ContexInit()); } public DbSet<Appointment> Appointments { get; set; } public DbSet<MedicalPath> MedicalPaths { get; set; } public DbSet<Chat> Chats { get; set; } public DbSet<Repport> Repports { get; set; } public DbSet<Rate> Ratings { get; set; } public DbSet<Disponibility> Disponibilities { get; set; } //public DbSet<Question> Questions { get; set; } //public DbSet<Commentaire> Commentaires { get; set; } //public DbSet<Question> Questions { get; set; } //public DbSet<Commentaire> Commentaires { get; set; } //public DbSet<Reason> Reasons { get; set; } public static PiContext Create() { return new PiContext(); } } public class ContexInit : DropCreateDatabaseIfModelChanges<PiContext> { protected override void Seed(PiContext context) { /* List<Patient> patients = new List<Patient>() { new Patient {PatientId=1 } }; context.Patients.AddRange(patients); context.SaveChanges();*/ } } } <file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class Ajout_des_tables_commentaire_et_question : DbMigration { public override void Up() { CreateTable( "dbo.Commentaires", c => new { IdCommentaire = c.Int(nullable: false, identity: true), LaCommentaire = c.String(), Question_IdQuestion = c.Int(), }) .PrimaryKey(t => t.IdCommentaire) .ForeignKey("dbo.Questions", t => t.Question_IdQuestion) .Index(t => t.Question_IdQuestion); CreateTable( "dbo.Questions", c => new { IdQuestion = c.Int(nullable: false, identity: true), LaQuestion = c.String(), Patient_Id = c.String(maxLength: 128), }) .PrimaryKey(t => t.IdQuestion) .ForeignKey("dbo.AspNetUsers", t => t.Patient_Id) .Index(t => t.Patient_Id); } public override void Down() { DropForeignKey("dbo.Questions", "Patient_Id", "dbo.AspNetUsers"); DropForeignKey("dbo.Commentaires", "Question_IdQuestion", "dbo.Questions"); DropIndex("dbo.Questions", new[] { "Patient_Id" }); DropIndex("dbo.Commentaires", new[] { "Question_IdQuestion" }); DropTable("dbo.Questions"); DropTable("dbo.Commentaires"); } } } <file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class Modif_table_user : DbMigration { public override void Up() { AddColumn("dbo.AspNetUsers", "Address", c => c.String()); AddColumn("dbo.AspNetUsers", "Gender", c => c.Int()); AlterColumn("dbo.AspNetUsers", "BirthDate", c => c.DateTime(nullable: true, precision: 7, storeType: "datetime2")); DropColumn("dbo.AspNetUsers", "adress"); } public override void Down() { AddColumn("dbo.AspNetUsers", "adress", c => c.String()); AlterColumn("dbo.AspNetUsers", "BirthDate", c => c.DateTime(nullable: true, precision: 7, storeType: "datetime2")); DropColumn("dbo.AspNetUsers", "Gender"); DropColumn("dbo.AspNetUsers", "Address"); } } } <file_sep>using Data; using Domain; using Microsoft.AspNet.Identity; using Service; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using WebUI.Models.Analytics; namespace WebUI.Controllers { public class UserAPIController : ApiController { IServicesUser us = new ServicesUser(); UserManager<User, string> _userManager = new UserManager<User, string>(new ApplicationUserStore(new PiContext())); // GET: api/UserAPI public IHttpActionResult Get() { IList<UserModel> lcm = new List<UserModel>(); foreach (var item in us.getAll()) { UserModel cm = new UserModel(); cm.Id = item.Id; cm.FirstName = item.FirstName; cm.Email = item.Email; cm.PhoneNumber = item.PhoneNumber; cm.UserName = item.UserName; cm.BirthDate = item.BirthDate; //cm.Gender = item.Gender.Value.ToString(); cm.Address = item.Address; cm.ImageName = item.ImageName; lcm.Add(cm); } if (lcm.Count == 0) { return NotFound(); } return Ok(lcm); } // GET: api/UserAPI/5 public IHttpActionResult Get(string id) { User item = us.GetById(id); UserModel cm = new UserModel(); cm.Id = item.Id; cm.FirstName = item.FirstName; cm.Email = item.Email; cm.PhoneNumber = item.PhoneNumber; cm.UserName = item.UserName; cm.BirthDate = item.BirthDate; //cm.Gender = item.Gender.Value.ToString(); cm.Address = item.Address; cm.ImageName = item.ImageName; return Ok(cm); } // POST: api/UserAPI public void Post([FromBody]string value) { } // PUT: api/UserAPI/5 public void Put(int id, [FromBody]string value) { } // DELETE: api/UserAPI/5 public void Delete(int id) { } } } <file_sep>using Data.Infrastructure; using Domain; using Infrastructure; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.EspacePatient { public class ServiceAppointment : Service<Appointment>,IServiceAppointment { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork uof = new UnitOfWork(dbf); public ServiceAppointment():base(uof) { } public List<User> GetUsers() { return dbf.DataContext.Users.ToList(); } public virtual void AddAppointment(Appointment ap) { ap.AppointmentState = StateEnum.In_Progress; ////_repository.Add(entity); uof.getRepository<Appointment>().Add(ap); } public List<Appointment> GetAll() { var list = uof.getRepository<Appointment>().GetMany(null, null).ToList(); return list; } } } <file_sep>using Domain; using System; using System.Collections.Generic; using System.Data.Entity.ModelConfiguration; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Data.Configurations { public class PatientConfiguration : EntityTypeConfiguration<Patient> { public PatientConfiguration() { HasMany(p => p.Appointments).WithRequired(a => a.Patient).HasForeignKey(a => a.PatientId).WillCascadeOnDelete(false); HasMany(p => p.Conversations).WithRequired(c => c.Patient).HasForeignKey(c => c.PatientId).WillCascadeOnDelete(false); HasOptional(p => p.MedicalPath).WithRequired(m => m.Patient).WillCascadeOnDelete(false); } } } <file_sep>using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Data.Infrastructure; using Domain; using Infrastructure; namespace Service.EspaceMedecin { public class ServiceDisponibility : Service<Disponibility>, IServiceDisponibility { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork utwk = new UnitOfWork(dbf); public ServiceDisponibility() : base(utwk) { } public IEnumerable<Disponibility> geDispoByDoctorId(string id) { var req = from Disponibility in GetMany() where Disponibility.DoctorId == id select Disponibility; return req; } } } <file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class Modif_table_appointment : DbMigration { public override void Up() { DropIndex("dbo.Rates", new[] { "appointment_AppointmentId" }); DropIndex("dbo.Rates", new[] { "patient_Id" }); RenameColumn(table: "dbo.Appointments", name: "doctor_Id", newName: "DoctorId"); RenameColumn(table: "dbo.Appointments", name: "patient_Id", newName: "PatientId"); RenameIndex(table: "dbo.Appointments", name: "IX_doctor_Id", newName: "IX_DoctorId"); RenameIndex(table: "dbo.Appointments", name: "IX_patient_Id", newName: "IX_PatientId"); AddColumn("dbo.Appointments", "Location", c => c.String()); AddColumn("dbo.Appointments", "AppointmentState", c => c.Int(nullable: false, defaultValue: 0)); CreateIndex("dbo.Rates", "Appointment_AppointmentId"); CreateIndex("dbo.Rates", "Patient_Id"); DropColumn("dbo.Appointments", "Disease"); DropColumn("dbo.Appointments", "state"); } public override void Down() { AddColumn("dbo.Appointments", "state", c => c.Int(nullable: false)); AddColumn("dbo.Appointments", "Disease", c => c.String()); DropIndex("dbo.Rates", new[] { "Patient_Id" }); DropIndex("dbo.Rates", new[] { "Appointment_AppointmentId" }); DropColumn("dbo.Appointments", "AppointmentState"); DropColumn("dbo.Appointments", "Location"); RenameIndex(table: "dbo.Appointments", name: "IX_PatientId", newName: "IX_patient_Id"); RenameIndex(table: "dbo.Appointments", name: "IX_DoctorId", newName: "IX_doctor_Id"); RenameColumn(table: "dbo.Appointments", name: "PatientId", newName: "patient_Id"); RenameColumn(table: "dbo.Appointments", name: "DoctorId", newName: "doctor_Id"); CreateIndex("dbo.Rates", "patient_Id"); CreateIndex("dbo.Rates", "appointment_AppointmentId"); } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.Analytics { public interface IServiceDashboard2 : IService<Patient> { IEnumerable<Patient> getAllPatientsByDoctor(string doctorId); IEnumerable<Patient> getAllPatientsTreatedByDoctor(string doctorId); IEnumerable<Patient> getAllPatientsNotTreatedByDoctor(string doctorId); } } <file_sep>using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using System.Web; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Microsoft.Owin.Security; using WebUI.Models; namespace WebUI { public class IdentityConfig { } } <file_sep>using Data.Infrastructure; using Domain; using Infrastructure; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.Analytics { public class ServiceDashboard2 : Service<Patient>, IServiceDashboard2 { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork uow = new UnitOfWork(dbf); public ServiceDashboard2() : base(uow) { } public IEnumerable<Patient> getAllPatientsByDoctor(string doctorId) { return GetMany(); } public IEnumerable<Patient> getAllPatientsTreatedByDoctor(string doctorId) { var app = uow.getRepository<Appointment>().GetMany(a => a.AppointmentState == StateEnum.Completed || a.AppointmentState == StateEnum.In_Progress && a.DoctorId.Equals(doctorId)); var req = from patients in GetMany() join ap in app on patients.Id equals ap.PatientId select patients; return req.Distinct(); } public IEnumerable<Patient> getAllPatientsNotTreatedByDoctor(string doctorId) { var app = uow.getRepository<Appointment>() .GetMany(a => a.AppointmentState != StateEnum.Completed && a.AppointmentState != StateEnum.In_Progress && a.DoctorId.Equals(doctorId)); var req = from patients in GetMany() join ap in app on patients.Id equals ap.PatientId select patients; return req.Distinct(); } } } <file_sep>using Data; using Domain; using Microsoft.Owin; using Owin; using System; using System.Web; using Service.Identity; namespace Service { public static class Startup { //TODO Rename class public static void OwinInit(IAppBuilder app) { app.CreatePerOwinContext(PiContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create); } } } <file_sep>using Domain; using Microsoft.AspNet.Identity.Owin; using Service.Identity; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web; using System.Web.Http; using System.Web.Mvc; using static WebUI.Models.AccountViewModels; namespace WebUI.Controllers.Users { public class AccountController : ApiController { private ApplicationSignInManager _signInManager; private ApplicationUserManager _userManager; public AccountController() { } public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager) { UserManager = userManager; SignInManager = signInManager; } public ApplicationSignInManager SignInManager { get { return _signInManager ?? HttpContext.Current.GetOwinContext().Get<ApplicationSignInManager>(); } private set { _signInManager = value; } } public ApplicationUserManager UserManager { get { return _userManager ?? HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>(); } private set { _userManager = value; } } // POST: /Account/Login [System.Web.Http.HttpPost] [System.Web.Http.AllowAnonymous] [ValidateAntiForgeryToken] [System.Web.Http.Route("api/Login")] public async Task<IHttpActionResult> Login(LoginViewModell model) { var result = await SignInManager.PasswordSignInAsync(model.Username, model.PasswordHash, model.RememberMe, shouldLockout: false); switch (result) { case SignInStatus.Success: return Ok("ConnexionSuccess"); case SignInStatus.Failure: default: ModelState.AddModelError("", "Invalid login attempt."); return Ok("ConnexionFailed"); } } [System.Web.Http.HttpPost] [System.Web.Http.AllowAnonymous] [ValidateAntiForgeryToken] [System.Web.Http.Route("api/Register")] public async Task<IHttpActionResult> Register(RegisterViewModell model) { // return Ok(model.AccountType); switch (model.AccountType) { case EAccountType.Patient: { Patient v = new Patient { UserName = (model.UserName), Email = model.Email, Address = model.Address, FirstName = model.FirstName, LastName = model.LastName, BirthDate = model.BirthDate, ImageName = model.ImageName, PhoneNumber = model.PhoneNumber, Gender = model.Gender, }; var results = await UserManager.CreateAsync(v, model.PasswordHash); if (results.Succeeded) { //result = await UserManager.AddToRoleAsync(user.Id, model.Cv); await SignInManager.SignInAsync(v, isPersistent: false, rememberBrowser: false); return Ok("Patient added !"); } } break; case EAccountType.Doctor: { Doctor res = new Doctor { UserName = model.UserName, Email = model.Email, Address = model.Address, FirstName = model.FirstName, LastName = model.LastName, BirthDate = model.BirthDate, ImageName = model.ImageName, PhoneNumber = model.PhoneNumber, Gender = model.Gender, Speciality = model.Speciality }; if (res.ImageName == null) { res.ImageName = "default-user-image.png"; } var results = await UserManager.CreateAsync(res, model.PasswordHash); if (results.Succeeded) { //result = await UserManager.AddToRoleAsync(user.Id, model.Cv); await SignInManager.SignInAsync(res, isPersistent: false, rememberBrowser: false); return Ok("Docteur added !"); } } break; } return Ok("Fail !"); } } } <file_sep>using Data.Infrastructure; using Domain; using Infrastructure; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.EspacePatient { public class ServiceProfil_Patient:Service<Patient>,IServiceProfil_Patient { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork uof = new UnitOfWork(dbf); public ServiceProfil_Patient():base(uof) { } } } <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using System.Text.RegularExpressions; namespace WebUI.Models.Doctolib { public class Rss { public string Link { get; set; } public string Title { get; set; } public string Description { get; set; } } }<file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class Ajout_des_tables_medicalPath_et_chats : DbMigration { public override void Up() { RenameColumn(table: "dbo.Chats", name: "doctor_Id", newName: "DoctorId"); RenameColumn(table: "dbo.Chats", name: "patient_Id", newName: "PatientId"); RenameIndex(table: "dbo.Chats", name: "IX_doctor_Id", newName: "IX_DoctorId"); RenameIndex(table: "dbo.Chats", name: "IX_patient_Id", newName: "IX_PatientId"); CreateTable( "dbo.MedicalPaths", c => new { PathId = c.String(nullable: false, maxLength: 128), RecommendedSpeciality = c.String(), ValidatedSteps = c.Int(nullable: false), Justification = c.String(), }) .PrimaryKey(t => t.PathId) .ForeignKey("dbo.AspNetUsers", t => t.PathId) .Index(t => t.PathId); CreateTable( "dbo.MedicalPathDoctors", c => new { MedicalPath_PathId = c.String(nullable: false, maxLength: 128), Doctor_Id = c.String(nullable: false, maxLength: 128), }) .PrimaryKey(t => new { t.MedicalPath_PathId, t.Doctor_Id }) .ForeignKey("dbo.MedicalPaths", t => t.MedicalPath_PathId, cascadeDelete: true) .ForeignKey("dbo.AspNetUsers", t => t.Doctor_Id, cascadeDelete: true) .Index(t => t.MedicalPath_PathId) .Index(t => t.Doctor_Id); AddColumn("dbo.Chats", "CreationDate", c => c.DateTime(nullable: false, precision: 7, storeType: "datetime2") ); DropColumn("dbo.AspNetUsers", "Insuranceid"); } public override void Down() { AddColumn("dbo.AspNetUsers", "Insuranceid", c => c.Int()); DropForeignKey("dbo.MedicalPaths", "PathId", "dbo.AspNetUsers"); DropForeignKey("dbo.MedicalPathDoctors", "Doctor_Id", "dbo.AspNetUsers"); DropForeignKey("dbo.MedicalPathDoctors", "MedicalPath_PathId", "dbo.MedicalPaths"); DropIndex("dbo.MedicalPathDoctors", new[] { "Doctor_Id" }); DropIndex("dbo.MedicalPathDoctors", new[] { "MedicalPath_PathId" }); DropIndex("dbo.MedicalPaths", new[] { "PathId" }); DropColumn("dbo.Chats", "CreationDate"); DropTable("dbo.MedicalPathDoctors"); DropTable("dbo.MedicalPaths"); RenameIndex(table: "dbo.Chats", name: "IX_PatientId", newName: "IX_patient_Id"); RenameIndex(table: "dbo.Chats", name: "IX_DoctorId", newName: "IX_doctor_Id"); RenameColumn(table: "dbo.Chats", name: "PatientId", newName: "patient_Id"); RenameColumn(table: "dbo.Chats", name: "DoctorId", newName: "doctor_Id"); } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Data.Infrastructure; using Infrastructure; using Microsoft.AspNet.Identity.EntityFramework; namespace Service { public class ServiceUser : Service<User>, IServiceUser { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork utwk = new UnitOfWork(dbf); public ServiceUser(IUnitOfWork utwk) : base(utwk) { } public bool checkUserByRole(User us) { return false; } public void addRoleToUser(User u) { } } } <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; using System.Text.RegularExpressions; namespace WebUI.Models.Doctolib { public class RssReader { private static string _blogURL = "http://www.castries.fr/index.php/outils/rss?idpage=23&idmetacontenu="; public static IEnumerable<Rss> GetRssFeed() { XDocument feedXml = XDocument.Load(_blogURL); var feeds = from feed in feedXml.Descendants("item") select new Rss { Title = feed.Element("title").Value, Link = feed.Element("link").Value, Description = Regex.Match(feed.Element("description").Value, @"^.{1,180}\b(?<!\s)").Value, }; return feeds; } } }<file_sep>using Data; using Domain; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.Owin; using Microsoft.Owin.Security.Cookies; using Owin; using static Service.Startup; [assembly: OwinStartupAttribute(typeof(WebUI.Startup))] namespace WebUI { public partial class Startup { public void Configuration(IAppBuilder app) { // ConfigureAuth(app); OwinInit(app); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login") }); // Uncomment the following lines to enable logging in with third party login providers //app.UseMicrosoftAccountAuthentication( // clientId: "", // clientSecret: ""); //app.UseTwitterAuthentication( // consumerKey: "", // consumerSecret: ""); //app.UseFacebookAuthentication( // appId: "", // appSecret: ""); //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() //{ // ClientId = "", // ClientSecret = "" //}); //AddUsersAndRoles(); } private void AddUsersAndRoles() { PiContext context = new PiContext(); var UserManager = new UserManager<User>(new UserStore<User>(context)); var RoleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context)); if (!RoleManager.RoleExists("Doctor")) { var roleresult = RoleManager.Create(new IdentityRole("Doctor")); } if (!RoleManager.RoleExists("Patient")) { var roleresult = RoleManager.Create(new IdentityRole("Patient")); } if (!RoleManager.RoleExists("Admin")) { var roleresult = RoleManager.Create(new IdentityRole("Admin")); } var user = new User { UserName = "admin", Email = "<EMAIL>" }; string pwd = "<PASSWORD>$"; var adminResult = UserManager.Create(user, pwd); if (adminResult.Succeeded) { UserManager.AddToRole(user.Id, "Admin"); } } } } <file_sep>using Microsoft.AspNet.Identity.EntityFramework; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public enum Gender { Male, Female } public enum EAccountType { Patient, Doctor, Administrator } public class User : IdentityUser { // public int? UserId { get; set; } public String FirstName { get; set; } public String LastName { get; set; } [DataType(DataType.Date)] public DateTime BirthDate { get; set; } public String Address { get; set; } public Gender? Gender { get; set; } public String ImageName { get; set; } } } <file_sep>using Microsoft.AspNet.Identity.EntityFramework; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace WebUI.Models.Analytics { public enum Gender { male, female } public enum EAccountType { Patient, Doctor, Administrator } public enum SpecialityEnum { Cardiologist, Dentist, Dermatologist, Gastroenterologist, General, Gynecologist, Pediatrician, Therapist } public class UserModel : IdentityUser { public String FirstName { get; set; } public String LastName { get; set; } [DataType(DataType.Date)] public DateTime BirthDate { get; set; } public String Address { get; set; } public String ImageName { get; set; } public Gender? Gender { get; set; } public SpecialityEnum Speciality { get; set; } } }<file_sep>using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class Commentaire { [Key] public int IdCommentaire { get; set; } public String LaCommentaire { get; set; } public Question Question { get; set; } } } <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public enum SpecialityEnum { Cardiologist, Dentist, Dermatologist, Gastroenterologist, Generalist, Gynecologist, Neurologist, Ophthalmologist, Pediatrician, Therapist }; public class Doctor : User { public SpecialityEnum Speciality { get; set; } public virtual ICollection<MedicalPath> MedicalPaths { get; set; } public virtual ICollection<Chat> Conversations { get; set; } public virtual ICollection<Appointment> Appointments { get; set; } } } <file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class Modif_repport : DbMigration { public override void Up() { DropIndex("dbo.Repports", new[] { "doctor_Id" }); AddColumn("dbo.Repports", "RepportName", c => c.String()); AddColumn("dbo.Repports", "RepportDate", c => c.DateTime(nullable: false, precision: 7, storeType: "datetime2", defaultValue: DateTime.Now)); AddColumn("dbo.Repports", "PatientName", c => c.String()); AddColumn("dbo.Repports", "DiseaseDeclared", c => c.String()); AddColumn("dbo.Repports", "Symptoms", c => c.String()); AddColumn("dbo.Repports", "Abnormalities", c => c.String()); AddColumn("dbo.Repports", "ImageDisease", c => c.String()); AddColumn("dbo.Repports", "RepportContent", c => c.String()); AddColumn("dbo.Repports", "Diagnostic", c => c.String()); AddColumn("dbo.Repports", "ReferentDoctor", c => c.String()); CreateIndex("dbo.Repports", "Doctor_Id"); DropColumn("dbo.Repports", "ReppotName"); } public override void Down() { AddColumn("dbo.Repports", "ReppotName", c => c.String()); DropIndex("dbo.Repports", new[] { "Doctor_Id" }); DropColumn("dbo.Repports", "ReferentDoctor"); DropColumn("dbo.Repports", "Diagnostic"); DropColumn("dbo.Repports", "RepportContent"); DropColumn("dbo.Repports", "ImageDisease"); DropColumn("dbo.Repports", "Abnormalities"); DropColumn("dbo.Repports", "Symptoms"); DropColumn("dbo.Repports", "DiseaseDeclared"); DropColumn("dbo.Repports", "PatientName"); DropColumn("dbo.Repports", "RepportDate"); DropColumn("dbo.Repports", "RepportName"); CreateIndex("dbo.Repports", "doctor_Id"); } } } <file_sep>using Domain; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.EspaceMedecin { public interface IServiceMedecin : IService<Doctor> { IEnumerable<Doctor> getDoctorByUserName(string username); IEnumerable<Doctor> getDoctorById(string id); //void editDoctor(Doctor d); } } <file_sep>using Data.Infrastructure; using Domain; using Infrastructure; using ServicePattern; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.Analytics { public class ServiceDashboard3 : Service<Appointment>, IServiceDashboard3 { static IDatabaseFactory dbf = new DatabaseFactory(); static IUnitOfWork uow = new UnitOfWork(dbf); public ServiceDashboard3() : base(uow) { } public IEnumerable<Appointment> getAllAppointments() { return GetMany(); } public IEnumerable<Appointment> getAllAppointmentsByDoctor(string doctorId) { return GetMany(a => a.DoctorId == doctorId); } } } <file_sep>using Data; using Domain; using Service.EspaceMedecin; using System; using System.Collections.Generic; using System.Data.Entity; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; namespace WebUI.Controllers.EspaceMedecin { public class MedecinDashController : Controller { ServiceMedecin sm = new ServiceMedecin(); // GET: MedecinDash public ActionResult DashboardMedecin() { var medecin = sm.getDoctorByUserName(AccountController.UserCoUserName); return View(medecin); } public ActionResult Delete(int id) { return View(); } // POST: Medecin/Delete/5 [HttpPost] public ActionResult Delete(string id, FormCollection collection) { try { // TODO: Add delete logic here var req = sm.GetMany().Where(a => a.Id.Equals(id)).FirstOrDefault(); sm.Delete(req); sm.Commit(); return RedirectToAction("Index","Home"); } catch { return View(); } } public ActionResult Edit(String id) { var doctor = sm.GetById(id); return View(doctor); } PiContext pi = new PiContext(); [HttpPost] public ActionResult Edit([Bind(Include = "Id,Email,SecurityStamp,PhoneNumber, LockoutEndDateUtc,AccessFailedCount,UserName, FirstName,LastName,birthDate,Address,ImageName,Gender,Speciality")] Doctor d, HttpPostedFileBase Image) { //Doctor do= new Doctor(); // TODO: Add update logic here if (ModelState.IsValid) { String fileName = Path.GetFileName(Image.FileName); d.ImageName = fileName; var doctor = sm.GetMany().Single(em => em.Id == d.Id); d.PasswordHash = <PASSWORD>.<PASSWORD>; d.SecurityStamp = doctor.SecurityStamp; pi.Entry(d).State = EntityState.Modified; pi.SaveChanges(); return RedirectToAction("DashboardMedecin"); } // return RedirectToAction("Index"); return View(d); } } }<file_sep>using System; using System.Collections.Generic; using System.Data.Entity.ModelConfiguration; using System.Linq; using System.Text; using Domain; using System.Threading.Tasks; namespace Data.Configurations { class CourseConfig : EntityTypeConfiguration<Domain.Course> { public CourseConfig() { //One to Many /* WithMany(pr => pr.Visits) .HasForeignKey(d => d.CourseId) .WillCascadeOnDelete(false);*/ } } } <file_sep>using Service.Analytics; using Service.EspaceMedecin; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace WebUI.Controllers.Analytics { public class DashboardController : Controller { // GET: Dashboard IServiceDashboard sd = new ServiceDashboard(); IServiceDashboard2 sd2 = new ServiceDashboard2(); IServiceDashboard3 sd3 = new ServiceDashboard3(); // GET: Index public ActionResult Index() { var medecin = sd.getDoctorByName(AccountController.UserCoUserName); var listAppointments = sd3.getAllAppointmentsByDoctor(medecin.Id); List<double> nberAppointments = new List<double>(); double nberAppointmentsCanceled = new double(); var appointment_states = listAppointments.Select(a => a.AppointmentState).Distinct(); var appointment_statesInString = new List<string>(); foreach (var item in appointment_states) { appointment_statesInString.Add(item.ToString()); } foreach (var item in appointment_states) { //nberAppointments.Add(((listAppointments.Count(x => x.AppointmentState == item))*100/listAppointments.Count())); double res = (listAppointments.Count(x => x.AppointmentState == item)) * 100 / listAppointments.Count(); double nber = Math.Round(res, 1); nberAppointments.Add(nber); if (item == Domain.StateEnum.Cancelled) nberAppointmentsCanceled = nber; } var finalRepartitionsByAppointment = nberAppointments; ViewBag.STATES = appointment_statesInString; ViewBag.REPARTITIONS = finalRepartitionsByAppointment.ToList(); ViewBag.CANCELED = nberAppointmentsCanceled; return View(medecin); } public ActionResult PatientTreated() { var medecin = sd.getDoctorByName(AccountController.UserCoUserName); var listPatients = sd2.getAllPatientsTreatedByDoctor(medecin.Id); var listMonths = sd3.getAllAppointmentsByDoctor(medecin.Id).GroupBy(a => a.Date.Month.ToString()); List<int> nberAppointments = new List<int>(); var appointment_monthInString = new List<string>(); foreach (var item in listMonths) { appointment_monthInString.Add(item.ToString()); } foreach (var item in listMonths) { nberAppointments.Add(listMonths.Count(x => x.Any() == item.Any())); } var finalRepartitionsByAppointment = nberAppointments; var nbrePT = listPatients.Count(); ViewBag.MONTHS = appointment_monthInString; ViewBag.NBERPATIENT = nbrePT; ViewBag.REPARTITION = finalRepartitionsByAppointment.ToList(); return View(); } // GET: Dashboard/Details/5 public ActionResult Details(int id) { return View(); } // GET: Dashboard/Create public ActionResult Create() { return View(); } // POST: Dashboard/Create [HttpPost] public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here return RedirectToAction("Index"); } catch { return View(); } } // GET: Dashboard/Edit/5 public ActionResult Edit(int id) { return View(); } // POST: Dashboard/Edit/5 [HttpPost] public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here return RedirectToAction("Index"); } catch { return View(); } } // GET: Dashboard/Delete/5 public ActionResult Delete(int id) { return View(); } // POST: Dashboard/Delete/5 [HttpPost] public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here return RedirectToAction("Index"); } catch { return View(); } } } } <file_sep>using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public enum StateEnum { Cancelled, In_Progress, Completed, Postponed }; public class Appointment { public int AppointmentId { get; set; } [DataType(DataType.Date)] public DateTime Date { get; set; } public string Location { get; set; } public StateEnum AppointmentState { get; set; } public SpecialityEnum Specialities { get; set; } public virtual Doctor Doctor { get; set; } public string DoctorId { get; set; } public virtual Patient Patient { get; set; } public string PatientId { get; set; } } } <file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class Suppression_DBSets_inutiles : DbMigration { public override void Up() { DropForeignKey("dbo.Appointments", "course_CourseId", "dbo.Courses"); DropForeignKey("dbo.AspNetUsers", "course_CourseId", "dbo.Courses"); DropForeignKey("dbo.Messages", "chat_ChatId", "dbo.Chats"); DropForeignKey("dbo.Debreifs", "appointment_AppointmentId", "dbo.Appointments"); DropForeignKey("dbo.Repports", "course_CourseId", "dbo.Courses"); DropIndex("dbo.AspNetUsers", new[] { "course_CourseId" }); DropIndex("dbo.Appointments", new[] { "course_CourseId" }); DropIndex("dbo.Messages", new[] { "chat_ChatId" }); DropIndex("dbo.Debreifs", new[] { "appointment_AppointmentId" }); DropIndex("dbo.Repports", new[] { "course_CourseId" }); DropColumn("dbo.AspNetUsers", "course_CourseId"); DropColumn("dbo.Appointments", "course_CourseId"); DropColumn("dbo.Repports", "course_CourseId"); DropTable("dbo.Courses"); DropTable("dbo.Messages"); DropTable("dbo.Debreifs"); } public override void Down() { CreateTable( "dbo.Debreifs", c => new { DebreifId = c.Int(nullable: false, identity: true), FinalDisease = c.String(), Description = c.String(), appointment_AppointmentId = c.Int(), }) .PrimaryKey(t => t.DebreifId); CreateTable( "dbo.Messages", c => new { MessageId = c.Int(nullable: false, identity: true), Content = c.String(), sender = c.Int(nullable: false), receiver = c.Int(nullable: false), chat_ChatId = c.Int(), }) .PrimaryKey(t => t.MessageId); CreateTable( "dbo.Courses", c => new { CourseId = c.Int(nullable: false, identity: true), }) .PrimaryKey(t => t.CourseId); AddColumn("dbo.Repports", "course_CourseId", c => c.Int()); AddColumn("dbo.Appointments", "course_CourseId", c => c.Int()); AddColumn("dbo.AspNetUsers", "course_CourseId", c => c.Int()); CreateIndex("dbo.Repports", "course_CourseId"); CreateIndex("dbo.Debreifs", "appointment_AppointmentId"); CreateIndex("dbo.Messages", "chat_ChatId"); CreateIndex("dbo.Appointments", "course_CourseId"); CreateIndex("dbo.AspNetUsers", "course_CourseId"); AddForeignKey("dbo.Repports", "course_CourseId", "dbo.Courses", "CourseId"); AddForeignKey("dbo.Debreifs", "appointment_AppointmentId", "dbo.Appointments", "AppointmentId"); AddForeignKey("dbo.Messages", "chat_ChatId", "dbo.Chats", "ChatId"); AddForeignKey("dbo.AspNetUsers", "course_CourseId", "dbo.Courses", "CourseId"); AddForeignKey("dbo.Appointments", "course_CourseId", "dbo.Courses", "CourseId"); } } } <file_sep>using Domain; using ServicePattern; using Infrastructure; using Data.Infrastructure; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service { class ServiceDoctor: Service<Doctor>,IserviceDoctor { static IDatabaseFactory dbf = new DatabaseFactory(); //IRepositoryBase<Product> rps = new RepositoryBase<Product>(dbf); static IUnitOfWork uow = new UnitOfWork(dbf); public ServiceDoctor() : base(uow) { } } } <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Domain { public class Patient : User { //public int Insuranceid { get; set; } //public virtual Course course { get; set; } public virtual ICollection<Chat> Conversations { get; set; } public virtual ICollection<Appointment> Appointments { get; set; } public virtual MedicalPath MedicalPath { get; set; } public int Poids { get; set; } public int Taille { get; set; } public int Age { get; set; } public String Traitements { get; set; } } } <file_sep>namespace Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class modifClassPatient : DbMigration { public override void Up() { AddColumn("dbo.AspNetUsers", "Poids", c => c.Int()); AddColumn("dbo.AspNetUsers", "Taille", c => c.Int()); AddColumn("dbo.AspNetUsers", "Age", c => c.Int()); AddColumn("dbo.AspNetUsers", "Traitements", c => c.String()); } public override void Down() { DropColumn("dbo.AspNetUsers", "Traitements"); DropColumn("dbo.AspNetUsers", "Age"); DropColumn("dbo.AspNetUsers", "Taille"); DropColumn("dbo.AspNetUsers", "Poids"); } } }
d7fe7d9a8f18ea1bf7a626ba68576d4f672661a4
[ "C#" ]
59
C#
AzzaMaalej/PIDEVEpione
43681566d921ee1926bee7876ee17fffd52a0616
a2a22dd57f5c6bc741ee8357c7203170aece6224
refs/heads/master
<file_sep>from vehicle import Vehicle class Car(Vehicle): def __init__(self, ccm =0, top_speed = 0, is_running = False): super().__init__(ccm, top_speed) self.is_running = is_running def start_engine(self): self.is_running = True def stop_engine(self): self.is_running = False <file_sep>import csv import sys from person import Person def open_csv(file_name): result_list = [] with open(file_name, 'r') as fileka: data = csv.reader(fileka) for line in data: name,phonenumber = line.split(",") result_list.append(Person(name,phonenumber)) return result_list def get_csv_file_name(argv_list): return argv_list[1:] def format_output(person): return 'This number belongs to: ' + person._name def get_person_by_phone_number(person_list, user_input_phone_number): for personka in person_list: if personka._phonenumber == user_input_phone_number: return personka return None def main(): file_name = get_csv_file_name(sys.argv) if file_name is None: print('No database file was given.') sys.exit(0) person_list = open_csv(file_name) user_input_phone_number = input('Please enter the phone number: ') match_person = get_person_by_phone_number(person_list, user_input_phone_number) print(format_output(match_person)) if __name__ == '__main__': main() <file_sep>class Person(): _name = None _phone_number = None def __init__(self, name, phone_number): self._name = name self._phone_number = phone_number def is_phone_number_matching(self, input_phone_number): if input_phone_number == self._phone_number: return True return False def get_name(self): return self._name @staticmethod def normalize_phone_number(phone_number): result = "" for num in range(len(phone_number)): if phone_number[num] != "-" or phone_number[num]!= " ": result += phone_number[num] return result <file_sep>class Vehicle(): def __init__(self, ccm = 0 , top_speed = 0): self.ccm = ccm self.top_speed = top_speed<file_sep>from vehicle import Vehicle class Truck(Vehicle): def __init__(self, ccm = 0, top_speed = 0, carry_limit =0, current_carriage_weight = None): super().__init__(ccm,top_speed) self.carry_limit = carry_limit self.current_carriage_weight = current_carriage_weight def has_carriage(self): return self.current_carriage_weight != None def attach_carriage(self, weight): if weight > self.carry_limit: return False else: return True def detach_carriage(self): self.current_carriage_weight = None
53c739314805f286165e67024b8085b91cad3f89
[ "Python" ]
5
Python
CodecoolMSC2016/python-pair-prgramming-exercises-4th-tw-cs-t
bea59a7e6d1c4aba37b9b09d945919bd55c61cb2
f6f379d912e443c76cde41d2d5dfe93c57bbbdd0