SAM3S8/SD8 Software Package: examples/adc12/main.c File Reference

SAM3S8/SD8 Software Package 1.2
Defines | Enumerations | Functions | Variables

# main.c File Reference

`#include "board.h"`
`#include <string.h>`

Go to the source code of this file.

## Defines

#define | NUM_CHANNELS (2)
#define | ADC_DONE_MASK ( (1<<NUM_CHANNELS) - 1 )
#define | BUFFER_SIZE NUM_CHANNELS
#define | VOLT_REF (3300)
#define | MAX_DIGITAL (4095)
#define | STRING_EOL "\r"
#define | STRING_HEADER
#define | PWM_FREQUENCY 2
#define | MAX_DUTY_CYCLE 1000

## Enumerations

enum | eTriggerMode { TRIGGER_MODE_SOFTWARE = 0, TRIGGER_MODE_ADTRG, TRIGGER_MODE_TIMER, TRIGGER_MODE_PWM, TRIGGER_MODE_FREERUN }

## Functions

void | SysTick_Handler (void)
| Systick handler.
void | ADC_IrqHandler (void)
| Interrupt handler for the ADC.
int | main (void)
| adc12 Application entry point.

## Variables

tAdcTestMode | gAdcTestMode
tAdcSampleData | gAdcSampleData
Pin | gPinADTRG = {PIO_PA8B_ADTRG, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
Pin | gPinTIOA0 = {PIO_PA0B_TIOA0, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT}
Pin | gPinPwm0 = PIN_PWMC_PWMH0

## Detailed Description

This file contains all the specific code for the adc12 example.

Definition in file main.c.

## Define Documentation

#define ADC_DONE_MASK ( (1<<NUM_CHANNELS) - 1 )

ADC convention done mask

Definition at line 131 of file main.c.

#define BUFFER_SIZE NUM_CHANNELS

Size of the receive buffer and transmit buffer.

Definition at line 134 of file main.c.

#define MAX_DIGITAL (4095)

The maximal digital value

Definition at line 140 of file main.c.

#define NUM_CHANNELS (2)

Total number of ADC channels in use

Definition at line 129 of file main.c.

#define STRING_HEADER

Value:

    "-- ADC12 Example "SOFTPACK_VERSION" --\r\n" \
                          "-- "BOARD_NAME" --\r\n" \
                          "-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL

Definition at line 143 of file main.c.

#define VOLT_REF (3300)

Reference voltage for ADC, in mv

Definition at line 137 of file main.c.

## Enumeration Type Documentation

enum eTriggerMode

ADC trigger modes

Definition at line 164 of file main.c.

## Function Documentation

int main | ( | void | ) |

adc12 Application entry point.

Returns:
  Unused (ANSI-C compatibility).

Definition at line 646 of file main.c.

Here is the call graph for this function:

void SysTick_Handler | ( | void | ) |

Systick handler.

Default SysTick interrupt handler.

Definition at line 588 of file main.c.

Here is the call graph for this function:

## Variable Documentation

tAdcSampleData gAdcSampleData

ADC sample data

Definition at line 189 of file main.c.

tAdcTestMode gAdcTestMode

ADC test mode

Definition at line 186 of file main.c.

Pin gPinADTRG = {PIO_PA8B_ADTRG, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}

Definition of ADTRG pin

Definition at line 192 of file main.c.

Pin gPinPwm0 = PIN_PWMC_PWMH0

Definition of PWM0 pin

Definition at line 198 of file main.c.

Pin gPinTIOA0 = {PIO_PA0B_TIOA0, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT}

Definition of TIOA0 pin

Definition at line 195 of file main.c.

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines