Oops...
where are bitfields?
~d
On Wednesday 19 November 2003 18:29, Garst R. Reese wrote:
> Dmitry wrote:
> > hm...
> > any code snippet?
> > ~d
>
> Sure, let me know if you need more.
> Thanks,
> Garst
>
> #ifdef _MMC_TEST
> int main(void)
> {
> unsigned int i;
> union reg16b_t reg16b;
> mcu_init();
> spi_init();
> lcd_init();
> clear_display();
> lcd_set_pos(0,0);
> get_register(MMC_SEND_CSD,®16b);
> print_register(®16b);
> print_response(0xEE);
> print_response(reg16b.csd.READ_BL_LEN);
> SPI_NONE;
> }
> #endif
>
>
> int get_register( unsigned char reg_cmd, union reg16b_t *reg16)
> {
> unsigned char arguments[4];
> unsigned char temp25;
> int i;
>
> arguments[0]=0x00;
> arguments[1]=0x00;
> arguments[2]=0x00;
> arguments[3]=0x00;
> temp25=mmc_sendcmd(reg_cmd,arguments);
> if(temp25)
> {
> SPI_NONE;
> SPI_LCD_EN;
> lcd_write_string("GETREG");
> print_response(temp25);
> BREAKPNT;
> return FALSE;
> }
> mmc_get_data((unsigned char*) reg16);
> return TRUE;
> }
>
>
> int mmc_get_data(unsigned char* data)
> {
> unsigned char temp25;
> int i ;
>
> while((temp25=mmc_get_response())==0); //if card is busy
> if(temp25!=0xFE)
> {
> BREAKPNT;
> return FALSE;
> }
>
> /*read the data*/
> for(i=0;i<16;i++)
> {
> data[i]=spi_read();
> }
>
> //CRC TOKENs
> spi_read();
> spi_read();
>
> return TRUE;
> }
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
--
/*****************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) State Polytechnical Univ.
(_Y_.)' ._ ) `._ `. ``-..-' Radio-Physics Departament
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 5403923, 5585314
*****************************************************************/