embed - Is Something similar to shiftOut in LPC1769/FreeRTOS? -


i'm trying read parallax sht11 module lpc1769 board using freertos.

i found example http://wiring.org.co/learning/basics/humiditytemperaturesht11.html

and i'm trying port lpc1769

is similar shitout function ?

my knowledge mbed scarce, in pin should write?

lpc_gpio0->????? 

i've read lpc_gpiox->fiopin stores current pin value, here?

sorry...

i've found implementation of shiftout() function :

void shiftout(uint8_t datapin, uint8_t clockpin, uint8_t bitorder, uint8_t val) { uint8_t i; digitalwrite(clockpin, low);     (i = 0; < 8; i++)  {     if (bitorder == lsbfirst)         digitalwrite(datapin, !!(val & (1 << i)));     else             digitalwrite(datapin, !!(val & (1 << (7 - i))));     digitalwrite(clockpin, high);     digitalwrite(clockpin, low);     } } 

currently i'm want support msbfirst, function looks like...

#define gpio0_write(pin,value)   if ( value == 0 ) { lpc_gpio0->fioclr|= ( 1 << pin); } else { lpc_gpio0->fioset |= ( 1 << pin); }   gpio0_write(clock_pin, low);    (i = 0; < 8; i++) {     gpio0_write(data_pin, !!(cmd_temperature & (1 << (7 - i))));      gpio0_write(clock_pin,high);     gpio0_write(clock_pin,low); } 

any suggestion welcome.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -