Code Monkey home page Code Monkey logo

rtems_rpi_testing's Introduction

RTEMS_rpi_testing

Test cases and drivers for the Raspberry Pi BSP on RTEMS. Also includes test cases for the RTEMS GPIO API.

Documentation from 2015 GSOC can be found in https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card

Documentation from 2014 GSOC can be found in https://devel.rtems.org/wiki/GSoC/2013/Raspberry_Pi_BSP_Peripherals

GPIO - Test cases for the RTEMS GPIO API.

SPI_bus - Test cases for the Raspberry Pi SPI bus including device drivers.

I2C_bus - Test cases for the Raspberry Pi I2C bus including device drivers.

rtems_rpi_testing's People

Contributors

asuol avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

hermixy magnate3

rtems_rpi_testing's Issues

SPI device driver

Hi, I'm working with your SPI device driver but for the MCP4822 component, and it's not working.
There isn't any compiler or run-time errors, but it seems that the MCP4822 doesn't receive data.
This is the edited code of the driver:

`static rtems_libi2c_tfr_mode_t tfr_mode = {
  .baudrate = 20000000,
  .bits_per_char = 8,
  .lsb_first = FALSE,
  .clock_inv = TRUE,
  .clock_phs = FALSE
};

static rtems_status_code spi_mcp4822_write(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
) {
	rtems_status_code sc = RTEMS_SUCCESSFUL;
	rtems_libio_rw_args_t *rwargs = arg;
	int cnt = rwargs -> count;
	unsigned char *buf = (unsigned char *) rwargs -> buffer;
	/*send start*/
	sc = rtems_libi2c_send_start(minor);
	if(sc<0){
		printf("send start error \n");
		fflush(stdout);
		return sc;
	}else{
		printf("start sended \n");
		fflush(stdout);
	}
	/* ioctl*/
	sc = rtems_libi2c_ioctl(minor, RTEMS_LIBI2C_IOCTL_SET_TFRMODE, &tfr_mode);
	 if ( sc != RTEMS_SUCCESSFUL ) {
		printf("ioctl error \n");
		fflush(stdout);
	    return sc;
	 }else{
		printf("ioctl setted \n");
		fflush(stdout);
	 }
	/*send addr*/
	sc = rtems_libi2c_send_addr(minor, FALSE);
      if ( sc != RTEMS_SUCCESSFUL ) {
          printf("send address error \n");
	  fflush(stdout);
         return sc;
      }else{
         printf("address sended \n");
	 fflush(stdout);
    }

	/*write bytes*/
	int data_sent_cnt = rtems_libi2c_write_bytes(minor, buf, cnt);
    if (data_sent_cnt < 0) {
	  printf("write bytes error \n");
	  fflush(stdout);
          return RTEMS_IO_ERROR;
    }else{
          printf("wrote %d bytes \n", data_sent_cnt);
          fflush(stdout);
    }
	/*send stop*/
    sc = rtems_libi2c_send_stop(minor);
    if ( sc != RTEMS_SUCCESSFUL ) {
	  printf("send stop error \n");
	  fflush(stdout);
         return sc;
    }else{
	printf("stop sended \n");
	fflush(stdout);
    }
	return RTEMS_SUCCESSFUL;
}

/*read not used, data cannot be read from mcp4822 */
static rtems_status_code spi_mcp4822_read(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
) {
  rtems_status_code sc = RTEMS_SUCCESSFUL;
  return sc;
};
...`

rtems_status_code spi_mcp4822_read is empty because the MCP4822 can't be read.

I read the issue about the I2C device driver, and I understand that the libi2c is deprecated

I'm working with RTEMS v5.1 and I see that they add the SPI framework: https://git.rtems.org/rtems/commit/?h=5&id=a42be52bbf2b3a549d4b9635a5a93215dacd0657.
Do you have any advice?

Thank you in advice for your help

I2C device driver

Hi, first of all, thank you for setting up this repository and your blog posts, they are really helpful.
I'm trying to work with your I2C device driver, although I'm actually working with an MCP3425.

I read in your README that "The device driver is to be put in the libchip/I2C RTEMS directory, and must also be referred in the libchip Makefile.".

I'm working with RTEMS v5.1 and in my RTEMS host environment, I installed the raspberrypi2 BSP. Therefore, I have a directory arm-rtems5/raspberrypi2/lib/include/libchip, but inside I can find neither an i2c/ directory nor a Makefile.

Probably things have changed a bit since you wrote your README, but maybe you have some suggestion on this? And, in general, why is it necessary to do these operations? Could you elaborate a little bit on that or send me any useful reference?

Thanks in advance for your help!

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.