Code Monkey home page Code Monkey logo

ifx9021_driver's Introduction

IFX9021_Driver

A simple spi interface for the IFX9021 motor driver chip by infenion

Datasheet

https://octopart.com/datasheet/ifx9201sgauma1-infineon-57372547

Setup

Connect the spi pins on the IFX9021 to the ESP32. The default pins are as follows:

ESP32 Common Name IFX9021 Name IFX9021 Pin #
3.3V VCC VSO 2
GND GND GND 6
14 SCK SCK 10
13 MOSI SI 8
12 MISO SO 3
15 CS CSN 9

!!Remember to also connect the ship to its supply voltage to pin 4, 12V in this case.

The ESP32 pins can be changed. Multiple chips can be used, each gets its own CS pin.

Usage

Put the data to send into a byte variable and call the spiCommand function. The function takes the spi handle (fancy name for the network name), the data to send, and the CS pin as arguments:

byte data = 0x12; spiCommand(hspi, data, HSPI_CS);

the return of spiCommand is the data received in response from the chip.

The IFX9021 can be daisy chained, such the CS pin can be used to select which chip to send data to.

The chip transmits MSB first

ifx9021_driver's People

Contributors

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