Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 10 months ago.
Library Creation
I'm new to C library creation, so I thought I'd work on a simple one to learn. I was able to get an SPI LCD working with a normal project so I then thought to move the initialization and control codes into a library to clean up the main file. Below are my CPP and H files and the references I used to create my code. I suspect my errors stem from the first one and once it's fixed the others will fall out quickly.
References:
- https://developer.mbed.org/cookbook/Writing-a-Library
- https://developer.mbed.org/users/screamer/code/mbed/file/aff670d0d510/SPI.h
- https://developer.mbed.org/forum/mbed/topic/607/?page=1#comment-3058
- /mbed.bld/Classes/SPI.doc;
Errors:
- Error: No instance of constructor "mbed::SPI::SPI" matches the argument list in "SPI-LCD.cpp", Line: 8, Col: 80
- Error: No instance of constructor "mbed::SPI::SPI" matches the argument list in "SPI-LCD.cpp", Line: 8, Col: 93
- Error: No instance of constructor "mbed::SPI::SPI" matches the argument list in "SPI-LCD.cpp", Line: 8, Col: 106
- Error: No default constructor exists for class "mbed::DigitalOut" in "SPI-LCD.cpp", Line: 8, Col: 113
- Error: Expected a "{" in "SPI-LCD.cpp", Line: 8, Col: 113
- Error: Class "mbed::SPILCD" has no member "init" in "SPI-LCD.cpp", Line: 15, Col: 10
- Error: Explicit type is missing ("int" assumed) in "SPI-LCD.cpp", Line: 15, Col: 2
- Warning: Missing return statement at end of non-void function "mbed::SPILCD::init" in "SPI-LCD.cpp", Line: 17, Col: 2
- Info: Unable to download. Fix the reported errors...
Code:
https://developer.mbed.org/users/Me/code/NHD_SPI_LCD_LIB/