Elküldve: 2012. augusztus 14. kedd, 16:50
Ez C++!
Az ANSI C az a nyelv alapja.....
Az ANSI C az a nyelv alapja.....
Mikrokontroller világ (Arduino, Bascom-AVR, programozás, tanfolyam)
http://forum.tavir.hu:80/
ITT is körülnézhetsz. Szintén regisztrálós.
Ha nem buta kérdés (és eddig nem kérdeztél butákat) akkor tedd fel nyugodtan ezután is. Legföljebb nem válaszolunkkapu48 írta:Talán nem zavarlak több buta kérdéssel.
Igen. Tök jól megértetted.kapu48 írta: XXXX XXXX XXXX XXXX Beolvasom 16 bites kimeneti regisztert
& 1111 1000 0000 0111 ÉS Maszk
XXXX X000 0000 0XXX Eredmény
| 0000 0XXX XXXX X000 << 3 a ki küldendő Byte
VAGY után az eredmény mehet ki.
Kód: Egész kijelölése
/**
* @brief Sets the selected data port bits.
* @note This functions uses GPIOx_BSRR register to allow atomic read/modify
* accesses. In this way, there is no risk of an IRQ occurring between
* the read and the modify access.
* @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bits to be written.
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
* @retval None
*/
void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin));
GPIOx->BSRRL = GPIO_Pin;
}
/**
* @brief Clears the selected data port bits.
* @note This functions uses GPIOx_BSRR register to allow atomic read/modify
* accesses. In this way, there is no risk of an IRQ occurring between
* the read and the modify access.
* @param GPIOx: where x can be (A..I) to select the GPIO peripheral.
* @param GPIO_Pin: specifies the port bits to be written.
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
* @retval None
*/
void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin));
GPIOx->BSRRH = GPIO_Pin;
}
Kód: Egész kijelölése
void GLCD_Wriete(uint16_t databyte){
// Ide még kel az LCD vezérlés?
//Törlünk egy 8 bites ablakot:
GPIO_ResetBits(GLCD_DATA_PORT, 0x07F8); // 0x07F8
//És bele irjuk az adatunkat:
databyte <<= 3; //Balra 3 bitel
GPIO_SetBits(GLCD_DATA_PORT, databyte);
//Mindjárt egyszerűbb a dolgom.
}
Kód: Egész kijelölése
/* Check the parameters */
assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
assert_param(IS_GPIO_PIN(GPIO_Pin));