Added support STM32G0 Series #2
@@ -1,8 +1,16 @@
|
||||
#ifndef DSMAX7219_H
|
||||
#define DSMAX7219_H
|
||||
|
||||
#include "stm32f0xx_hal.h"
|
||||
#include <stdbool.h>
|
||||
#ifdef STM32G030xx
|
||||
#include "stm32g0xx_hal.h"
|
||||
#endif
|
||||
|
||||
#ifdef STM32F030xx
|
||||
#include "stm32f0xx_hal.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef struct DS_MAX7219
|
||||
{
|
||||
|
||||
@@ -24,10 +24,6 @@ void DS_MAX7219_Init(DS_MAX7219* Display, SPI_HandleTypeDef* SPI, GPIO_TypeDef*
|
||||
|
||||
void DS_MAX7219_Print(DS_MAX7219* Display, int64_t Number)
|
||||
{
|
||||
|
||||
//sprintf(Display->DisplayData, "%lld", Number);
|
||||
|
||||
|
||||
if (Number<0)
|
||||
{
|
||||
Display->DisplayData[0] = '-';
|
||||
@@ -171,7 +167,7 @@ void DS_MAX7219_UpdataDisplay(DS_MAX7219 *Display)
|
||||
for (uint8_t i = 0; i < 8; i++)
|
||||
{
|
||||
HAL_GPIO_WritePin(Display->Port_CS, Display->Pin_CS, GPIO_PIN_RESET);
|
||||
uint16_t Data = (i+1<<8) + __DS_MAX7219_ConvertSymbol(Display->DisplayData[7-i]);
|
||||
uint16_t Data = ((i+1)<<8) + __DS_MAX7219_ConvertSymbol(Display->DisplayData[7-i]);
|
||||
HAL_SPI_Transmit(Display->SPI, (uint8_t*) &Data, 1, 100);
|
||||
HAL_GPIO_WritePin(Display->Port_CS, Display->Pin_CS, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user