jacking/main.c

55 lines
1.2 KiB
C

#include <bsp/gctl.h>
#include <bsp/gpio.h>
#include <bsp/uart.h>
#include <bsp/usb.h>
#include <bsp/irq.h>
#include <bsp/cache.h>
#include <bsp/util.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
extern void jazelle_main(void);
int main(void)
{
Fx3CacheEnableCaches();
Fx3IrqInit();
Fx3GctlInitClock();
*(volatile uint32_t *)(void *)0x400020e8 = 0;
Fx3GctlInitIoMatrix(FX3_GCTL_ALTFUNC_GPIF32BIT_UART_I2S);
Fx3UartInit(115200, FX3_UART_NO_PARITY, FX3_UART_1_STOP_BIT);
/*while (true) {
Fx3UartTxString("\nhello world\n");
Fx3UartTxFlush();
}*/
Fx3GpioInitClock();
/*Fx3GpioSetupSimple(45,
FX3_GPIO_SIMPLE_ENABLE |
FX3_GPIO_SIMPLE_INPUT_EN);
Fx3GpioSetupSimple(54,
FX3_GPIO_SIMPLE_ENABLE |
FX3_GPIO_SIMPLE_DRIVE_HI_EN |
FX3_GPIO_SIMPLE_DRIVE_LO_EN);
Fx3GpioSetupComplex(50,
FX3_PIN_STATUS_ENABLE |
(FX3_GPIO_TIMER_MODE_SLOW_CLK << FX3_PIN_STATUS_TIMER_MODE_SHIFT) |
(FX3_GPIO_PIN_MODE_PWM << FX3_PIN_STATUS_MODE_SHIFT) |
FX3_PIN_STATUS_DRIVE_HI_EN |
FX3_PIN_STATUS_DRIVE_LO_EN,
0, GPIO_SLOW_CLK/1000-1, GPIO_SLOW_CLK/2000);
Fx3IrqEnableInterrupts();*/
jazelle_main();
while (true) ; // a
}