Skip to content
Snippets Groups Projects
Commit a5fe5633 authored by schneider's avatar schneider
Browse files

fix(ips): Adapt to card10

parent 9b0f1ec6
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "DEV_Config.h" #include "DEV_Config.h"
#include "spi.h" #include "spi.h"
#define SPI SPI0 #define SPI SPI2
//const gpio_cfg_t DEV_CS_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE}; //const gpio_cfg_t DEV_CS_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
//const gpio_cfg_t DEV_BL_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE}; //const gpio_cfg_t DEV_BL_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
**/ **/
extern const gpio_cfg_t DEV_RST_PIN; extern const gpio_cfg_t DEV_RST_PIN;
extern const gpio_cfg_t DEV_DC_PIN; extern const gpio_cfg_t DEV_DC_PIN;
extern const gpio_cfg_t DEV_CS_PIN; //extern const gpio_cfg_t DEV_CS_PIN;
extern const gpio_cfg_t DEV_BL_PIN; //extern const gpio_cfg_t DEV_BL_PIN;
/** /**
* GPIO read and write * GPIO read and write
**/ **/
......
...@@ -53,8 +53,8 @@ COMPILER=GCC ...@@ -53,8 +53,8 @@ COMPILER=GCC
# Specify the board used # Specify the board used
ifeq "$(BOARD)" "" ifeq "$(BOARD)" ""
BOARD=EvKit_V1 #BOARD=EvKit_V1
#BOARD=card10 BOARD=card10
endif endif
# This is the path to the CMSIS root directory # This is the path to the CMSIS root directory
......
...@@ -68,24 +68,24 @@ ...@@ -68,24 +68,24 @@
// Parameters for PWM output // Parameters for PWM output
#define PORT_PWM PORT_0 // port #define PORT_PWM PORT_0 // port
#define PIN_PWM PIN_7 // pin #define PIN_PWM PIN_21 // pin
#define FREQ 200 // (Hz) #define FREQ 200 // (Hz)
//#define DUTY_CYCLE 75 // (%) //#define DUTY_CYCLE 75 // (%)
#define DUTY_CYCLE 20 // (%) #define DUTY_CYCLE 20 // (%)
#define PWM_TIMER MXC_TMR1 // must change PORT_PWM and PIN_PWM if changed #define PWM_TIMER MXC_TMR3 // must change PORT_PWM and PIN_PWM if changed
/***** Definitions *****/ /***** Definitions *****/
#define I2C_DEVICE MXC_I2C0_BUS0 #define I2C_DEVICE MXC_I2C0_BUS0
#define SPI SPI0 #define SPI SPI2
#define SPI_SPEED 1000000 // Bit Rate #define SPI_SPEED 1000000 // Bit Rate
/***** Globals *****/ /***** Globals *****/
static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE}; static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
const gpio_cfg_t DEV_RST_PIN = {PORT_1, PIN_6, GPIO_FUNC_OUT, GPIO_PAD_NONE}; const gpio_cfg_t DEV_RST_PIN = {PORT_0, PIN_28, GPIO_FUNC_OUT, GPIO_PAD_NONE};
const gpio_cfg_t DEV_DC_PIN = {PORT_1, PIN_7, GPIO_FUNC_OUT, GPIO_PAD_NONE}; const gpio_cfg_t DEV_DC_PIN = {PORT_0, PIN_23, GPIO_FUNC_OUT, GPIO_PAD_NONE};
/***** Functions *****/ /***** Functions *****/
void PWM_Output() void PWM_Output()
...@@ -146,7 +146,7 @@ int main(void) ...@@ -146,7 +146,7 @@ int main(void)
printf("Hello World!\n"); printf("Hello World!\n");
#if 0 #if 1
//Setup the I2CM //Setup the I2CM
I2C_Shutdown(MXC_I2C0_BUS0); I2C_Shutdown(MXC_I2C0_BUS0);
I2C_Init(MXC_I2C0_BUS0, I2C_FAST_MODE, NULL); I2C_Init(MXC_I2C0_BUS0, I2C_FAST_MODE, NULL);
...@@ -183,8 +183,9 @@ int main(void) ...@@ -183,8 +183,9 @@ int main(void)
LCD_Clear(BLACK); LCD_Clear(BLACK);
Paint_NewImage(LCD_WIDTH, LCD_HEIGHT,0,WHITE); Paint_NewImage(LCD_WIDTH, LCD_HEIGHT,0,WHITE);
Paint_Clear(BLACK); Paint_Clear(BLACK);
//Paint_SetRotate(180); Paint_SetRotate(180);
Paint_DrawString_EN(0, 0, "123", &Font24, 0x000f, 0xfff0); Paint_DrawString_EN(0, 0, "123", &Font24, 0x000f, 0xfff0);
Paint_DrawString_EN(0, 23, "ABC", &Font24, BLUE, CYAN); Paint_DrawString_EN(0, 23, "ABC", &Font24, BLUE, CYAN);
Paint_DrawString_CN(20,42, "΢ѩµç×Ó", &Font24CN, WHITE, RED); Paint_DrawString_CN(20,42, "΢ѩµç×Ó", &Font24CN, WHITE, RED);
......
...@@ -168,6 +168,7 @@ __weak void SystemInit(void) ...@@ -168,6 +168,7 @@ __weak void SystemInit(void)
MXC_GPIO0->vssel |= (1UL << 9) | (1UL << 10); // USB UART MXC_GPIO0->vssel |= (1UL << 9) | (1UL << 10); // USB UART
MXC_GPIO0->vssel |= (1UL << 20) | (1UL << 21) | (1UL << 22) | (1UL << 29); // Wristband MXC_GPIO0->vssel |= (1UL << 20) | (1UL << 21) | (1UL << 22) | (1UL << 29); // Wristband
MXC_GPIO0->vssel |= (1UL << 17) | (1UL << 23) | (1UL << 28); // GPIO to TOP MXC_GPIO0->vssel |= (1UL << 17) | (1UL << 23) | (1UL << 28); // GPIO to TOP
MXC_GPIO0->vssel |= (1UL << 24) | (1UL << 25) | (1UL << 26) | (1UL << 27); // SPI to TOP
MXC_GPIO0->vssel |= (1UL << 31); // ECG Switch MXC_GPIO0->vssel |= (1UL << 31); // ECG Switch
MXC_GPIO0->ps |= 0xFFFFFFFF; MXC_GPIO0->ps |= 0xFFFFFFFF;
......
...@@ -84,7 +84,8 @@ const gpio_cfg_t gpio_cfg_spi17y1_ss0 = { PORT_0, (PIN_16), GPIO_FUNC_ALT2, GPI ...@@ -84,7 +84,8 @@ const gpio_cfg_t gpio_cfg_spi17y1_ss0 = { PORT_0, (PIN_16), GPIO_FUNC_ALT2, GPI
const gpio_cfg_t gpio_cfg_spi17y1_ss1 = { PORT_0, (PIN_22), GPIO_FUNC_ALT2, GPIO_PAD_NONE }; const gpio_cfg_t gpio_cfg_spi17y1_ss1 = { PORT_0, (PIN_22), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
const gpio_cfg_t gpio_cfg_spi17y1_ss2 = { PORT_0, (PIN_23), GPIO_FUNC_ALT2, GPIO_PAD_NONE }; const gpio_cfg_t gpio_cfg_spi17y1_ss2 = { PORT_0, (PIN_23), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
const gpio_cfg_t gpio_cfg_spi17y2 = { PORT_0, (PIN_25 | PIN_26 | PIN_27 | PIN_28 | PIN_29), GPIO_FUNC_ALT2, GPIO_PAD_NONE }; //const gpio_cfg_t gpio_cfg_spi17y2 = { PORT_0, (PIN_25 | PIN_26 | PIN_27 | PIN_28 | PIN_29), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
const gpio_cfg_t gpio_cfg_spi17y2 = { PORT_0, (PIN_25 | PIN_26 | PIN_27), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
const gpio_cfg_t gpio_cfg_spi17y2_ss0 = { PORT_0, (PIN_24), GPIO_FUNC_ALT2, GPIO_PAD_NONE }; const gpio_cfg_t gpio_cfg_spi17y2_ss0 = { PORT_0, (PIN_24), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
const gpio_cfg_t gpio_cfg_spi17y2_ss1 = { PORT_0, (PIN_30), GPIO_FUNC_ALT2, GPIO_PAD_NONE }; const gpio_cfg_t gpio_cfg_spi17y2_ss1 = { PORT_0, (PIN_30), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
const gpio_cfg_t gpio_cfg_spi17y2_ss2 = { PORT_0, (PIN_31), GPIO_FUNC_ALT2, GPIO_PAD_NONE }; const gpio_cfg_t gpio_cfg_spi17y2_ss2 = { PORT_0, (PIN_31), GPIO_FUNC_ALT2, GPIO_PAD_NONE };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment