Code Monkey home page Code Monkey logo

audioamp_4_click's Introduction

MikroE


AudioAmp_4 Click

  • CIC Prefix : AUDIOAMP4
  • Author : Nemanja Medakovic
  • Verison : 1.0.0
  • Date : Nov 2018.

Software Support

We provide a library for the AudioAmp_4 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Library Description

The library performs a audio control and works as audio amplifier. Possible commands are to turn ON or OFF the output (speaker) and to set the output volume by selecting the desired channel. For more details check documentation.

Key functions :

  • T_AUDIOAMP4_RETVAL audioamp4_setChannel( uint8_t channel ) - Function performs a volume channel selection.
  • T_AUDIOAMP4_RETVAL audioamp4_shutdown( uint8_t state ) - Function turns shutdown to ON or OFF state.

Examples Description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes GPIO interface, turns shutdown OFF and performs a volume channel 3 selection.
  • Application Task - (code snippet) - Checks which command is sent from uart and performs a determined command. Note : Possible commands are:
  • Shutdown OFF
  • Shutdown ON l Legend 0-7 Volume channel selection
void applicationTask()
{
    rxDat = UART_Rdy_Ptr();

    if (rxDat != _NO_RECEIVED_DATA)
    {
        rxDat = UART_Rd_Ptr();

        if (rxDat == '+')
        {
            audioamp4_shutdown( _AUDIOAMP4_SHUTDOWN_OFF );

            mikrobus_logWrite( "* Shutdown OFF *", _LOG_LINE );
        }
        else if (rxDat == '-')
        {
            audioamp4_shutdown( _AUDIOAMP4_SHUTDOWN_ON );

            mikrobus_logWrite( "* Shutdown ON *", _LOG_LINE );
        }
        else if (rxDat == 'l')
        {
            writeLegend();
        }
        else
        {
            channSel = rxDat - '0';
            responseCheck = audioamp4_setChannel( channSel );

            checkResponse();
        }
    }
}

Additional Functions :

  • void checkResponse() - Checks is channel selection parametar valid or not.
  • void writeLegend() - Writes the all possible commands on uart.

The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.



audioamp_4_click's People

Contributors

kacaperendic avatar

Watchers

 avatar  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.