Join a font in a main.C
Hi everybody,
After several attempts, I cannot correctly declare my variables in the files. I'm a little lost with file declarations to reach certain variables delcared elsewhere
This is why I decided to come and ask for help.
I 'm actually work on a screen with st7567 driver.
For that I have create à font.h to stock some font : like this
// Character bitmaps for Microsoft Sans Serif 10pt
const uint8_t microsoftSansSerif_10pt[] =
{
// @0 '!' (1 pixels wide)
// #
// #
// #
// #
// #
// #
// #
// #
//
// #
0xFF,
0x02,
// @2 '"' (3 pixels wide)
// # #
// # #
// # #
// # #
0x0F, 0x00, 0x0F,
after I have create a driver to communciate with the st7567 driver.
I have call this files st7567_driver.h and st7567_driver.c .
In the st7567_driver.c I declared file like this :
/**************************************************************************************
* Included Files
**************************************************************************************/
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "stm32l031xx.h"
#include "main.h"
#include "st7567_driver.h"
#include "font.h"
extern SPI_HandleTypeDef hspi1; // Je mets extern pour signifier que la déclaration de la fonction est ailleurs ( dans le main.c)
Now the problem begin because I'm A noob :
In my main.c , I would like to use a function which sends the name of the font to use.
Draw_text(0,0,'K', µsoftSansSerif_10pt);
microsoftSansSerif_10pt is the name of my font in the font.h
But the comoler send me an error :
../Core/Src/main.c:110:23: error: 'microsoftSansSerif_10pt' undeclared (first use in this function)
I tried several ways to do it with the words "extern" to declare antoher file etc...
I also read the documentation, but I did not succeed in understanding the process.
IF someone who knows this subject well could guide me on how and where to declare the files that would be super nice.
Thank you vcery much
dje8269