Commit a2d3790d authored by 张泽仁's avatar 张泽仁

organize project

parent 9ce0beba
This diff is collapsed.
CC = gcc
TARGET = main
LDFLAGS = -lwiringPi
SRCS = main.c interface.c
HDRS = interface.h LocalDimmingLedData.h
$(TARGET): $(SRCS) $(HEADERS)
$(CC) -o $(TARGET) $(SRCS) $(LDFLAGS)
\ No newline at end of file
This diff is collapsed.
#ifndef __INTERFACE__H
#define __INTERFACE__H
extern void LocalDimming_Init();
extern void setGpioLevel(int num, int level);
extern int SPI_Transfer(const char *pu8TxBuf, char *pu8RxBuf, int i32len);
extern int AW20144_Byte_Write(int i32ChipSelect, char u8Page, char u8Addr, char u8Val);
extern void resetPwm();
extern void setPwmtomax();
extern void eachPicWrite(int num, int pic);
int xfm_Init();
void protocalAck(int fileusb);
uint16_t getAngle(char *rece);
uint16_t CrcValueCalc(const uint8_t *cpucData, uint16_t usLength);
void sentUart(char *buf, int fileuart);
void circleReading();
typedef void(*audio_event_cb_t)(void *user_ctx, int id);
void audio_set_callback(audio_event_cb_t cb, void *user_ctx);
#endif
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/spi/spidev.h>
#include <stdint.h>
#include <wiringPi.h>
#include <string.h>
#include "interface.h"
//#include "LocalDimmingLedData.h"
#define SPI_DEVICE "/dev/spidev0.0" // SPI设备文件路径
int main()
{
LocalDimming_Init();
//setPwmtomax();
//resetPwm();
/*
printf("input num:\n");
int num;
int pic;
scanf(" %d", &num);
scanf("%d", &pic);
*/
resetPwm();
int ch;
scanf("%d", &ch);
if (ch)
{
setPwmtomax();
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment