Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Software Engineering Expert

Question 2:

You are a firmware engineer for a large project which is developing a new device which is capable of sorting fruit based on its precise colour.

You are responsible for developing the firmware for the front-end sensor. The only hitch is that the hardware is still under development and the electronics team haven't yet chosen the actual sensor that will he used.

However, they have narrowed it down to two different vendors. The electronics team have however told you that the sensor measures illuminance on three different channels, Red, Green, Blue, each with an 8 bit resolution.

A colour is defined by an tuple. They have also told you that the sensor will probably be interfaced over an SPI bus.

You have been given a pre-existing driver for the SPI bus, which has one relevant command, defined in Kspi..h>:
/* *
* brief Read from the SPI bus
* CT' param address= register address of SPI slave to read from
* @return= value of register
*/
uint8_t spi_read(uint8_t address);

The electronics team tell you that the Red channel is at address Ox01, Green at address 0)02 and Blue at address Ox03 i.e. if you call spi_read(0%.03) the value that will be returned is the intensity of the blue channel. They also tell you that a status register is found at address OxOO which should return 0x97 if the sensor is configured correctly, and this should probably be checked before reading a value from the colour sensor.

(a) Explain, with the aid of code examples where appropriate, how you would go about writing a driver for the colour sensor_ In particular, explain design decisions made in your API,. for example, how you decide to represent the 3-byte colour information.

(b) Discuss, with the aid of code examples where appropriate, how you would go about testing the colour driver without having the actual sensor to hand. Provide some sample tests that could be used to checkthe colour driver, and also higher level code which depends on the colour sensor.

(c) The electronics team tell you that the blue channel is too sensitive and its value should be divided by 2. Explain how you would modify your code and check that it is working correctly.

(d) The electronics team say they have identified a better sensor that they would like to use in the new version of the product. The only issue is that it communicates over an 12C bus, rather than SPI and the order of the Red and Green channels are swapped. You have a similar driver for the 12C bus which has the prototype:

uint82 i2cread(uint8t address);

Explain how you would modify and test your code such that your colour sensor driver would be able to support either the SPI or the I2C sensor, depending on the product version.

Software Engineering, Computer Science

  • Category:- Software Engineering
  • Reference No.:- M92724222
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in Software Engineering

In this assignment you will answer the following review

In this assignment, you will answer the following review questions from the reading materials of the module/week. 1. "What are the key components of a typical P2P application? Describe their functions." 2. "What are the ...

In this assignment you will answer the following questions

In this assignment, you will answer the following questions related to Android platform and Android security design. 1. Describe Android architecture in detail by explaining the four conceptual layers. 2. Describe Androi ...

Overviewyou are required to modify and logically extend

Overview You are required to modify and logically extend the functionality of a provided code base to implement a game. This requires you to modify the code base as well as create documentation and implement various user ...

Write reply to this article with references with apa

Write reply to this article with references with APA bibliography. Hate Crimes Over the past couple of years, hate crimes have been on the rise in America's largest cities. Studies show that there were sharp spikes in th ...

Instructionsprivacy-preserving data miningdata mining

INSTRUCTIONS PRIVACY-PRESERVING DATA MINING Data mining technology can be exploited to reveal sensitive information from the original data. Thus it is important to preservethe privacy of the parties that the data refer t ...

Write review on this article with apa formatgovernment

Write review on this article with APA format. Government surveillance is a major issue in the United States and globally. Surveillance refers to any collection and processing of personal data, whether, identifiable or no ...

Address the following integrating biblical perspectives

Address the following, integrating biblical perspectives where appropriate: Define a hate crime and describe how white supremacist groups use the Internet to spread their message of hate. Explain why hate crime legislati ...

Research projectin the course we have covered various

RESEARCH PROJECT In the course, we have covered various security and privacy issues that arise in the cyberspace field. We have learned to identify these risks and have discussed the current approaches and developments f ...

Reply to this article with apa referencehate crimes

Reply to this article with APA reference. Hate crimes According to Merriam-Webster, hate crime is any of various crimes (such as assault or defacement of property) when motivated by hostility to the victim as a member of ...

Proposaldesign of an efficient gps tracking system tag for

Proposal Design of an efficient GPS Tracking System (tag) for monitoring small species IMPLEMENTING EMBEDDED SYSTEMS USING SYSML Task Using PapyrusSysML Software (Downloadable online - Evaluation Copy- Latest Version) Mo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As