本文整理汇总了C++中PIO_LISTSIZE函数的典型用法代码示例。如果您正苦于以下问题:C++ PIO_LISTSIZE函数的具体用法?C++ PIO_LISTSIZE怎么用?C++ PIO_LISTSIZE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PIO_LISTSIZE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SensorsTestInit
void SensorsTestInit()
{
char pinDirection = 0;
int i;
PIO_Configure(aDigitalOuts, PIO_LISTSIZE(aDigitalOuts));
PIO_Configure(digitalIns, PIO_LISTSIZE(digitalIns));
PIO_Configure(sensorsPower, PIO_LISTSIZE(sensorsPower));
PMC_EnablePeripheral(AT91C_ID_PIOB);
PMC_EnablePeripheral(AT91C_ID_PIOA);
SelectAng0(); // select analog port 0 to be mesured instead of BattVoltage
SensorPowerOn(); // turn on the Vcc line
if(PMC_IsPeriphEnabled(AT91C_ID_TWI) == 0){
PIO_Configure(twiPortPins, PIO_LISTSIZE(twiPortPins));
PMC_EnablePeripheral(AT91C_ID_TWI);
TWI_ConfigureMaster(AT91C_BASE_TWI,TWCK,MCK);
}
// set all pins on pullup chip to output
WritePullupData(0x00,&pinDirection,1);
WritePullupData(0x01,&pinDirection,1);
for(i = 0;i < 8;i++){
if(i>1) AnalogPullup(i,0); // disable Analog pullups for output test
DigitalPullup(i,1); // enable all digital pullups
}
}
示例2: AccelInit
unsigned char AccelInit(void)
{
PIO_Configure(accIntPins, PIO_LISTSIZE(accIntPins));
if(PMC_IsPeriphEnabled(AT91C_ID_TWI) == 0){
PIO_Configure(twiPins, PIO_LISTSIZE(twiPins));
PMC_EnablePeripheral(AT91C_ID_TWI);
TWI_ConfigureMaster(AT91C_BASE_TWI,TWCK,MCK);
}
usleep(10000);
#ifdef STACCEL
// ST Accelerometer
char setup[4];
setup[0] = (1<<5)|(2<<3)|7; // Normal power, data rate = 400Hz, ZYX axis enabled
setup[1] = 0; // Do not add filter stuff
setup[2] = (2<<0); // Data ready interrupt on INT 2 pad
setup[3] = (0<<4); // do update between reads, and set scale to +/- 2g's
WriteAccelData(0x20|(1<<7),setup,4);
#else
// Freescale Accelerometer
//AccelCalibration();
AccelSetScale(2);
AccelSetCalibration();
#endif
SetPitCallback(AccelCallback,3);
return 0;
}
示例3: glcd_init
//---------------------------
void glcd_init(void)
{
unsigned int tcmr,tfmr;
unsigned char i;
PIO_Configure(GLcdpins,PIO_LISTSIZE(GLcdpins));
PIO_Configure(sscPins, PIO_LISTSIZE(sscPins));
PIO_Set(&GLcdpins[3]);
PIO_Set(&GLcdpins[4]);
SSC_Configure(AT91C_BASE_SSC,AT91C_ID_SSC,500000,BOARD_MCK);
tcmr=AT91C_SSC_CKS_TK|AT91C_SSC_CKO_DATA_TX|AT91C_SSC_START_CONTINOUS;
tfmr=SSC_DATLEN(8)|SSC_DATNB(15)|SSC_FSLEN(16)|AT91C_SSC_FSOS_LOW|AT91C_SSC_FSDEN ;
SSC_ConfigureTransmitter(AT91C_BASE_SSC,tcmr,tfmr);
SSC_EnableTransmitter(AT91C_BASE_SSC);
PIO_Set(&GLcdpins[5]);
//PIO_Clear(&GLcdpins[5]);
for(i = 0; i < 3; i++);
GLCD_WriteCommand((DISPLAY_ON_CMD | ON), i);
}
示例4: ILI9488_InitInterface
static void ILI9488_InitInterface(void)
{
PIO_Configure(ILI9488_Reset, PIO_LISTSIZE(ILI9488_Reset));
PIO_Configure(spi_pins, PIO_LISTSIZE(spi_pins));
PIO_Configure(ILI9488_Pwm, PIO_LISTSIZE(ILI9488_Pwm));
/* Enable PWM peripheral clock */
PMC_EnablePeripheral(ID_PWM0);
/* Set clock A and clock B */
// set for 14.11 KHz for CABC control
// mode = PWM_CLK_PREB(0x0A) | (PWM_CLK_DIVB(110)) |
// PWM_CLK_PREA(0x0A) | (PWM_CLK_DIVA(110));
PWMC_ConfigureClocks(PWM0, 14200, 0, BOARD_MCK);
/* Configure PWM channel 1 for LED0 */
PWMC_DisableChannel(PWM0, CHANNEL_PWM_LCD);
PWMC_ConfigureChannel(PWM0, CHANNEL_PWM_LCD, PWM_CMR_CPRE_CLKA,0,PWM_CMR_CPOL);
PWMC_SetPeriod(PWM0, CHANNEL_PWM_LCD, 16);
PWMC_SetDutyCycle(PWM0, CHANNEL_PWM_LCD, 8);
PWMC_EnableChannel(PWM0, CHANNEL_PWM_LCD);
SPI_Configure(ILI9488, ILI9488_ID, (SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_PCS( ILI9488_cs )));
SPI_ConfigureNPCS( ILI9488, ILI9488_cs,
SPI_CSR_CPOL | SPI_CSR_BITS_9_BIT |
SPI_DLYBS(100, BOARD_MCK) | SPI_DLYBCT(100, BOARD_MCK) |
SPI_SCBR( 35000000, BOARD_MCK) ) ;
SPI_Enable(ILI9488);
}
示例5: ADS7843_Initialize
/**
* \brief Initialization of the SPI for communication with ADS7843 component.
*/
extern void ADS7843_Initialize( void )
{
volatile uint32_t uDummy;
/* Configure pins */
PIO_Configure(pinsSPI, PIO_LISTSIZE(pinsSPI));
PIO_Configure(pinBusy, PIO_LISTSIZE(pinBusy));
SPI_Configure(BOARD_TSC_SPI_BASE,
BOARD_TSC_SPI_ID,
SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_PCS(BOARD_TSC_NPCS) /* Value of the SPI configuration register. */
);
SPI_ConfigureNPCS(BOARD_TSC_SPI_BASE, BOARD_TSC_NPCS,
SPI_CSR_NCPHA | SPI_CSR_DLYBS(DELAY_BEFORE_SPCK) |
SPI_CSR_DLYBCT(DELAY_BETWEEN_CONS_COM) | SPI_CSR_SCBR(0xC8) );
SPI_Enable(BOARD_TSC_SPI_BASE);
for (uDummy=0; uDummy<100000; uDummy++);
uDummy = REG_SPI_SR;
uDummy = REG_SPI_RDR;
SendCommand(CMD_ENABLE_PENIRQ);
}
示例6: UART_Configure
extern void UART_Configure( uint32_t baudrate, uint32_t masterClock)
{
#if 0
const Pin pPins[] = CONSOLE_PINS;
/* Configure PIO */
PIO_Configure(pPins, PIO_LISTSIZE(pPins));
uint32_t mode = US_MR_USART_MODE_RS485 | US_MR_USCLKS_MCK
| US_MR_CHRL_8_BIT | US_MR_PAR_NO | US_MR_NBSTOP_1_BIT
| US_MR_CHMODE_NORMAL;
PMC->PMC_PCER0 = 1 << CONSOLE_ID;
USART_Configure( USART1, mode, CONSOLE_BAUDRATE, BOARD_MCK ) ;
USART1->US_IDR = 0xFFFFFFFF ;
NVIC_EnableIRQ( USART1_IRQn ) ;
USART_SetTransmitterEnabled( USART1, 1 ) ;
#else
#ifdef CONSOLE_USART_USE_UART1
const Pin pPins[] = {{1 << 3, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}};
Uart *pUart = CONSOLE_USART;
#else
const Pin pPins[] = CONSOLE_PINS;
Uart *pUart = (Uart *)CONSOLE_USART;
#endif
/* Configure PIO */
PIO_Configure(pPins, PIO_LISTSIZE(pPins));
/* Configure PMC */
#ifdef CONSOLE_USART_USE_UART1
PMC->PMC_PCER0 = 1 << ID_UART1;
#else
PMC->PMC_PCER0 = 1 << CONSOLE_ID;
#endif
/* Reset and disable receiver & transmitter */
pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX
| UART_CR_RXDIS | UART_CR_TXDIS;
/* Configure mode */
pUart->UART_MR = UART_MR_PAR_NO | US_MR_CHRL_8_BIT;
/* Configure baudrate */
/* Asynchronous, no oversampling */
pUart->UART_BRGR = (masterClock / baudrate) / 16;
/* Disable PDC channel */
pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
/* Enable receiver and transmitter */
pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN;
#endif
}
示例7: GPIO_Init
void GPIO_Init(void)
{
PIO_Configure( pinsSwitches, PIO_LISTSIZE(pinsSwitches) );
PIO_Configure( pinsGpios, PIO_LISTSIZE(pinsGpios) );
//PIO_InitializeInterrupts( AT91C_AIC_PRIOR_LOWEST );
//LED_Configure(LED_DS1);
//LED_Configure(LED_DS2);
}
示例8: main
//------------------------------------------------------------------------------
/// Initializes the CCID driver and runs it.
/// \return Unused (ANSI-C compatibility)
//------------------------------------------------------------------------------
int main( void )
{
// Initialize traces
TRACE_CONFIGURE(DBGU_STANDARD, 115200, BOARD_MCK);
printf("-- USB Device CCID Project %s --\n\r", SOFTPACK_VERSION);
printf("-- %s\n\r", BOARD_NAME);
printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
// If they are present, configure Vbus & Wake-up pins
PIO_InitializeInterrupts(0);
// Configure IT on Smart Card
ConfigureCardDetection();
// Configure ISO7816 driver
PIO_Configure(pinsISO7816, PIO_LISTSIZE(pinsISO7816));
PIO_Configure(pinsPower, PIO_LISTSIZE(pinsPower));
/* power up the card */
PIO_Set(&pinsPower[0]);
ISO7816_Init( pinIso7816RstMC );
// USB audio driver initialization
CCIDDriver_Initialize();
// connect if needed
VBUS_CONFIGURE();
while (USBD_GetState() < USBD_STATE_CONFIGURED);
CCID_Insertion();
// Infinite loop
while (1) {
if( USBState == STATE_SUSPEND ) {
TRACE_DEBUG("suspend !\n\r");
LowPowerMode();
USBState = STATE_IDLE;
}
if( USBState == STATE_RESUME ) {
// Return in normal MODE
TRACE_DEBUG("resume !\n\r");
NormalPowerMode();
USBState = STATE_IDLE;
}
CCID_SmartCardRequest();
}
return 0;
}
示例9: ShallEraseBootstrap
static unsigned char ShallEraseBootstrap()
{
const Pin pButtons[] = {PINS_PUSHBUTTONS};
unsigned char buttonIdx;
// Configure all PIO corresponding to buttons in input
PIO_Configure(pButtons, PIO_LISTSIZE(pButtons));
for (buttonIdx = 0; buttonIdx < PIO_LISTSIZE(pButtons); ++buttonIdx) {
// Check if button is pressed
if (!PIO_Get(&(pButtons[buttonIdx]))) {
return 1;
}
}
return 0;
}
示例10: USART1_UART_Init
void USART1_UART_Init(unsigned int baudrate) {
unsigned int mode = AT91C_US_USMODE_NORMAL
| AT91C_US_CLKS_CLOCK
| AT91C_US_CHRL_8_BITS
| AT91C_US_PAR_NONE
| AT91C_US_NBSTOP_1_BIT
| AT91C_US_CHMODE_NORMAL;
// Configure pins
PIO_Configure(pins, PIO_LISTSIZE(pins));
// Enable the peripheral clock in the PMC
PMC_EnablePeripheral(AT91C_ID_US0);
// Configure the USART in the desired mode
USART_Configure(AT91C_BASE_US0, mode, baudrate, BOARD_MCK);
// Configure the RXBUFF interrupt
AT91C_BASE_US0->US_IER = AT91C_US_RXRDY;
AIC_ConfigureIT(AT91C_ID_US0, 0, ISR_Usart0);
AIC_EnableIT(AT91C_ID_US0);
// Enable receiver & transmitter
USART_SetTransmitterEnabled(AT91C_BASE_US0, 1);
USART_SetReceiverEnabled(AT91C_BASE_US0, 1);
}
示例11: _ConfigurePIOs
/**
* Initialize PIOs
*/
static void _ConfigurePIOs(void)
{
/* Configure SDcard pins */
PIO_Configure(pinsSd, PIO_LISTSIZE(pinsSd));
/* Configure SD card detection */
CardDetectConfigure();
}
示例12: LCDD_SetBacklight
/**
* \brief Set the backlight of the LCD.
*
* \param level Backlight brightness level [1..16], 1 means maximum brightness.
*/
void LCDD_SetBacklight (uint32_t level)
{
uint32_t i;
const Pin pPins[] = {BOARD_BACKLIGHT_PIN};
/* Ensure valid level */
level = (level < 1) ? 1 : level;
level = (level > 16) ? 16 : level;
/* Enable pins */
PIO_Configure(pPins, PIO_LISTSIZE(pPins));
/* Switch off backlight */
PIO_Clear(pPins);
i = 600 * (BOARD_MCK / 1000000); /* wait for at least 500us */
while(i--);
/* Set new backlight level */
for (i = 0; i < level; i++) {
PIO_Clear(pPins);
PIO_Clear(pPins);
PIO_Clear(pPins);
PIO_Set(pPins);
PIO_Set(pPins);
PIO_Set(pPins);
}
}
示例13: i2c_eeprom_slave_init
void i2c_eeprom_slave_init(void) {
uint64_t uid = uid_get_uid64();
memcpy(eeprom.memory, &uid, sizeof(uint64_t));
eeprom.offset = 0;
eeprom.acquire = 0;
eeprom.page = 0;
const Pin twi_pins[] = {PINS_TWI_STACK};
// Configure TWI pins
PIO_Configure(twi_pins, PIO_LISTSIZE(twi_pins));
// Enable TWI peripheral clock
PMC->PMC_PCER0 = 1 << ID_TWI1;
// Configure TWI interrupts
NVIC_DisableIRQ(TWI1_IRQn);
NVIC_ClearPendingIRQ(TWI1_IRQn);
NVIC_SetPriority(TWI1_IRQn, PRIORITY_EEPROM_SLAVE_TWI1);
NVIC_EnableIRQ(TWI1_IRQn);
// Configure TWI as slave, with address I2C_EEPROM_SLAVE_ADDRESS
TWI_ConfigureSlave(TWI_STACK, I2C_EEPROM_SLAVE_ADDRESS);
// Enable TWI interrupt
TWI_EnableIt(TWI_STACK, TWI_IER_SVACC);
}
示例14: imu_startblink
void imu_startblink(void) {
imu_leds_on(true);
Pin pins[] = {PINS_IMU_LED};
for(uint8_t i = 0; i < 6; i++) {
pins[i].type = PIO_OUTPUT_1;
}
PIO_Configure(pins, PIO_LISTSIZE(pins));
for(uint8_t i = 0; i < 41; i++) {
TC0->TC_CHANNEL[0].TC_RA = blink_lookup[i];
TC0->TC_CHANNEL[1].TC_RA = blink_lookup[i];
TC0->TC_CHANNEL[2].TC_RB = blink_lookup[i];
PWMC_SetDutyCycle(PWM, 3, blink_lookup[40-i]);
SLEEP_MS(6);
}
for(uint8_t i = 0; i < 41; i++) {
TC0->TC_CHANNEL[0].TC_RA = blink_lookup[40-i];
TC0->TC_CHANNEL[1].TC_RA = blink_lookup[40-i];
TC0->TC_CHANNEL[2].TC_RB = blink_lookup[40-i];
PWMC_SetDutyCycle(PWM, 3, blink_lookup[i]);
SLEEP_MS(6);
}
for(uint8_t i = 0; i < 41; i++) {
TC0->TC_CHANNEL[0].TC_RA = blink_lookup[i];
TC0->TC_CHANNEL[1].TC_RA = blink_lookup[i];
TC0->TC_CHANNEL[2].TC_RB = blink_lookup[i];
PWMC_SetDutyCycle(PWM, 3, blink_lookup[40-i]);
SLEEP_MS(6);
}
imu_leds_on(false);
}
示例15: _ILI9488_Spi_HW_Initialize
/**
* \brief ILI9488 Hardware Initialization for SPI/SMC LCD.
*/
static void _ILI9488_Spi_HW_Initialize(void)
{
/* Pin configurations */
PIO_Configure(&lcd_spi_reset_pin, 1);
PIO_Configure(&lcd_spi_cds_pin, 1);
PIO_Configure(lcd_pins, PIO_LISTSIZE(lcd_pins));
PIO_Configure(&lcd_spi_pwm_pin, 1);
/* Enable PWM peripheral clock */
PMC_EnablePeripheral(ID_PWM0);
PMC_EnablePeripheral(ID_SPI0);
/* Set clock A and clock B */
// set for 14.11 KHz for CABC control
//mode = PWM_CLK_PREB(0x0A) | (PWM_CLK_DIVB(110)) |
//PWM_CLK_PREA(0x0A) | (PWM_CLK_DIVA(110));
PWMC_ConfigureClocks(PWM0, 14200, 0, BOARD_MCK);
/* Configure PWM channel 1 for LED0 */
PWMC_DisableChannel(PWM0, CHANNEL_PWM_LCD);
PWMC_ConfigureChannel(PWM0, CHANNEL_PWM_LCD, PWM_CMR_CPRE_CLKA, 0,
PWM_CMR_CPOL);
PWMC_SetPeriod(PWM0, CHANNEL_PWM_LCD, 16);
PWMC_SetDutyCycle(PWM0, CHANNEL_PWM_LCD, 8);
PWMC_EnableChannel(PWM0, CHANNEL_PWM_LCD);
SPI_Configure(ILI9488_SPI, ID_SPI0, (SPI_MR_MSTR | SPI_MR_MODFDIS
| SPI_PCS(SMC_EBI_LCD_CS)));
SPI_ConfigureNPCS(ILI9488_SPI,
SMC_EBI_LCD_CS,
SPI_CSR_CPOL | SPI_CSR_BITS_8_BIT | SPI_DLYBS(6, BOARD_MCK)
| SPI_DLYBCT(100, BOARD_MCK) | SPI_SCBR(20000000, BOARD_MCK));
SPI_Enable(ILI9488_SPI);
}