Click here to Skip to main content
15,903,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Can someone take a look at this project, getting linker errors, I've done everything to fix Pin
Member 1129483021-Aug-15 9:25
Member 1129483021-Aug-15 9:25 
GeneralRe: Can someone take a look at this project, getting linker errors, I've done everything to fix Pin
CPallini21-Aug-15 9:35
mveCPallini21-Aug-15 9:35 
SuggestionRe: Can someone take a look at this project, getting linker errors, I've done everything to fix Pin
David Crow21-Aug-15 9:23
David Crow21-Aug-15 9:23 
QuestionMFC Project Style "Visual Studio", but Single Document with multiple views Pin
Member 853403521-Aug-15 5:34
Member 853403521-Aug-15 5:34 
AnswerRe: MFC Project Style "Visual Studio", but Single Document with multiple views Pin
Richard MacCutchan21-Aug-15 6:10
mveRichard MacCutchan21-Aug-15 6:10 
GeneralRe: MFC Project Style "Visual Studio", but Single Document with multiple views Pin
Member 853403522-Aug-15 21:43
Member 853403522-Aug-15 21:43 
GeneralRe: MFC Project Style "Visual Studio", but Single Document with multiple views Pin
Richard MacCutchan23-Aug-15 1:09
mveRichard MacCutchan23-Aug-15 1:09 
QuestionAccessing struct member and getting error I do not know how to fix it. Pin
Vaclav_21-Aug-15 4:08
Vaclav_21-Aug-15 4:08 
I am stuck again.
I have inherited this piece of code which basically associate SAM3X8E pins with hardware registers.
I think it is pretty clever usage of array of struct and it works fine.
The original code did not include convenient way to access ALL of the registers, so I am trying to build the missing registers from basis assignments.

The registers are related to "port" ( designated PIOA.. thru PIOF) so if I can get the port assigned to a pin I can build all of the missing registers.

Here is the code to get the the port info from first (test) pin:
P_DB is a pointer to pins array.

( I have left all of the support code here FYI )

....
regtype TEST = *P_DB.pPort; *p_DB[0] fails same way
//lcd_i2c.print( (int) P_DB[0].pPort, HEX); // test access first pin
...

Now here is the error message from compiler ( on TEST) and I have no idea how to fix it:

C:\DOCUME~1\Vaclav\LOCALS~1\Temp\build6265730787782115322.tmp\sketch\AAA_TFT_LCD.h: In member function 'void TFT_LCD::LCD_Writ_Bus(char, char, byte)':
C:\DOCUME~1\Vaclav\LOCALS~1\Temp\build6265730787782115322.tmp\sketch\AAA_TFT_LCD.h:4370:30: error: request for member 'pPort' in '((TFT_LCD*)this)->TFT_LCD::P_DB', which is of non-class type 'volatile uint32_t* [16] {aka volatile long unsigned int* [16]}'
regtype TEST = *P_DB.pPort;

The error on (int) P_DB[0].pPort, code is pretty much same.

I hope I have provided all of the info necessary so someone can suggest a solution on how to access the pPort member.

/* Types used for the tables below */
// theae are indexes to array - what a trick
//typedef struct _PinDescription
//{
// Pio* pPort ;
// uint32_t ulPin ;
// uint32_t ulPeripheralId ;
// EPioType ulPinType ;
// uint32_t ulPinConfiguration ;
// uint32_t ulPinAttribute ;
// EAnalogChannel ulAnalogChannel ; /* Analog pin in the Arduino context (label on the board) */
// EAnalogChannel ulADCChannelNumber ; /* ADC Channel number in the SAM device */
// EPWMChannel ulPWMChannel ;
// ETCChannel ulTCChannel ;
//} PinDescription ;
//
///* Pins table to be instanciated into variant.cpp */
//extern const PinDescription g_APinDescription[] ;

//// Number of pins defined in PinDescription array
//#define PINS_COUNT (79u)
//#define NUM_DIGITAL_PINS (54u)
//#define NUM_ANALOG_INPUTS (12u)
//
//#define digitalPinToPort(P) ( g_APinDescription[P].pPort ) so what is this refernce to .pPort
//#define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin )
////#define analogInPinToBit(P) ( )
//#define portOutputRegister(port) ( &(port->PIO_ODSR) )
//#define portInputRegister(port) ( &(port->PIO_PDSR) )
//#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER )
//
///*
// * Pins descriptions
// * global array of all pins descriptions as what type
// * Arduino/hardware/arduino/sam/variants/arduino_due_x/variant.cpp
//
// */
//extern const PinDescription g_APinDescription[]=
//{
// // 0 .. 53 - Digital pins
// // ----------------------
// // 0/1 - UART (Serial)
// { PIOA, PIO_PA8A_URXD, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // URXD
// { PIOA, PIO_PA9A_UTXD, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // UTXD
//
// // 2
<a href=""></a>[<a href="" target="_blank">^</a>]
AnswerRe: Accessing struct member and getting error I do not know how to fix it. Pin
Richard MacCutchan21-Aug-15 4:21
mveRichard MacCutchan21-Aug-15 4:21 
GeneralSOLVED : Accessing struct member and getting error I do not know how to fix it. Pin
Vaclav_21-Aug-15 5:57
Vaclav_21-Aug-15 5:57 
QuestionUsing #define wrong way ? Pin
Vaclav_20-Aug-15 6:56
Vaclav_20-Aug-15 6:56 
AnswerRe: Using #define wrong way ? Pin
k505420-Aug-15 7:10
mvek505420-Aug-15 7:10 
GeneralSOLVED Re: Using #define wrong way ? Pin
Vaclav_20-Aug-15 8:07
Vaclav_20-Aug-15 8:07 
QuestionRe: Using #define wrong way ? Pin
CPallini20-Aug-15 21:06
mveCPallini20-Aug-15 21:06 
AnswerRe: Using #define wrong way ? Pin
Vaclav_21-Aug-15 4:12
Vaclav_21-Aug-15 4:12 
GeneralRe: Using #define wrong way ? Pin
Stefan_Lang31-Aug-15 22:02
Stefan_Lang31-Aug-15 22:02 
QuestionHow to send a text file from C to java and receive the same text file from java to C Pin
venkat28vk18-Aug-15 20:57
venkat28vk18-Aug-15 20:57 
AnswerRe: How to send a text file from C to java and receive the same text file from java to C Pin
Richard MacCutchan18-Aug-15 21:53
mveRichard MacCutchan18-Aug-15 21:53 
QuestionRe: How to send a text file from C to java and receive the same text file from java to C Pin
David Crow19-Aug-15 5:24
David Crow19-Aug-15 5:24 
AnswerRe: How to send a text file from C to java and receive the same text file from java to C Pin
ThatsAlok20-Aug-15 0:23
ThatsAlok20-Aug-15 0:23 
GeneralOT Pin
CPallini20-Aug-15 0:35
mveCPallini20-Aug-15 0:35 
GeneralRe: OT Pin
ThatsAlok20-Aug-15 1:51
ThatsAlok20-Aug-15 1:51 
GeneralRe: OT Pin
ThatsAlok20-Aug-15 1:53
ThatsAlok20-Aug-15 1:53 
QuestionCMFCToolBarComboBoxButton::GetByCmd returns NULL Pin
joliet17-Aug-15 20:26
joliet17-Aug-15 20:26 
AnswerRe: CMFCToolBarComboBoxButton::GetByCmd returns NULL Pin
Jochen Arndt17-Aug-15 20:59
professionalJochen Arndt17-Aug-15 20:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.