Code Monkey home page Code Monkey logo

cd74hc4067's Introduction

CD74HC4067

STM32 LL(Low Layer) library for the CD74HC4067 High Speed CMOS 16-Channel Analog Multiplexer/Demultiplexer.

Features

  • No HAL dependencies
  • Lightweight design
  • Easy to use

Trade-offs

  • Single GPIO port for all pins

image

Add as CPM project dependency

How to add CPM to the project, check the link

# For Clion STM32 plugin generated Cmake add
CPMAddPackage(
        NAME CD74HC4067
        GITHUB_REPOSITORY ximtech/CD74HC4067
        GIT_TAG origin/main)

include_directories(${CD74HC4067_DIRECTORY}) # add directory to project
file(GLOB_RECURSE SOURCES ${CD74HC4067_SOURCES}) # add source files

Wiring

  • image
  • image

Usage

LED with multiplexer

    Multiplexer *mux = initMultiplexer(GPIOA, MUX_S0_Pin, MUX_S1_Pin, MUX_S2_Pin, MUX_S3_Pin, MUX_ENABLE_Pin, MUX_SIGNAL_Pin);
    setEnableMultiplexer(mux, true);   // by default disabled

    while (1) {
        writeMultiplexer(mux, MUX_CHANNEL_0, MUX_HIGH);
        for (MultiplexerChannel i = MUX_CHANNEL_0; i < MUX_CHANNEL_15; i++) {
            LL_mDelay(100);
            writeMultiplexer(mux, i, MUX_LOW);
            writeMultiplexer(mux, i + 1, MUX_HIGH);
        }

        LL_mDelay(100);
        writeMultiplexer(mux, MUX_CHANNEL_15, MUX_LOW);
    }
}

Input data

    Multiplexer *mux = initMultiplexer(GPIOA, MUX_S0_Pin, MUX_S1_Pin, MUX_S2_Pin, MUX_S3_Pin, MUX_ENABLE_Pin, 0);
    setEnableMultiplexer(mux, true);
    setMultiplexerChannel(mux, MUX_CHANNEL_1); // select channel
    uint32_t adcValue = readADC();  // use signal value

cd74hc4067's People

Contributors

ximtech avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.