changed to m0+
This commit is contained in:
parent
478708e5d3
commit
e7860e218c
|
@ -41,7 +41,8 @@ SRC:=$(wildcard *.c)
|
|||
|
||||
# The CPU architecture (will be used for -mcpu)
|
||||
# for the LPC824, can we use "cortex-m0plus"?
|
||||
MCPU:=cortex-m0
|
||||
#MCPU:=cortex-m0
|
||||
MCPU:=cortex-m0plus
|
||||
|
||||
# Include directory for the system include files
|
||||
SYSINC:=../lpc_chip_82x/inc
|
||||
|
@ -120,6 +121,7 @@ all: $(DISNAME) $(HEXNAME) $(BINNAME)
|
|||
.PHONY: upload
|
||||
upload: $(DISNAME) $(HEXNAME) $(ELFNAME) $(BINNAME)
|
||||
#dd bs=1024 conv=nocreat,notrunc if=$(BINNAME) of="/media/$(shell echo $$USER)/CRP DISABLD/firmware.bin"
|
||||
../hex2lpc/hex2lpc -s 2 -f $(HEXNAME) -x
|
||||
$(SIZE) $(ELFNAME)
|
||||
|
||||
.PHONY: clean
|
||||
|
|
|
@ -35,25 +35,8 @@ void draw(u8g2_t *u8g2)
|
|||
{
|
||||
u8g2_SetFontMode(u8g2, 1); // Transparent
|
||||
u8g2_SetFontDirection(u8g2, 0);
|
||||
u8g2_SetFont(u8g2, u8g2_font_inb24_mf);
|
||||
u8g2_DrawStr(u8g2, 0, 30, "U");
|
||||
|
||||
u8g2_SetFontDirection(u8g2, 1);
|
||||
u8g2_SetFont(u8g2, u8g2_font_inb30_mn);
|
||||
u8g2_DrawStr(u8g2, 21,8,"8");
|
||||
|
||||
u8g2_SetFontDirection(u8g2, 0);
|
||||
u8g2_SetFont(u8g2, u8g2_font_inb24_mf);
|
||||
u8g2_DrawStr(u8g2, 51,30,"g");
|
||||
u8g2_DrawStr(u8g2, 67,30,"\xb2");
|
||||
|
||||
u8g2_DrawHLine(u8g2, 2, 35, 47);
|
||||
u8g2_DrawHLine(u8g2, 3, 36, 47);
|
||||
u8g2_DrawVLine(u8g2, 45, 32, 12);
|
||||
u8g2_DrawVLine(u8g2, 46, 33, 12);
|
||||
|
||||
u8g2_SetFont(u8g2, u8g2_font_4x6_tr);
|
||||
u8g2_DrawStr(u8g2, 1,54,"github.com/olikraus/u8g2");
|
||||
u8g2_SetFont(u8g2, u8g2_font_6x12_tr);
|
||||
u8g2_DrawStr(u8g2, 0, 20, "Hello World");
|
||||
}
|
||||
|
||||
/*=======================================================================*/
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include "u8x8.h"
|
||||
|
||||
/* although we use SW I2C, use the HW pins for later upgrade */
|
||||
#define I2C_CLOCK_PIN 10
|
||||
#define I2C_CLOCK_PIN 13
|
||||
#define I2C_CLOCK_PORT 0
|
||||
#define I2C_DATA_PIN 11
|
||||
#define I2C_DATA_PIN 17
|
||||
#define I2C_DATA_PORT 0
|
||||
|
||||
uint8_t u8x8_gpio_and_delay_lpc824(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
|
||||
|
@ -19,8 +19,8 @@ uint8_t u8x8_gpio_and_delay_lpc824(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, v
|
|||
case U8X8_MSG_GPIO_AND_DELAY_INIT:
|
||||
/* only support for software I2C*/
|
||||
|
||||
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO10, PIN_I2CMODE_GPIO); /* clk */
|
||||
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO11, PIN_I2CMODE_GPIO); /* data */
|
||||
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO13, PIN_MODE_PULLUP); /* clk */
|
||||
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO17, PIN_MODE_PULLUP); /* data */
|
||||
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, I2C_CLOCK_PORT, I2C_CLOCK_PIN);
|
||||
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, I2C_DATA_PORT, I2C_DATA_PIN);
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@ int __attribute__ ((noinline)) main(void)
|
|||
|
||||
for(;;)
|
||||
{
|
||||
Chip_GPIO_SetPinOutHigh(LPC_GPIO_PORT, 0, 15);
|
||||
delay_micro_seconds(1000000);
|
||||
//Chip_GPIO_SetPinOutHigh(LPC_GPIO_PORT, 0, 15);
|
||||
//delay_micro_seconds(1000000);
|
||||
|
||||
u8g2_FirstPage(&u8g2);
|
||||
do
|
||||
|
@ -100,7 +100,7 @@ int __attribute__ ((noinline)) main(void)
|
|||
draw(&u8g2);
|
||||
} while( u8g2_NextPage(&u8g2) );
|
||||
|
||||
Chip_GPIO_SetPinOutLow(LPC_GPIO_PORT, 0, 15);
|
||||
//Chip_GPIO_SetPinOutLow(LPC_GPIO_PORT, 0, 15);
|
||||
delay_micro_seconds(1000000);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue