started on framework for test projecgt

stable
Penguin 4 years ago
parent 8a12ae95c4
commit 554184343e

@ -0,0 +1,36 @@
/*
* pc_board.h
*
* Created: 5/3/2020 6:47:40 PM
* Author: Penguin
*/
#ifndef _PC_BOARD_H_
#define _PC_BOARD_H_
#include <hal_gpio.h>
// SAME54 has 14 pin functions
#define GPIO_PIN_FUNCTION_A 0
#define GPIO_PIN_FUNCTION_B 1
#define GPIO_PIN_FUNCTION_C 2
#define GPIO_PIN_FUNCTION_D 3
#define GPIO_PIN_FUNCTION_E 4
#define GPIO_PIN_FUNCTION_F 5
#define GPIO_PIN_FUNCTION_G 6
#define GPIO_PIN_FUNCTION_H 7
#define GPIO_PIN_FUNCTION_I 8
#define GPIO_PIN_FUNCTION_J 9
#define GPIO_PIN_FUNCTION_K 10
#define GPIO_PIN_FUNCTION_L 11
#define GPIO_PIN_FUNCTION_M 12
#define GPIO_PIN_FUNCTION_N 13
// I2C Config
#define I2C_MASTER_SDA (GPIO_PORTA, 22)
#define I2C_MASTER_SCL (GPIO_PORTA, 23)
// Debug USART Config
#define USART_DEBUG_RX GPIO(GPIO_PORTB, 24)
#define USART_DEBUG_TX GPIO(GPIO_PORTB, 25)
#endif

@ -0,0 +1,14 @@
/*
* pc_master.h
*
* Created: 5/3/2020 6:47:27 PM
* Author: Penguin
*/
#ifndef _PC_MASTER_H_
#define _PC_MASTER_H_
// usart debug settings
#define DEBUG_MAX_BUFFER_SIZE (128)
#endif

@ -8,28 +8,5 @@
#ifndef ATMEL_START_PINS_H_INCLUDED
#define ATMEL_START_PINS_H_INCLUDED
#include <hal_gpio.h>
// SAME54 has 14 pin functions
#define GPIO_PIN_FUNCTION_A 0
#define GPIO_PIN_FUNCTION_B 1
#define GPIO_PIN_FUNCTION_C 2
#define GPIO_PIN_FUNCTION_D 3
#define GPIO_PIN_FUNCTION_E 4
#define GPIO_PIN_FUNCTION_F 5
#define GPIO_PIN_FUNCTION_G 6
#define GPIO_PIN_FUNCTION_H 7
#define GPIO_PIN_FUNCTION_I 8
#define GPIO_PIN_FUNCTION_J 9
#define GPIO_PIN_FUNCTION_K 10
#define GPIO_PIN_FUNCTION_L 11
#define GPIO_PIN_FUNCTION_M 12
#define GPIO_PIN_FUNCTION_N 13
#define PA22 GPIO(GPIO_PORTA, 22)
#define PA23 GPIO(GPIO_PORTA, 23)
#define PB24 GPIO(GPIO_PORTB, 24)
#define PB25 GPIO(GPIO_PORTB, 25)
#endif // ATMEL_START_PINS_H_INCLUDED

@ -0,0 +1,6 @@
#ifndef _P_GPIO_H_
#define _P_GPIO_H_
void p_gpio_init(void);
#endif

@ -0,0 +1,7 @@
#ifndef _P_I2C_H_
#define _P_I2C_H_
void p_i2c_init(void);
#endif

@ -0,0 +1,18 @@
#include "p_usart.h"
static usart_async_descriptor debug_inst;
static uint8_t debug_buffer[DEBUG_MAX_BUFFER_SIZE]
void p_usart_init(void)
{
}
void p_write(struct usart_async_descriptor* const inst, const uint8_t* data, uint16_t len)
{
}
void p_debug(const char* str, ...)
{
}

@ -0,0 +1,11 @@
#ifndef _P_USART_H_
#define _P_USART_H_
void p_usart_init(void);
void p_write(struct usart_async_descriptor* const inst, const uint8_t* data, uint16_t len);
void p_debug(const char* str, ...);
#endif

@ -0,0 +1,12 @@
/*
* oracle.c
*
* Created: 5/3/2020 7:24:09 PM
* Author: Penguin
*/
#include "oracle.h"
void oracle_init(void)
{
}

@ -0,0 +1,27 @@
/*
* oracle.h
*
* Created: 5/3/2020 7:05:17 PM
* Author: Penguin
*/
#ifndef _ORACLE_H_
#define _ORACLE_H_
typedef enum p_err
{
PE_GOOD = 0x0, //
PE_BAD = 0x1 //
}p_err;
typedef enum p_log_level
{
}p_log_level;
void oracle_init(void);
int p_qprint(const char* str, ...);
int p_lprint(const char* str, ...);
#endif

@ -457,6 +457,12 @@
<Compile Include="Config\hpl_tc_config.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="Config\pc_board.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="Config\pc_master.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="Config\peripheral_clk_config.h">
<SubType>compile</SubType>
</Compile>
@ -469,6 +475,30 @@
<Compile Include="Device_Startup\system_same54.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_gpio.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_gpio.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_i2c.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_i2c.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_tcc.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_tcc.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_usart.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="drivers\p_usart.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="driver_init.c">
<SubType>compile</SubType>
</Compile>
@ -856,9 +886,16 @@
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="oracle.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="oracle.h">
<SubType>compile</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="Config\" />
<Folder Include="devices\display\" />
<Folder Include="Device_Startup\" />
<Folder Include="examples\" />
<Folder Include="hal\" />
@ -883,6 +920,8 @@
<Folder Include="hpl\sercom\" />
<Folder Include="hpl\tc\" />
<Folder Include="hri\" />
<Folder Include="drivers" />
<Folder Include="devices" />
</ItemGroup>
<ItemGroup>
<None Include="Device_Startup\same54p20a_flash.ld">