Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
84621c7cdThis file is pinned to the selected release. Download the original to open it in your design tool.
#ifdef CMD_TX
#error at the moment you can only have one component using the tx channel of the command port
#else
#define CMD_TX
#endif
COMP(en);
HAL_PIN(en) = 0.0;
HAL_PIN(txen) = 0.0;
INIT(
//PC12 TX
//PB13 TXEN
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_Init(GPIOB, &GPIO_InitStructure);
);
NRT(
if(PIN(txen) > 0){
GPIO_SetBits(GPIOB, GPIO_Pin_13);
}
else{
GPIO_ResetBits(GPIOB, GPIO_Pin_13);
}
if(PIN(en) > 0)
GPIO_SetBits(GPIOC, GPIO_Pin_12);
else
GPIO_ResetBits(GPIOC, GPIO_Pin_12);
);
ENDCOMP;