本文整理汇总了C++中GPIO_PDOR_PDO函数的典型用法代码示例。如果您正苦于以下问题:C++ GPIO_PDOR_PDO函数的具体用法?C++ GPIO_PDOR_PDO怎么用?C++ GPIO_PDOR_PDO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GPIO_PDOR_PDO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
int DigitalOutputPin::Status()
{
int ret = 0;
switch( GPIOPorts[ (int)pin ] )
{
case PortA:
{
ret = GPIOA_PDOR & GPIO_PDOR_PDO( GPIO_PIN( GPIOPinNumbers[ (int)pin ] ) );
break;
}
case PortB:
{
ret = GPIOB_PDOR & GPIO_PDOR_PDO( GPIO_PIN( GPIOPinNumbers[ (int)pin ] ) );
break;
}
case PortC:
{
ret = GPIOC_PDOR & GPIO_PDOR_PDO( GPIO_PIN( GPIOPinNumbers[ (int)pin ] ) );
break;
}
case PortD:
{
ret = GPIOD_PDOR & GPIO_PDOR_PDO( GPIO_PIN( GPIOPinNumbers[ (int)pin ] ) );
break;
}
case PortE:
{
ret = GPIOE_PDOR & GPIO_PDOR_PDO( GPIO_PIN( GPIOPinNumbers[ (int)pin ] ) );
break;
}
}
return ret;
}
示例2: LCD_WrDat
void LCD_WrDat(u8 data)
{
u8 i=8;
//LCD_CS=0;;
// GPIOC_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(15));;;;
GPIOA_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(16));;;;
asm("nop");
// GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(12));;;;
GPIOE_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(25));;;;
asm("nop");
while(i--)
{
// if(data&0x80){GPIOC_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(13));;;;}
if(data&0x80){GPIOE_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(24));;;;}
// else{GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(13));;;;}
else{GPIOE_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(24));;;;}
// GPIOC_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(12));
GPIOE_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(25));
asm("nop");;;;
//asm("nop");
// GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(12));;;;;
GPIOE_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(25));;;;;
data<<=1;
}
//LCD_CS=1;
}
示例3: LCD_WrCmd
void LCD_WrCmd(u8 cmd)
{
u8 i=8;
//LCD_CS=0;;
// GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(15));;;;;
// GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(12));;;;;
GPIOA_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(16));;;;;
GPIOE_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(25));;;;;
//asm("nop");
while(i--)
{
// if(cmd&0x80){GPIOC_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(13));;;;;}
if(cmd&0x80){GPIOE_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(24));;;;;}
// else{GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(13));;;;;;}
else{GPIOE_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(24));;;;;;}
// GPIOC_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(12));;;;;
GPIOE_PDOR |= GPIO_PDOR_PDO(GPIO_PIN(25));;;;;
asm("nop");;;;
//asm("nop");
// GPIOC_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(12));;;;;
GPIOE_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(25));;;;;
cmd<<=1;;;;;
}
//LCD_CS=1;
}
示例4: leds_arch_init
/*---------------------------------------------------------------------------*/
void
leds_arch_init(void)
{
/**
* Initialize blue led
*/
/* Configure pin as output */
GPIOD_PDDR |= GPIO_PDDR_PDD(0x02);
/* Set initialization value */
GPIOD_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x02));
/* Initialization of Port Control register */
PORTD_PCR1 = (uint32_t)((PORTD_PCR1 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/**
* Initialize green led
*/
/* Configure pin as output */
GPIOB_PDDR |= GPIO_PDDR_PDD(0x00080000);
/* Set initialization value */
GPIOB_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x00080000));
/* Initialization of Port Control register */
PORTB_PCR19 = (uint32_t)((PORTB_PCR19 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/**
* Initialize red led
*/
/* Configure pin as output */
GPIOB_PDDR |= GPIO_PDDR_PDD(0x00040000);
/* Set initialization value */
GPIOB_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x00040000));
/* Initialization of Port Control register */
PORTB_PCR18 = (uint32_t)((PORTB_PCR18 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
}
示例5: LEDRed_Init
/* ===================================================================*/
LDD_TDeviceData* LEDRed_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate LDD device structure */
LEDRed_TDeviceData *DeviceDataPrv;
/* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
/* Save RTOS Device structure */
DeviceDataPrv->UserData = UserDataPtr; /* Store the RTOS device structure */
/* Enable device clock gate */
/* SIM_SCGC5: PORTC=1 */
SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;
/* GPIOC_PDOR: PDO|=0x0200 */
GPIOC_PDOR |= GPIO_PDOR_PDO(0x0200);
/* GPIOC_PDDR: PDD|=0x0200 */
GPIOC_PDDR |= GPIO_PDDR_PDD(0x0200);
/* Initialization of pin routing */
/* PORTC_PCR9: ISF=0,MUX=1 */
PORTC_PCR9 = (uint32_t)((PORTC_PCR9 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_LEDRed_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例6: TraccionTrasera_Direccion_Init
/* ===================================================================*/
LDD_TDeviceData* TraccionTrasera_Direccion_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate device structure */
TraccionTrasera_Direccion_TDeviceDataPtr DeviceDataPrv;
/* {FreeRTOS RTOS Adapter} Driver memory allocation: RTOS function call is defined by FreeRTOS RTOS Adapter property */
DeviceDataPrv = (TraccionTrasera_Direccion_TDeviceData *)pvPortMalloc(sizeof(TraccionTrasera_Direccion_TDeviceData));
#if FreeRTOS_CHECK_MEMORY_ALLOCATION_ERRORS
if (DeviceDataPrv == NULL) {
return (NULL);
}
#endif
DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */
/* Configure pin as output */
/* GPIOE_PDDR: PDD|=8 */
GPIOE_PDDR |= GPIO_PDDR_PDD(0x08);
/* Set initialization value */
/* GPIOE_PDOR: PDO&=~8 */
GPIOE_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x08));
/* Initialization of Port Control register */
/* PORTE_PCR3: ISF=0,MUX=1 */
PORTE_PCR3 = (uint32_t)((PORTE_PCR3 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_TraccionTrasera_Direccion_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例7: BitIoLdd4_Init
/* ===================================================================*/
LDD_TDeviceData* BitIoLdd4_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate device structure */
BitIoLdd4_TDeviceDataPtr DeviceDataPrv;
/* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */
/* Enable device clock gate */
/* SIM_SCGC5: PORTD=1 */
SIM_SCGC5 |= SIM_SCGC5_PORTD_MASK;
/* Configure pin as output */
/* GPIOD_PDDR: PDD|=8 */
GPIOD_PDDR |= GPIO_PDDR_PDD(0x08);
/* Set initialization value */
/* GPIOD_PDOR: PDO&=~8 */
GPIOD_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x08));
/* Initialization of pin routing */
/* PORTD_PCR3: ISF=0,MUX=1 */
PORTD_PCR3 = (uint32_t)((PORTD_PCR3 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_BitIoLdd4_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例8: GPIO2_Init
/* ===================================================================*/
LDD_TDeviceData* GPIO2_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate LDD device structure */
GPIO2_TDeviceData *DeviceDataPrv;
/* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
/* Save RTOS Device structure */
DeviceDataPrv->UserData = UserDataPtr; /* Store the RTOS device structure */
/* GPIOE_PDOR: PDO|=0x000C0000 */
GPIOE_PDOR |= GPIO_PDOR_PDO(0x000C0000);
/* GPIOE_PDDR: PDD|=0x000C0000 */
GPIOE_PDDR |= GPIO_PDDR_PDD(0x000C0000);
/* Initialization of Port Control registers */
/* PORTE_PCR18: ISF=0,MUX=1 */
PORTE_PCR18 = (uint32_t)((PORTE_PCR18 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/* PORTE_PCR19: ISF=0,MUX=1 */
PORTE_PCR19 = (uint32_t)((PORTE_PCR19 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_GPIO2_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例9: BitIoLdd2_Init
/* ===================================================================*/
LDD_TDeviceData* BitIoLdd2_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate device structure */
BitIoLdd2_TDeviceDataPtr DeviceDataPrv;
/* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */
/* Configure pin as output */
/* GPIOB_PDDR: PDD|=0x0200 */
GPIOB_PDDR |= GPIO_PDDR_PDD(0x0200);
/* Set initialization value */
/* GPIOB_PDOR: PDO&=~0x0200 */
GPIOB_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x0200));
/* Initialization of Port Control register */
/* PORTB_PCR9: ISF=0,MUX=1 */
PORTB_PCR9 = (uint32_t)((PORTB_PCR9 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_BitIoLdd2_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例10: cam_start
void cam_start() {
// call pwm driver to start camera clock (CLK) for a 5% duty cycle
FTM2_CNT = 0;
FTM2_C0V = 45;
// set cam flag
cam_flag = EXEC_FLAG_UP;
// set SI pulse high
GPIOA_PSOR |= GPIO_PDOR_PDO(GPIO_PIN(14));
// enable interrupt
enable_irq(64);
}
示例11: uxParTestGetLED
unsigned portBASE_TYPE uxParTestGetLED( unsigned portBASE_TYPE uxLED )
{
unsigned portBASE_TYPE uxReturn = pdFALSE;
if( uxLED < partstNUM_LEDs )
{
portENTER_CRITICAL();
{
uxReturn = !(GPIOA_PDOR & GPIO_PDOR_PDO(GPIO_PIN(10)));
}
portEXIT_CRITICAL();
}
return uxReturn;
}
示例12: GPIO1_Init
/* ===================================================================*/
LDD_TDeviceData* GPIO1_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate LDD device structure */
GPIO1_TDeviceData *DeviceDataPrv;
/* {MQXLite RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
/* Save RTOS Device structure */
DeviceDataPrv->UserData = UserDataPtr; /* Store the RTOS device structure */
/* GPIOB_PDOR: PDO&=~0x00200000 */
GPIOB_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x00200000));
/* GPIOB_PDDR: PDD|=0x00200000 */
GPIOB_PDDR |= GPIO_PDDR_PDD(0x00200000);
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_GPIO1_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例13: BitIO_UPRDY_Init
/* ===================================================================*/
LDD_TDeviceData* BitIO_UPRDY_Init(LDD_TUserData *UserDataPtr)
{
/* Configure pin as output */
/* GPIOE_PDDR: PDD|=0x20000000 */
GPIOE_PDDR |= GPIO_PDDR_PDD(0x20000000);
/* Set initialization value */
/* GPIOE_PDOR: PDO|=0x20000000 */
GPIOE_PDOR |= GPIO_PDOR_PDO(0x20000000);
/* Initialization of Port Control register */
/* PORTE_PCR29: ISF=0,MUX=1 */
PORTE_PCR29 = (uint32_t)((PORTE_PCR29 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
return ERR_OK;
}
示例14: MB_DTR_Init
/* ===================================================================*/
LDD_TDeviceData* MB_DTR_Init(LDD_TUserData *UserDataPtr)
{
/* Allocate device structure */
MB_DTR_TDeviceDataPtr DeviceDataPrv;
/* {MQXLite RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */
/* Configure pin as output */
/* GPIOA_PDDR: PDD|=0x20000000 */
GPIOA_PDDR |= GPIO_PDDR_PDD(0x20000000);
/* Set initialization value */
/* GPIOA_PDOR: PDO&=~0x20000000 */
GPIOA_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x20000000));
/* Registration of the device structure */
PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_MB_DTR_ID,DeviceDataPrv);
return ((LDD_TDeviceData *)DeviceDataPrv);
}
示例15: cam_isr
void cam_isr() {
// clear interrupt flag
FTM2_C0SC;
FTM2_C0SC &= ~(0x80u);
// send SI low
GPIOA_PCOR |= GPIO_PDOR_PDO(GPIO_PIN(14));
// run ADC on data input for 128 pixels
if (cam_clockCounter < 128) {
cam_clockCounter++;
adc_start();
} else {
// disable interrupt
disable_irq(64);
cam_clockCounter = 0;
FTM2_C0V = 0;
cam_flag = EXEC_FLAG_DOWN;
}
}