How do you approach a project if there's no library of a device available?

I know there are a lot of existing libraries, especially made for Arduinos since it really ease beginners to learn. However there are certain libraries that are only written for Arduinos and most of it are at least is a combination of C and C++, so running that library on a chip that only supports C is useless.

Arduino are good for prototyping, and even if I need to use it commercially with a smaller form-factor, I can redesign it since the schematic is available.

The problem is not on hardware, but software.

For example, MFRC522 is very famous and the library by miguelbalboa is the most robust for MFRC522, but only works for Arduino. If I were to port it to a say Atmel chip or Microchip chip, then portability becomes an issue.

MFRC522 is just an example and it's lucky enough to have a good library. What if I have a device that has no available library? How do you approach this problem?

Study the data sheet for the device carefully, and write code that configures it to do what you want.

The end result will probably be more compact and efficient than any provided library; you will understand it, and have learned a lot in the process.

cyberjupiter:
only written for Arduinos and most of it are at least is a combination of C and C++, so running that library on a chip that only supports C is useless.

Microprocessors know nothing about whether the program was written in C or C++ or any other language. The compiler converts the code you write into code suitable for the selected microprocessor.

If you can get a C/C++ compiler that can produce code for the Atmel or Microchip processor that you want to use it is quite likely that the library code will work, or will work with a few changes.

If that does not work then what @jremington said is the way to go.

...R

only written for Arduinos and most of it are at least is a combination of C and C++, so running that library on a chip that only supports C is useless.

Okay that was indeed a silly statement.

Why is there no standard of what language to use? Why would anyone use C++ in such constrained environment anyway. The world would be much simpler if everyone uses C.

cyberjupiter:
Why is there no standard of what language to use? Why would anyone use C++ in such constrained environment anyway.

AFAIK the idea of C++ is to make life easier for the programmer. Does it any difference to the compiled code?

...R

The world would be much simpler if everyone uses C.

You misspelled FORTRAN. Or COBOL. Or any language that YOU don't know.