本文整理汇总了C++中port_init函数的典型用法代码示例。如果您正苦于以下问题:C++ port_init函数的具体用法?C++ port_init怎么用?C++ port_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了port_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_devices
void init_devices (void)
{
cli(); //Clears the global interrupts
port_init();
timer1_init();
adc_init();
uart0_init();
sei(); //Enables the global interrupts
}
示例2: init_devices
//function to initialize all devices
void init_devices()
{
cli(); //Clears the global interrupts
timer1_init();
port_init(); //Initializes all the ports
uart0_init(); //Initailize UART1 for serial communication
//adc_init();
sei(); //Enables the global interrupts
}
示例3: init_devices
/*
* Function For Devices Initialisation
*/
void init_devices (void)
{
cli(); ///< Clears the global interrupts
port_init(); ///< initialise the ports
adc_init();
uart0_init();
timer5_init();
timer1_init();
sei(); //Enables the global interrupts
}
开发者ID:eyantra,项目名称:CS684_Automated_Electronic_Toll_Tax_Collection_System_2010,代码行数:13,代码来源:AETC_Robot.c
示例4: port_init
void ADS7843::init()
{
port_init(); //端口初始化
interrupt_init(); //中断初始化
CS_HIGH; //片选拉高
SCK_LOW; //时钟为低
CS_LOW; //片选拉低
isInitialized = true;
}
示例5: init_devices
void init_devices (void)
{
cli(); //Clears the global interrupts
port_init();
adc_init();
lcd_init();
timer5_init();
TIMSK5 = 0x01; //timer5 overflow interrupt enable.
sei(); //Enables the global interrupts
}
示例6: init
void init()
{
cli(); //Clears the global interrupts
port_init(); //Initializes all the ports
uart0_init(); //Initialize UART0 for serial communication
left_encoder_interrupt_init(); //Initialize interrupts for left encoder
right_encoder_interrupt_init(); //Initialize interrupts for right encoder
timer5_init(); //Initialize TIMER5 for PWM
sei(); //Enables the global interrupts
}
示例7: init_devices
void init_devices (void)
{
cli(); //Clears the global interrupts
//for motion
port_init();
//for LCD
port_init();
adc_init();
//for Xbee
uart0_init(); //Initailize UART0 for serial communiaction
uart2_init(); //Initailize UART1 for serial communiaction
sei(); //Enables the global interrupts
}
示例8: init_devices
void init_devices (void)
{
cli(); //Clears the global interrupts
port_init();
uart0_init(); //Initailize UART1 for serial communiaction
adc_init();
timer5_init();
timer1_init();
sei(); //Enables the global interrupts
}
示例9: main
void main() {
sysclk_init(); // Initialize oscillator
wait_ms(1000);
port_init(); // Initialize crossbar and GPIO
gpib_init();
timer_init();
EA = 1; // Global Interrupt enable
usb0_init();
while (1) {
gpib_polling();
usb_polling();
if(sys_state & SYS_PERIODIC_ACTIVE){
sys_state &= ~SYS_PERIODIC_ACTIVE;
led_toggle(1);
}
if(sys_state & SYS_GPIB_CONTROLLER){
led_on(2);
}else{
led_off(2);
}
{ // check talked
static __xdata u8 persistent = 0;
if(sys_state & SYS_GPIB_TALKED){
led_on(3);
persistent = 0x40;
}else if(persistent > 0){
led_toggle(3);
persistent--;
}else{
led_off(3);
}
}
{ // check listened
static __xdata u8 persistent = 0;
if(sys_state & SYS_GPIB_LISTENED){
led_on(4);
persistent = 0x40;
}else if(persistent > 0){
led_toggle(4);
persistent--;
}else{
led_off(4);
}
}
}
}
示例10: init_devices
void init_devices (void)
{
cli(); //Clears the global interrupts
timer1_init();
port_init();
adc_init();
timer5_init();
left_position_encoder_interrupt_init();
right_position_encoder_interrupt_init();
sei(); //Enables the global interrupts
}
示例11: init_devices
//Function to initialize all the peripherals
void init_devices(void)
{
cli(); //disable all interrupts
port_init();
timer1_init();
adc_init();
uart0_init();
// left_position_encoder_interrupt_init();
// right_position_encoder_interrupt_init();
sei(); //re-enable interrupts
}
示例12: ov7725_eagle_get_img
/*!
* @brief 鹰眼ov7725采集图像(采集到的数据存储在 初始化时配置的地址上)
* @since v5.0
*/
void ov7725_eagle_get_img()
{
ov7725_eagle_img_flag = IMG_START; //开始采集图像
port_init(PTD14, ALT1 | IRQ_FALLING | PULLUP ); //初始化 PTD7 管脚,复用功能为GPIO ,下降沿触发中断,上拉电阻
PORTD_ISFR |= 0x4000;
enable_irq(PORTD_IRQn); //允许PTA的中断
while(ov7725_eagle_img_flag != IMG_FINISH) //等待图像采集完毕
{
if(ov7725_eagle_img_flag == IMG_FAIL) //假如图像采集错误,则重新开始采集
{
ov7725_eagle_img_flag = IMG_START; //开始采集图像
PORTA_ISFR = ~0; //写1清中断标志位(必须的,不然回导致一开中断就马上触发中断)
//enable_irq(PORTD_IRQn); //允许PTA的中断
}
}
port_init(PTD13, ALT1 | PULLUP ); //PCLK
port_init(PTD14, ALT1 | PULLDOWN ); //场中断,上拉,上降沿触发中断,带滤波
}
示例13: parse4port
// порт
cli_result_t parse4port ( void *Port, int argc, char **argv )
{
const char *PortCfg[ 5 ];
#define File ( PortCfg[ 0 ] )
#define Parity ( PortCfg[ 1 ] )
#define Speed ( PortCfg[ 2 ] )
#define DBits ( PortCfg[ 3 ] )
#define SBits ( PortCfg[ 4 ] )
// настроить порт
cli_arg_t JournalArgs[] =
{
{ "port_file", 0, CLI_OPTIONAL_ARG, CLI_REQUIRED_VAL, __parse4port_strp, &File },
{ "port_parity", 0, CLI_OPTIONAL_ARG, CLI_REQUIRED_VAL, __parse4port_strp, &Parity },
{ "port_speed", 0, CLI_OPTIONAL_ARG, CLI_REQUIRED_VAL, __parse4port_strp, &Speed },
{ "port_sbits", 0, CLI_OPTIONAL_ARG, CLI_REQUIRED_VAL, __parse4port_strp, &DBits },
{ "port_dbits", 0, CLI_OPTIONAL_ARG, CLI_REQUIRED_VAL, __parse4port_strp, &SBits },
CLI_LAST_ARG
};
cli_result_t Result = cli_parse ( JournalArgs, argc, argv );
if ( Result != CLI_SUCCESS )
{
return Result;
}
if ( rs232_init ( ( *( askue_port_t** ) Port )->RS232, &( ( *( askue_port_t** ) Port )->Termios ) ) )
{
return CLI_ERROR_HANDLER;
}
rs232_set_speed ( &( ( *( askue_port_t** ) Port )->Termios ), Speed );
rs232_set_databits ( &( ( *( askue_port_t** ) Port )->Termios ), DBits );
rs232_set_stopbits ( &( ( *( askue_port_t** ) Port )->Termios ), SBits );
rs232_set_parity ( &( ( *( askue_port_t** ) Port )->Termios ), Parity );
if ( rs232_apply ( ( *( askue_port_t** ) Port )->RS232, &( ( *( askue_port_t** ) Port )->Termios ) ) )
{
return CLI_ERROR_HANDLER;
}
if ( port_init ( *( askue_port_t** ) Port, File, Speed, DBits, SBits, Parity ) == -1 )
{
return CLI_ERROR_HANDLER;
}
return Result;
#undef File
#undef Parity
#undef Speed
#undef DBits
#undef SBits
}
示例14: memport_init
static void memport_init( muse_env *env, void *ptr, muse_cell args )
{
memport_t *p = (memport_t*)ptr;
p->base.mode |= MUSE_PORT_READ_WRITE;
port_init( env, (muse_port_base_t*)p );
p->first = p->last = NULL;
p->read_offset = 0;
}
示例15: init_devices
void init_devices (void)
{
cli(); //Clears the global interrupts
port_init();
adc_init();
lcd_init();
lcd_set_4bit();
// timer1_init();
sei(); //Enables the global interrupts
}