From 554184343e64c9897637685922eefb8ede8722c6 Mon Sep 17 00:00:00 2001 From: Penguin Date: Tue, 5 May 2020 01:15:47 -0500 Subject: [PATCH] started on framework for test projecgt --- .../.vs/project_oracle_test_prj/v14/.atsuo | Bin 16896 -> 49664 bytes .../project_oracle_test_prj/Config/pc_board.h | 36 ++++++++++++++++ .../Config/pc_master.h | 14 +++++++ .../atmel_start_pins.h | 23 ----------- .../project_oracle_test_prj/drivers/p_gpio.h | 6 +++ .../project_oracle_test_prj/drivers/p_i2c.h | 7 ++++ .../project_oracle_test_prj/drivers/p_tcc.h | 6 +++ .../project_oracle_test_prj/drivers/p_usart.c | 18 ++++++++ .../project_oracle_test_prj/drivers/p_usart.h | 11 +++++ .../project_oracle_test_prj/oracle.c | 12 ++++++ .../project_oracle_test_prj/oracle.h | 27 ++++++++++++ .../project_oracle_test_prj.cproj | 39 ++++++++++++++++++ 12 files changed, 176 insertions(+), 23 deletions(-) create mode 100644 software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_board.h create mode 100644 software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_master.h create mode 100644 software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.c create mode 100644 software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.h diff --git a/software/firmware/project_oracle_test_prj/.vs/project_oracle_test_prj/v14/.atsuo b/software/firmware/project_oracle_test_prj/.vs/project_oracle_test_prj/v14/.atsuo index 0adfae42b9d0610e018b33955acb123571a4c6f1..49c6e5ff69738772a5721a495519ce7bb82e15e0 100644 GIT binary patch literal 49664 zcmeHQd5|kddDlK)&&D=i4v(!AF1p6+cvMa(AdMQ9bkQm8#2!!e@q#RVP%c8*qLM zc;?w>pQTH59fwnQfH)9S@%Xh>Csl402VYS2sVWt_m#QwiQ0Fh+;jR-u{j>Lc?9>x8 z*CXD2uahE2K#^BfRDMt|;K;37-655YmtTq&ILz*iSGPa=G=kB5MJLlIx(!tgIS^DV z5C<=^06T~`%DWl#Z^g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*nj2_velj+~2_vKK*i z0Ow1He#B*XYS~O#HP!=@)`)1q5I9d!X)VkLSqu?lBLrG`RH7cfD-VA~avs6tc~<4n-p z5wqS;Yf+RnK-N8I*2P9WHFh%vChLbqYOfKpQz6jT2MLow;tjx8xhcK0=x4Uou9xRO zee9^(*m}Jgy(YZ}o6<Wmz%>H5WV(ix?UrPK*3w_f}7Gs_s89jkrO#J_6hd6;Xl zr7L=WF!(HctB>NpsStE5_o!fy(*=ou$L`^7a2glm?r`_?Eqb)HC<;%=>L%0ibSoUFU?+NO^HgVx*UCWj9^|l)d7k6MsMC&0IhRPB&GZg)J*S}lZP+6 ziyI13V(=iKGX0kyXX%ChE(Q++XW{$6Rb4C_vNydHyw1awa)rm|+8gYFneh;K<~>#v xAJf%{>2CQU6znjT1jYpnKkb=sV{kj{fW-YOcoIHs;^<8aD6SZOFiQRu+AqWcpqu~z diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_board.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_board.h new file mode 100644 index 0000000..3869c0e --- /dev/null +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_board.h @@ -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 + +// 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 \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_master.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_master.h new file mode 100644 index 0000000..9ccc961 --- /dev/null +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/Config/pc_master.h @@ -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 \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/atmel_start_pins.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/atmel_start_pins.h index 44a1c39..48712d5 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/atmel_start_pins.h +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/atmel_start_pins.h @@ -8,28 +8,5 @@ #ifndef ATMEL_START_PINS_H_INCLUDED #define ATMEL_START_PINS_H_INCLUDED -#include - -// 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 diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_gpio.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_gpio.h index e69de29..7997827 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_gpio.h +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_gpio.h @@ -0,0 +1,6 @@ +#ifndef _P_GPIO_H_ +#define _P_GPIO_H_ + +void p_gpio_init(void); + +#endif \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_i2c.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_i2c.h index e69de29..5d60dcd 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_i2c.h +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_i2c.h @@ -0,0 +1,7 @@ +#ifndef _P_I2C_H_ +#define _P_I2C_H_ + +void p_i2c_init(void); + + +#endif \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_tcc.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_tcc.h index e69de29..49a7bc2 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_tcc.h +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_tcc.h @@ -0,0 +1,6 @@ +#ifndef _P_TCC_H_ +#define _P_TCC_H_ + + + +#endif \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.c b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.c index e69de29..4c9bcd8 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.c +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.c @@ -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, ...) +{ + +} \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.h index e69de29..16c73d1 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.h +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/drivers/p_usart.h @@ -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 \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.c b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.c new file mode 100644 index 0000000..4310f82 --- /dev/null +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.c @@ -0,0 +1,12 @@ +/* + * oracle.c + * + * Created: 5/3/2020 7:24:09 PM + * Author: Penguin + */ +#include "oracle.h" + +void oracle_init(void) +{ + +} \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.h b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.h new file mode 100644 index 0000000..ffd0d0d --- /dev/null +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/oracle.h @@ -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 \ No newline at end of file diff --git a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/project_oracle_test_prj.cproj b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/project_oracle_test_prj.cproj index 8008062..af86218 100644 --- a/software/firmware/project_oracle_test_prj/project_oracle_test_prj/project_oracle_test_prj.cproj +++ b/software/firmware/project_oracle_test_prj/project_oracle_test_prj/project_oracle_test_prj.cproj @@ -457,6 +457,12 @@ compile + + compile + + + compile + compile @@ -469,6 +475,30 @@ compile + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + compile @@ -856,9 +886,16 @@ compile + + compile + + + compile + + @@ -883,6 +920,8 @@ + +