Hi,
A bus can only include contiguous pins on the same port.
palWriteGroup() and palWriteBus() are similar except that the first is a macro and the second uses that bus structure. palWritePort() simply operates on the whole port, not a subset of pins.
Giovanni
palWriteGroup() macro
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: palWriteGroup() macro
Hi giovani
Thx for replay, will pls give sample code to better understand what I want to do 16 bit data to 8bit LCD Interface
thx
Thx for replay, will pls give sample code to better understand what I want to do 16 bit data to 8bit LCD Interface
thx
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: palWriteGroup() macro
You should give details, your description is not sufficient to write code. You may also give a look to uGFX, they have already several LCD drivers.
Giovanni
Giovanni
Re: palWriteGroup() macro
what I Have
PB0,PB2,PB3,PB4,PB5,PB6,PB7,PB10 pin for Lower 8bit
A16,A15,A14,A12,A0,A1,A2,A4 for Higher 8bit
can I use this as bus
Thx
PB0,PB2,PB3,PB4,PB5,PB6,PB7,PB10 pin for Lower 8bit
A16,A15,A14,A12,A0,A1,A2,A4 for Higher 8bit
can I use this as bus
Thx
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: palWriteGroup() macro
You can't make a bus, bits are on different ports and not contiguous. You have to write your own functions in order to align the bits properly and then use palReadPort() and palWritePort() in order to implement an read-modify-write cycle.
It is very complex, setting bits one by one would be easier but not efficient. You should at least try to use contiguous pins.
Giovanni
It is very complex, setting bits one by one would be easier but not efficient. You should at least try to use contiguous pins.
Giovanni
Re: palWriteGroup() macro
I have MapleMini Board
What I am trying to set GPIOB.4,GPIOB.3 set as
palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
after all I did but always I both pins are float line INPUT this pins are JTAG pins Is that any setting in config for JTAG to use or disable or else what I do to check ,
Code is just to make high low in these pins nothing else
Thx
What I am trying to set GPIOB.4,GPIOB.3 set as
palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
after all I did but always I both pins are float line INPUT this pins are JTAG pins Is that any setting in config for JTAG to use or disable or else what I do to check ,
Code is just to make high low in these pins nothing else
Thx
Re: palWriteGroup() macro
Hi
I am not getting control(no Output) on PB3 and PB4 Pin
and PB0,PB1,PB2, PB5 is giving response on SW Press
Code is onlt this line GPIOB,8 is Input Pin In MApleMini same code well working in MapleIDE
int main(void){
// halInit(); // initialize hardware abstraction layer
// chSysInit(); // initialize ChibiOS kernel
GPIOB->CRL = 0x88333333;
while(1){
if(palReadPad(GPIOB, 8))
{
GPIOB->BSRR = 0b00111111;
}
else
{
GPIOB->BRR = 0b00111111;
}
// chThdSleepMilliseconds(500);
}
}
I am not getting control(no Output) on PB3 and PB4 Pin
and PB0,PB1,PB2, PB5 is giving response on SW Press
Code is onlt this line GPIOB,8 is Input Pin In MApleMini same code well working in MapleIDE
int main(void){
// halInit(); // initialize hardware abstraction layer
// chSysInit(); // initialize ChibiOS kernel
GPIOB->CRL = 0x88333333;
while(1){
if(palReadPad(GPIOB, 8))
{
GPIOB->BSRR = 0b00111111;
}
else
{
GPIOB->BRR = 0b00111111;
}
// chThdSleepMilliseconds(500);
}
}
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: palWriteGroup() macro
HI
i have tried with
#include "ch.h"
#include "hal.h"
also
but PB0,PB2,PB5,PB6 is giving response with PB1 as Input
ONLY PB3 and PB4 is opwndrain input
may GPIO clk init. by MapleMini Bootloader
I checked the GPIOB->CRL Data also its set as Output those Pin I set those pin as PUSH-PULL-OUTPUT so GPIOB-CRL is 0x88333383 return value
THX
i have tried with
#include "ch.h"
#include "hal.h"
also
but PB0,PB2,PB5,PB6 is giving response with PB1 as Input
ONLY PB3 and PB4 is opwndrain input
may GPIO clk init. by MapleMini Bootloader
I checked the GPIOB->CRL Data also its set as Output those Pin I set those pin as PUSH-PULL-OUTPUT so GPIOB-CRL is 0x88333383 return value
THX