Телесистемы
 Разработка, производство и продажа радиоэлектронной аппаратуры
На главную   | Карта сайта | Пишите нам | В избранное
Требуется программист в Зеленограде
- обработка данных с датчиков; ColdFire; 40 тыс.
e-mail:jobsmp@pochta.ru

Телесистемы | Электроника | Конференция «Микроконтроллеры и их применение»

Народ, это что за ентакий способ инициализации структуры ??? Первй раз такое вижу

Отправлено DASM 11 сентября 2009, г. 14:27




//! Option structure for SPI channels.
typedef struct
{
//! The SPI channel to set up.
unsigned char reg;

//! Preferred baudrate for the SPI.
unsigned int baudrate;

//! Number of bits in each character (8 to 16).
unsigned char bits;

//! Delay before first clock pulse after selecting slave (in PBA clock periods).
unsigned char spck_delay;

//! Delay between each transfer/character (in PBA clock periods).
unsigned char trans_delay;

//! Sets this chip to stay active after last transfer to it.
unsigned char stay_act;

//! Which SPI mode to use when transmitting.
unsigned char spi_mode;

//! Disables the mode fault detection.
//! With this bit cleared, the SPI master mode will disable itself if another
//! master tries to address it.
unsigned char modfdis;
} spi_options_t;
int _tmain(int argc, _TCHAR* argv[])
{
spi_options_t spiOptions =
{
.reg = 1, // Defined in conf_at45dbx.h.
.baudrate = 2, // Defined in conf_at45dbx.h.
.bits = 3, // Defined in conf_at45dbx.h.
.spck_delay = 0,
.trans_delay = 0,
.stay_act = 1,
.spi_mode = 0,
.modfdis = 1
};


}



Составить ответ | Вернуться на конференцию.

Ответы


Отправка ответа
Имя*: 
Пароль: 
E-mail: 
Тема*:

Сообщение:

Ссылка на URL: 
URL изображения: 

если вы незарегистрированный на форуме пользователь, то
для успешного добавления сообщения заполните поле, как указано ниже:
увеличьте 6 на 2:

Перейти к списку ответов | Конференция | Раздел "Электроника" | Главная страница | Карта сайта

Rambler's Top100 Рейтинг@Mail.ru
 
Web telesys.ru