MSPM0_ValvanoWare  1.0
ECE445L starter code
Macros | Functions
Debugging

Debugging tools. More...

Macros

#define PAoutPin0Bit0   (GPIOA->DOUT31_0&1)
 using PAoutPin0Bit0 places PA0 output on bit 0
 
#define PBoutPin22Bit1   (((GPIOB->DOUT31_0&(1<<22))>>21))
 using PBoutPin22Bit1 places PB22 output on bit 1
 
#define PBoutPin26Bit2   (((GPIOB->DOUT31_0&(1<<26))>>24))
 using PBoutPin26Bit2 places PB26 output on bit 2
 
#define PBoutPin27Bit3   (((GPIOB->DOUT31_0&(1<<27))>>24))
 using PBoutPin27Bit3 places PB27 output on bit 3
 
#define PAinPin18Bit4   (((GPIOA->DIN31_0&(1<<18))>>14))
 using PAinPin18Bit4 places PA18 input on bit 4
 
#define PBinPin21Bit5   (((GPIOB->DIN31_0&(1<<21))>>16))
 using PBinPin21Bit5 places PA21 input on bit 5
 

Functions

void Debug_Init (void)
 Initialize arrays. More...
 
uint32_t Debug_Dump (uint32_t data)
 Debugging dump. More...
 
uint32_t Debug_Dump2 (uint32_t data)
 Debugging dump with filter. More...
 
uint32_t Debug_Period (uint32_t mask)
 Initialize arrays. More...
 
uint32_t Debug_Duty (uint32_t mask)
 Initialize arrays. More...
 
uint8_t TExaS_LaunchPadLogic (void)
 PB21,PA18,PB27,PB26,PB22,PA0. More...
 
uint8_t TExaS_PB22PA0Logic (void)
 PB22,PA0. More...
 
uint8_t TExaS_PA60Logic (void)
 PA6-PA0. More...
 
uint8_t TExaS_PB18PB17PB16PB2PB1PB0Logic (void)
 PB18-16 outputs, PB2-0 input. More...
 
void TExaS_Init (ADC12_Regs *adc12, uint32_t channel, uint8_t(*logic)(void))
 Initialize TExaS. More...
 

Detailed Description

Debugging tools.

Function Documentation

◆ Debug_Dump()

uint32_t Debug_Dump ( uint32_t  data)

Debugging dump.

Records one data and one time into the two arrays.

Parameters
datais value to store in DataBuffer
Returns
1 for success, 0 for failure (buffers full)
Note
Initializes your index or pointer
See also
Debug_Init() Debug_Period()

◆ Debug_Dump2()

uint32_t Debug_Dump2 ( uint32_t  data)

Debugging dump with filter.

One first call record data and time. On subsequent calls, only record data and one time only if the data differs from the last recording

Parameters
datais value to store in DataBuffer
Returns
1 for success, 0 for failure (buffers full)
Note
Initializes your index or pointer
See also
Debug_Init() Debug_Period()

◆ Debug_Duty()

uint32_t Debug_Duty ( uint32_t  mask)

Initialize arrays.

Calculate duty cycle of the recorded data using mask.
Period is defined as rising edge (low to high) to the next rising edge.
High is defined as rising edge (low to high) to the next falling edge.
Duty cycle is (100*High)/Period

Parameters
maskspecifies which bit(s) to observe
Returns
period in bus cycles, 0 if there is not enough collected data to calculate period
Note
Lab 3 extra credit
See also
Debug_Init() Debug_Period()

◆ Debug_Init()

void Debug_Init ( void  )

Initialize arrays.

Initialize the debugging dump buffers

Parameters
none
Returns
none
Note
Initializes your index or pointer
See also
Debug_Dump() Debug_Period()

◆ Debug_Period()

uint32_t Debug_Period ( uint32_t  mask)

Initialize arrays.

Calculate period of the recorded data using mask

Parameters
maskspecifies which bit(s) to observe
Returns
period in bus cycles, 0 if there is not enough collected data to calculate period
Note
Period is defined as rising edge (low to high) to the next rising edge
See also
Debug_Init() Debug_Period()

◆ TExaS_Init()

void TExaS_Init ( ADC12_Regs *  adc12,
uint32_t  channel,
uint8_t(*)(void)  logic 
)

Initialize TExaS.

Initialize TExaS scope or logic analyzer
Sends one 8-bit data to PC at 10kHz

Parameters
adc12is ADC0 or ADC1 (set to 0 for logic analyzer)
channelspecifies ADC channel 0 to 7
logicfunction that returns an 8-bit value with bit 7 set
Returns
none

◆ TExaS_LaunchPadLogic()

uint8_t TExaS_LaunchPadLogic ( void  )

PB21,PA18,PB27,PB26,PB22,PA0.

To configure logic analyzer for PB21,PA18,PB27,PB26,PB22,PA0 call TExaS_Init(0,0,&TExaS_LaunchPadLogic);

Parameters
none
Returns
8-bit PB21,PA18,PB27,PB26,PB22,PA0
Note
40 instructions, 2us, 2overhead
See also
TExaS_Init

◆ TExaS_PA60Logic()

uint8_t TExaS_PA60Logic ( void  )

PA6-PA0.

To configure logic analyzer for PA6-PA0 outputs call TExaS_Init(0,0,&TExaS_PA60Logic);

Parameters
none
Returns
8-bit PA6-PA0 outputs
Note
11 instructions, 1.5us, 1.5% overhead
See also
TExaS_Init

◆ TExaS_PB18PB17PB16PB2PB1PB0Logic()

uint8_t TExaS_PB18PB17PB16PB2PB1PB0Logic ( void  )

PB18-16 outputs, PB2-0 input.

To configure logic analyzer for PB18-16 outputs, PB2-0 input call TExaS_Init(0,0,&TExaS_PB18PB17PB16PB2PB1PB0Logic);

Parameters
none
Returns
8-bit PB18-16 outputs, PB2-0 input
See also
TExaS_Init

◆ TExaS_PB22PA0Logic()

uint8_t TExaS_PB22PA0Logic ( void  )

PB22,PA0.

To configure logic analyzer for PB22,PA0 call TExaS_Init(0,0,&TExaS_PB22PA0Logic);

Parameters
none
Returns
8-bit PB22,PA0
Note
16 instructions, 1.5us, 1.5% overhead
See also
TExaS_Init