Defines | Functions | Variables

main.c File Reference

#include <lpc21xx.h>
#include <errno.h>
#include <periph/can.h>
#include <string.h>
#include <deb_led.h>
#include <can_ids.h>
#include <can_msg_def.h>
#include <servo.h>
#include <powswitch.h>
#include <engine.h>
#include <adc_filtr.h>
#include <uart_nozen.h>
Include dependency graph for main.c:

Defines

#define CAN_SPEED   1000000
#define CAN_ISR   0
#define UART0_ISR   1
#define UART1_ISR   2
#define SERVO_ISR   4
#define ADC_ISR   5
#define CR   0x0d
#define PWM_CHAN_A   0
#define PWM_CHAN_B   1
#define ADC_TIME   60
#define SERVO_0_BOUND   0x10
#define SERVO_1_BOUND   0xFA
#define TIMEOUT_DELAY   3000
#define CHELAE_R_MAX   0xE0
#define CHELAE_R_MIN   0x30
#define CHELAE_L_MAX   0xA0
#define CHELAE_L_MIN   0x00
#define HOKUYO_MAX   0xFF
#define HOKUYO_MIN   0x20
#define HOKUYO_AHEAD   0xD0
#define CHELAE_L   2
#define CHELAE_R   1
#define HOKUYO   0
#define START_TIME   16
#define PUCK_PIN   18
#define PUCK_TIME   50
#define BACK_PIN   19
#define START_PIN   15
Picker_09 (lpceurobot)

#define LED_GREEN
 Blinks once per second when software is alive.
#define LED_BLUE
 Blinks when a CAN message is received:
#define LED_YELLOW
 Light: when timeout occurs.
#define LED_RED
 Not used.

Functions

void led_blik (unsigned char led)
void atoim (unsigned int val)
void send_adc ()
void set_pwm (unsigned char chan, unsigned char pwm)
void go_to_sleep ()
 set carousel to sleep caused by CAN_PWR_ALERT CAN message
void can_rx (can_msg_t *msg)
void init_perip (void)
void timeout (void)
void puck_switch (void)
void start_button (void)
int main (void)

Variables

can_msg_t msg
unsigned int time_blink
volatile unsigned int time_timeout
volatile unsigned int sberac_timeout
volatile unsigned sberac_timeout_en = 0
unsigned int time_adc = 0
int time_delay = 0
uint32_t time_puck = 0
uint8_t start_bt = 0
uint32_t time_start = 0
uint8_t start_cnt = 0

Define Documentation

#define ADC_ISR   5
#define ADC_TIME   60
#define BACK_PIN   19
#define CAN_ISR   0
#define CAN_SPEED   1000000
#define CHELAE_L   2
#define CHELAE_L_MAX   0xA0
#define CHELAE_L_MIN   0x00
#define CHELAE_R   1
#define CHELAE_R_MAX   0xE0
#define CHELAE_R_MIN   0x30
#define CR   0x0d
#define HOKUYO   0
#define HOKUYO_AHEAD   0xD0
#define HOKUYO_MAX   0xFF
#define HOKUYO_MIN   0x20
#define PUCK_PIN   18
#define PUCK_TIME   50
#define PWM_CHAN_A   0
#define PWM_CHAN_B   1
#define SERVO_0_BOUND   0x10
#define SERVO_1_BOUND   0xFA
#define SERVO_ISR   4
#define START_PIN   15
#define START_TIME   16
#define TIMEOUT_DELAY   3000
#define UART0_ISR   1
#define UART1_ISR   2

Function Documentation

void atoim ( unsigned int  val  ) 

Here is the caller graph for this function:

void can_rx ( can_msg_t *  msg  ) 

Here is the call graph for this function:

void go_to_sleep (  ) 

set carousel to sleep caused by CAN_PWR_ALERT CAN message

Here is the call graph for this function:

void init_perip ( void   ) 

Here is the call graph for this function:

void led_blik ( unsigned char  led  ) 

Here is the caller graph for this function:

int main ( void   ) 

Here is the call graph for this function:

void puck_switch ( void   ) 

Here is the caller graph for this function:

void send_adc (  ) 

Here is the caller graph for this function:

void set_pwm ( unsigned char  chan,
unsigned char  pwm 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void start_button ( void   ) 
void timeout ( void   ) 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

can_msg_t msg
volatile unsigned int sberac_timeout
volatile unsigned sberac_timeout_en = 0
uint8_t start_bt = 0
uint8_t start_cnt = 0
unsigned int time_adc = 0
unsigned int time_blink
int time_delay = 0
uint32_t time_puck = 0
uint32_t time_start = 0
volatile unsigned int time_timeout