Giter VIP home page Giter VIP logo

mcblib's Introduction

MCBLib

Motion core library implements the Ingenia Motion Control Bus protocol.

Highlights

  • Develop for embedded devices, from low performance MCU to powerful MPU
  • Developed in C language
  • Designed to be integrated into RTOS

Requirements

The next elements are needed on the platform where this code is going to be added:

  • SPI interface
  • 1 General purpose input with interrupt capabilities
  • 2 General purpose outputs

Contribution guideline

HAL adaptation

This repository implements higher layers of the motion control bus. Users has to implement the required Hardware Abstraction Layer (HAL) / Board Support Layer (BSP) or any low layer drivers dependent on the platform.

In order to make the developer life easier, the next facilities has been added into the code:

  1. User application code just need to include mcb.h file and use the included API
  2. HAL adaptation can be done modifying the file mcb_usr.c (not recommended)
  3. HAL adaptation can be done directly on the user code (recommended)
  4. mcb_usr.h includes all the functions that should be implemented on the user low layers
  5. Description of each function is added inside mcb_usr.h

The recommended procedure to implement the HAL is:

  1. Include into the HAL file the mcb_usr.h header

  2. Implement the function from the mcb_usr.h

     ******************************************************************************
       File Name  : SPI.c
     
       Description: This file provides code for the configuration
        of the SPI instances.
     ******************************************************************************
     
     include "mcb_usr.h"
     
     
     ...
    
    
     void 
     Mcb_IntfSPITransfer(uint16_t u16Id, uint16_t* pu16In, uint16_t* pu16Out, uint16_t u16Sz)
     {
     	switch (u16Id)
     	{
     		case 0:
     			HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_RESET);
     			HAL_SPI_TransmitReceive_DMA(&hspi1, (uint8_t*) pu16In, (uint8_t*) pu16Out, u16Sz);
     			break;
     		default:
     			/* Nothing */
     			break;
     	}
     }
    

Who do I talk to?

This repository is maintained by Ingenia FW team.

mcblib's People

Contributors

jcastro-ingeniamc avatar javifercep avatar jperez-ingenia avatar josepcastro 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.