asked    Suzanne     2018-10-22       c       65 view        1 Answer

[SOLVED] Changing hardware flow control pins on STM32

I have been reading up on handshaking and hardware flow control for serial communication and I have a question that I can't seem to find an answer to.

If you set up hardware flow control for a serial port on cubeMX it will set the pins up that are required. I know you can use alternative pins as well and this can be done through cubeMX.

My question is, could you set up hardware flow control manually by using different pins or do you strictly have to use the implemented pins?

I am using a STM32F207ZETx and I am using USB as well as serial - however when using the USB peripheral it blocks the hardware flow control pins for USART1 which I need, and I need hardware flow control for my project! The alternate pins for hardware flow control are also already used so I'm in a bit of a pickle.

  1 Answer  

        answered    Natalie     2018-10-22      

My question is, could you set up hardware flow control manually by using different pins or do you strictly have to use the implemented pins?

You can do hardware flow control yourself in software, and in fact it is quite simple to do.

The USART1_RTS is an output pin. It is set/high when the USART1 is ready to receive data. The USART1_CTS is an input pin. The other end sets it high when it is ready to receive data, and low when it is not.

Let's say that you send and receive one character at a time, and use two GPIO pins for USART1_RTS and USART1_CTS instead of the hardware support.

Normally, you keep USART1_RTS high. When receiving data, if you are running out of receive buffer, you set USART1_RTS low. When you make more room in the receive buffer, you set USART1_RTS high. (If you have a buffering scheme that cannot run out of receive buffer, you can tie the RTS line high.)

Before sending each character, you check if USART1_CTS is high. If it is low, you don't send the data, but wait for USART1_CTS to become high before you do.

That's it.

Your Answer

 2018-10-22         Elliot

Woocommerce cart mockup for retrieving cart total

I need to calculate the total amount that a cart will cost with multiple products and coupons added. I need to get this total without changing the global WC()->cart. So my thoughts were to create a temporary cart, add all the items and coupons and then return WC_Cart:get_total();Here's my code://5438 is my product (simple subscription, $55 with a $50 signup fee)//product_schedule_discount is the coupon code that removes 100% of the signup fee$tmpCart = new WC_Cart();$tmpCart->add_to_cart( 5438, '1', '0', array(), array() );$tmpCart->apply_coupon('product_schedule_disc...
 php                     1 answers                     39 view
 2018-10-22         Gloria

Call wordpress plugin methods from functions file

I'm looking to utilize the woocommerce paypal pro plugin in some rest API calls, in my theme's functions.php file. The goal would be to get the constructed html form in one call, and process payment with another. I still have not quite wrapped my head around how to interact with the plugins classes. Is there a simple explanation or an example of this sort of pattern (for any similar plugin setup) that can be used? Now that I'm a bit more awake...It's as simple as interacting with the plugin methods as normal PHP class:$ppp = new WC_PP_PRO_Gateway();$html = $ppp->paym...
 wordpress                     1 answers                     43 view
 2018-10-22         Don

Woocommerce: Change the sequence of Product Title, Price and Description on shop catalog page

This question already has an answer here: WooCommerce action hooks and overriding templates 1 answer If you're referring to the single product page here is a list of functions that are hooked into this action./** * Product Summary Box. * * @see woocommerce_template_single_title() * @see woocommerce_template_single_rating() * @see woocommerce_template_single_price() * @see woocommerce_template_single_excerpt() * @see woocommerce_template_single_meta() * @see woocommerce_template_single_s...
 php                     1 answers                     42 view