Skip to content

Commit 1d2baaa

Browse files
committed
Dual CONVST support added
1 parent 75cbeff commit 1d2baaa

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

Firmware/AnalogInput/app.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ void core_callback_t_500us(void)
201201
{
202202
core_func_mark_user_timestamp();
203203
set_CONVST;
204+
set_CONVSTB;
204205
switch (app_regs.REG_TRIGGER_DESTINY)
205206
{
206207
case GM_TRIG_TO_DO0: set_DO0; break;
@@ -234,6 +235,7 @@ void core_callback_t_1ms(void)
234235
{
235236
core_func_mark_user_timestamp();
236237
set_CONVST;
238+
set_CONVSTB;
237239
switch (app_regs.REG_TRIGGER_DESTINY)
238240
{
239241
case GM_TRIG_TO_DO0: set_DO0; break;

Firmware/AnalogInput/app_ios_and_regs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ void init_ios(void)
2020
io_pin2out(&PORTA, 0, OUT_IO_DIGITAL, IN_EN_IO_EN); // DO2
2121
io_pin2out(&PORTA, 1, OUT_IO_DIGITAL, IN_EN_IO_EN); // DO1
2222
io_pin2out(&PORTA, 2, OUT_IO_DIGITAL, IN_EN_IO_EN); // DO0
23-
io_pin2out(&PORTC, 0, OUT_IO_DIGITAL, IN_EN_IO_EN); // CS_ADC
24-
io_pin2out(&PORTC, 4, OUT_IO_DIGITAL, IN_EN_IO_EN); // CONVST
23+
io_pin2out(&PORTC, 0, OUT_IO_DIGITAL, IN_EN_IO_EN); // CONVSTA
24+
io_pin2out(&PORTC, 1, OUT_IO_DIGITAL, IN_EN_IO_EN); // CONVSTB
25+
io_pin2out(&PORTC, 4, OUT_IO_DIGITAL, IN_EN_IO_EN); // CS_ADC
2526
io_pin2out(&PORTC, 5, OUT_IO_DIGITAL, IN_EN_IO_DIS); // MOSI
2627
io_pin2out(&PORTC, 7, OUT_IO_DIGITAL, IN_EN_IO_DIS); // SCK
2728
io_pin2out(&PORTD, 0, OUT_IO_WIREDAND, IN_EN_IO_EN); // RESET
@@ -37,6 +38,7 @@ void init_ios(void)
3738
clr_DO0;
3839
set_CS_ADC;
3940
clr_CONVST;
41+
clr_CONVSTB;
4042
clr_MOSI;
4143
clr_SCK;
4244
clr_RESET;

Firmware/AnalogInput/app_ios_and_regs.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,23 @@ void init_ios(void);
5656
#define read_DO0 read_io(PORTA, 2)
5757

5858
/* CS_ADC */
59-
#define set_CS_ADC clear_io(PORTC, 0)
60-
#define clr_CS_ADC set_io(PORTC, 0)
61-
#define tgl_CS_ADC toggle_io(PORTC, 0)
62-
#define read_CS_ADC read_io(PORTC, 0)
59+
#define set_CS_ADC clear_io(PORTC, 4)
60+
#define clr_CS_ADC set_io(PORTC, 4)
61+
#define tgl_CS_ADC toggle_io(PORTC, 4)
62+
#define read_CS_ADC read_io(PORTC, 4)
63+
64+
/* CONVSTA */
65+
#define set_CONVST set_io(PORTC, 0)
66+
#define clr_CONVST clear_io(PORTC, 0)
67+
#define tgl_CONVST toggle_io(PORTC, 0)
68+
#define read_CONVST read_io(PORTC, 0)
69+
70+
/* CONVSTB */
71+
#define set_CONVSTB set_io(PORTC, 1)
72+
#define clr_CONVSTB clear_io(PORTC, 1)
73+
#define tgl_CONVSTB toggle_io(PORTC, 1)
74+
#define read_CONVSTB read_io(PORTC, 1)
6375

64-
/* CONVST */
65-
#define set_CONVST set_io(PORTC, 4)
66-
#define clr_CONVST clear_io(PORTC, 4)
67-
#define tgl_CONVST toggle_io(PORTC, 4)
68-
#define read_CONVST read_io(PORTC, 4)
6976

7077
/* MOSI */
7178
#define set_MOSI set_io(PORTC, 5)

Firmware/AnalogInput/interrupts.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ ISR(PORTB_INT0_vect, ISR_NAKED)
5555

5656
case GM_DI0_RISE_CATCH_SAMPLE:
5757
set_CONVST;
58+
set_CONVSTB;
5859
switch (app_regs.REG_TRIGGER_DESTINY)
5960
{
6061
case GM_TRIG_TO_DO0: set_DO0; break;
@@ -89,6 +90,7 @@ ISR(PORTB_INT0_vect, ISR_NAKED)
8990

9091
case GM_DI0_FALL_CATCH_SAMPLE:
9192
set_CONVST;
93+
set_CONVSTB;
9294
switch (app_regs.REG_TRIGGER_DESTINY)
9395
{
9496
case GM_TRIG_TO_DO0: set_DO0; break;
@@ -114,6 +116,7 @@ ISR(PORTD_INT0_vect, ISR_NAKED)
114116
if (!read_BUSY)
115117
{
116118
clr_CONVST;
119+
clr_CONVSTB;
117120

118121
switch (app_regs.REG_TRIGGER_DESTINY)
119122
{

0 commit comments

Comments
 (0)