Skip to content
amin edited this page Jul 1, 2016 · 1 revision

init.h

#ifndef INIT_H_
#define INIT_H_

#include "nrf24l01.h"
#include <asf.h>
#include "functions.h"

#define CHARGE_PERIOD(_A_) tc_write_period(&TCC0, _A_)
#define KICK_PERIOD(_A_)   tc_write_period(&TCC0, _A_)
#define CHARGE_DUTY_CYCLE(_A_) tc_write_cc(&TCC0, TC_CCC, _A_)
#define KICK_DUTY_CYCLE(_A_)   tc_write_cc(&TCC0, TC_CCD, _A_)
#define CHARGE_START tc_enable_cc_channels(&TCC0,TC_CCCEN)
#define CHARGE_STOP tc_disable_cc_channels(&TCC0,TC_CCCEN)
#define KICK_START   tc_enable_cc_channels(&TCC0,TC_CCDEN)
#define KICK_STOP   tc_disable_cc_channels(&TCC0,TC_CCDEN)
#define CHIP_PERIOD(_A_)   tc_write_period(&TCC1, _A_)
#define CHIP_DUTY_CYCLE(_A_)   tc_write_cc(&TCC1, TC_CCA, _A_)
#define CHIP_START   tc_enable_cc_channels(&TCC1,TC_CCAEN)
#define CHIP_STOP   tc_disable_cc_channels(&TCC1,TC_CCAEN)

void port_init(void);
void spi_init(void);
void nrf_init (void);
void robot_id_set(void);
void evsys_init(void);
void adc_init(void);
void adc_calibration (void);
void current_sensor_offset (void);
void tc_init(void);
extern char Address[_Address_Width];

#endif /* INIT_H_ */

For using Kick board we need to generate PWM signals and check capacitor voltage limits.PWM needs eanabling and disabling Compare Channels which is done with tc_enable_cc_channels() and tc_disable_cc_channels().It needs changing periods of signals which is done with tc_write_period().And it needs to change the Compare value (to change duty cycle of signals)which is done with tc_write_cc().

Address array is the address which is used in wireless protocole.

Clone this wiki locally